3600)unlink($strpath); $i++; } } //Возвращаемся в каталог книги chdir($adrself); $arrdata=explode("*",$data); //Скидываем в хранилище ip, маршрут, реферер. $ippath="admin/conf/stat/ip.txt"; $marshpath="admin/conf/stat/march.txt"; $refpath="admin/conf/stat/ref.txt"; //ip if(!file_exists($ippath)) $f=fopen($ippath,"w+"); else $f=fopen($ippath,"a"); fwrite ($f,$arrdata[0]."\r\n"); fclose($f); //Откуда пришёл if(!file_exists($refpath)) $f=fopen($refpath,"w+"); else $f=fopen($refpath,"a"); if ($arrdata[3]=="no")@$r="Закладка"; else @$r=$arrdata[3]; fwrite ($f,$r."\r\n"); fclose($f); //Маршрут $str=""; $i=0; foreach($arrdata as $line) { if ($i==4) $str=$line; if ($i>4) $str.="*".$line; $i++; } if(!file_exists($marshpath)) $f=fopen($marshpath,"w+"); else $f=fopen($marshpath,"a"); fwrite ($f,$str."\r\n"); fclose($f); $fileno=false; //Если нет файла статистики $strpath="admin/conf/stat/stat.txt"; if(!file_exists($strpath))$fileno=true; if($fileno)$f=fopen($strpath,"w+"); else $f=fopen($strpath,"a"); //Модифицируем данные $i=0; foreach($arrdata as $line) { if($i==2)$line=time(); if(@$string!="")@$string.="*".$line; else @$string=$line; $i++; } fwrite($f,$string."\r\n"); fclose($f); } else { chdir($adrself); } } else { chdir($adrself); } //------------------------------------------ //Данные из настроек $strpath="admin/conf/mes.txt"; @$f=fopen($strpath,'r'); $cont=file($strpath); fclose($f); //Очищаем от \n $i=0; foreach($cont as $line) { $cont[$i]=trim( $cont[$i]); $i++; } //Поиск $strpath="admin/conf/search.txt"; @$f=fopen($strpath,'r'); $arrSearch=file($strpath); fclose($f); //Очищаем от \n $i=0; foreach($arrSearch as $line) { $arrSearch[$i]=trim( $arrSearch[$i]); $i++; } //Код================================== $strpath="admin/conf/code/topcode.txt"; $size=filesize($strpath); if($size) { $f=fopen($strpath,'r'); @$code_top=fread($f, filesize($strpath)); fclose($f); } $strpath="admin/conf/code/botcode.txt"; $size=filesize($strpath); if($size) { $f=fopen($strpath,'r'); @$code_bot=fread($f, filesize($strpath)); fclose($f); } $strpath="admin/conf/code/leftcode.txt"; $size=filesize($strpath); if($size) { $f=fopen($strpath,'r'); @$code_left=fread($f, filesize($strpath)); fclose($f); } $strpath="admin/conf/code/rigcode.txt"; $size=filesize($strpath); if($size) { $f=fopen($strpath,'r'); @$code_rig=fread($f, filesize($strpath)); fclose($f); } $strpath="admin/conf/code/align.txt"; @$f=fopen($strpath,'r'); $al_code=file($strpath); fclose($f); //Очищаем от \n $i=0; foreach($al_code as $line) { $al_code[$i]=str_replace("\r\n","",$al_code[$i]); $al_code[$i]=trim($al_code[$i]); $i++; } if($al_code[0]==1)$al_top="left"; if($al_code[0]==2)$al_top="center"; if($al_code[0]==3)$al_top="right"; if($al_code[1]==1)$al_bot="left"; if($al_code[1]==2)$al_bot="center"; if($al_code[1]==3)$al_bot="right"; if($al_code[2]==1)$al_left="top"; if($al_code[2]==2)$al_left="bottom"; if($al_code[2]==3)$al_left="center"; if($al_code[3]==1)$al_rig="top"; if($al_code[3]==2)$al_rig="bottom"; if($al_code[3]==3)$al_rig="center"; //======================================== $strpath="admin/conf/descript.txt"; $size=filesize($strpath); if($size): $f=fopen($strpath,'r'); $descr=fread($f, filesize($strpath)); fclose($f); endif; $strpath="admin/conf/keywords.txt"; $size=filesize($strpath); if($size): $f=fopen($strpath,'r'); $key=fread($f, filesize($strpath)); fclose($f); endif; //Позиция if($cont[11]==1)$al="left"; if($cont[11]==2)$al="center"; if($cont[11]==3)$al="right"; if($cont[18]==1)$cont[18]="left"; if($cont[18]==2)$cont[18]="center"; if($cont[18]==3)$cont[18]="right"; if($cont[19]==1)$cont[19]="left"; if($cont[19]==2)$cont[19]="center"; if($cont[19]==3)$cont[19]="right"; $d=opendir("db"); $i=0; //Название файлов в массив while(($e=readdir($d))!=false): if($e =="." || $e ==".." || $e==".htaccess") continue; @$arr[@$i]=$e; @$i++; endwhile; closedir($d); if (@$code_left=="")$al_code[4]=0; if (@$code_rig=="")$al_code[5]=0; $size_centr_tab= 100-($al_code[4]+$al_code[5]); $al_code[6]+=15; echo " Гостевая книга "; if (@$code_top!="") { echo ""; } echo ""; if ($i==0): echo ""; endif; echo ""; if (@$code_left!="") { echo ""; } echo ""; if (@$code_bot!="") { echo ""; } echo "
"; if($al_code[11]==0) { echo @$code_top; } else { include("admin/conf/code/topcode.txt"); } echo "
"; if (@$code_left!="") echo ""; echo ""; if(@$code_rig!="") echo ""; echo "
"; if ($cont[23]==1) echo"книга"; echo " ".$cont[22]."

