6 |
kaklik |
1 |
<?php
|
|
|
2 |
extract($HTTP_GET_VARS);
|
|
|
3 |
extract($HTTP_POST_VARS);
|
|
|
4 |
header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
|
|
|
5 |
header("Cache-Control: no-cache, must-revalidate");
|
|
|
6 |
header("Pragma: no-cache");
|
|
|
7 |
?>
|
|
|
8 |
<?php
|
|
|
9 |
$nickname = str_replace ("\n"," ", $nickname);
|
|
|
10 |
$nickname = str_replace ("<", " ", $nickname);
|
|
|
11 |
$nickname = str_replace (">", " ", $nickname);
|
|
|
12 |
$nickname = str_replace ("fuck", "-", $nickname);
|
|
|
13 |
$nickname = str_replace ("suck", "-", $nickname);
|
|
|
14 |
$nickname = str_replace ("ass", "-", $nickname);
|
|
|
15 |
$nickname = str_replace ("&", "and", $nickname);
|
|
|
16 |
$nickname = stripslashes ($nickname);
|
|
|
17 |
$message = str_replace ("\n"," ", $message);
|
|
|
18 |
$message = str_replace ("<", " ", $message);
|
|
|
19 |
$message = str_replace ("&","and", $message);
|
|
|
20 |
$message = str_replace ("fuck", "-", $message);
|
|
|
21 |
$message = str_replace ("suck", "-", $message);
|
|
|
22 |
$message = str_replace ("ass", "-", $message);
|
|
|
23 |
$message = stripslashes ($message);
|
|
|
24 |
$p=gmdate("d M H:i");
|
|
|
25 |
?>
|
|
|
26 |
&output=
|
|
|
27 |
<?php
|
|
|
28 |
$chat_file = "shout.txt";
|
|
|
29 |
$chat_lenght = 40;
|
|
|
30 |
$max_single_msg_lenght = 100000;
|
|
|
31 |
$max_file_size = $chat_lenght * $max_single_msg_lenght;
|
|
|
32 |
$file_size= filesize($chat_file);
|
|
|
33 |
if ($file_size > $max_file_size) {
|
|
|
34 |
$lines = file($chat_file);
|
|
|
35 |
$a = count($lines);
|
|
|
36 |
$u = $a - $chat_lenght;
|
|
|
37 |
for($i = $a; $i >= $u ;$i--){
|
|
|
38 |
$msg_old = $lines[$i] . $msg_old;
|
|
|
39 |
}
|
|
|
40 |
$deleted = unlink($chat_file);
|
|
|
41 |
$fp = fopen($chat_file, "a+");
|
|
|
42 |
$fw = fwrite($fp, $msg_old);
|
|
|
43 |
fclose($fp);
|
|
|
44 |
}
|
|
|
45 |
$msg = str_replace ("\n"," ", $message);
|
|
|
46 |
$msg = stripslashes ($msg);
|
|
|
47 |
if ($msg != ""){
|
|
|
48 |
$fp = fopen($chat_file, "a+");
|
|
|
49 |
$fw = fwrite($fp, "<font color=\"blue\"><b>$nickname:($p)<br></b></font> $msg\n");
|
|
|
50 |
fclose($fp);}
|
|
|
51 |
$lines = file($chat_file);
|
|
|
52 |
$a = count($lines);
|
|
|
53 |
$u = $a - $chat_lenght;
|
|
|
54 |
for($i = $a; $i >= $u ;$i--){
|
|
|
55 |
echo $lines[$i];
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
?>
|