View Full Version : How to list 5 random FEATURED sites on the front page?
jeeplaw
05-03-2006, 04:02 PM
I guess that question says it all. And I'm running 3.0.4..anyone else do this kind of thing yet?
LyndaLAX
05-03-2006, 06:59 PM
I'd like to know as well,
best,
Lynda
bobby9101
05-03-2006, 08:30 PM
Place in index.php
Content visible to registered users only.
right above Content visible to registered users only.
place in main.tpl
Content visible to registered users only.
wherever you want them to display
if you have any problems give me a shout
jeeplaw
05-03-2006, 10:02 PM
Where would be a good idea to place that code in the main.tpl? I tried placing it near the bottom, but it broke my site.
Fatal error: Smarty error: [in main.tpl line 97]: syntax error: mismatched tag {/if}. expected {/foreach} (opened line 93). (Smarty_Compiler.class.php, line 2286) in /home/jeeplaw/domains/dietdirectory.org/public_html/libs/smarty/Smarty.class.php on line 1095
Also, I'm running 3.0.4
bobby9101
05-03-2006, 10:03 PM
can you post me a url and your main.tpl please
what version are you using?
jeeplaw
05-03-2006, 10:04 PM
www.dietdirectory.org
bobby9101
05-03-2006, 10:05 PM
main.tpl and version?
dedoo
05-23-2006, 12:51 PM
Great mod thanks for posting it.
One question though. Is it possible to add a different css class to these links?
i.e. show different colors for the links and linktexts?
I'm trying to show them in an addbox with a different background color than the directory itself
Danny
dcristo
06-08-2006, 02:44 PM
Did anyone get this working with 3.04?
Steven Myers
06-08-2006, 03:07 PM
Here you go: http://www.phplinkdirectory.com/forum/showthread.php?t=3916 Works in 3.05 as well.
Just change variables for the listings, I cannot say that this will actually display 5 for you but it will display 10.
jerryg
02-12-2007, 12:00 PM
Thanks for sharing this great mod. It's work with 3.1.0. Example: {url no longer in service}
:)
shadav
02-12-2007, 02:29 PM
or you can try this one...not sure if it'd work with your version but it'll display as many as you tell it to, however it only displays them in one column...i got it to do 2 columns but doing that it will sometimes show duplicate listings
Link Rotation (http://www.phplinkdirectory.com/forum/showthread.php?t=9231)
webfinity
04-06-2007, 04:36 PM
I'm not able to get this working
I want to display all links randomly... not just featured so I changed featured="0". Nothing shows up. :(
I'm using version 3.1.0, can this be the problem?
shzor
06-04-2007, 08:25 AM
Hi, plz let me know i m using 3.2 so i need this mod as well :)
shadav
06-04-2007, 11:37 PM
i'm sure it'll work on 3.2 or you can try the link that i posted, it works on 3.2
shzor
06-05-2007, 05:26 AM
i tried but didnt work for me, it displays nothing on main page :(
James
06-05-2007, 05:38 AM
in the index.php change the red code for the one listed
$random_link = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE FEATURED = 1 AND STATUS=2 ORDER BY RAND() LIMIT 5");
$tpl->assign('random_link', $random_link);
Instead of using this in the main.tpl:
{if $category.ID eq 0 and not $p and not $qu}
use this from tojo:
{if !$uid & !$search & empty($category.ID) & !$list & $scriptname == "index"}
also you need to add this to the init.php right before the ?>
$tpl->assign('scriptname' , basename($_SERVER[PHP_SELF], ".php"));
this works :)
shzor
06-15-2007, 08:22 PM
Thanks alot Dawzz its working now :)
byronbra
06-16-2007, 12:39 AM
Working perfectly, thanks Bobbi and Dawzz
jackieshine
07-09-2007, 07:43 PM
really great, tks.
khoking
07-24-2007, 01:39 AM
Hi,
This is my main.tpl file, where should I put the codes? I want to have featured links below the categories, and have title FEATURED LINKS there.
I am a newbie to php and phpld...
Content visible to registered users only.
jeffcai
08-07-2007, 07:10 AM
thanks a lot, i am using the 3.1 version and got it work
http://www.directoryseo.org/
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.