68 Classifieds Forums

Random Featured and Normal listings

This is a discussion on Random Featured and Normal listings within the v3.1 Modules & Modifications forums, part of the v3.1 Legacy Help & Support category; Easy fix to display random horizontal featured and normal listing on any page and the same page. 1/ Make a ...


Go Back   68 Classifieds Forums > v3.1 Legacy Help & Support > v3.1 Modules & Modifications

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-15-2007, 03:53 PM
CHRD's Avatar
Senior Member
 
Join Date: Nov 2006
Posts: 169
Rep Power: 12
CHRD is on a distinguished road
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 Dev
V4.09 Dev sweeeet
“Powerful you have become, the dark side I sense in you.”
Reply With Quote
  #2  
Old 11-15-2007, 04:03 PM
Junior Member
 
Join Date: Aug 2007
Posts: 19
Rep Power: 6
kampbell is on a distinguished road
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
Senior Member
 
Join Date: Nov 2006
Posts: 169
Rep Power: 12
CHRD is on a distinguished road
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 Dev
V4.09 Dev sweeeet
“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
Senior Member
 
Join Date: Nov 2006
Posts: 169
Rep Power: 12
CHRD is on a distinguished road
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 Dev
V4.09 Dev sweeeet
“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
  #5  
Old 03-02-2008, 08:58 PM
Soleiltan's Avatar
Senior Member
 
Join Date: Jan 2008
Posts: 124
Rep Power: 6
Soleiltan is on a distinguished road
Thumbs up

Quote:
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.”
This worked like a dream! Thank you for what I had been looking for!!!!!
__________________
~~ Lorren

Any advice is always appreciated.

v 3.1.10 Developer; v 4 Developer
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 02:24 PM.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22