Размер файла: 4.32Kb
<?php
$r=rand(0,10000);
include "./header.php";
//ўЄ«оз Ґ¬ Є®дЁЈга жЁ®л© д ©«
include "./ini.php";
//Ї®бл« Ґ¬ ў Ў §г § Їа®бл
$query_settings = @mysql_query("select * from `".$px.$stable."` where var='$room' and mod='room';");
//§ Їа®б ў ¬ ббЁў
$settings = @mysql_fetch_array($query_settings);
//⥪г饥 ўаҐ¬п
$timenow = strftime("%H:%M");
// ўв®аЁ§ жЁп
$login = autorize();
//ўлв бЄЁў Ґ¬ Ґ®Ўе®¤Ё¬лҐ ¤ лҐ Ё§ Ў¤
$num_msgs = $login['nmsgs'];
$time_update = $login['tupdate'];
if(empty($num_msgs)) $num_msgs = 5;
if(empty($time_update)) $time_update = 300;
if($mod=="privat")
print '<card id="main" title="'.$settings['val2'].'-'.$timenow.'" ontimer="room.php?id='.$id.'&pass='.$pass.'&room='.$room.'&mod=privat&r='.$r.'"><timer value="'.$time_update.'"/>';
else
print '<card id="main" title="'.$settings['val2'].'-'.$timenow.'" ontimer="room.php?id='.$id.'&pass='.$pass.'&room='.$room.'&r='.$r.'"><timer value="'.$time_update.'"/>';
print '<do type="options" name="update" label="'.$lang['update'].'"><go href="room.php?id='.$id.'&pass='.$pass.'&room='.$room.'&r='.$r.'" method="get"/></do>'.
'<do type="options" name="say" label="'.$lang['say'].'"><go href="room.php?id='.$id.'&pass='.$pass.'&room='.$room.'&r='.$r.'#say" method="get"/></do>'.
'<do type="options" name="whowhere" label="'.$lang['who_online'].'"><go href="online.php?id='.$id.'&pass='.$pass.'&room='.$room.'&r='.$r.'" method="get"/></do>'.
'<p>';
//Ґб«Ё ЁзҐЈ® Ґ ЇҐаҐ¤ ®, в® нв® з «мл© ®вбзҐв
if(empty($start)) $start = 0;
$start=intval($start);
if($start<0) $start=0;
//§ Їа®б ў Ў §г б®®ЎйҐЁп
if($room=="vict") {
$arr = @mysql_query("select * from `".$px.$vtable."` WHERE (pr_to = '' AND pr_from = '') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."') order by time desc;");
$que = @mysql_query("select * from `".$px.$vtable."` WHERE (pr_to = '' AND pr_from = '') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."') order by time desc limit $start,$num_msgs;");
} else {
$arr = @mysql_query("select * from `".$px.$mtable."` WHERE room = '$room' AND ((pr_to = '' AND pr_from = '') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."')) order by time desc;");
$que = @mysql_query("select * from `".$px.$mtable."` WHERE room = '$room' AND ((pr_to = '' AND pr_from = '') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."')) order by time desc limit $start,$num_msgs;");
}
//Є®«ЁзҐбвў® ўбҐе б®®ЎйҐЁ©
$i = @mysql_num_rows($arr);
//ЇҐз в Ґ¬ ббл«ЄЁ
print "<small><a href=\"room.php?id=$id&pass=$pass&room=$room&ref=$rand\">".$lang['update']."</a></small><br/>";
print '<small><a href="history.php?id='.$id.'&pass='.$pass.'&room='.$room.'&mod=privat&r='.$r.'">'.$lang['privat'].'</a></small><br/>';
print "<small><anchor>".$lang['say']."<go href=\"room.php?id=$id&pass=$pass&room=$room&ref=$rand#say\" method=\"get\"/></anchor></small>";
//ўлў®¤Ё¬ б®®ЎйҐЁп ў жЁЄ«Ґ
while($data = @mysql_fetch_array($que)) {
//Ґ®Ўе®¤Ё¬лҐ ¤ лҐ
$dblogin = $data['login'];
$dbmsg = $data['msg'];
$dbtime = date("H.i", $data['time']);
$pr_to = $data['pr_to'];
$pr_from = $data['pr_from'];
//§ Їа®б ў Ў §г ¤ ле
$qdblogin = @mysql_query("select * from `".$px.$utable."` where login='$dblogin'");
//ЄЁ¤ Ґ¬ ў ¬ ббЁў
$db = @mysql_fetch_array($qdblogin);
if(!empty($pr_to)&&!empty($pr_from)) print "<br/><b><a href=\"user.php?id=$id&pass=$pass&room=$room&dbid=".$db['id']."&r=$r\">$dblogin</a>[!]</b> [$dbtime]<br/>$dbmsg";
else
print "<br/><small><b><a href=\"user.php?id=$id&pass=$pass&room=$room&dbid=".$db['id']."&r=$r\">$dblogin</a></b> [$dbtime]</small><br/><small>$dbmsg</small>";
}
if($start!=0)
print "<br/><small><a href=\"history.php?id=$id&pass=$pass&room=$room&mod=$mod&r=$r&start=".($start-$num_msgs)."\">".htmlspecialchars("<<<")."</a></small>";
if($i>$start+$num_msgs)
print "<br/><small><a href=\"history.php?id=$id&pass=$pass&room=$room&mod=$mod&r=$r&start=".($start+$num_msgs)."\">".htmlspecialchars(">>>")."</a></small>";
print "<br/><small><a href=\"enter.php?id=$id&pass=$pass\">".$lang['holl']."</a></small><br/>";
print '</p>'.
'</card>'.
'</wml>';
ob_end_flush();
//а §алў Ґ¬ ᮥ¤ЁҐЁҐ б Ў¤
@mysql_close();
?>