echo'<div class="phdr">Trực tuyến</div>';
echo '<div class="orangex">';
$onltime = '".time() - 300."';
$gbot = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
$yanbot = 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)';
$bing = 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)';
$msn = 'msnbot/1.1 (+http://search.msn.com/msnbot.htm)';
$bd = 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)';
$DCM = 'DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)';
$yahoo = 'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)';
$Ahrefs = 'Mozilla/5.0 (compatible; AhrefsBot/3.1; +http://ahrefs.com/robot/)';
$Sosos = 'Sosospider+(+http://help.soso.com/webspider.htm)';
$googlebot = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$gbot'"), 0);
$yandexbot = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$yanbot'"), 0);
$bingbot = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$bing'"), 0);
$baidu = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$msn'"), 0);
$msnbot = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$bd'"), 0);
$yahoobot = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$yahoo'"), 0);
$DoCoMo = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$DCM'"), 0);
$AhrefsBot = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$Ahrefs'"), 0);
$Sosospider = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '$onltime' AND `browser`='$Sosos'"), 0);
$usere = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . (time() - 300) . "'"), 0);
$tamune = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > '" . (time() - 300) . "'"), 0);
$total = $total+$googlebot+$msnbot+$yandexbot+$bingbot+$yahoobot+$baidu+$DoCoMo+$AhrefsBot+$Sosospider+$usere+$tamune;
if ($total) {
echo '•Online: '.($googlebot > 0 ? '<font color="red">Google[BOT]</font>, ' : '').''.($yandexbot > 0 ? '<font color="117cd6">Yandex[BOT]</font>, ' : '').''.($bingbot > 0 ? '<font color="red">Bing[BOT]</font>, ' : '').''.($baidu > 0 ? '<font color="1d942e">Baidu[BOT]</font>, ' : '').''.($msnbot > 0 ? '<font color="c4a916">MSN[BOT]</font>, ' : '').''.($yahoobot > 0 ? '<font color="b70db9">Yahoo[BOT]</font>, ' : '').''.($DoCoMo > 0 ? '<font color="red">DoCoMo[BOT]</font>, ' : '').''.($AhrefsBot > 0 ? '<font color="red">AhrefsBot[BOT]</font>, ' : '').''.($Sosospider > 0 ? '<font color="0d66b9">Soso[BOT]</font>, ' : '').'';
}
$online = array();
$hadir = @mysql_query("SELECT * FROM `users` WHERE `lastdate` >= '" . intval(time() - 300) . "' ORDER BY RAND() LIMIT 5 ;");
$hitung = mysql_num_rows($hadir);
while ($notal = mysql_fetch_array($hadir)){
$online[] = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $notal['id'] . '">' . $notal['name'] . '</a>';
}
if (($usere >= 1) && ($usere <= 5)){
echo implode(', ',$online).'.';
} elseif ($usere >= 6){
$minus = $usere - 5;
echo implode(', ',$online).'.';
echo ' <a href="' . core::$system_set['homeurl'] . '/users/index.php?act=online">' . $minus . ' thêm</a>';
}
echo '
•Khách: ';
if ($tamune >= 1)
echo '<a href="' . core::$system_set['homeurl'] . '/users/index.php?act=online&mod=guest">' . $tamune . '</a>';
else
echo 'No Guest';
//new member//
echo '
•T.v mới: ';
$req = mysql_query("SELECT `id`, `name`, `datereg` FROM `users` WHERE (preg='1') ORDER BY `datereg` DESC LIMIT 1; ");
$arr = mysql_fetch_array($req);
echo '<a href="' . core::$system_set['homeurl'] . '/'.$arr['id'].'-'.$arr['name'].'">'.$arr['name'].'</a>';
echo'</div>';
Dán vào cuối mainmenu.php