\n"; echo "\n"; echo "\n"; echo "$btitle\n"; echo "\n"; echo "\n"; echo "\n"; } function ftr(){ echo "\n"; echo "\n"; } ////////////////////////////////////////////////////////////////////////////// function view(){ global $datfile; global $gbook; global $max; global $num; global $qim; global $admname; global $admmail; global $borpodkl; global $bgpodkl; global $bgmes; global $hdrbgmes; global $hdrfont; global $subhdrbgmes; global $subhdrfont; global $backmes; global $fontmes; global $fontuinip; global $admnamcol; hdr(); echo "
- добавить запись -

\n"; $data=file($datfile); $total=count($data); if (!isset($num)) $num=0; echo "
\n\n\n\n\n
\n\n\n\n\n
\n
\n"; for ($i=$num;$i"; $aa=""; } if($icq == "unknown"){ $img = ""; }else{ $img = ""; } if(empty($admsg)){ $admsg=""; }else{ $admsg="--
$admname: $admsg
--

"; } echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $name$nameurl ] 
 $city [$date]
 $msg

$admsg\n
"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n
$img$a$icq$aa$ip
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; } echo "
\n
\n
\n
\n"; echo "
\n\n\n"; $page_next = $num + $max; $page_prev = $num - $max; if ($num >= $max) { echo "\n"; } if ($num + $max < $total) { echo "\n"; } echo "\n
\"Первая\""; echo " \"Предыдущие \"Следующие"; echo " \"Последняя\"
\n
\n"; echo "

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "

© 2000-01 by SL\n"; echo "
\n"; echo "
\n"; ftr(); } //////////////////////////////////////////////////////////////////////////////////////////// function form(){ global $gbook; global $name; global $mail; global $url; global $nameurl; global $city; global $msg; global $icq; global $error; global $bgmes; global $hdrbgmes; global $hdrfont; global $backmes; global $subhdrbgmes; global $fontmes; global $btitle; if(!isset($name)) $name=""; if(!isset($mail)) $mail=""; if(!isset($url)) $url=""; if(!isset($nameurl)) $nameurl="HomePage"; if(!isset($city)) $city=""; if(!isset($msg)) $msg=""; if(!isset($icq)) $icq=""; if(!isset($err)) $err=""; if($error=="found") $err="
\nВсе поля помеченные \"*\" должны быть заполнены.\n"; elseif($error=="mail") $err="
\nНеверный формат e-mail адреса.\n"; hdr(); ?>
" method="POST"> ">
" height="1">">   " height="1"> 
" height="1" colspan="2"> 
" height="1" align="right" width="120">" size="2">* Имя " height="1" width="330">  
" height="1" align="right" width="120">" size="2">E-Mail " height="1" width="330">  
" height="1" align="right" width="120">" size="2">Url " height="1" width="330">  
" height="1" align="right" width="120">" size="2">Название Url " height="1" width="330">  
" height="1" align="right" width="120">" size="2">* Город " height="1" width="330">  
" height="1" align="right" width="120">" size="2">* Сообщение " height="1" width="330">  
" height="1" align="right" width="120">" size="2">Icq " height="1" width="330">  
" colspan="2">
 
* обязательные поля




© 2000-01 by SL
\nКак звать: Павел А. Ф.
\n"; echo "Когда родился: 82 год XX века н.э.
\n"; echo "Место жительства: Калининград.
\n"; ftr(); exit; } if(empty($qim)){ $q = "n/a"; $e = ""; $ee = ""; }else{ $q = "$qim"; $e = ""; $ee = ""; } ?>

 

 




Author: " title="Author">SL
GBook version: 3.1
Programming language: PHP4
GBook works on: " title="more...">PHP/
Plugins:
 QIM:

Script is written in a Kaliningrad (West Russia)



 


mailto: sadlion@mail.ru   hp: http://www.bytecity.ru/~plus/

