dgtupltn95
New Member
mở forum/index tìm
thêm vào sau
PHP:
echo functions::display_error($lng['error_wrong_data']);
break;
}
PHP:
$online_u = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > " . (time() - 300) . " AND `place` = 'forum,$id'"), 0);
$online_g = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_sessions` WHERE `lastdate` > " . (time() - 300) . " AND `place` = 'forum,$id'"), 0);
$totalonline = $online_u $online_g;
echo '<div>Đang xem: ';
$q = @mysql_query("select * from `users` where `lastdate` > " . (time() - 300) . " AND `place` = 'forum,$id';");
$count = mysql_num_rows($q);
while ($arr = mysql_fetch_array($q)){
$vinahit = mysql_query("select `rights` from `users` where id='" . $arr['id'] . "'");
$kingkem = mysql_fetch_array($vinahit);
if ($kingkem['rights'] == 0 ) $colornick['colornick'] = '000000';
if ($kingkem['rights'] == 3 ) $colornick['colornick'] = '0000ff';
if ($kingkem['rights'] == 6 ) $colornick['colornick'] = '009900';
if ($kingkem['rights'] == 7 ) $colornick['colornick'] = 'ff00ff';
if ($kingkem['rights'] == 9 ) $colornick['colornick'] = 'ff0000';
$u_on[]='<b><a href="../users/profile.php?user=' . $arr['id'] . '"><font color="#'.$colornick['colornick'].'">' . $arr['name'] . '</font></a></b>';
}
if ($online_u > 0)
echo implode(', ',$u_on).' và '.$online_g.' khách';
echo '</div>';