special for danja@koala // ---------------------------------------- settings ------------------------------------------ // // register globals = off $message = $_POST['message']; $page = $_GET['page']; // database file $gbData = "data.txt"; // URL or URI of the page $thisPage = "/gb/index.php"; // ------------------------------------ formatting before writing the file // 0 - don't cut // N - cut till N amount of symbols // amount of (
) allowed $brLimit = 0; // max length $msgLimit = 1000; // ----------------------------------- formatting output // messages per page $msgToPage = 20; // styles count $sylesCount = 20; // repeat styles (1 - yes, 0 - no) $norepeat = 1; // ! if yes mount of styles shouldn't be less then amount per page // "design" $design = "
^[message]
"; // Font size depending on the length of the message function fsize($msglen) { // $size = размер $size = 120; if ($msglen > 5) $size =100; if ($msglen > 15) $size = 80; if ($msglen > 25) $size = 60; if ($msglen > 35) $size = 40; if ($msglen > 45) $size = 37; if ($msglen > 60) $size = 35; if ($msglen > 80) $size = 31; if ($msglen >100) $size = 28; if ($msglen >200) $size = 27; if ($msglen >300) $size = 25; if ($msglen >450) $size = 24; return $size; } // ---------------------------------------- adding ----------------------------------------- // if ($message != "") { $message = preg_replace("/\t/", " ", $message); $message = preg_replace("/\r/", "", $message); if ($msgLimit) $message= substr($message,0,$msgLimit); $message = preg_replace("/¬/", "¬", $message); if ($brLimit) { $pattern = "/\n{".$brLimit.",}/"; preg_replace($pattern, "", $message); } $message = preg_replace("/\n/", "¬", $message); $message = preg_replace("/(\s+)/", " ", $message); $message = stripSlashes($message); $ip = (getenv("REMOTE_HOST") != "") ? getenv("REMOTE_HOST") : getenv("REMOTE_ADDR"); // мало ли что $ip = preg_replace("/\s+/", "", $ip); $date = time(); // OPEN DATA $data = @fopen($gbData, "a"); if (!$data) { echo "SHIT: can't open database file!!

that's life"; exit; } fwrite($data, $date."\t".$ip."\t".$message."\n"); fclose($data); echo ""; exit; } // ------------------------------------------- read ------------------------------------------ // // OPEN DATA $file = @file($gbData); if (!$file) { echo "SHIT:can't open database file!!

that's life"; exit; } // Вычисления $pages = Ceil(sizeof($file)/$msgToPage); if ($page == "") $page = $pages; $from = ($page*$msgToPage)-($msgToPage-1); $to = $page*$msgToPage; $from -=1; $to -=1; // По правилам $count = 0; $tmp = array(); $line = array(); $output = array(); // Parsing for ($i=0; $i=$from && $i<=$to) { do { $rnd = rand(1,$sylesCount); } while (isset($tmp[$rnd])); $tmp[$rnd] = 1; $random = ($norepeat) ? $rnd : rand(1,$sylesCount); $line = explode("\t", $file[$i]); $message = preg_replace("/(\n|\r)$/", "", $line[2]); $msglen = strlen($message); $message = strip_tags($message, ""); $message = preg_replace("/¬/", "
", $message); $message = preg_replace("/\^\[message\]/i", $message, $design); $message = preg_replace("/\^\[random\]/i", $random, $message); $message = preg_replace("/\^\[n\]/i", "$count", $message); $message = preg_replace("/\^\[size\]/i", "".fsize($msglen)."", $message); $count++; $output[] = $message; } } ?>    freedom of speech, watch what you say.    [ happy now! <img> is enabled! ]
=1; $i--) { //$n = sprintf("%0".strlen($pages)."d",$i); echo ""; if ($i!=$page) echo ""; for ($k=1; $k<=strlen($i); $k++) { echo "\"page".$i."\""; } if ($i!=$page) echo ""; echo ""; //echo ($i==$page) ? "".$i."" : "".$i.""; if ($i > 1) echo ""; } */ // Линейка - цифры текстом /* for ($i=$pages; $i>=1; $i--) { echo ($i==$page) ? "".$i."" : "".$i.""; if ($i > 1) { echo " | "; } } */ // Линейка - картинки for ($i=$pages; $i>=1; $i--) { echo ($i==$page) ? "\"fresh" : "\"shit"; if ($i > 1) echo " "; } ?>