Subversion Repositories svnkaklik

Rev

Go to most recent revision | Blame | Last modification | View Log | Download

<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
?>
<?php
$nickname = str_replace ("\n"," ", $nickname);
$nickname = str_replace ("<", " ", $nickname);
$nickname = str_replace (">", " ", $nickname);
$nickname = str_replace ("fuck", "-", $nickname);
$nickname = str_replace ("suck", "-", $nickname);
$nickname = str_replace ("ass", "-", $nickname);
$nickname = str_replace ("&", "and", $nickname);
$nickname = stripslashes ($nickname);
$message = str_replace ("\n"," ", $message);
$message = str_replace ("<", " ", $message);
$message = str_replace ("&","and", $message);
$message = str_replace ("fuck", "-", $message);
$message = str_replace ("suck", "-", $message);
$message = str_replace ("ass", "-", $message);
$message = stripslashes ($message);
$p=gmdate("d M H:i");
?>
&output=
<?php
$chat_file = "shout.txt";
$chat_lenght = 40;
$max_single_msg_lenght = 100000;
$max_file_size = $chat_lenght * $max_single_msg_lenght;
$file_size= filesize($chat_file);
if ($file_size > $max_file_size) {
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
$msg_old =  $lines[$i] . $msg_old;
}
$deleted = unlink($chat_file);
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, $msg_old);
fclose($fp);
}
$msg = str_replace ("\n"," ", $message);
$msg = stripslashes ($msg);
if ($msg != ""){
$fp = fopen($chat_file, "a+");
$fw = fwrite($fp, "<font color=\"blue\"><b>$nickname:($p)<br></b></font> $msg\n");
fclose($fp);}
$lines = file($chat_file);
$a = count($lines);
$u = $a - $chat_lenght;
for($i = $a; $i >= $u ;$i--){
echo $lines[$i];
}

?>