|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
************************************************
** Number of online users in header / footer! **
************************************************
1. Add the following code to your phpinclude template (PHP-Parsed code):
************************************************************
// start - get online users (hack by firefly)
$datecut=time()-$cookietimeout;
$headerguests=$DB_site->query_first("SELECT COUNT(*) AS count FROM session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$DB_site->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM session WHERE session.userid>0 AND session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$headeronline=$headerguests+$headerusers;
// end - get online users (hack by firefly)
************************************************************
2. Save the template changes.
3. Place $headeronline wherever you want in either your header or footer templates to show number of online users. In addition, you can also use $headerguests to show number of online guests, or $headerusers to show number of online members.
|
|