Файл: in4at/history.php
Строк: 77
<?php
##################################################################################################
## Script name : In4at ##
## Version : Final ##
## Made by : XPYCT(Сергей Мищенко) ##
## E-mail : bce-ok@bk.ru ##
## ICQ : 447-50-50-62 ##
## Site : http://vkontakte.ru/id31604521 ##
## Внимание! Скрипт распространяется бесплатно! Модификация W4at by XPYCT ##
##################################################################################################
list($msec,$sec)=explode(chr(32),microtime());$HeadTime=$sec+$msec;
define('REQ_2_chat', true);
require('4at_set.php');
require('db_con.php');
require('style.php');
if ($py !== spy_code) require('us_info.php');
$smset = $row['smiles'];
$tr_link=$row['tr_link'];
if ($rm<0||$rm>20||!isset($rm)) exit;
$room="room".$rm;
if($rm==10) $rm.="&pwd=$pwd";
if($mod=='privat') $rm.="&mod=$mod";
$max = $row['max'];
$bind1 = $row['bind1'];
$bind2 = $row['bind2'];
$bind3 = $row['bind3'];
$bind4 = $row['bind4'];
$bind5 = $row['bind5'];
$bind6 = $row['bind6'];
$pic=$row['pic'];
$qi=mysql_query("Select who from ignor where user= '".$id."'");
while($ia=mysql_fetch_array($qi)){
$ignor[]=$ia[0];}
if ($row['zamen']==1){
function rus_to_en($str){
$str = str_replace('а','a',$str);
$str = str_replace('е','e',$str);
$str = str_replace('ё','e',$str);
$str = str_replace('и','u',$str);
$str = str_replace('к','k',$str);
$str = str_replace('о','o',$str);
$str = str_replace('р','p',$str);
$str = str_replace('с','c',$str);
$str = str_replace('у','y',$str);
$str = str_replace('х','x',$str);
$str = str_replace('А','A',$str);
$str = str_replace('В','B',$str);
$str = str_replace('Е','E',$str);
$str = str_replace('Ё','E',$str);
$str = str_replace('К','K',$str);
$str = str_replace('М','M',$str);
$str = str_replace('Н','H',$str);
$str = str_replace('О','O',$str);
$str = str_replace('Р','P',$str);
$str = str_replace('С','C',$str);
$str = str_replace('Т','T',$str);
$str = str_replace('Х','X',$str);
return $str;
}
ob_start("rus_to_en");}else{ob_start();}
echo head;
if ($vv!=0){
echo '<div class="d0"><b>История!</b></div>';
} else {
echo '<card id="history" title="История">';
echo "<do type="options" name="refresh" label="Обновить"><go href="chat.php?$wp&rm=$rm$takep"/></do><p>";
}
echo $fsize1;
echo "» <a href="chat.php?$wp&rm=$rm$takep#add" accesskey="$bind1">Сказать</a> ($bind1)<br/>";
echo "» <a href="chat.php?$wp&rm=$rm$takep" accesskey="$bind2">Обновить</a> ($bind2)<br/>---";
if (!isset($num)) $num=0;
$bmax = $max*2;
$bnum = $num+1;
if (empty($pwd)) $pwd='pub';
if ($rm==10) $res = mysql_query ("Select HIGH_PRIORITY * from $room WHERE (((usid = '".$id."')OR(towhom = '".$id."')OR(towhom = '')) and (pwd='".$pwd."')) order by id desc LIMIT $bnum,$bmax");
elseif($mod=='privat') $res = mysql_query ("Select HIGH_PRIORITY * from $room WHERE (usid = '".$id."')OR(towhom = '".$id."') order by id desc LIMIT $bnum,$bmax");
else $res = mysql_query ("Select HIGH_PRIORITY * from $room WHERE ((usid = '".$id."')OR(towhom = '".$id."')OR(towhom = '')) order by id desc LIMIT $bnum,$bmax");
$kol = mysql_affected_rows();
$kop=0;
while($xz = mysql_fetch_array($res)){
$kop++;
$usid = $xz['usid'];
if (!in_array($usid, $ignor)){
$date = $xz['time'];
$klu4 = $xz['klu4'];
$name = $xz['who'];
$msg = $xz['message'];
if ($smset==0&&$xz['messagewosm']!='') $msg = $xz['messagewosm'];
if ($smset==2&&$xz['messagewoasm']!='') $msg = $xz['messagewoasm'];
$th = $xz['towhom'];
$msg = str_replace($us, '<b>'.$us.'</b>', $msg);
if ($pic!=0){
if ($usid<11){
$sxa='<img src="'.$usid.'.gif" alt="-"/>';
} else {
$isex = mysql_fetch_array(mysql_query("select sex from users WHERE id = '".$usid."' LIMIT 1;"));
if ($isex[0]==1) $sxa='<img src="m.gif" alt="м"/>';
else $sxa='<img src="f.gif" alt="ж"/>';
}
} else $sxa='';
if ($row['level']>6 and $row['del_link']==1) $add=' <a href="dm.php?'.$wp.'&rm='.$rm.'&klu4='.$klu4.$takep.'">X</a>';
else $add='';
if (($th == $id) or ($th and $name==$row['user'])) $adp='[P!]';
else $adp='';
echo '<br/>'.$sxa.'<b><a href="inside.php?'.$wp.'&rm='.$rm.'&nk='.$usid.$takep.'">'.$name.'</a>'.$adp.'</b> ['.$date.$add.']'.$msg;
if ($kop >= $max) break;
}
}
echo '<br/>'.divide;
mysql_close ($link);
$page_next = $num + $max;
$page_prev = $num - $max;
if($num==0)$total+1;
if ($max < $kol) {
echo "<a href="history.php?$wp&rm=$rm&num=$page_next$takep" accesskey="$bind6">>>></a> ($bind6)<br/>";
}
if ($num >= $max) {
echo "<a href="history.php?$wp&rm=$rm&num=$page_prev$takep" accesskey="$bind5"><<< </a>($bind5)<br/>";
}
echo divide;
echo "» <a href="enter.php?$wp" accesskey="$bind4">Прихожая</a> ($bind4)<br/>";
$pagesize=round((ob_get_length())/1024,1);
if ($tr_link==1){
echo divide;
echo '[<a href="trafik.php?'.$wp.'&rm='.$rm.'">'.$pagesize.' kb</a>]';
list($msec,$sec)=explode(chr(32),microtime());
echo '['.round(($sec+$msec)-$HeadTime,3).' sec]';
}
echo $fsize2;
echo foot;
$alltraf=$row['alltraf'];
$alltraf=$alltraf+$pagesize;
mysql_query("Update users set alltraf='".$alltraf."', lasttraf='".$pagesize."' where id='".$id."'");
mysql_close ($link);
ob_end_flush();
?>