Файл: shistory.php
Строк: 119
<?php
ini_set('display_errors', 'off');
$r=rand(0,10000);
header ("Content-type: text/html; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
print '<?xml version="1.0" encoding="UTF-8"?>';
print "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>История</title><link rel="StyleSheet" type="text/css" href="style/default.css"></head><body><div>";
include "./ini.php";
mysql_query ("select * from bannedib WHERE ci='$ci' AND (ip = '".getenv(REMOTE_ADDR)."')and(browser = '".getenv(HTTP_USER_AGENT)."')");
if(mysql_affected_rows()!=0){include "b.php";}
$query_settings = @mysql_query("select * from `".$px.$stable."` where var='$room' and mod='room' and ci='$ci';");
$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 '<title>'.$settings['val2'].'-'.$timenow.'</title>';
print "<link rel="StyleSheet" type="text/css" href="style/0".$s.".css"></head><body>";
if(empty($start)) $start = 0;
$start=intval($start);
if($start<0) $start=0;
if($room=="unlim") {
$arr = @mysql_query("select * from `".$px.$untable."` WHERE (pr_to = '' AND pr_from = '' and ci='$ci') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."' and ci='$ci' ) order by time desc;");
$que = @mysql_query("select * from `".$px.$untable."` WHERE (pr_to = '' AND pr_from = '' and ci='$ci') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."' and ci='$ci') 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 = '' and ci='$ci') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."' and ci='$ci')) order by time desc;");
$que = @mysql_query("select * from `".$px.$mtable."` WHERE room = '$room' AND ((pr_to = '' AND pr_from = '' and ci='$ci') OR (pr_from = '".$login['login']."' OR pr_to = '".$login['login']."' and ci='$ci')) order by time desc limit $start,$num_msgs;");
}
$i = @mysql_num_rows($arr);
print "<div class="contur_rek"><div class="header_rek"><a href="shistory.php?s=$s&ci=$ci&id=$id&pass=$pass&room=$room&r=".$r."">".$lang['update']."</a>";
print ' | <a href="shistory.php?s='.$s.'&ci='.$ci.'&id='.$id.'&pass='.$pass.'&room='.$room.'&mod=privat&r='.$r.'">'.$lang['privat'].'</a>';
print " | <a href="sroom.php?s=$s&ci=$ci&id=$id&pass=$pass&room=$room&r=".$r."">".$lang['say']."</a></div></div><div class="contur"><div class="header">";
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' and ci='$ci'");
$db = @mysql_fetch_array($qdblogin);
if(!empty($pr_to)&&!empty($pr_from)) print "<div class="smain"><b><a href="suser.php?s=$s&ci=$ci&id=$id&pass=$pass&room=$room&dbid=".$db['id']."&r=$r">$dblogin</a>[!]</b> <span style="color:#FAA134;">[$dbtime]</span><br/>$dbmsg</div>";
else
print "<div class="smain"><b><a href="suser.php?s=$s&ci=$ci&id=$id&pass=$pass&room=$room&dbid=".$db['id']."&r=$r">$dblogin</a></b> <span style="color:#FAA134;">[$dbtime]</span><br/>$dbmsg</div>";
}
print "</div></div>";
if($start!=0)
print "<div class="contur"><div class="header"><a href="shistory.php?s=$s&ci=$ci&id=$id&pass=$pass&room=$room&mod=$mod&r=$r&start=".($start-$num_msgs)."">".htmlspecialchars("<<<")."</a>";
if($i>$start+$num_msgs)
print "<a href="shistory.php?s=$s&ci=$ci&id=$id&pass=$pass&room=$room&mod=$mod&r=$r&start=".($start+$num_msgs)."">".htmlspecialchars(">>>")."</a>";
print "</div></div>";
print "<div class="contur_rek"><div class="header_rek"><a href="enter.php?s=$s&ci=$ci&id=$id&pass=$pass">".$lang['holl']."</a></div></div>";
print '</body></html>';
ob_end_flush();
@mysql_close();
?>