Файл: chat/menu.php
Строк: 94
<?php
/**
* @package Chat for JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2010-2017 k_2
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/profile/?user=6251
*/
define('_IN_JOHNCMS', 1);
require('../incfiles/core.php');
$lng_chat = core::load_lng('chat');
// Ограничение доступа
if ($rights != 9) {
header("location: $home?err");
exit;
}
// Задаем настройки системы
$req = db::query("SELECT * FROM `chat_settings`");
$chat_settings = array();
while ($res = mysqli_fetch_row($req)) $chat_settings[$res[0]] = $res[1];
mysqli_free_result($req);
// системные переменные
$headmod = 'admin';
$textl = $lng['admin_panel'];
require('../incfiles/head.php');
/*
-----------------------------------------------------------------
Переключаем режимы работы
-----------------------------------------------------------------
*/
$array = array(
'mod_bots',
'mod_rooms',
'mod_moders',
'mod_search',
'mod_messages',
'mod_phrases',
'mod_chat'
);
if ($act && ($key = array_search($act, $array)) !== false && file_exists('includes/panel/' . $array[$key] . '.php')) {
require('includes/panel/' . $array[$key] . '.php');
} else {
/*
-----------------------------------------------------------------
Вывод меню Админ панели чата
-----------------------------------------------------------------
*/
echo '<div class="phdr"><a href="../' . $set['admp'] . '/index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng_chat['control_chat'] . '</div>';
$i = 0;
$soob = 0;
$soob_s = 0;
$room = db::query("SELECT * FROM `chat_rooms`");
while ($room_d = mysqli_fetch_assoc($room)) {
$soob = $soob + db::result(db::query("SELECT COUNT(*) FROM `chat_room_" . $room_d['id'] . "`"), 0);
$soob_s = $soob_s + db::result(db::query("SELECT COUNT(*) FROM `chat_room_" . $room_d['id'] . "` WHERE `tip` = '1'"), 0);
++$i;
}
$boty = db::result(db::query("SELECT COUNT(*) FROM `chat_bot`"), 0);
$vop = db::result(db::query("SELECT COUNT(*) FROM `chat_vop`"), 0);
$moders = db::result(db::query("SELECT COUNT(*) FROM `chat_users` WHERE `rights` = '1'"), 0);
$zaban = db::result(db::query("SELECT COUNT(*) FROM `chat_users` WHERE `ban_time` > '" . time() . "'"), 0);
$users_chat_ban = db::result(db::query("SELECT COUNT(*) FROM `chat_users` WHERE `ban_time` > '0'"), 0);
echo '<div class="gmenu"><p><h3><img src="../images/rate.gif" width="16" height="16" class="left" /> ' . $lng_chat['statistics'] . '</h3><ul>' .
'<li>' . $lng_chat['bots'] . ': ' . $boty . '</li>' .
'<li>' . $lng_chat['phrases'] . ': ' . $vop . '</li>' .
'<li>' . $lng_chat['rooms'] . ': ' . $i . '</li>' .
'<li>' . $lng_chat['messages_total'] . ': ' . $soob . '</li>' .
'<li>' . $lng_chat['messages_hidden'] . ': <span class="red">' . $soob_s . '</span></li>' .
'</ul></p></div>' .
'<div class="menu"><p><h3><img src="../images/settings.png" width="16" height="16" class="left" /> ' . $lng_chat['management'] . '</h3><ul>' .
'<li><a href="menu.php?act=mod_chat"><b>' . $lng['settings'] . '</b></a></li>';
if ($boty)
echo '<li><a href="menu.php?act=mod_bots"><b>' . $lng_chat['bots'] . '</b></a> <small>(' . $boty . '/' . $vop . ')</small></li>';
else
echo '<li><a href="menu.php?act=mod_bots&mod=nev"><b>' . $lng_chat['add_bot'] . '</b></a></li>';
if ($soob)
echo '<li><a href="menu.php?act=mod_messages"><b>' . $lng_chat['cleaning'] . '</b></a> <small>(' . $soob . '/<span class="red">' . $soob_s . '</span>)</small></li>';
if ($i)
echo '<li><a href="menu.php?act=mod_rooms"><b>' . $lng_chat['rooms'] . '</b></a> <small>(' . $i . ')</small></li>';
else
echo '<li><a href="menu.php?act=mod_rooms&mod=add"><b>' . $lng_chat['add_room'] . '</b></a></li>';
if ($zaban)
echo '<li><a href="index.php?act=ban&mod=users_ban"><b>' . $lng_chat['banned'] . '</b></a> <small>(<span class="red">' . $zaban . '</span>)</small></li>';
if ($users_chat_ban)
echo '<li><a href="index.php?act=ban&mod=col_vo"><b>Нарушители</b></a> <small>(<span class="red">' . $users_chat_ban . '</span>)</small></li>';
echo '<li><a href="menu.php?act=mod_moders"><b>' . $lng_chat['chat_moders'] . '</b></a> <small>(' . $moders . ')</small></li>' .
'</ul></p></div>' .
'<div class="phdr"><a href="index.php">' . $lng_chat['to_chat'] . '</a></div><p>' .
'<a href="../' . $set['admp'] . '/index.php">' . $lng['admin_panel'] . '</a></p>';
}
require('../incfiles/end.php');