Файл: online/include.online.php
Строк: 81
<?php
$on24 = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '" . TIME_TODAY . "'"), 0);
$on1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` >" . (TIME - 300) . ""), 0);
$on2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0);
$on3 = $on1 + $on2;
if ($user['set_online'] == 1) {
echo "<div class = 'razd'><center>";
if ($user['set_online_view'] == 1) {
echo "<a href = '/online/'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a>";
echo " | ";
echo "<a href = '/online/guest.php'>Гостей " . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</a>";
}
if ($user['set_online_view'] == 2) {
echo "<a href = '/online/'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a> ";
echo "(<a href = '/online/guest.php'>Гостей " . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</a>)";
}
if ($user['set_online_view'] == 3) {
echo "<a href = '/online/'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a> ";
echo "(+<a href = '/online/guest.php'> " . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</a>)";
}
if ($user['set_online_view'] == 4) {
$kol = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0);
$kol1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0);
$obkol = $kol + $kol1;
echo "<a href = '/online/'>Онлайн $obkol</a>";
}
echo " <span id = 'hide'><a href = '/online/info.php' title = 'Подробнее'><img src = '/style/icons/info_mini.png' /></a></span>";
echo "</center></div>";
$q = mysql_query("SELECT `id` FROM `user` WHERE `date_last` > '" . (TIME - 300) . "' ORDER BY `date_last` DESC LIMIT 7");
echo "<table class = 'razd'><tr><td class = 'null'>";
while ($ank = mysql_fetch_assoc($q)) {
$ank = get_user($ank['id']);
echo "<a href = '/info.php?id=$ank[id]' title = '$ank[nick]'>n";
avatar($ank['id'], '36');
echo "</a>";
}
echo "</td></tr></table>";
}
if ($user['set_online'] == 2) {
$q = mysql_query("SELECT `id` FROM `user` WHERE `date_last` > '" . (TIME - 300) . "' ORDER BY `date_last` DESC LIMIT 7");
echo "<table class = 'razd'><tr><td class = 'null'>";
while ($ank = mysql_fetch_assoc($q)) {
$ank = get_user($ank['id']);
echo "<a href = '/info.php?id=$ank[id]' title = '$ank[nick]'>n";
avatar($ank['id'], '36');
echo "</a>";
}
echo "</td></tr></table>";
}
if ($user['set_online'] == 3) {
echo "<div class = 'razd'><center>";
echo "<a href = '/online/'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a>";
echo " | ";
echo "<a href = '/online/guest.php'>Гостей " . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</a>";
echo " <span id = 'hide'><a href = '/online/info.php' title = 'Подробнее'><img src = '/style/icons/info_mini.png' /></a></span>";
echo "</center></div>";
}