zhangjingyu
看论坛首页最下面社区明星php文件,重点是第9行。如果楼上的测试代码第7行换成这样的,会输出什么结果呢?
$query = $db->query("SELECT m.uid,m.username,m.icon,m.groupid,m.memberid,md.rvrc,md.money,md.postnum,md.todaypost,md.lastpost,md.onlinetime FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.lastpost>'$tdtime' ORDER BY md.todaypost DESC limit 0,4");
while($tuser=$db->fetch_array($query)){
if($p array(\r\n\t\t'uid' => '$tuser[uid]',\r\n\t\t'username' => '$tuser[username]',\r\n\t\t'icon' => '$tuser[icon]',\r\n\t\t'groupids' => '$tuser[levelname]',\r\n\t\t'rvrc' => '$tuser[rvrc]',\r\n\t\t'money' => '$tuser[money]',\r\n\t\t'todaypost' => '$tuser[todaypost]',\r\n\t\t'postnum' => '$tuser[postnum]',\r\n\t\t'onlinetime' => '$tuser[onlinetime]',\r\n\t),\r\n";
$sortuser[]=array('uid' => $tuser[uid],'username' => $tuser[username],'icon' => $tuser[icon],'groupids' => $tuser[levelname],'rvrc' => floor($tuser[rvrc]),'money' => $tuser[money],'todaypost' => $tuser[todaypost],'postnum' => $tuser[postnum],'onlinetime' => $tuser[onlinetime]);
}
模板文件:
今日状元
今日榜眼
今日探花
明日之星
会员:$newst[username]
级别:$newst[groupids]
发帖:$newst[postnum]
今日:$newst[todaypost]
在线:$newst[onlinetime]小时