Файл: modules/users/include.php
Строк: 192
<?php
/* DCMS Special
* Дата последнего редактирования 13.12.2015
* Модифицировал densnet
*/
$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;
if ($user['set_online'] == 1) {
?>
<div class='card'>
<div class='card-header'>
<div class="bd-example">
<span style="float: right;" id="hides">
<a data-toggle="modal" data-target="#set" href="/?users_set"><span data-toggle='tooltip' data-placement='left' title='Настроить'><span class='fa fa-cog fa-fw'></span></span></a>
</span>
</div>
<?php
if ($user['set_online_view'] == 1) {
echo "<center>";
echo "<a href='/?users'>Онлайн <b>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 600) . ""), 0) . "</b></a>";
echo " | ";
echo "<a href='/?users'>Гостей <b>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</b></a>";
echo "</center>";
}
if ($user['set_online_view'] == 2) {
echo "<center>";
echo "<a href='/?users'>Онлайн <b>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 600) . ""), 0) . "</b></a> ";
echo "(<a href='/?guest'>Гостей <b>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</b></a>)";
echo "</center>";
}
if ($user['set_online_view'] == 3) {
echo "<center>";
echo "<a href='/?users'>Онлайн <b>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 600) . ""), 0) . "</b></a> ";
echo "(+<a href='/?users'> <b>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</b></a>)";
echo "</center>";
}
if ($user['set_online_view'] == 4) {
$kol = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 600) . ""), 0);
$kol1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0);
$obkol = $kol + $kol1;
echo "<center>";
echo "<a href='/?users'>Онлайн <b>$obkol</b></a>";
echo "</center>";
}
$q = mysql_query("SELECT `id` FROM `user` WHERE `date_last` > '" . (TIME - 600) . "' ORDER BY `date_last` DESC LIMIT 8");
echo "</div><div class='card-block'>";
while ($ank = mysql_fetch_assoc($q)) {
$ank = get_user($ank['id']);
echo "<a data-toggle='tooltip' data-placement='bottom' href='/info.php?id=$ank[id]' title='$ank[nick]'>n";
avatar($ank['id'], '36', 'border-radius: 2px;');
echo "</a>";
}
?>
</div>
</div>
<?php
}
if ($user['set_online'] == 2) {
$q = mysql_query("SELECT `id` FROM `user` WHERE `date_last` > '" . (TIME - 600) . "' ORDER BY `date_last` DESC LIMIT 8");
?>
<div class = 'card'>
<div class='card-block'>
<div class="bd-example">
<span style="float: right;" id="hides">
<a data-toggle="modal" data-target="#set" href="/?users_set"><span data-toggle='tooltip' data-placement='left' title='Настроить'><span class='fa fa-cog fa-fw'></span></span></a>
</span>
</div>
<?php
while ($ank = mysql_fetch_assoc($q)) {
$ank = get_user($ank['id']);
echo "<a data-toggle='tooltip' data-placement='bottom' href='/info.php?id=$ank[id]' title='$ank[nick]'>n";
avatar($ank['id'], '36', 'border-radius: 2px;');
echo "</a>";
}
?>
</div>
</div>
<?php
}
if ($user['set_online'] == 3) {
?>
<div class='card'>
<div class='card-header' style="margin-bottom: -1px;"><center>
<div class="bd-example">
<span style="float: right;" id="hides">
<a data-toggle="modal" data-target="#set" href="/?users_set"><span data-toggle='tooltip' data-placement='left' title='Настроить'><span class='fa fa-cog fa-fw'></span></span></a>
</span>
</div>
<?php
echo "<a class='card-link' href='/?users'>Онлайн " . mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > " . (TIME - 600) . ""), 0) . "</a>";
echo "<a class='card-link' href='/?users'>| Гостей " . mysql_result(mysql_query("SELECT COUNT(*) FROM `guests` WHERE `date_last` > " . (TIME - 500) . " AND `pereh` > '0'"), 0) . "</a>";
echo "</center>";
?>
</div>
</div>
<?php
}
?>
<div class="modal fade" id="set" tabindex="-1" role="dialog" aria-labelledby="aut" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h5 class="modal-title" id="exampleModalLabel">Настройки панели</h5>
</div>
<div class="modal-body">
<form name='settings' action='/?users_set&<?= $passgen ?>' method='POST'>
<div class='card'>
<div class='card-header'>Вывод онлайн панели</div>
<div class='card-block'>
<div class="c-inputs-stacked">
<?php
echo "<label class='c-input c-radio'><input id='3' type='radio' name='set_online' value='3' " . ($user['set_online'] == 3 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Только данные</label>";
echo "<label class='c-input c-radio'><input id='2' type='radio' name='set_online' value='2' " . ($user['set_online'] == 2 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Только аватары</label>";
echo "<label class='c-input c-radio'><input id='1' type='radio' name='set_online' value='1' " . ($user['set_online'] == 1 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Данные + аватары</label>";
echo "<label class='c-input c-radio'><input id='0' type='radio' name='set_online' value='0' " . ($user['set_online'] == 0 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Не показывать вообще</label>";
?>
</div>
</div>
<div class='card-header'>Вид онлайн панели</div>
<div class='card-block'>
<div class="c-inputs-stacked">
<?php
echo "<label class='c-input c-radio'><input id='1' type='radio' name='set_online_view' value='1' " . ($user['set_online_view'] == 1 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Вариант 1<br /><font color = 'blue'>Онлайн 235 | Гостей 452</font></label>";
echo "<label class='c-input c-radio'><input id='2' type='radio' name='set_online_view' value='2' " . ($user['set_online_view'] == 2 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Вариант 2<br /><font color = 'blue'>Онлайн 235 (Гостей 452)</font></label>";
echo "<label class='c-input c-radio'><input id='3' type='radio' name='set_online_view' value='3' " . ($user['set_online_view'] == 3 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Вариант 3<br /><font color = 'blue'>Онлайн 235 (+452)</font></label>";
echo "<label class='c-input c-radio'><input id='4' type='radio' name='set_online_view' value='4' " . ($user['set_online_view'] == 4 ? " checked='checked'" : NULL) . "><span class='c-indicator'></span> Вариант 4 (общее количество)<br /><font color = 'blue'>Онлайн 687</font></label>";
?>
</div>
</div>
</div>
<div class="modal-footer">
<button name='save' class="btn btn-success"><span class='fa fa-save fa-fw'></span> Сохранить</button>
</div>
</form>
</div>
</div>
</div>
</div>