File size: 6.7Kb
<?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();
}
if ($target['0'] == $_SESSION['re'] && $target['0'] != '')
{
if ($target['1'] == $_SESSION['re2'] && mysql_fetch_object(mysql_query('SELECT `var`,`val1` FROM `'.$px.$stable.'` WHERE `id` = "'.intval($target['2']).'"')))
{
require_once(rootpath.'chat_room.php'); exit();
}
if ($target['1'] != ''){
if ($target['1'] == $_SESSION['re14'] && $idu->level >= 6) {require_once(rootpath.'chat_admin.php'); exit();}
if ($target['1'] == $_SESSION['re15'] && $idu->level >= 1) {require_once(rootpath.'chat_moder.php'); exit();}
if ($target['1'] == $_SESSION['re1']) {require_once(rootpath.'chat_news.php'); exit();}
if ($target['1'] == $_SESSION['re3']) {require_once(rootpath.'chat_meets.php'); exit();}
if ($target['1'] == $_SESSION['re4']) {require_once(rootpath.'letters/index.php'); exit();}
if ($target['1'] == $_SESSION['re5']) {require_once(rootpath.'chat_search.php'); exit();}
if ($target['1'] == $_SESSION['re6']) {require_once(rootpath.'chat_online.php'); exit();}
if ($target['1'] == $_SESSION['re7']) {require_once(rootpath.'chat_kosti.php'); exit();}
if ($target['1'] == $_SESSION['re8']) {require_once(rootpath.'chat_statistic.php'); exit();}
if ($target['1'] == $_SESSION['re9']) {require_once(rootpath.'chat_help.php'); exit();}
if ($target['1'] == $_SESSION['re10']) {require_once(rootpath.'chat_trf.php'); exit();}
if ($target['1'] == $_SESSION['re11']) {require_once(rootpath.'chat_ignor.php'); exit();}
if ($target['1'] == $_SESSION['re12']) {require_once(rootpath.'chat_setup.php'); exit();}
if ($target['1'] == $_SESSION['re13']) {require_once(rootpath.'chat_profile.php'); exit();}
if ($target['1'] == $_SESSION['re16']) {require_once(rootpath.'chat_smiles.php'); exit();}
if ($target['1'] == $_SESSION['re17']) {require_once(rootpath.'aworld.php'); exit();}}
}
mysql_query('UPDATE `chat_session` SET `online` = "" WHERE `login` = "'.$login.'"');
$num_in = mysql_fetch_array(mysql_query('SELECT count(*) FROM `'.$px.$ltable.'` WHERE `to_user` = "'.$login.'" AND `new` = 1'));
$num_in_all = mysql_fetch_array(mysql_query('SELECT count(*) FROM `'.$px.$ltable.'` WHERE `to_user` = "'.$login.'"'));
$pdc = mysql_fetch_array(mysql_query('SELECT count(*) FROM `chat_session` WHERE `timeout` > "'.intval(time()-600).'" AND `online` = ""'));
$num_meets = mysql_fetch_array(mysql_query('SELECT count(*) FROM `'.$px.$meettable.'` WHERE 1'));
$num_news = mysql_fetch_array(mysql_query('SELECT count(*) FROM `chat_news` WHERE 1'));
$q = mysql_query('SELECT * FROM `'.$px.$stable.'` WHERE `mod` = "room" ORDER BY val3');
$cls->a_header('Прихожая');
echo '<div class="d1"><h5 align="center">'.$lang['holl'].'<br/>['.$pdc['count(*)'].']</h5></div>';
if ($idu->level){echo '<div class="d0">';}
if($idu->level >= 6) {echo '<a href="?'.ref.'/'.ref14.'&'.SID.'">'.$lang['admining'].'</a><br/>';}
if($idu->level >= 1) {echo '<a href="?'.ref.'/'.ref15.'&'.SID.'">Управление чатом</a>';}
if ($idu->level){echo '</div>';}
$cls->write('<div class="d0"><a href="?'.ref.'/'.ref1.'&'.SID.'">Новости('.$num_news['count(*)'].')</a><br/>'.
'<a href="?'.ref.'/'.ref3.'&'.SID.'">'.$lang['meets'].'('.$num_meets['count(*)'].')</a></div><div class="d0">'.
'<a href="?'.ref.'/'.ref4.'&'.SID.'">'.$lang['letters'].'('.$num_in['count(*)'].'/'.$num_in_all['count(*)'].')</a><br/>'.
'<a href="?'.ref.'/'.ref5.'&'.SID.'">'.$lang['search'].'</a><br/>'.
'<a href="?'.ref.'/'.ref6.'&'.SID.'">'.$lang['who_online'].'</a><br/>'.
'<div class="foot"><a href="?'.ref.'/'.ref7.'&'.SID.'">Кости</a><br/>'.
'<a href="?'.ref.'/'.ref17.'&'.SID.'">Другой мир</a></div></div>'.
'<br/>');
$_SESSION['croom'] = mysql_num_rows($q); session_register('croom');
while ($droom = mysql_fetch_object($q))
{
$dcount = mysql_fetch_array(mysql_query('SELECT count(*) FROM `chat_session` WHERE `timeout` > "'.intval(time()-600).'" AND `online` = "'.$droom->id.'"'));
if ($droom->id != '6')
{
$cls->write('<div class="d1">'.++$nr.'.<a href="?'.ref.'/'.ref2.'/'.$droom->id.'&'.SID.'">'.$droom->val1.'</a> ('.$dcount['count(*)'].')</div>');if ($nr < mysql_num_rows($q)-1){$cls->write('<div class="d0"></div>');}
}
}
echo '<br/>'; echo $_SESSION['backout'];
$dcount = mysql_fetch_array(mysql_query('SELECT count(*) FROM `chat_session` WHERE `timeout` > "'.intval(time()-600).'" AND `online` = "6"'));
$cls->write('<div class="d0"><div class="d3">'.
'<a href="./?'.ref.'/'.ref2.'/6&'.SID.'">Подвал('.$dcount['count(*)'].')</a></div>'.
'</div><br/><div class="d0">'.
'<a href="?'.ref.'/'.ref8.'&'.SID.'">'.$lang['stats'].'</a><br/>'.
'<a href="?'.ref.'/'.ref16.'&'.SID.'">Смайлики</a><br/>'.
'<a href="?'.ref.'/'.ref9.'&'.SID.'">'.$lang['help'].'</a><br/>'.
'<a href="?'.ref.'/'.ref10.'&'.SID.'">Трафик</a><br/>'.
'<a href="?'.ref.'/'.ref11.'&'.SID.'">'.$lang['ignor'].'</a><br/>'.
'<a href="?'.ref.'/'.ref12.'&'.SID.'">'.$lang['settings'].'</a><br/>'.
'<a href="?'.ref.'/'.ref13.'&'.SID.'">'.$lang['profile'].'</a><br/>'.
'</div>');
$_SESSION['re'] = ref; session_register('re');
$_SESSION['re1'] = ref1; session_register('re1');
$_SESSION['re2'] = ref2; session_register('re2');
$_SESSION['re3'] = ref3; session_register('re3');
$_SESSION['re4'] = ref4; session_register('re4');
$_SESSION['re5'] = ref5; session_register('re5');
$_SESSION['re6'] = ref6; session_register('re6');
$_SESSION['re7'] = ref7; session_register('re7');
$_SESSION['re8'] = ref8; session_register('re8');
$_SESSION['re9'] = ref9; session_register('re9');
$_SESSION['re10'] = ref10; session_register('re10');
$_SESSION['re11'] = ref11; session_register('re11');
$_SESSION['re12'] = ref12; session_register('re12');
$_SESSION['re13'] = ref13; session_register('re13');
$_SESSION['re14'] = ref14; session_register('re14');
$_SESSION['re15'] = ref15; session_register('re15');
$_SESSION['re16'] = ref16; session_register('re16');
$_SESSION['re17'] = ref17; session_register('re17');
$pagesize = round((ob_get_length()+500)/1024,1);
require_once(rootpath.'trafic.php');
$end = gettime();
$cls->write('<div class="foot">['.round(($end - $mystart), 5).']</div>');
$cls->a_footer();
ob_end_flush();
@mysql_close();
?>