- Impact
- 38
I am getting listings from a database right now based on category ID (_GET['id']). What I need to do is rewrite the getListings method to filter by location ID ($locationId['id']) as well as category ID. The problem is getListings is encrypted and I dont have the source of the function.
I know that basically all the getListings method does is $db->GetAll but for some reason when I try the code listed below I get this error:
OLD CODE:
NEW CODE:
..OK so it's a little PEAR too.
See the usage here:
http://paste.biz/paste-2532.html
If this is tough and/or more info is needed, please pm me a quote and let's get the ball rolling.
I know that basically all the getListings method does is $db->GetAll but for some reason when I try the code listed below I get this error:
Code:
Results: 1
Fatal error: Call to a member function on a non-object in /home/before83/public_html/includes/template_listing_results.php on line 34
OLD CODE:
PHP:
$r = $category_tree->getListings($_GET['id'],false, $page_start, $config['count_directory'],'membership DESC, firmname');
NEW CODE:
PHP:
$r =
$db->GetAll("
SELECT *
from ".T_LISTINGS."
INNER JOIN ".T_LIST2CAT."
ON ".T_LISTINGS.".selector = ".T_LIST2CAT.".list_id
WHERE ".T_LISTINGS.".loc_id = ".$locationId['id']."
AND ".T_LIST2CAT.".cat_id = ".$_GET['id']."
AND ".T_LISTINGS.".date_expire > NOW()
AND ".T_LISTINGS.".admin_approved = 1 ORDER BY membership DESC, firmname");
..OK so it's a little PEAR too.
See the usage here:
http://paste.biz/paste-2532.html
If this is tough and/or more info is needed, please pm me a quote and let's get the ball rolling.





