Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Need help recreating a method (PHP/OOP)

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch
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:

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.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back