Размер файла: 1.28Kb
<?
session_start();
//include"func.php";
if(isset($_SESSION['chat_name'])){if(trim($_SESSION['chat_name'])!=""){$chat_log=trim(htmlspecialchars($_SESSION['chat_name']));}}
$chat_xfile = @file("../data/chat_base.dat");
$chat_soob=30;
$chat_t=count($chat_xfile);
if($chat_t < $chat_soob){$chat_tot=$chat_t;}else{$chat_tot=$chat_soob;}
if($chat_t < $chat_soob){$chat_tot1=0;}else{$chat_tot1=$chat_t-$chat_soob;}
for($chat_i = $chat_tot1; $chat_i < $chat_tot + $chat_tot1; $chat_i++)
{
$chat_udata = explode("::",$chat_xfile[$chat_i]);
if(isset($chat_udata[3]) and isset($chat_log))
{
if($chat_log==$chat_udata[3])
{
$chat_text=wordwrap($chat_udata[1], 50, "<br>", 1);
echo'<font color="#cccc55"><b>'.$chat_udata[0].' -> '.$chat_udata[3].'</b></font><font color="lime"> - '.$chat_udata[2].'</font><br><font color=red>'.$chat_text.'</font><br>
<font color="#cccccc">*************************************</font><br/>';
}
}
if(!isset($chat_udata[3]))
{
$chat_text=wordwrap($chat_udata[1], 50, "<br>", 1);
echo'<font color="#cccc55"><b>'.$chat_udata[0].'</b></font><font color="lime"> - '.$chat_udata[2].'<br>'.$chat_text.'</font><br>
<font color="#cccccc">*************************************</font><br/>';
}
}
?>