Support Forums

Two Featured Ad Sections on Home

This is a discussion on Two Featured Ad Sections on Home within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Hi, how can I put two featured ad sections on the home for two different categories? Thanks again....


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 07-28-2008, 09:14 PM   #1
Customer
 
Join Date: May 2008
Posts: 26
Rep Power: 10
go3matix is on a distinguished road
Question Two Featured Ad Sections on Home

Hi, how can I put two featured ad sections on the home for two different categories? Thanks again.
go3matix is offline   Reply With Quote
Old 07-29-2008, 08:24 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,297
Rep Power: 130
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Find the file /includes/classes/smarty/plugins/function.feature_listings_horizontal.php and make a copy of it in the same directory but with a new name, something like

/includes/classes/smarty/plugins/function.feature_listings_horizontal_mycat.php

Open the newly saved file and look for the following line near the top of the file

Code:
function smarty_function_feature_listings_horizontal($params, &$smarty)
change it to match the new name like so.....

Code:
function smarty_function_feature_listings_horizontal_mycat($params, &$smarty)
Then scroll down a little bit and find the database query line that looks something like this.....

Code:
$sSQL="SELECT id,title,price FROM ".PREFIX."listings WHERE display = 'Y' AND expiration > NOW() AND featured = 'Y' ORDER BY rand() LIMIT ".$number;

and change it to the following, replace "mycat" with the number of the category you want to pull ads from.

Code:
$sSQL="SELECT id,title,price FROM ".PREFIX."listings WHERE display = 'Y' AND expiration > NOW() AND section = 'mycat' featured = 'Y' ORDER BY rand() LIMIT ".$number;
Then call the new plugin just like the original by using the new plugins name like so....

{feature_listings_horizontal_mycat number=8 cols=4 table_attr='width="100%" cellpadding="3" cellspacing="3"' td_attr='style="border-top: 1px dashed #999;"'}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Price show up at featured home page need to be off cranko Technical Support 7 04-08-2008 08:10 AM
How show up 12 featured listing in home page ? Marcelo Templates, HTML, CSS, and Design Help 2 05-01-2007 01:21 AM


All times are GMT -4. The time now is 11:14 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0