View file index.php

File size: 9.86Kb
<?    ///////////////////////////////////////////////////////////////////////
      ////// Скрипт коментариев на одном файле, не требующий мускула ////////
      ////// Версия: 1.0                                             ////////
      ////// Последняя версия: http://ueb.ru/scripts/kament.rar      ////////
      ////// Афтар: Terkin                                           ////////
      ////// ё-майл: [email protected]                             ////////
      ////// Сцайт: http://ueb.ru                                    ////////
      ////// Особые благодарности                                    ////////
      //////                  Вантузу http://wap.pizdec.ru           ////////
      //////                  scory   http://xwap.org                ////////
      ///////////////////////////////////////////////////////////////////////
      ////// В следующей версии ожидается улучшение быстродействия,  ////////
      ////// замена таблиц на div, навигация по цветам.              ///////////
      //////  СКРИПТ ЕСТЬ И ВСЕГДА БУДЕТ БЕСПЛАТНЫМ!!!!!!!!!!!!!!!   ///////////////
      /////////////////////////////////////////////////////////////////////////////////
      ////// для вывода колличества сообщений вставляем в станицу    /////////////////////
      //////  include ("http://ваш_адрес/index.php?elda=1&amp;id=номер_страницы");  ////////
      ///////////////////////////////////////////////////////////////////////////////////////////

$garo = array("общее","купи ребенка","продам девственность","розовый террор","слава роботам","говно в конверте");      ///здесь названия разделов ///
$beta = array("index","kupireb","kolja","futbolka","prezident","govno");                                    ///здесь ссылки разделов   ///
if (!@$id)  $id = 0 ;
if (!@$login) $login = "имя" ;
if (!@$mess)  $mess = "сообщение" ;
$file = @file("m.txt");                    /////не забудьте права доступа 777 поставить /////
$total = count($file);
for ($ik = 0; $ik <= $total; $ik++) {
$file = @file("m.txt");
$data = explode("::::",$file[$ik]);
$opt = $data[3];
$con[$opt] = $con[$opt] + 1; }
$con[0] = $total;
  if($elda == 1) {echo"$con[$id]"; exit;};

