Размер файла: 3.8Kb
<?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();
}
$cls->write('<div class="d0"><a accesskey="1" href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'&'.SID.'">'.$lang['update'].'</a><br/>'.
'<a accesskey="2" href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.$_SESSION['re6'].'&'.SID.'">'.$lang['who_online'].'</a><br/>'.
'<a accesskey="3" href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.$_SESSION['re5'].'&'.SID.'">'.$lang['search'].'</a><br/>'.
'<a accesskey="4" href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.$_SESSION['re10'].'&'.SID.'">Трафик</a><br/>'.
'<a accesskey="5" href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.ref1.'&'.SID.'">'.$lang['say'].'</a>'.
'<br/>');
$ulevel = $idu->level;
if ($ulevel >= '3' && $ulevel <= '7') {$cls->write('<a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.$_SESSION['re15'].'&'.SID.'">Управление чатом</a><br/>');}
$ignor = '';
$qi = mysql_query('SELECT `user` FROM `'.$px.$itable.'` WHERE `loginid` = "'.$id.'"');
while ($idata = mysql_fetch_object($qi))
{
$ignor .= 'login != "'.$idata->user.'" AND ';
}
$cls->write('<div class="foot"><form method="post" action="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'&'.SID.'">');
$cls->write('<textarea name="msg" rows="3" cols="15" class="iarea"></textarea><br/>');
$cls->write('<input type="checkbox" name="translit" value="1"/>'.$lang['translit'].'<br/>');
$cls->end_form('Написать');
$cls->write('</div></div>');
if ($room == '1')
{
$b = mysql_fetch_object(mysql_query('SELECT `msg`, `time` FROM `chat_vopros` WHERE `id` = "1"'));
$utime = $b->time;
$cls->write('<div class="d0"><div class="d3"><font style="color:#f00;text-decoration:underline;">Умник</font> ['.date("H.i",$utime).']>'.$b->msg.'</div></div>');
}
$que = mysql_query('SELECT * FROM `'.$px.$mtable.'` WHERE '.$ignor.' (`room` = "'.$room.'" OR `room` = "all") AND ((`pr_to` = "" AND `pr_from` = "") OR (`pr_from` = "'.$id.'" OR `pr_to` = "'.$id.'")) ORDER BY `time` DESC LIMIT '.$num_msgs);
if (mysql_num_rows($que) == '0') {$cls->write('<div class="d1">Сообщений нет.</div>');}
while ($m = mysql_fetch_object($que))
{
$dblogin = $m->login;
$dbmsg = trim(stripslashes($m->msg));
$dbtime = $m->time;
$pr_to = $m->pr_to;
$pr_from = $m->pr_from;
$db = mysql_fetch_object(mysql_query('SELECT `id` FROM `'.$px.$utable.'` WHERE `login` = "'.$dblogin.'"'));
if ($dblogin == 'Narik') {$tlogin = 'Андрей';}
else if ($dblogin == 'Igos') {$tlogin = 'Игорь';}
else {$tlogin = $dblogin;}
if (empty($db->id) || $m->login == $login)
{
$cls->write('<div class="d4"><font style="color:#6FFF81;">'.$tlogin.'</font>['.date("H.i",$dbtime).']>'.$dbmsg.'</div>');
}
else
{
if (!empty($pr_to) && !empty($pr_from))
{
$cls->write('<div class="d4"><b><a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.ref3.'/'.$_SESSION['rooms4'].$db->id.'&'.SID.'">'.$tlogin.'</a></b>[приват]['.date("H.i",$dbtime).']>'.$dbmsg.'</div>');
}
else
{
$cls->write('<div class="d4"><b><a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.ref3.'/'.$_SESSION['rooms4'].$db->id.'&'.SID.'">'.$tlogin.'</a></b>['.date("H.i",$dbtime).']>'.$dbmsg.'</div>');
}
}
}
$cls->write('<div class="d1"><a href="?'.$_SESSION['re'].'/'.$_SESSION['re2'].'/'.$room.'/'.ref2.'&'.SID.'">'.$lang['history'].'</a>'.
'<br/><a href="?'.SID.'">'.$lang['holl'].'</a></div>');
?>