Файл: vsime.com/system/functions/banned.php
Строк: 125
<?
function banned($cat, $user_id, $prov=0)
{
global $comm, $dbi, $config;
if ($prov == 1)$ok = false;
$user = profile($user_id);
if ($cat == 'comm_forum')
{
if (mysqli_result("SELECT COUNT(*) FROM `users_ban` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$user[id]' AND `type` = 'forum'"))
{
if ($prov == 0)
{
$max_time_ban = mysqli_result("SELECT MAX(`time_ban`) FROM `users_ban` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$user[id]' AND `type` = 'forum' LIMIT 1");
$ban = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$user[id]' AND `time_ban` = '$max_time_ban' AND `type` = 'forum' LIMIT 1"));
$time_ban = ($ban['time_ban']-$ban['time'])/3600;
$ban_give = profile($ban['id_ank']);
echo "<div class='banned_".($config['web']==true?"web":"wap")."'>n";
echo "Вы были забанены модератором n";
echo profile_icon($ban_give['id']).profile_nick($ban_give['id'], 1).profile_medal($ban_give['id']);
echo " на $time_ban ч.<br />n";
echo "Во время действия бана Вы не сможете писать в форуме сообщества <b>".htmlspecialchars($comm['name'])."</b>.n";
echo "</div>n";
} else $ok = true;
}
} elseif ($cat == 'comm_chat')
{
if (mysqli_result("SELECT COUNT(*) FROM `users_ban` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$user[id]' AND `type` = 'chat'"))
{
if ($prov == 0)
{
$max_time_ban = mysqli_result("SELECT MAX(`time_ban`) FROM `users_ban` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$user[id]' AND `type` = 'chat' LIMIT 1");
$ban = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$user[id]' AND `time_ban` = '$max_time_ban' AND `type` = 'chat' LIMIT 1"));
$time_ban = ($ban['time_ban']-$ban['time'])/3600;
$ban_give = profile($ban['id_ank']);
echo "<div class='banned_".($config['web']==true?"web":"wap")."'>n";
echo "Вы были забанены модератором n";
echo profile_icon($ban_give['id']).profile_nick($ban_give['id'], 1).profile_medal($ban_give['id']);
echo " на $time_ban ч.<br />n";
echo "Во время действия бана Вы не сможете писать в чате сообщества <b>".htmlspecialchars($comm['name'])."</b>.n";
echo "</div>n";
} else $ok = true;
}
} elseif ($cat == 'forum')
{
if (mysqli_result("SELECT COUNT(*) FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$user[id]' AND `type` = 'forum'")) {
if ($prov == 0) {
$max_time_ban = mysqli_result("SELECT MAX(`time_ban`) FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$user[id]' AND `type` = 'forum' LIMIT 1");
$ban = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$user[id]' AND `time_ban` = '$max_time_ban' AND `type` = 'forum' LIMIT 1"));
$time_ban = ($ban['time_ban']-$ban['time'])/3600;
$ban_give = profile($ban['id_ank']);
echo "<div class='banned_".($config['web']==true?"web":"wap")."'>n";
echo "Вы были забанены модератором n";
echo profile_icon($ban_give['id']).profile_nick($ban_give['id'], 1).profile_medal($ban_give['id']);
echo " на $time_ban ч.<br />n";
echo "Во время действия бана Вы не сможете писать в форуме.n";
echo "</div>n";
} else $ok = true;
}
} elseif ($cat == 'chat') {
if (mysqli_result("SELECT COUNT(*) FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$user[id]' AND `type` = 'chat'")) {
if ($prov == 0) {
$max_time_ban = mysqli_result("SELECT MAX(`time_ban`) FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$user[id]' AND `type` = 'chat' LIMIT 1");
$ban = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$user[id]' AND `time_ban` = '$max_time_ban' AND `type` = 'chat' LIMIT 1"));
$time_ban = ($ban['time_ban']-$ban['time'])/3600;
$ban_give = profile($ban['id_ank']);
echo "<div class='banned_".($config['web']==true?"web":"wap")."'>n";
echo "Вы были забанены модератором n";
echo profile_icon($ban_give['id']).profile_nick($ban_give['id'], 1).profile_medal($ban_give['id']);
echo " на $time_ban ч.<br />n";
echo "Во время действия бана Вы не сможете писать в чате.n";
echo "</div>n";
} else $ok = true;
}
}
if ($prov == 1)return $ok;
}
?>