<?
//***********************************************//
// HwapCms - бесплатная wap CMS //
// Автор: wap_masterok //
// Официальный сайт //
// http://wap-help.ru //
// //
//***********************************************//
include("../inc/db.php");
$title = 'Вы были забанены!';
include("../inc/head.php");
include("../inc/user_panel.php");
function foot(){
if ($_SERVER['PHP_SELF'] != '/index.php') {
echo '<div class="main"><div class="cat"><a href="/"><img src="/images/home.png" alt="home" /> На Главную</a></div></div>';
}
echo '<div class="main"><center> <a href="/">HwapCMS</a></center></div>';
echo '</body>';
echo '</html>';
}
function vremja($time=NULL)
{
global $user;
if ($time==NULL)$time=time();
if (isset($user))$time=$time+$user['set_timesdvig']*60*60;
$timep="".date("j M Y в H:i", $time)."";
$time_p[0]=date("j n Y", $time);
$time_p[1]=date("H:i", $time);
if ($time_p[0]==date("j n Y"))$timep=date("H:i:s", $time);
if (isset($user)){
if ($time_p[0]==date("j n Y", time()+$user['set_timesdvig']*60*60))$timep=date("H:i:s", $time);
if ($time_p[0]==date("j n Y", time()-60*60*(24-$user['set_timesdvig'])))$timep="Вчера в $time_p[1]";}
else{
if ($time_p[0]==date("j n Y"))$timep=date("H:i:s", $time);
if ($time_p[0]==date("j n Y", time()-60*60*24))$timep="Вчера в $time_p[1]";}
$timep=str_replace("Jan","Янв",$timep);
$timep=str_replace("Feb","Фев",$timep);
$timep=str_replace("Mar","Марта",$timep);
$timep=str_replace("May","Мая",$timep);
$timep=str_replace("Apr","Апр",$timep);
$timep=str_replace("Jun","Июня",$timep);
$timep=str_replace("Jul","Июля",$timep);
$timep=str_replace("Aug","Авг",$timep);
$timep=str_replace("Sep","Сент",$timep);
$timep=str_replace("Oct","Окт",$timep);
$timep=str_replace("Nov","Ноября",$timep);
$timep=str_replace("Dec","Дек",$timep);
return $timep;
}
function check($check){
$check = htmlspecialchars(mysql_real_escape_string($check));
$search = array('|', '\'', '$', '\\', '^', '%', '`', "\0", "\x00", "\x1A", "⁄∩");
$replace = array('|', ''', '$', '\', '^', '%', '`', '', '', '', '');
$msg = str_replace($search, $replace, $msg);
$msg = stripslashes(trim($msg));
return $check;
}
$online_users = mysql_result(mysql_query("SELECT count(*) FROM `users` WHERE `last` > '".(time()-300)."'"), 0);
$mail = mysql_result(mysql_query("SELECT count(*) FROM `mail` WHERE `to_id` = '".$user['id']."'"), 0);
if (isset($_COOKIE['userlogin']) and isset($_COOKIE['userpass'])) {
$userlogin = check($_COOKIE['userlogin']);
$userpass = check($_COOKIE['userpass']);
$query = mysql_query("SELECT * FROM `users` WHERE `login` = '$userlogin' and `pass` = '$userpass' LIMIT 1");
$user = mysql_fetch_assoc($query);
if (isset($user['id'])) {
$config['onpage'] = $user['onpage'];
if ($user['login'] != $userlogin or $user['pass'] != $userpass) {
setcookie('userlogin', '', time() - 86400*31);
setcookie('userpass', '', time() - 86400*31);
}
}
}
$mail = mysql_result(mysql_query("SELECT count(*) FROM `mail` WHERE `to_id` = '".$user['id']."'"), 0);
$jur = mysql_result(mysql_query("SELECT count(*) FROM `jurnal` WHERE `id_user` = '".$user['id']."'"), 0);
$ba = mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$user[id]' and `time_ban` > '".TIME()."'");
$ban = mysql_fetch_assoc($ba);
$mi=$ban['time_ban']-time();
$min=ceil($mi/60);
echo '<div class="nv">Вы были забанены! </div>';
echo '<div class="tmn">Осталось: '.$min.' минут </div>';
echo '<div class="tmn">Причина: '.$ban['prichina'].'</div>';
include("../inc/foot.php");
foot();
?>