//die('trenutno imamo problema sa forumom. Molimo probajte kasnije.
Hvala na razumevanju!');
//------------------------------------------------------------------ Problemi
/*
$mode=$HTTP_GET_VARS["mode"];
$forumPotpis=$HTTP_POST_VARS["forumPotpis"];
$forumPassword=$HTTP_POST_VARS["forumPassword"];
$forumId=$HTTP_POST_VARS["forumId"];
$forumKomentar=$HTTP_POST_VARS["forumKomentar"];
*/
error_reporting (E_ALL ^ E_NOTICE);
$mode=$_GET["mode"];
$forumPotpis=$_POST["forumPotpis"];
$forumPassword=$_POST["forumPassword"];
$forumId=$_POST["forumId"];
$forumKomentar=$_POST["forumKomentar"];
//$mode=$HTTP_POST_VARS["mode"];
//$mode=$HTTP_POST_VARS["mode"];
if ($mode=="left") echo '
forum026 »» | '; else echo 'Forum026 | '; echo '
Pravila foruma | |
';
$fname="forum.txt"; $file=fopen($fname,"r"); $totalCnt=0; $okCnt=0; $theRed=""; $newCnt=0; $delCnt=0;
if ($mode=="left") echo 'Najnovije: '; else echo 'Dosadasnji ovogodisnji postovi (najpre najnoviji): '; if ($file) { while (!feof ($file)) { $line = fgets ($file, 2048); if (substr($line,0,6)=='forum:') { $totalCnt++; $okCnt++; $red[$okCnt]=substr($line,6,2042); } else if (substr($line,0,6)=='f_app:') { $red[$okCnt].=' '.substr($line,6,2042); } else if (substr($line,0,6)=='f_new:') { $totalCnt++; $newCnt++; $redNew[$newCnt]=substr($line,6,2042); } else if (substr($line,0,6)=='f_nap:') { $redNew[$newCnt].=' '.substr($line,6,2042); } else if (substr($line,0,6)=='f_del:') { $totalCnt++; } else if (substr($line,0,6)=='f_dap:') { } } } fclose($file); if ($mode=="left") for ($i=1; $i<=min(10,$okCnt); $i++) echo '» '.$red[$okCnt+1-$i].' '; else for ($i=1; $i<=$okCnt; $i++) echo ''.$i.'. '.$red[$okCnt+1-$i].' '; echo " Poslato: $totalCnt, objavljeno: $okCnt! "; if ($mode=="new") { if ((strlen($forumKomentar)<3) or (strlen($forumPotpis)<4)) { die (" Vaš komentar \"$forumKomentar\" nije korektno pospisan ili je prekratak pa nece ni biti registrovan. Haj'te ponovo - i popunite i polje za potpis i komentar. "); } $red=$forumKomentar; //.' ['.$forumPotpis.', '.date("d.m.Y. H:i:s").']'); $file=fopen($fname,"a"); if ($file) { if (strlen($forumKomentar)>2000) fputs($file,'f_new:nastavak prethodnog komentara:: '. substr($forumKomentar,2000,1900).' ['.$forumPotpis.', '.date("d.m.Y. H:i:s").']'."\r\n"); fputs($file,'f_new:'.substr($forumKomentar,0,2000).' ['.$forumPotpis.', '.date("d.m.Y. H:i:s").']'."\r\n"); fclose($file); echo " Vaš komentar \"$red\"sa potpisom \"$forumPotpis\" je primljen. Posle obrade bice dodat."; } } //mode new else if ($mode=="admin") { for ($i=1; $i<=$newCnt; $i++) echo ' '; } //mode admin else if ($mode=="edit") { $file=fopen($fname,"w"); if ($file) { for ($i=1; $i<=$okCnt; $i++) { fputs($file,'forum:'.substr($red[$i],0,2042)."\r\n"); /*$red[$i]=substr($red[$i],80,9000); while (strlen($red[$i])>0) { fputs($file,'f_app:'.substr($red[$i],0,80)."\r\n"); $red[$i]=substr($red[$i],80,9000); }*/ echo 'saved '.$i.' '; } echo ' psw='.$forumPassword.' id='.$forumId.' '; for ($i=1; $i<=$newCnt; $i++) { if (($i==$forumId) and ($forumPassword=='026salji')) { fputs($file,'forum:'.substr($redNew[$i],0,2042)."\r\n"); /*$redNew[$i]=substr($redNew[$i],80,9000); while (strlen($redNew[$i])>0) { fputs($file,'f_app:'.substr($redNew[$i],0,80)."\r\n"); $redNew[$i]=substr($redNew[$i],80,9000); }*/ echo 'show '.$i.' '; } //show else if (($i==$forumId) and ($forumPassword=='026brisi')) { echo 'skip '.$i.' '; } //delete else { fputs($file,'f_new:'.substr($redNew[$i],0,2042)."\r\n"); /*$redNew[$i]=substr($redNew[$i],80,9000); while (strlen($redNew[$i])>0) { fputs($file,'f_nap:'.substr($redNew[$i],0,80)."\r\n"); $redNew[$i]=substr($redNew[$i],80,9000); }*/ echo 'new '.$i.' '; } //new } fclose($file); } } //mode edit ?> |