Добавить сообщение   Всего ".count(@$arr)." записей"; if ($arrSearch[0]==1) { echo "
     Подробный поиск
"; } if (@$logon) { echo " Панель управления "; } echo "
Пока ни одной записи нет. Оставьте первое сообщение!
"; if($al_code[13]==0) { echo @$code_left; } else { include("admin/conf/code/leftcode.txt"); } echo ""; if(count(@$arr)!=0) { echo ""; //Обрабатываем названия--------------------------- //Сортируем по убыванию rsort($arr); //Навигация------------------------------------ //Проверяем $start if (empty($_GET['start'])) $start=0; elseif ($_GET['start'] >= count($arr)) $start=0; elseif ($_GET['start'] < 0) $start=0; else $start=$_GET['start']; if ($start < count($arr)) $count=count($arr)-$start; else $count=$start-count($arr); //Сколько выводить $stop=$cont[5]; if($stop > $count) $stop=$count; //-------------------------------------------------- //Первый цикл выбирает и открывает файл из массива for($i=$start; $i < $stop+$start; $i++): $strpath="db/".$arr[$i]; @$f=fopen($strpath,r); //Файл построчно в массив $content $content=file($strpath); fclose($f); echo ""; echo "
"; echo""; //Цикл выводит файл в таблицу $mes=false; $com=false; foreach(@$content as $line): //Обрабатываем строку: $ch1=substr($line,0,1); if(!$mes): $line=str_replace($ch1," ",$line); $line=ltrim($line); if ($line!= ""): if(@$cont[6]==1): switch($ch1): case "%": $line="   ". $line. "
"; break; case "@": $line=" ". $line. "
"; break; case "#": $line="   ". $line. "
"; break; case "$": $line="   ". $line. "
"; break; case "№": $line="   ". $line. "
"; break; case "*": $line="   ". $line; break; case "~": echo "
"; $mes=true; break; endswitch; else: switch($ch1): case "^": break; case ">": break; case "%": $line="".$line. "
"; break; case "@": $line=$line. "
"; break; case "#": $line=$line. "
"; break; case "$": $line="". $line. "
"; break; case "№": $line="". $line. "
"; break; case "*": $line= $line."
"; break; case "~": echo "
"; $mes=true; break; endswitch; endif; endif; endif; if ($ch1=="^") continue; if ($ch1=="{"): @$com=true; $line=str_replace($ch1," ",$line); $line=ltrim($line); endif; if($mes) { $line=str_replace("[br]","
",$line); $line=str_replace("[code]","
",$line); $line=str_replace("[/code]","
",$line); $line=str_replace("[b]","",$line); $line=str_replace("[/b]","",$line); $line=str_replace("[i]","",$line); $line=str_replace("[/i]","",$line); $line=str_replace("[u]","",$line); $line=str_replace("[/u]","",$line); $line=str_replace("[s]","",$line); $line=str_replace("[/s]","",$line); $line=str_replace("[tt]","",$line); $line=str_replace("[/tt]","",$line); $line=str_replace("[sup]","",$line); $line=str_replace("[/sup]","",$line); $line=str_replace("[sub]","",$line); $line=str_replace("[/sub]","",$line); $line=str_replace("[font color=#FF0000]","",$line); $line=str_replace("[font color=#0000FF]","",$line); $line=str_replace("[font color=#008080]","",$line); $line=str_replace("[/font]","",$line); //url if($line) { $step=0; $result=""; $endPos=1; while($endPos) { $beginPos=strpos($line,"[url]",$step); if($beginPos===0 || $beginPos>0 )$endPos=strpos($line,"[/url]",$beginPos+5); if( ($beginPos === 0 && $endPos > 0) || ($beginPos>0 && $endPos > 0) ) { $result.=substr($line,$step,$beginPos-$step); $result.="".substr($line,$beginPos+5,$endPos-$beginPos-5).""; $step= $endPos+6; } else { $result.=substr($line,$step ); break; } } if($result!="") { $result=str_replace("[url]","",$result); $result=str_replace("[/url]","",$result); $line=$result; } } //Смайлики $line=str_replace(":0","  ",$line); $line=str_replace(";)","  ",$line); $line=str_replace(":)","  ",$line); $line=str_replace(":ъ","  ",$line); $line=str_replace(":ь","  ",$line); $line=str_replace(":-","  ",$line); $line=str_replace(":}","  ",$line); $line=str_replace(":(","  ",$line); $line=str_replace(";(","  ",$line); $line=str_replace(";ъ","  ",$line); $line=str_replace(";ь","  ",$line); } if (!$com) echo $line; else @$com_text.=$line; endforeach; if(@$com_text!="")@$com_text="".$cont[12]."  ".@$com_text; echo "

".@$com_text."

"; //Картинка редактирования if (@$logon) { echo ""; } echo "
"; } if(@$code_rig!="") { echo "
"; if($al_code[14]==0) { echo @$code_rig; } else { include("admin/conf/code/rigcode.txt"); } } echo "
"; if($al_code[12]==0) { echo @$code_bot; } else { include("admin/conf/code/botcode.txt"); } echo "
"; echo " "; ?>