Вход Регистрация
Файл: DarkAge/moder/chat.php
Строк: 80
<?
Error_Reporting
(E_ALL & ~E_NOTICE);
$ref=rand(100,10000000);

include_once (
"../files/zag.php");
echo 
"<p align="left">";

$log htmlspecialchars(stripslashes($log));
$pas htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("../data/reg/$log.dat"); 
if (
$text!=""){
$udata explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {

$file=@file("../data/moders.dat");
$total=count($file);
for(
$i=0$i<$total$i++){
$data=explode("|",$file[$i]);
if(
$data[0]==$log){


switch(
$go) {

default:
function 
img($image) {return eregi_replace("pic/","../pic/"$image);} ob_start("img");

if(empty(
$udata[35])){$udata[35]="5";}
$file = @file("../data/chat.dat");
$total count($file);    
if (empty(
$_GET['start'])) $start 0;
else 
$start $_GET['start'];
if (
$total $start $udata[35]){ $end $total; }
else {
$end $start $udata[35]; }
for (
$i $start$i $end$i++){

$file = @file("../data/chat.dat");
$file array_reverse($file);
$data explode("#",$file[$i]);
$i2=round($i+1);

$data[6]=str_replace("rn"""$data[6]);


if(!empty(
$data[1])){
echo
"<small><small><b><a href="chat.php?log=$log&amp;pas=$pas&amp;go=del&amp;id=$i">[DEL]</a><a href="chat.php?log=$log&amp;pas=$pas&amp;go=ignor&amp;name=$data[1]">[IGNOR]</a></b><a href="../search.php?log=$log&amp;pas=$pas&amp;go=go&amp;nick=$data[1]">$data[1]</a></small> - <small>$data[0]<br/>[$data[2]/$data[3]]</small></small><br/>";}
}
echo
"<br/><small>- - -</small>";
echo
"<form mathod="post" action="chat.php?log=$log&amp;pas=$pas&amp;go=add">";
echo 
"<br/><input name="msg" maxlength="999" title="msg"/><br/>";
echo 
"<small><input class="button" type="submit" value="&#x41D;&#x430;&#x43F;&#x438;&#x441;&#x430;&#x442;&#x44C;">";
echo "<postfield name="msg" value="$(msg)"/>";
echo 
"<postfield name="self" value="$self"/>";
echo 
"</form></small>";

if (
$start != 0) {echo '<small><a href="chat.php?start='.($start $udata[35]).'&amp;log='.$log.'&amp;pas='.$pas.'">&#x41D;&#x430;&#x437;&#x430;&#x434;</a></small> ';}else{echo'<small>- - -</small>';}

if (
$total $start $udata[35]) {echo ' <small><a href="chat.php?start='.($start $udata[35]).'&amp;log='.$log.'&amp;pas='.$pas.'">&#x414;&#x430;&#x43B;&#x435;&#x435;</a></small>';}

echo
"<br/><small><a href="chat.php?log=$log&amp;pas=$pas&amp;ref=$ref">&#x41E;&#x431;&#x43D;&#x43E;&#x432;&#x438;&#x442;&#x44C;</a></small><br/>"
break;

case 
'add':

if(
getenv("HTTP_X_FORWARDED_FOR")){ $ip getenv("HTTP_X_FORWARDED_FOR"); }else{
if(
getenv("REMOTE_ADDR")) $ip getenv("REMOTE_ADDR");}
$ip=htmlspecialchars(stripslashes($ip));
$brow=htmlspecialchars(stripslashes(getenv('HTTP_USER_AGENT')));
$brow=strtok($brow,'/');

$brow=str_replace("#","",$brow);
$ip=str_replace("#","",$ip);

$msg=htmlspecialchars(stripslashes($msg));
$msg=str_replace("#","",$msg);

$date=date("d.m.y");
$time=date("H:i");

    
$text="$msg#$log#$brow#$ip#";
$text=str_replace("rn"""$text);


$fp=fopen("../data/chat.dat","a+");
flock ($fp,LOCK_EX);
fputs($fp,"$textrn");
flock ($fp,LOCK_UN);
fclose($fp);



$file=file("../data/chat.dat"); $i count($file);
if (
$i>=1000) {
$fp=fopen("../data/chat.dat","w");
flock ($fp,LOCK_EX);
unset(
$file[0]);
fputs($fpimplode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);
}



echo
"<small><a href="chat.php?log=$log&amp;pas=$pas">&#x421;&#x43E;&#x43E;&#x431;&#x449;&#x435;&#x43D;&#x438;&#x435; &#x434;&#x43E;&#x431;&#x430;&#x432;&#x43B;&#x435;&#x43D;&#x43E;!</a></small>";
break;

case 
'del':

$file = @file("../data/chat.dat");
$total count($file);  

if(
$id=="0"){$id=$total-1;}else{$id=$total-$id-1;}

$file=file("../data/chat.dat"); 

$fp=fopen("../data/chat.dat","w");
flock ($fp,LOCK_EX);
for (
$i=0;$isizeof($file);$i++) { if ($i==$id) {unset($file[$i]);} }

fputs($fpimplode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);

echo
"<small><a href="chat.php?log=$log&amp;pas=$pas">&#x423;&#x434;&#x430;&#x43B;&#x435;&#x43D;&#x43E;.</a></small>";

break;

case 
'ignor':

$name=htmlspecialchars(stripslashes($name));

echo 
"<small>Причина:</small><br/>";
echo 
"<form method="post" action="chat.php?log=$log&amp;pas=$pas&amp;go=ban&amp;name=$name">";
echo 
"<input name="prichina" maxlength="999"/><br/>";
echo 
"<small><input class="button" type="submit" value="Банить">";
echo 
"<postfield name="prichina" value="$(prichina)"/>";
echo 
"</form></small><br/>";

break;

case 
'ban':

$name=htmlspecialchars(stripslashes($name));
$file=@file("../data/chat.dat");
$file array_reverse($file);
$total=count($file);

for(
$i=0$i<$total$i++){
$data explode("#",$file[$i]);

if(
$name==$data[1]){ 

$ip=explode(".",$data[3]);

$ipn="$ip[0].$ip[1].$ip[2]";
$time=time();

$prichina=htmlspecialchars(stripslashes($prichina));
$prichina=str_replace("|","",$prichina);
$name=str_replace("|","",$name);

$text="$ipn||$time||$name||$prichina||$data[0]||";

$fp=fopen("../data/ban.dat","a+");
flock($fp,LOCK_EX);                                                                       
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

echo
"<small><a href="chat.php?log=$log&amp;pas=$pas">$name забанен на 24 часа.</a></small><br/>";
echo
"<small>- - -<br/>&#187; <a href="../main.php?log=$log&amp;pas=$pas">&#x41C;&#x43E;&#x451; &#x43C;&#x435;&#x43D;&#x44E;</a></small></p></body></html>";
 exit;}


}
break;



}}
}
}else{echo
"<small>&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x438;&#x43B;&#x438; &#x43B;&#x43E;&#x433;&#x438;&#x43D; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!</small><br/>";}


echo
"<small>- - -<br/>&#187; <a href="../main.php?log=$log&amp;pas=$pas">&#x41C;&#x43E;&#x451; &#x43C;&#x435;&#x43D;&#x44E;</a></small><br/>";

echo 
"</p></body></html>";


?>
Онлайн: 0
Реклама