echo'<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0 Transitional//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xml:lang="ru">';
echo'<head><meta http-equiv="Content-Type" content="application/vnd.wap.xhtml; charset=UTF-8 "/>';
echo'<title>Комментарии</title>';
echo'<style type="text/css"><!--body{margin:1px;padding:1px;} div.d {background-color: #4D94C8; border-top: 3px solid yellow; border-bottom: 3px solid yellow; padding: 6px; vertical-align: middle; }--></style>';
echo'<body bgcolor="#000000" text="black" link="black" alink="black" vlink="black"></head>';
echo'<center>';
echo'<table border="0" bordercolor="red" cellpadding="5" width="100%"><tr><td align="center" bgcolor="#FF9900">';
echo'<a href="ky">Купи игру!</a>';
echo'</td></tr><tr><td width="100%" bgcolor="yellow" align="left">';
$en = "</td></tr><tr><td bgcolor=\"#FF9900\" align=\"center\"><a href=\"ky\">Скачай каталог!</a></td></tr><tr><td align=\"center\"><font color=\"#FF9900\"><b>©2004-2006 <a href=\"http://ueb.ru\"><font color=\"#FF9900\">Terkin</font></a></b></font></td></tr></table></center></body></html>";
if ($stranica == 2) {
echo'<b>Комментарии сайта</b><br/><br/>Категории:<br/>';
$koll=6;                                                                                                                       ///здесь колличество разделов///
for ($ih = 0; $ih < $koll; $ih++){ echo"- <a href=\"index.php?id=$ih&stranica=0\">$garo[$ih]</a>[$con[$ih]]<br/> ";}
echo"<br/>";}
elseif ($stranica == 1){
if (($t1 == 1) || ($t2 == 1) || ($vkl == 1)) { $tre = 1; };
if ($tre == 1) {
$trans1 = array("A","a","B","b","V","v","G","g","D","d","E","e","YO","yo","ZH","zh","Z","z","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","R","r","S","s","T","t","U","u","F","f","H","h","C","c","CH","ch","W","w","SC","sc","**","*","Q","q","''","'","YE","ye","YU","yu","YA","ya");
$trans2 = array("А","а","Б","б","В","в","Г","г","Д","д","Е","е","Ё","ё","Ж","ж","З","з","И","и","Й","й","К","к","Л","л","М","м","Н","н","О","о","П","п","Р","р","С","с","Т","т","У","у","Ф","ф","Х","х","Ц","ц","Ч","ч","Ш","ш","Щ","щ","Ъ","ъ","Ы","ы","Ь","ь","Э","э","Ю","ю","Я","я");};
if ($do == 1) {
if ($t1 == 1) { $login=str_replace($trans1,$trans2,$login); };
if ($t2 == 1) { $mess=str_replace($trans1,$trans2,$mess); };
$login = htmlspecialchars(stripslashes($login));
$mess = htmlspecialchars(stripslashes($mess));
$login = strip_tags($login);
$mess = strip_tags($mess);
$mess=str_replace("$","",$mess);
$mess=str_replace("сообщение","",$mess);
$login=str_replace("имя","",$login);
$login=str_replace("quot;","",$login);
$login=str_replace("$","",$login);
$login=str_replace("&lt;","",$login);
$login=str_replace("<","",$login);
$login=str_replace(">","",$login);
$login=str_replace("&gt;","",$login);
$login=str_replace("\"","",$login);
$login=str_replace("\\","",$login);
$login=str_replace("&","",$login);
$login=str_replace("%","",$login);
$login=str_replace("^","",$login);
$login=str_replace("№","",$login);
$login=str_replace(";","",$login);
if ($login == ""){ $login1 = "<font color=\"red\">Введи ник!</font><br/>"; $c1 = 1;} else {$c1 = 0;};
if ($mess == "") { $mess1 = "<font color=\"red\">Введи сообщение!</font><br/>"; $c2 = 1;} else {$c2 = 0;};
if ($c1 == 0) {
if ($c2 == 0) {
if ($color == 1) { $beg = ""; $in = "";}
else { $beg = "<font color=\"$color\">"; $in = "</font>"; };
$date = date("h:i d.m");
$userinfo = "$login::::$date::::$beg$mess$in::::$id::::";
$file = @file("m.txt");
$total = count($file);
$total = $total - 1;
$data1 = explode(":::",$file[$total]);
$data2 = explode(":::",$userinfo);
if($data1[2] == $data2[2]) { $m ="<center><br/>Не флуди!<br/><a href=\"index.php?stranica=0&login=$login&id=$id\">ENTER</a><br/><br/></center>";  }
else { $m ="<center><br/>OK!<br/><a href=\"index.php?stranica=0&login=$login&id=$id\">ENTER</a><br/><br/></center>";
$fileinfo = fopen("m.txt","a+");
fputs($fileinfo,"\r\n$userinfo");
fclose($fileinfo);};
echo $m;
echo $en;
exit;};};};
echo'<small>Категория: <b>[<a href="/'.$beta[$id].'.php">'.$garo[$id].'</a>]</b></small><br/>';
echo'<form method="post"  action="index.php?stranica=1&do=1&id='.$id.'">';
echo $login1;
echo"<input name=\"login\" size=\"22\" maxlength=\"25\" value=\"$login\"/><br/>";
echo"<input type=\"checkbox\" name=\"t1\" value=\"1\"/>translit";                  /////ниже цвета текста, можете заменить на любые другие, список цветов на http://www.artlebedev.ru/tools/colors//////
echo"<select size=\"1\" name=\"color\"><option value=\"1\">цвет текста</option><option value=\"red\">красный</option><option value=\"blue\">синий</option><option value=\"green\">зеленый</option><option value=\"orange\">оранжевый</option></select><br/>";
echo $mess1;
echo"<textarea name=\"mess\" maxlength=\"300\" rows=\"2\" cols=\"16\" tabindex=\"0\">$mess</textarea><br/>";
echo"<input type=\"checkbox\" name=\"t2\" value=\"1\"/>translit";
echo"<input value=\"добавить\" type=\"submit\"/></form>";
if ($vkl == 1) {
echo'<small>Правила транслита: <b><a href="index.php?stranica=1&vkl=0&id='.$id.'&mess='.$mess.'&login='.$login.'">[on]</a></b></small><table>';
for ($i = -1; $i < 65; $i++){ $i = $i+1; $j = $i+1;
echo "<tr><td>$trans1[$i]($trans1[$j])</td><td>- </td><td>$trans2[$i]($trans2[$j])</td></tr>"; };
echo'</table>'; }
else { echo'<small>Правила транслита: <b><a href="index.php?stranica=1&vkl=1&id='.$id.'&mess='.$mess.'&login='.$login.'">[off]</a></b></small>'; }; }
else { echo"<small><b>[<a href=\"index.php?stranica=2\">Категории</a>]</b> ";
if ($id == 0) {$pok = "";} else { $pok = "[<a href=\"index.php?id=0&login=$login\">Показать все</a>]";};
echo"$pok<br/>[<a href=\"/$beta[$id].php\">$garo[$id]</a>]</small><br/><br/>[<a href=\"index.php?stranica=1&login=$login&id=$id\">Написать</a>]<br/>[<a href=\"index.php?login=$login&id=$id\">Обновить</a>]<br/><br/>";
if (empty($_GET['start'])) { $start = 0;  }
else { $start = $_GET['start']; }
if ($total < $start + 8){ $end = $total; }
else {$end = $start + 8; }
for ($i = $start; $i < $end; $i++) {
$file = @file("m.txt");
$file = array_reverse($file);
$data = explode("::::",$file[$i]);
if ($id == 0) { $pi = $data[3]; } else { $pi = $id; };
if ($data[3] == $pi) {if(!@$tut){$tut=1;}else{$tut=$tut+1;};
echo "<div class=d><b><a href=\"index.php?stranica=1&mess=$data[0],&login=$login&id=$id\">$data[0]</a></b><small> $data[1]<br/>";
if ($id != $pi) { echo "[<i><a href=\"index.php?id=$pi\">$garo[$pi]</a></i>]<br/>";};
echo "</small>$data[2]</div>";}
else{ $start = $start+1; if($end < $total) {$end=$end+1;};};};
if ($con[$id] > $tut) {echo "<br/><small> [<a href=\"index.php?start=".($start + 8)."&login=$login&id=$id&tut=$tut\">&#x414;&#x430;&#x43B;&#x435;&#x435;</a>]</small>"; };
echo"<br/>[<a href=\"index.php?stranica=1&login=$login&id=$id\">Написать</a>]<br/>[<a href=\"index.php?login=$login&id=$id\">Обновить</a>]<br/><small><b>Всего: [$con[$id]]</b></small><br/><br/>";};
echo $en;
?>