$hotmember1 = '';
$query = $db->query("SELECT username, uid, posts FROM {$tablepre}members ORDER BY posts DESC LIMIT 0, 10");
while($member = $db->fetch_array($query)) {
$hotmember1.="<table width='100%' border='0' cellspacing='0' cellpadding='0' style='margin-top:4px'><tr><td width='5%'> </td>
<td width='89%' bgcolor='#FFFFFF'><table width='95%' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr><td width='75%' valign='bottom' ><a href='viewpro.php?uid=$member[uid]' target='_blank' class='mainlink1' >$member[username]</a></td><td width='25%'><div align='right'>$member[posts]</div></td></tr></table></td></tr></table>";
}
DESC LIMIT 0, 10");后面的10为调用条数
---------------------------------------------
7、论坛精华贴调用:
代码
复制代码 代码如下:
//社区精华TOP
$jingthreads = '';
$query = $db->query("SELECT * FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where digest ORDER BY `t` . `lastpost` DESC LIMIT 0, 7");
while($thread = $db->fetch_array($query)) {
$thread[subject] = cutstr($thread[subject], 35);
$jingthreads.="<table width='100%' border='0' cellspacing='0' cellpadding='2'><tr><td width='85%'><a href='viewthread.php?tid=$thread[tid]' target='_blank' title='作者:$thread[author] 版块:$thread[name]' class='mainlink1'>·$thread[subject] </a></td></tr></table>" ;
}
DESC LIMIT 0, 7");后面的7为调用条数
($thread[subject], 35);后面的35为显示字符数
---------------------------------------------
8、论坛最新贴调用:
代码
复制代码 代码如下:
//最新文章
$replythreads = '';
$query = $db->query("SELECT author, views, tid, subject, lastpost FROM {$tablepre}threads ORDER BY dateline DESC LIMIT 0, 10");
while($thread = $db->fetch_array($query)) {
$thread[subject] = cutstr($thread[subject], 27);
$thread[lastpost] = gmdate("Y-m-j g:i", $thread[lastpost] + $timeoffset * 3600);
$replythreads.=" <LI><a href='viewthread.php?tid=$thread[tid]' title='作者:$thread[author] 回复:$thread[lastpost]' target=_blank>$thread[subject]</A><br />";
}
$replythreads调用变量名
DESC LIMIT 0, 10");后面的10为调用条数
($thread[subject], 27);后面的27为显示字符数
---------------------------------------------
9、友情链接调用
代码
复制代码 代码如下: