Файл: modules/online/include.php
Строк: 61
<?php
/* Мод "Пользователи онлайн"
* Версия v0.0.1
* Дата последнего редактирования 24.11.2014
* Двиг DCMS Special
* Модифицировал densnet
* Файл include.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 - 600) . ""), 0);
$on2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0);
$on3 = $on1 + $on2;
define('DIR_ONLINE', '/modules/online/');
if ($user['set_online'] == 1) {
echo "<div class = 'razd'><center>";
if ($user['set_online_view'] == 1) {
echo "<a href = '" . DIR_ONLINE . "'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a>";
echo " | ";
echo "<a href = '" . DIR_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 = '" . DIR_ONLINE . "'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a> ";
echo "(<a href = '" . DIR_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 = '" . DIR_ONLINE . "'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a> ";
echo "(+<a href = '" . DIR_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 = '" . DIR_ONLINE . "'>Онлайн $obkol</a>";
}
echo " <a href = '" . DIR_ONLINE . "info.php' title = 'Подробнее'>" . img('info_mini.png') . "</a>";
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 = user::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 = user::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 = '" . DIR_ONLINE . "'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 300) . ""), 0) . "</a>";
echo " | ";
echo "<a href = '" . DIR_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 = '" . DIR_ONLINE . "info.php' title = 'Подробнее'>" . img('info_mini.png') . "</a></span>";
echo "</center></div>";
}