<?
// ////// // // // //
// // // // ///// /////
///// \\ // // // // // // // // // // // //
// // \\ // // // // // // // // // ////// // //
// // \\ // // // // // // // // // // // //
///// \// ////// // // // // // ///// // //
// /////
//
/////////////////////////// [email protected] ///////////////////////////////
Error_Reporting(E_ALL & ~E_NOTICE); /////////////// игнорируем ошибки
header("Content-type:text/vnd.wap.wml;charset=utf-8"); //////// тип и кодировка документа
////////////// Параметры книги /////////////////////////////////////////////////
$gl="../"; /////////ссылка на главную
$admin="Admin"; ////////админ
$parad="admin"; ////////пароль админа
$zag="Guest book"; ///////// заголовок
$ydal="100"; ///////// количество сообщений оствляемых на сервере. Если вы хотите, чтобы оставлялись все сообщения, то оставьте =""
//////////////////////////////////////////////////////////////////////////////
$u1=getenv('HTTP_USER_AGENT');
$brayz=strtok($u1,'/');
$currHour=date("H",time());///////////формат даты и времени
$currDate=date("dS F, Y", time());
$curr=date("i:s", time());
$currTime=date("$currHour:i:s", time());
$vrem=time();
if($log!=$admin){$log="";}
if($pas!=$parad) {$log="";}
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">
<wml><card id=\"mas\" title=\"$zag\" ontimer=\"index.php?log=$log&pas=$pas\" >
<timer value=\"1\"/><p>";
///////////// выводим вмл заголовок
if($log!=""){$imja=$log;}
if($imja=="") {$ntext="";}
if($site=="http://"){$site="";}
if($mail=="@"){$mail="";}
$vsego = file("vsego.shet");
$vsego=$vsego[0];
if($vsego>0){$i=$vsego-3;} else{$i=0;} /////// количество проверяемых на повторяемсть сообщений (тут 3)
while($i <= $vsego)
{$tex=@file("zapis/$i.mess");
$utex=explode(":||:",$tex[0]);
$text=trim($utex[2]);
if($ntext==$text){$ntext="";}
$i=$i+1;}
if($ntext!=""){
$ntext=str_replace("$","ue",$ntext);
$trans2= array("Ё","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы","Ё","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы");
$trans1= array("JO","ZH","CH","SH","SCH","JE","JY","JA","jo","zh","ch","sh","sch","je","jy","ja","A","B","V","G","D","E","Z","I","J","K","L","M","N","O","P","R","S","T","U","F","H","C","'","Y","a","b","v","g","d","e","z","i","j","k","l","m","n","o","p","r","s","t","u","f","h","c","'","y","РЃ","Р–","Р§","РЁ","Р©","Р","Р®","РЇ","С‘","Р¶","С‡","С€","С‰","СЌ","СЋ","СЏ","Рђ","Р‘","Р’","Р“","Р”","Р•","Р—","Р?","Р™","Рљ","Р›","Рњ","Рќ","Рћ","Рџ","Р ","РЎ","Рў","РЈ","Р¤","РҐ","Р¦","Р¬","Р«","Р°","Р±","РІ","Рі","Рґ","Рµ","Р·","Рё","Р№","Рє","Р»","Рј","РЅ","Рѕ","Рї","СЂ","СЃ","С‚","Сѓ","С„","С…","С†","СЊ","С‹");
if($trans=="y"){$ntext=str_replace($trans1,$trans2,$ntext);};
$ntext=htmlspecialchars(stripslashes($ntext));
$imja=htmlspecialchars(stripslashes($imja));
$mail=htmlspecialchars(stripslashes($mail));
$site=htmlspecialchars(stripslashes($site));
$conv1 = array(":)",":(",":E",":smok1",":smok2",":smok3",":monyment",":cvetok",":jazik",
":grin",":fack",":plach",":viking",";)",":P",":chajnik",":pozdravlenie",":ryki",
":pivo1",":best",":cool",":wc",":bye",":nika",":kiss1",":encore",":kiss2",":drun",
":love",":beer",":luv",":syper",":gost",":dont",":lamer",":roza",":gitara",":mogila");
$conv2 =array("<img src=\"sm/s1.gif\" alt=\":)\"/>",
"<img src=\"sm/s2.gif\" alt=\":(\"/>",
"<img src=\"sm/s3.gif\" alt=\":E\"/>",
"<img src=\"sm/s4.gif\" alt=\"kyrit\"/>",
"<img src=\"sm/s5.gif\" alt=\"kyrit\"/>",
"<img src=\"sm/s6.gif\" alt=\"kyrit\"/>",
"<img src=\"sm/s7.gif\" alt=\"monyment\"/>",
"<img src=\"sm/s8.gif\" alt=\"cvetok\"/>",
"<img src=\"sm/s9.gif\" alt=\"jazik\"/>",
"<img src=\"sm/s10.gif\" alt=\"grin\"/>",
"<img src=\"sm/s11.gif\" alt=\"fack\"/>",
"<img src=\"sm/s12.gif\" alt=\"plach\"/>",
"<img src=\"sm/s13.gif\" alt=\"viking\"/>",
"<img src=\"sm/s14.gif\" alt=\";)\"/>",
"<img src=\"sm/s15.gif\" alt=\":P\"/>",
"<img src=\"sm/s16.gif\" alt=\"chajnik\"/>",
"<img src=\"sm/s17.gif\" alt=\"pozdravlenie\"/>",
"<img src=\"sm/s18.gif\" alt=\"ryki\"/>",
"<img src=\"sm/s19.gif\" alt=\"pivo1\"/>",
"<img src=\"sm/s20.gif\" alt=\"best\"/>",
"<img src=\"sm/s21.gif\" alt=\"cool\"/>",
"<img src=\"sm/s22.gif\" alt=\"wc\"/>",
"<img src=\"sm/s23.gif\" alt=\"bye\"/>",
"<img src=\"sm/s24.gif\" alt=\"nika\"/>",
"<img src=\"sm/s25.gif\" alt=\"kiss\"/>",
"<img src=\"sm/s26.gif\" alt=\"encore\"/>",
"<img src=\"sm/s27.gif\" alt=\"kiss\"/>",
"<img src=\"sm/s28.gif\" alt=\"drun\"/>",
"<img src=\"sm/s29.gif\" alt=\"love\"/>",
"<img src=\"sm/s30.gif\" alt=\"beer\"/>",
"<img src=\"sm/s31.gif\" alt=\"love\"/>",
"<img src=\"sm/s32.gif\" alt=\"syper\"/>",
"<img src=\"sm/s33.gif\" alt=\"gost\"/>",
"<img src=\"sm/s34.gif\" alt=\"dont\"/>",
"<img src=\"sm/s35.gif\" alt=\"lamer\"/>",
"<img src=\"sm/s36.gif\" alt=\"roza\"/>",
"<img src=\"sm/s37.gif\" alt=\"gitara\"/>",
"<img src=\"sm/s38.gif\" alt=\"mogila\"/>");
$ntext=str_replace($conv1,$conv2,$ntext);
$trans3= array("A","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы","A","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы");
if($trans=="y"){$ntext=str_replace($trans2,$trans3,$ntext);}
$substr_count = substr_count($ntext,"http://");
$n=1; $ofset=0;
while($n <= $substr_count ){
$pozicn = strpos($ntext, "http://",$ofset);
$pozick = strpos($ntext, " ",$pozicn);
$sim=$pozick-$pozicn;
if($sim==0) {$sim="";}
if($sim!=""){$sim=$sim+1;}
$zamenstr = substr($ntext, $pozicn, $sim);
$zamenstr=trim($zamenstr);
$ntext=str_replace($zamenstr,"<a href=\"$zamenstr\">$zamenstr</a>",$ntext);
$ofset=$pozick+$pozick1+19;
$n=$n+1;}
if($obr!=""){$ntext="<b>$obr,</b> $ntext";}
$zapis="$imja:||:$currTime/ $currDate:||:$ntext:||:$mail:||:$site:||:$brayz";
$counterarray = file("vsego.shet");
$me = $counterarray[0]+1;
$fp = @fopen("vsego.shet","wb");
@fputs($fp,$me);
@fclose($fp);
$fp=fopen("zapis/$me.mess","w");
fputs($fp,"$zapis \r\n"); ////////////////// создание нового файла с сообщением с именем номера этого файла
fclose($fp);
chmod ("zapis/$me.mess", 0777);
if($ydal!=""){$del=$me-$ydal;
if($del>=1){unlink ("zapis/$del.mess");}}
print"Сообщение добавленно";}
else{print"При добавлении сообщения произошла ошибка. Возможно вы не заполнили одного из обязательных полей, или выпытаетесь отправить подряд несколько одинаковых сообщений";}
print "
<br/><a href=\"$gl\">На главную</a><br/>
</p></card></wml>";
?>