View Single Post
  #2   IP: 218.2.29.203
Old 2007-07-10, 03:33 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default

Try this:

Open index.php and find:
Code:
echo $tpl->fetch('main.tpl', $id);
BEFORE that add this code:
Code:
$top10 = $db->GetOne("SELECT * FROM {$tables['link']['name']} WHERE STATUS = 2 ORDER BY HITS DESC LIMIT 0,10");
$last10 = $db->GetOne("SELECT * FROM {$tables['link']['name']} WHERE STATUS = 2 ORDER BY ID DESC LIMIT 0,10");
$tpl->assign('top10', $top10);
$tpl->assign('last10', $last10);
Open main.tpl

Where you want the top10 list to appear add:
Code:
{foreach from=$top10 item=link name=links}
{$link.URL}

{/foreach}
Where you want the last10 list to appear add:
Code:
{foreach from=$last10 item=link name=links}
{$link.URL}

{/foreach}
Reply With Quote