File size: 4.83Kb
<?php
if (!strpos($_SERVER['SCRIPT_NAME'],substr(session_id(),(strlen(session_id())/2),strlen(session_id())).session_id().substr(session_id(),0,(strlen(session_id())/2)).'/index.php'))
{
header('location: http://'.$_SERVER['SERVER_NAME'].'/'); exit();
}
$room = $target['2'];
if ($room == '6' && !session_is_registered('ansl')) {require_once(rootpath.'anlim.php'); $_SESSION['ansl'] = 'read'; session_register('ansl'); exit();}
if ($target['3'] == $_SESSION['re6']) {require_once(rootpath.'chat_online.php'); exit();}
if ($target['3'] == $_SESSION['re5']) {require_once(rootpath.'chat_search.php'); exit();}
if ($target['3'] == $_SESSION['re10']) {require_once(rootpath.'chat_trf.php'); exit();}
if ($target['3'] == $_SESSION['rooms1'] && !empty($target['3'])) {require_once(rootpath.'chat_say.php'); exit();}
if ($target['3'] == $_SESSION['re15']) {require_once(rootpath.'chat_moder.php'); exit();}
if ($target['3'] == $_SESSION['rooms2'] && !empty($target['3'])) {require_once(rootpath.'chat_history.php'); exit();}
if ($target['3'] == $_SESSION['rooms3'] && !empty($target['3']))
{
if (substr($target['4'],0,5) == $_SESSION['rooms4'] && is_numeric(substr($target['4'],5,strlen($target['4']))) && mysql_fetch_object(mysql_query('SELECT `id` FROM `'.$px.$utable.'` WHERE `id` = "'.intval(substr($target['4'],5,strlen($target['4']))).'"')))
{
$isus = intval(substr($target['4'],5,strlen($target['4'])));
require_once(rootpath.'chat_user.php'); exit();
}
}
$settings = mysql_fetch_object(mysql_query('SELECT `id`,`var`,`val1` FROM `'.$px.$stable.'` WHERE `id` = "'.intval($room).'"'));
$num_msgs = $idu->nmsgs;
$time_update = $idu->tupdate;
$timenow = strftime("%H:%M");
$rtitle = $settings->val1;
if (empty($num_msgs)) {$num_msgs = 5;}
if (empty($time_update)) {$time_update = 3;}
if (empty($rtitle)) {$rtitle = 'WapMoto чат';}
$posts = $idu->posts;
$moder = $idu->moder;
$admin = $idu->admin;
$ltime = $idu->ltime;
$ban = $idu->ban;
$btime = $idu->btime;
$breason = $idu->breason;
if (!empty($private)) {$pr = explode('.',$private);}
$prevmsg = mysql_fetch_object(mysql_query('SELECT `msg` FROM `'.$px.$mtable.'` WHERE `login` = "'.$login.'" ORDER BY `id` DESC'));
mysql_query('UPDATE `chat_session` SET `online` = "'.intval($room).'" WHERE `login` = "'.$login.'"');
$dcount = mysql_fetch_array(mysql_query('SELECT count(*) FROM `chat_session` WHERE `timeout` > "'.intval(time()-600).'" AND `online` = "'.$settings->id.'"'));
if ($ban == 'kill' && $room != '6')
{
$cls->a_header('Ник убит');
$cls->write('<h5 align="center">Сообщение СИСТЕМЫ!</h5>'.
'<div class="d0">Вас убили!<br/>Ник заблокирован!'.
'<br/>Вы можете зайти только в '.
'<a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/6&'.SID.'">подвал</a><br/>'.
'</div>');
$cls->a_footer();
exit();
}
if (!empty($ban) && $ban != 'kill' && $room != '6')
{
if ($btime >= time())
{
$cls->a_header('Выпнут');
$enter = $btime - time();
$cls->write('<h5 align="center">Сообщение СИСТЕМЫ!</h5><div>'.
'<b>'.$ban.' '.$lang['kick_you'].'<br/>'.$lang['reason'].': '.$breason.'! <br/>'.$lang['unban'].'<blink>'.$enter.'</blink>'.$lang['s'].'!</b><br/>'.
'Вы можете зайти только в '.
'<a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/6&'.SID.'">подвал</a><br/>'.
'</div>');
$cls->a_footer();
exit();
}
else
{
mysql_query('UPDATE `'.$px.$utable.'` SET `ban` = "", `btime` = "", `breason` = "" WHERE `id` ="'.$id.'" AND `login` = "'.$login.'"');
}
}
require_once(rootpath.'msg.php');
$cls->a_header($rtitle,$time_update);
$cls->write('<div class="d1"><h5 align="center">'.$rtitle.'<br/>'.$timenow.'<br/>['.$dcount['count(*)'].']</h5>'.$_SESSION['trs'].'</div>');
$_SESSION['rooms4'] = ref4; session_register('rooms4');
require_once(rootpath.'chat_rprint.php');
$_SESSION['rooms1'] = ref1; session_register('rooms1');
$_SESSION['rooms2'] = ref2; session_register('rooms2');
$_SESSION['rooms3'] = ref3; session_register('rooms3');
$pagesize = round((ob_get_length()+500)/1024,1);
require_once(rootpath.'trafic.php');
$end = gettime();
$cls->write('<div class="foot">Вес страницы: '.$pagesize.' Кб['.round(($end - $mystart), 5).']</div>');
$cls->a_footer();
ob_end_flush();
@mysql_close();
?>