<?
$fal = @file("MySql/base123/reg/$log.dat");
$udata = explode(":||:",$fal[0]);

if($udata[21]=="1"){
echo"<br/><small>= = =</small>";
$file = file("MySql/base123/chat.dat");
$file = array_reverse($file);
$total = count($file);


for ($i = 0; $i < $total; $i++){
$data = explode("#",$file[$i]);
if($data[1]!=="Favorit"){
$data_00[]=$data[0];
$data_11[]=$data[1];
}
}

if(empty($data_00)){echo"<small>Сообщений нет.</small>"; include_once"include/down.php"; exit;}

foreach($data_00 as $k=>$v)
{

$dat_screen0[]="<br/><small><a href=\"search.php?$sd&go=go&nick=$data_11[$k]\">$data_11[$k]</a>|<a href=\"say.php?$sd&nick=$data_11[$k]\">Ответ</a>$data_00[$k]</small>";
}


$total = count($dat_screen0);

if(empty($udata[35])){$udata[35]="5";}

/*if (empty($_GET['chat'])) $chat = 0;
else $chat = $_GET['chat'];
if ($total < $chat + $udata[35]){ $end = $total; }
else {$end = $chat + $udata[35]; }*/
for ($i = 0; $i < $udata[35]; $i++){

echo"$dat_screen0[$i]";

}echo"";
echo "<form action=\"add.php?$sd\" method=\"post\">";
echo "<br/><input name=\"msg\" maxlength=\"100\" title=\"msg\"/><br/><input type=\"hidden\" name=\"self\" value=\"$self\" />";
echo "<input type=\"submit\" value=\"Написать\"/></form>";
echo "<br/>";}
?>




