View Single Post
  #1   IP: 222.184.76.57
Old 2007-07-10, 02:41 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default How to list 5 random FEATURED sites on the front page? (phpld)

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
Reply With Quote