<?
Error_Reporting(E_ALL & ~E_NOTICE); ///////////////
header("Content-type:text/vnd.wap.wml;charset=utf-8"); ////////
////////////// /////////////////////////////////////////////////
//$gl="ssilka_na_glavnyu"; /////////
$admin="real"; ////////
$parad="10"; ////////
//$zag="Guest book"; /////////
$ydal="500"; ///////// ОШИБКА МОЖЕТ ВОЗНИКНУТЬ ЕСЛИ ПОСТОВ БУДЕТ БОЛЬШЕ 500
//////////////////////////////////////////////////////////////////////////////
$u1=getenv('HTTP_USER_AGENT');
$brayz=strtok($u1,'/');
$u2=getenv('HTTP_USER_AGENT');
$hostex = gethostbyaddr($REMOTE_ADDR);
$ip=getenv("REMOTE_ADDR");
$from=getenv("HTTP_REFERER");
$currHour=date("H");
$currDate=date("d F", time());
$currTime=date("$currHour:i", time());
$currDate = str_replace("January","Января",$currDate);
$currDate = str_replace("February","Февраля",$currDate);
$currDate = str_replace("March","Марта",$currDate);
$currDate = str_replace("April","Апреля",$currDate);
$currDate = str_replace("May","Мая",$currDate);
$currDate = str_replace("June","Июня",$currDate);
$currDate = str_replace("July","Июля",$currDate);
$currDate = str_replace("August","Августа",$currDate);
$currDate = str_replace("September","Сентября",$currDate);
$currDate = str_replace("October","Октября",$currDate);
$currDate = str_replace("November","Ноября",$currDate);
$currDate = str_replace("December","Декабря",$currDate);
$currDate = str_replace("2006","06",$currDate);
$currDate = str_replace("2007","07",$currDate);
$currDate = str_replace("2008","08",$currDate);
$currDate = str_replace("2009","09",$currDate);
$currDate = str_replace("2010","10",$currDate);
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=\"real-gb\" ontimer=\"index.php?log=$log&pas=$pas\" >
<timer value=\"10\"/><p>";
/////////////
print "$imja, спасибо за сообщение!<br/>loading...";
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));
$brayz=htmlspecialchars(stripslashes($brayz));
$u2=htmlspecialchars(stripslashes($u2));
$hostex=htmlspecialchars(stripslashes($hostex));
$ip=htmlspecialchars(stripslashes($ip));
$from=htmlspecialchars(stripslashes($from));
$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/post.gif\" alt=\":post\"/>",
"<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);}
{ $counter_array = file("cont/$nom.dat");
$id = $counter_array[0]+1;
$fp = @fopen("cont/$nom.dat","wb");
@fputs($fp,$id);
@fclose($fp); }
$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="<i>$obr</i>, $ntext";}
$zapis="$imja:||:$currTime/$currDate:||:$ntext:||:$mail:||:$site:||:$brayz:||:$u2:||:$ip:||:$from:||:$hostex";
$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/>
</p></card></wml>";
?>