", ">", $name); $name = ereg_replace("\"", """, $name); $msg = ereg_replace("&", "&", $msg); $msg = ereg_replace("<", "<", $msg); $msg = ereg_replace(">", ">", $msg); $msg = ereg_replace("\"", """, $msg); $city = ereg_replace("&", "&", $city); $city = ereg_replace("<", "<", $city); $city = ereg_replace(">", ">", $city); $city = ereg_replace("\"", """, $city); $mail = ereg_replace("&", "&", $mail); $mail = ereg_replace("<", "<", $mail); $mail = ereg_replace(">", ">", $mail); $mail = ereg_replace("\"", """, $mail); $nameurl = ereg_replace("&", "&", $nameurl); $nameurl = ereg_replace("<", "<", $nameurl); $nameurl = ereg_replace(">", ">", $nameurl); $nameurl = stripcslashes ($nameurl); $nameurl = ereg_replace("\"", """, $nameurl); $url = ereg_replace("&", "&", $url); $url = ereg_replace("<", "<", $url); $url = ereg_replace(">", ">", $url); $url = ereg_replace("\"", """, $url); $icq = ereg_replace("&", "&", $icq); $icq = ereg_replace("<", "<", $icq); $icq = ereg_replace(">", ">", $icq); $icq = ereg_replace("\"", """, $icq); $msg = eregi_replace("([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))", "\\0", $msg); $msg = eregi_replace("((ht|f)tp://www\.|www\.)([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})((/|\?)[a-z0-9~#%&\\/'_\+=:\?\.-]*)*)", "http://www.\\3", $msg); $msg = eregi_replace("((ht|f)tp://)((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((/|\?)[a-z0-9~#%&'_\+=:\?\.-]*)*)", "\\0", $msg); }else{ $icq=""; } $name = ereg_replace("\|", "¦", $name); $msg = ereg_replace("\|", "¦", $msg); $city = ereg_replace("\|", "¦", $city); $mail = ereg_replace("\|", "¦", $mail); $nameurl = ereg_replace("\|", "¦", $nameurl); $url = ereg_replace("\|", "¦", $url); $icq = ereg_replace("\|", "¦", $icq); $msg = ereg_replace(" ", "
", $msg); $name = stripcslashes ($name); $msg = stripcslashes ($msg); $city = stripcslashes ($city); $mail = stripcslashes ($mail); $url = stripcslashes ($url); $icq = stripcslashes ($icq); $icq=ereg_replace("[^0-9]", "", $icq); if(empty($icq)) $icq="unknown"; $mounths=array("Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Августа","Сентября","Октября","Ноября","Декабря"); $today=date ("d")." ".$mounths[date("m")-1]." ".date("Y")."г."." ".date ("H:i"); $fp=fopen("counter","r"); $n = fread($fp,filesize("counter")); fclose($fp); $n++; $fp = fopen("counter","w"); flock ($fp, 2); fputs ($fp,$n); flock ($fp, 3); fclose($fp); $lines = file("$datfile"); $message = "$n|$ip|$today|$name|$mail|$url|$nameurl|$city|$msg|$icq|$HTTP_USER_AGENT||"; $fp = fopen("$datfile", "w"); flock ($fp, 1); fwrite($fp, "$message\n"); for ($i = 0; $i < $mdata; $i++){ @fwrite($fp, "$lines[$i]"); } flock ($fp, 3); fclose($fp); if ($sendmail == "y" && !empty($admmail)){ $header="From: PHP GBook<$admmail>\nReply-To: $name<$mail>\nX-Mailer: SL Mail [PHP GBook v.3.1]"; $subj = "New Message from a $name"; $message="Hello $admname\n\n$today, $name пишет:\n$msg\n\n$mail"; $message = ereg_replace("
", "\n", $message); $subj = convert_cyr_string($subj,'w','k'); $message = convert_cyr_string($message,'w','k'); @mail ("$admname<$admmail>", $subj, $message, $header); } header ("Location: $gbook?book=view"); exit; } ///////////////////////////////////////////////////////////////////////////////////////// function pass(){ global $passwd; global $book; global $pass; global $gbook; echo ""; echo "Администрирование"; echo ""; echo "

 

"; echo "
Администрирование
"; echo "
\n"; echo "
\n"; echo "
"; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "
Введите пароль
"; echo ""; echo "
"; echo "
"; echo ""; echo ""; exit; } /////////////////////////////// function main(){ global $pass; global $gbook; global $passwd; global $total; global $salt; global $max; global $num; global $datfile; global $qim; global $book; global $mdata; global $bgmes; if($pass != $passwd){ if (!empty($pass)){ $pass = @crypt($pass, $salt); } } if ($pass == $passwd){ hdr(); echo "\n\n\n\n
интерфейс | настройки | изменить пароль | добавить запись
\n
\n"; $data=file($datfile); $total=count($data); if (!isset($num)){ $num=0; } $rema=($mdata-$total)+1; if($total>=$mdata+1) $reba="файл полон, более старые сообщения удаляются!"; else $reba="осталось $rema"; echo "
Всего записей: ".$total." ($reba)
"; for ($i=$num;$i"; $aa=""; } if($icq == "unknown"){ $img = ""; }else{ $img = ""; } $msg = ereg_replace("
", "\n", $msg); $admsg = ereg_replace("
", "\n", $admsg); echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 [$date]
"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n
$img
\n"; echo "
\n"; echo "
\n"; echo "\n\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n\n
id $number
----------
add
comment
\n"; echo "$useragent\n"; echo "
"; echo "
\n"; echo "
\n"; echo "
\n"; } echo "
\n\n\n"; $page_next = $num + $max; $page_prev = $num - $max; if ($num >= $max) { echo "\n"; } if ($num + $max < $total) { echo "\n"; } echo "\n
\"Первая\""; echo " \"Предыдущие \"Следующие"; echo " \"Последняя\"
\n
\n"; echo "


\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "

© 2000-01 by SL\n"; echo "
\n"; echo "
\n"; ftr(); }else{ echo "
Вход возбранен
\n"; } } //////////////////////////// function edit(){ global $gbook; global $book; global $passwd; global $pass; global $datfile; global $submit; global $date; global $msg; global $number; global $ip; global $name; global $mail; global $url; global $nameurl; global $city; global $icq; global $admsg; global $num; global $total; global $useragent; if ($pass != $passwd){ echo "кто это у нас тут такой умный..?
а как же авторизация?"; }else{ if ($submit == "Edit"){ $name = ereg_replace("&", "&", $name); $name = stripcslashes ($name); $name = ereg_replace("\|", "¦", $name); $msg = ereg_replace("&", "&", $msg); $msg = stripcslashes ($msg); $msg = ereg_replace(" ", "
", $msg); $msg = ereg_replace("\|", "¦", $msg); $city = ereg_replace("&", "&", $city); $city = stripcslashes ($city); $city = ereg_replace("\|", "¦", $city); $mail = ereg_replace("&", "&", $mail); $mail = stripcslashes ($mail); $mail = ereg_replace("\|", "¦", $mail); $nameurl = ereg_replace("&", "&", $nameurl); $nameurl = stripcslashes ($nameurl); $nameurl = ereg_replace("\|", "¦", $nameurl); $url = ereg_replace("&", "&", $url); $url = stripcslashes ($url); $url = ereg_replace("\|", "¦", $url); $icq = ereg_replace("&", "&", $icq); $icq = stripcslashes ($icq); $icq = ereg_replace("\|", "¦", $icq); $ip = ereg_replace("&", "&", $ip); $ip = stripcslashes ($ip); $ip = ereg_replace("\|", "¦", $ip); $admsg = ereg_replace("&", "&", $admsg); $admsg = stripcslashes ($admsg); $admsg = ereg_replace(" ", "
", $admsg); $admsg = ereg_replace("\|", "¦", $admsg); $content = file($datfile); for($i=0; $i<=count($content); $i++){ if (@ereg("^$number\|", $content[$i])) $content[$i]="$number|$ip|$date|$name|$mail|$url|$nameurl|$city|$msg|$icq|$useragent|$admsg|\n"; } $fp = fopen($datfile,"w"); flock ($fp, 2); for($i=0; $i<=count($content); $i++){ if(isset($content[$i])) fputs($fp, $content[$i]); } flock ($fp, 3); fclose($fp); header ("Location: $gbook?book=main&num=$num&total=$total&pass=$pass"); exit; }else{ $content = file($datfile); for($i=0; $i<=count($content); $i++){ if (ereg("^$number\|", $content[$i])) unset($content[$i]); } $fp = fopen($datfile,"w"); flock ($fp, 2); for($i=0; $i<=count($content); $i++){ if(isset($content[$i])) fputs($fp, $content[$i]); } flock ($fp, 3); fclose($fp); header ("Location: $gbook?book=main&num=$num&total=$total&pass=$pass"); exit; } } } ///////////////////////// function changepass(){ global $gbook; global $passwd; global $pass; global $salt; global $a; global $book; global $oldpass; global $newpass; global $newpasswd; if($pass != $passwd){ if (!empty($pass)){ $pass = @crypt($pass, $salt); } } if ($pass != $passwd){ echo "кто это у нас тут такой умный..?"; }else{ if(empty($a)){ echo "\n"; echo "Изменение пароля\n"; echo "\n"; echo "Меняем пароль\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; echo "\n\n
старый пароль
новый пароль
ещё раз новый
\n
\n"; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; exit; }else{ if (!empty($oldpass)){ $oldpass = @crypt($oldpass, $salt); } if($oldpass != $passwd){ echo "Неверно ввели старый пароль"; exit; } if(empty($newpass)){ echo "Вы не ввели новый пароль"; exit; } if($newpass != $newpasswd){ echo "Ошибка при повторном введении нового пароля"; exit; } $newpass = @crypt($newpass, $salt); $fp = @fopen("passwd.php", "w") or die("Access Denied"); flock ($fp, 2); fwrite($fp,""); flock ($fp, 3); fclose($fp); echo "\n"; echo "Пароль изменён\n"; echo "\n"; echo "Пароль был успешно изменён (надеюсь ты его, балбес, не забудешь!;)

\n"; echo "Вернуться назад\n"; echo "\n"; echo "\n"; } } } ///////////////////////////////////////////// function settings(){ global $gbook; global $gboo; global $datfil; global $ma; global $maxdat; global $qi; global $admnam; global $admmai; global $sendmai; global $usecenso; global $datfile; global $max; global $mdata; global $qim; global $admname; global $admmail; global $sendmail; global $usecensor; global $book; global $pass; global $passwd; global $q; global $hdrbgmes; global $hdrfont; if ($pass != $passwd){ echo "кто это у нас тут такой умный..?
а как же авторизация?"; }else{ if(empty($q)){ hdr(); if($sendmail=="y") $msy="checked"; else $msy=""; if ($usecensor=="y") $ucy="checked"; else $ucy=""; echo "
\n

 

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
"; echo "  Settings
"; echo " имя скрипта (PHP_SELF) /нужно переименовывать файл/
"; echo " имя файла с данными /нужно переименовывать файл/
"; echo " кол-во записей показываемых на странице
"; echo " максимальное кол-во записей хранящихся в файле
"; echo " путь к qim'у (http://www.domain.com/qm.php) /если нет, оставить пустым/
"; echo " имя администратора
"; echo " e-mail администратора
"; echo "отсылать на e-mail сообщения о новых записях
"; echo "использовать цензор
\n"; echo "
\n"; echo "
\n"; echo "
\n

 \n

main

\n"; ftr(); }else{ $conte = file("cfg.php"); for($i=0; $i<=count($conte); $i++){ if (@ereg("^\\\$gbook=", $conte[$i])) $conte[$i]="\$gbook=\"$gboo\";\n"; if (@ereg("^\\\$datfile=", $conte[$i])) $conte[$i]="\$datfile=\"$datfil\";\n"; if (@ereg("^\\\$max=", $conte[$i])) $conte[$i]="\$max=\"$ma\";\n"; if (@ereg("^\\\$mdata=", $conte[$i])) $conte[$i]="\$mdata=\"$maxdat\";\n"; if (@ereg("^\\\$qim=", $conte[$i])) $conte[$i]="\$qim=\"$qi\";\n"; if (@ereg("^\\\$admname=", $conte[$i])) $conte[$i]="\$admname=\"$admnam\";\n"; if (@ereg("^\\\$admmail=", $conte[$i])) $conte[$i]="\$admmail=\"$admmai\";\n"; if (@ereg("^\\\$sendmail=", $conte[$i])) $conte[$i]="\$sendmail=\"$sendmai\";\n"; if (@ereg("^\\\$usecensor=", $conte[$i])) $conte[$i]="\$usecensor=\"$usecenso\";\n"; } $fp = @fopen("cfg.php", "w") or die("Access Denied"); flock ($fp, 2); for($i=0; $i<=count($conte); $i++){ if(isset($conte[$i])) fputs($fp, $conte[$i]); } flock ($fp, 3); fclose($fp); header ("Location: $gbook?book=settings&pass=$pass"); exit; } } } //////////////////////////////// function face(){ global $gbook; global $book; global $pass; global $passwd; global $x; global $btitle; global $background; global $pbgcolor; global $pfontcolor; global $borpodkl; global $bgpodkl; global $bgmes; global $hdrbgmes; global $hdrfont; global $subhdrbgmes; global $subhdrfont; global $backmes; global $fontmes; global $fontuinip; global $admnamcol; global $btitl; global $backgroun; global $pbgcolo; global $borpodk; global $bgpodk; global $pfontcolo; global $bgme; global $hdrbgme; global $hdrfon; global $subhdrbgme; global $subhdrfon; global $backme; global $fontme; global $fontuini; global $admnamco; if ($pass != $passwd){ echo "кто это у нас тут такой умный..?
а как же авторизация?"; }else{ if(empty($x)){ echo "\n"; echo "\n"; echo "\n"; echo "Интерфейс\n"; echo "\n"; echo "\n"; echo "\n\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
  Interface
"; echo "-  Заголовок
"; echo "-  Фоновое изображение
"; echo "   Цвет основного фона
"; echo "   Цвет основной рамки
"; echo "   Цвет фона подкладки
"; echo "   Цвет текста
"; echo "   Цвет рамки сообщения
"; echo "   Цвет заголовка сообщения
"; echo "   Цвет текста заголовка
"; echo "   Цвет подзаголовка сообщения
"; echo "   Цвет текста подзаголовка
"; echo "   Цвет фона сообщения
"; echo "   Цвет текста сообщения
"; echo "   Цвет текста uin'а и ip
"; echo "   Цвет имени админа
\n"; echo "
\n\n
\n"; echo "
\n"; echo "

main

\n"; }else{ $conte = file("cfg.php"); for($i=0; $i<=count($conte); $i++){ if (@ereg("^\\\$btitle=", $conte[$i])) $conte[$i]="\$btitle=\"$btitl\";\n"; if (@ereg("^\\\$pbgcolor=", $conte[$i])) $conte[$i]="\$pbgcolor=\"$pbgcolo\";\n"; if (@ereg("^\\\$pfontcolor=", $conte[$i])) $conte[$i]="\$pfontcolor=\"$pfontcolo\";\n"; if (@ereg("^\\\$borpodkl=", $conte[$i])) $conte[$i]="\$borpodkl=\"$borpodk\";\n"; if (@ereg("^\\\$bgpodkl=", $conte[$i])) $conte[$i]="\$bgpodkl=\"$bgpodk\";\n"; if (@ereg("^\\\$bgmes=", $conte[$i])) $conte[$i]="\$bgmes=\"$bgme\";\n"; if (@ereg("^\\\$hdrbgmes=", $conte[$i])) $conte[$i]="\$hdrbgmes=\"$hdrbgme\";\n"; if (@ereg("^\\\$hdrfont=", $conte[$i])) $conte[$i]="\$hdrfont=\"$hdrfon\";\n"; if (@ereg("^\\\$subhdrbgmes=", $conte[$i])) $conte[$i]="\$subhdrbgmes=\"$subhdrbgme\";\n"; if (@ereg("^\\\$subhdrfont=", $conte[$i])) $conte[$i]="\$subhdrfont=\"$subhdrfon\";\n"; if (@ereg("^\\\$backmes=", $conte[$i])) $conte[$i]="\$backmes=\"$backme\";\n"; if (@ereg("^\\\$fontmes=", $conte[$i])) $conte[$i]="\$fontmes=\"$fontme\";\n"; if (@ereg("^\\\$fontuinip=", $conte[$i])) $conte[$i]="\$fontuinip=\"$fontuini\";\n"; if (@ereg("^\\\$admnamcol=", $conte[$i])) $conte[$i]="\$admnamcol=\"$admnamco\";\n"; if (@ereg("^\\\$background=", $conte[$i])) $conte[$i]="\$background=\"$backgroun\";\n"; } $fp = @fopen("cfg.php", "w") or die("Access Denied"); flock ($fp, 2); for($i=0; $i<=count($conte); $i++){ if(isset($conte[$i])) fputs($fp, $conte[$i]); } flock ($fp, 3); fclose($fp); header ("Location: $gbook?book=face&pass=$pass"); exit; } } } ///////////////////////////////////////////////////////////////////////////////////////// if (!isset($book)) $book=""; switch ($book) { case "form": form(); break; case "msgsend": sendmsgtobook(); break; case "view": view(); break; case "abt": abt(); break; case "adm": pass(); break; case "main": main(); break; case "cp": changepass(); break; case "edit": edit(); break; case "settings": settings(); break; case "face": face(); break; default: view(); break; } ?>