Ajax chat online user display
the core part of the chat room status display:mysql_select_db('gongshe_discuz', $link);$result = mysql_query("SELECT * FROM ajax_chat_online")
or die(mysql_error());
$ucount=0;
while($row = mysql_fetch_array( $result))
{
$ucount++;
$uID=$row['userID'];
$uName=$row['userName'];
$namelist.="{$uName}, {$nametail}";
}
if($ucount>0){
如果有人要做的事
}else
{
如果没人要做的事}
但是,问题是php在header template里面不工作。这是template被运用的方式所决定的。没有办法改变。只好想出一个变通的办法:
写了一个chatstatus.php script,本身就是一个页面。这里面含有上述chat status显示。然后再用iframe插到header template 里面。。。。。但是发现光插茶楼这一部分,它与其他链接无法完全对齐。干脆,把那一排链接都搬进chatstatus.php。。。。。
问题解决!
页:
[1]