<?
// ////// // // // //
// // // // ///// /////
///// \\ // // // // // // // // // // // //
// // \\ // // // // // // // // // ////// // //
// // \\ // // // // // // // // // // // //
///// \// ////// // // // // // ///// // //
// /////
//
/////////////////////////// [email protected] ///////////////////////////////
Error_Reporting(E_ALL & ~E_NOTICE);
$brayz = "$REMOTE_ADDR ";
$u1=getenv('HTTP_USER_AGENT');
$ipad=strtok($u1,'/');
//////////////////////////////////////////////////////////////////////////
$gl="http://da1.hoha.ru/index.wml"; /////////// ссылка на главную
$zag="Dionisij"; /////////// Загаловок
//////////////////////////////////////////////////////////////////////////
$currHour=date("H",time());
$currDate=date("dS F, Y", time());
$currTime=date("$currHour:i", time());
$text = @file("profil/$log.prof");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provpar=trim($udata[1]);}
if($par!=$provpar) {$log=""; $mess="";}
$name = htmlspecialchars(stripslashes($name));
$mess = htmlspecialchars(stripslashes($mess));
if ($tr==5) {
$trans1= array("E","F","CH","SH","IU","IA","A","B","V","G","D","ZH","Z","I","K","L","M","N","O","R","S","T","U","H","C","Y","ch","sh","iu","ia","a","b","v","g","d","e","zh","z","i","k","l","m","n","o","p","r","s","t","u","f","h","c","'","y","J","j","P");
$trans2= array("Е","Ф","Ч","Ш","Ю","Я","А","Б","В","Г","Д","Ж","З","И","К","Л","M","Н","О","Р","С","Т","У","Х","Ц","Ы","ч","ш","ю","я","а","б","в","г","д","е","ж","з","и","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы","Й","й","П");
$mess=str_replace($trans1,$trans2,$mess); };
if($log!="") {$text="$log::$mess::$currDate"; $im=$log;}
else {$text="-$name-::$mess::$currDate"; $im="-$name-";}
$klmes = @implode("",@file("rek/$razd=$prazd=$tem.mes")); ///// открываем счетчик с количеством сообщений
$faf = @file("rek/$razd=$prazd=$tem=$klmes.TEXT");
$udata = explode("::",$faf[0]);
$af = $udata[1];
if ($af == $mess) {$mess="";}
if ($mess!=""){
$counter_array = file("rek/$razd=$prazd=$tem.mes");
$id = $counter_array[0]+1;
$fp = @fopen("rek/$razd=$prazd=$tem.mes","wb");
@fputs($fp,$id);
@fclose($fp); ///////////// увеличиваем счеичик сообщений в теме на 1.
$sob=$id-2;
$fp=fopen("rek/$razd=$prazd=$tem=$id.TEXT","w"); ///////// записываем сообщение
fputs($fp,"$text \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd=$tem=$id.TEXT", 0777);
$counter_array = file("rek/$razd=$prazd.tem");
$id = $counter_array[0]+1;
$fp = @fopen("rek/$razd=$prazd.tem","wb");
@fputs($fp,$id);
@fclose($fp);
$text = @file("rek/$razd=$prazd=$tem.kt");
$udata = explode(":||:",$text[0]);
$del=trim($udata[5]);
unlink ("rek/$razd=$prazd=$del.sort");
$fp=fopen("rek/$razd=$prazd=$id.sort","w"); ///////// записываем сообщение
fputs($fp,"$tem \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd=$id.sort", 0777);
$ntext=":||:$udata[1]:||:$udata[2]:||:$currDate / $currTime:||:$im:||:$id";
$fp=fopen("rek/$razd=$prazd=$tem.kt","w"); ///////// записываем сообщение
fputs($fp,"$ntext \r\n");
fclose($fp);
chmod ("rek/$razd=$prazd=$tem.kt", 0777);
if($log!="") {$counter_array = file("profil/$log.st");
$id = $counter_array[0]+1;
$fp = @fopen("profil/$log.st","wb");
@fputs($fp,$id);
@fclose($fp); }
}
header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">
<wml>
<card id=\"tes\" title=\"$zag\" ontimer=\"mes.php?razd=$razd&prazd=$prazd&tem=$tem&nmes=$sob&log=$log&par=$par\" >
<timer value=\"10\"/>
<p>
Сообщение успешно добавленно!
<br/>
<a href=\"mes.php?razd=$razd&prazd=$prazd&tem=$tem&nmes=$id&log=$log&par=$par\">Форум</a><br/>
<a href=\"$gl\">На главную</a><br/>
</p>
</card>
</wml>"; ///////////////// последняя ссылка - на главную
?>