68 Classifieds Forums  

Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Modifications
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

v3.1 Modifications Questions on modifying 68 Classifieds. Please note these are not supported by 68 Classifieds, and may make future updates more difficult.

 
Thread Tools Display Modes
  #1  
Old 11-15-2007, 03:53 PM
CHRD's Avatar
CHRD CHRD is offline
Senior Member
 
Join Date: Nov 2006
Posts: 109
Default Random Featured and Normal listings

Easy fix to display random horizontal featured and normal listing on any page and the same page.

1/ Make a copy of function.feature_listings_horizontal.php, found in /includes/classes/smarty/plugins

2/ rename it to function.frand_listings_horizontal.php and upload to same folder

3/ open and edit line 18 function.feature_listings_horizontal.php, rename the "feature" part of the line to "frand"

4/ Edit line 57, look for featured = 'Y' ORDER BY rand() LIMIT, just change featured = 'Y' to featured = 'N'

5 edit line 158, look for function smarty_function_html_table_cycle_68($name, $var, $no). Insert a letter just before the 68, but not "v" I inserted n, so it looks like:
function smarty_function_html_table_cycle_n68($name, $var, $no)

open home.tpl.php found in /templates/default insert this code where it suitable:
{frand_listings_horizontal number=12 cols=4 table_attr='width="100%" style="border: 1px solid #cccccc;"' td_attr='valign="top" align="center"'}

This will let you display random normal listing along side the feartured listings
Thanks
Glenn
__________________
Costa del Sol
Spain
v3.1.10 Developer
�Powerful you have become, the dark side I sense in you.�
Reply With Quote
  #2  
Old 11-15-2007, 04:03 PM
kampbell kampbell is offline
Junior Member
 
Join Date: Aug 2007
Posts: 16
Default

Awesome. Excellent post! Is there anyway to make it specific, say like by state?
__________________
Karim
v3.1.9 Developer Edition
Reply With Quote
  #3  
Old 11-15-2007, 04:26 PM
CHRD's Avatar
CHRD CHRD is offline
Senior Member
 
Join Date: Nov 2006
Posts: 109
Default

Sorry I dont know that much, but I gues it would be in line 57 of the code
__________________
Costa del Sol
Spain
v3.1.10 Developer
�Powerful you have become, the dark side I sense in you.�
Reply With Quote
  #4  
Old 11-19-2007, 01:20 PM
CHRD's Avatar
CHRD CHRD is offline
Senior Member
 
Join Date: Nov 2006
Posts: 109
Default

I can make it call from a specific cat by placing
featured = 'N' AND section=58 ORDER BY rand() LIMIT ".$number;

58 = Cat ID

but it dosnt work if you enter the main cat ID with all your listings in sub cats all under a main cat but if you take out featured = 'N'
it will display normal and featured listings together

update: replace section=58 with section IN (3,4,5,6,7) to call from multi Cats
Thanks to Eric the Boss Man
__________________
Costa del Sol
Spain
v3.1.10 Developer
�Powerful you have become, the dark side I sense in you.�

Last edited by CHRD : 11-19-2007 at 01:29 PM.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:53 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.