<?
############################################
# Создание скрипта: Manlix SW #
# Имя скрипта: Manlix SW GuestBook #
# Версия скрипта: 0.3 #
# Статус: Бесплатный скрипт #
# Требования: PHP3 и выше #
# Дата создания скрипта: 9 февраля 2002 год#
# Страница: http://manliks.ru/manlix #
############################################
# Читай файл HowToUse.htm #
############################################
include("config.inc.php");
function form()
{
echo "
<html>
<head>
<title>Администратирование, Manlix SW GuestBook v0.3 - Разработка: Manlix SW</title>
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<meta http-equiv=\"content-type\" content=\"text/html; charset=windows-1251\">
<style type=\"text/css\">
<!--
A:link {COLOR: #000000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
A:active {COLOR: #000000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
A:visited {COLOR: #000000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
A:hover {COLOR: #000080; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
-->
</style>
</head>
<body background=images/background.gif>
<form action=admin.php method=get>
<table border=0 width=500 align=center cellspacing=1 cellpadding=3 bgcolor=000080>
<tr><td align=center bgcolor=face7d><font face=verdana size=2><a href=http://manliks.ru/manlix target=_blank>Manlix SW GuestBook v0.3</a></font></td></tr>
<tr><td align=center bgcolor=face7d><font face=verdana size=2 color=de0000>Введите пароль</font></td></tr>
<tr><td align=center bgcolor=face7d><input typy=text name=p size=25></td></tr>
<tr><td align=center bgcolor=face7d><input type=submit value=Войти></td></tr>
</form>
";
}
if ($p == "$password")
{
if ($iwgc == "yes")
{
setcookie("p",$p);
}
if ($sam == "yes")
{
$body = $saoa;
$body = str_replace("%name%",$name,$body);
$body = str_replace ("%date%","".date("d.m.Y (H:i:s)",$date)."","$body");
$body = str_replace ("%script%","$noos","$body");
$body = str_replace ("%message%","$message","$body");
$body = str_replace ("%answer%","$answer","$body");
$from="\"Гостевая книга\" <$moa>";
$headers="Content-Type: text/html; charset=windows-1251\n";
$headers.="From: $from\nX-Mailer: $noos";
$newm = "Ответ на Ваше сообщение!";
mail($mail,$newm,$body,$headers);
}
?>
<html>
<head>
<title>Manlix SW GuestBook v0.3 - Разработка: Manlix SW</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<style type="text/css">
<!--
A:link {COLOR: #000000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
A:active {COLOR: #000000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
A:visited {COLOR: #000000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
A:hover {COLOR: #de0000; FONT-FAMILY: Verdana; TEXT-DECORATION: none}
-->
</style>
<?
if ($menu == "messages" or $QUERY_STRING == "p=$p" or $menu == "message")
{
$general = file("$base");
$messages = count($general);
for ( $smile = $messages-1; $smile > -1; $smile--)
{
echo "<script language=JavaScript>
<!--
function smile$smile (icon)
{
document.Manlix_SW_GuestBook$smile.answer.value = document.Manlix_SW_GuestBook$smile.answer.value + ' :' + icon + ': ';
document.Manlix_SW_GuestBook$smile.answer.focus();
}
-->
</script>
";
}
}
?>
</head>
<?
if ($auto == "добавить")
{
$auf = fopen("$autochange","a");
$from = ereg_replace(":",":",$from);
$into = ereg_replace(":",":",$into);
fputs($auf,"$from::$into\n");
fclose($auf);
}
$autfi = file("$autochange");
if ($auto == "изменить" or $auto == "удалить")
{
$autfif = fopen("$autochange","w");
for ($autc = 0; $autc < count($autfi); $autc++)
{
if ($autc != $an)
{
fputs($autfif,$autfi[$autc]);
}
else
{
if ($auto == "изменить")
{
$from = ereg_replace(":",":",$from);
$into = ereg_replace(":",":",$into);
fputs($autfif,"$from::$into\n");
}
}
}
fclose($autfif);
}
function replace ($string)
{
$string = ereg_replace("<","<",$string);
$string = ereg_replace(">",">",$string);
$string = ereg_replace('\\\"',""",$string);
$string = ereg_replace("::","::",$string);
$string = ereg_replace("!","!",$string);
$string = ereg_replace("\r\n","<br>",$string);
$string = ereg_replace("%","%",$string);
$string = ereg_replace("^ +","",$string);
$string = ereg_replace(" +$","",$string);
$string = ereg_replace(" +"," ",$string);
return $string;
}
?>
<body bgcolor="#FFFFFF" background=images/background.gif>
<center>
<?
if ($logs == "Очистить лог файл")
{
$log_f = fopen("$dlogs/admin.log","w+");
fputs ($log_f,"");
fclose ($log_f);
}
if ($ban == "добавить")
{
$bli = fopen("$banlist","a");
$banip = ereg_replace("\*",".*",$banip);
$banip = ereg_replace("\.",".",$banip);
fputs($bli,"$banip::$banmessage\n");
fclose($bli);
}
$bans = file("$banlist");
if ($ban == "изменить" or $ban == "удалить")
{
$bansf = fopen("$banlist","w");
for ($banc = 0; $banc < count($bans); $banc++)
{
if ($banc != $nb)
{
fputs($bansf,$bans[$banc]);
}
else
{
if ($ban == "изменить")
{
$banip = ereg_replace("\*",".*",$banip);
$banip = ereg_replace("\.",".",$banip);
fputs($bansf,"$banip::$banmessage\n");
}
}
}
fclose($bansf);
}
$general = file("$base");
if (isset($action))
{
if ($action == "удалить" or $action == "изменить @ ответить" or $action == "забаннить")
{
$editor = fopen("$base","w");
for ($j = 0; $j < count($general); $j++)
{
if ($j != $number)
{
fputs($editor,$general[$j]);
}
else
{
if ($action == "изменить @ ответить")
{
$from = replace($from);
$into = replace($into);
$name = replace($name);
$message = replace($message);
$mail = replace($mail);
$city = replace($city);
$homepage = replace($homepage);
$answer = replace($answer);
$date = replace($date);
$ip = replace($ip);
$message = str_replace(":computer:","<img src=images/1.gif border=0>",$message);
$message = str_replace(":kurivo:","<img src=images/2.gif border=0>",$message);
$message = str_replace(":risuem:","<img src=images/3.gif border=0>",$message);
$message = str_replace(":druzia:","<img src=images/4.gif border=0>",$message);
$message = str_replace(":yazik:","<img src=images/5.gif border=0>",$message);
$message = str_replace(":p","<img src=images/5.gif border=0>",$message);
$message = str_replace(":chto:","<img src=images/6.gif border=0>",$message);
$message = str_replace(":glaz:","<img src=images/7.gif border=0>",$message);
$message = str_replace(":smeh:","<img src=images/8.gif border=0>",$message);
$message = str_replace(":gi:","<img src=images/9.gif border=0>",$message);
$message = str_replace(":stesnyaus:","<img src=images/10.gif border=0>",$message);
$message = str_replace(":sled:","<img src=images/11.gif border=0>",$message);
$message = str_replace(":smile:","<img src=images/12.gif border=0>",$message);
$message = str_replace(":)","<img src=images/12.gif border=0>",$message);
$message = str_replace(":ugu:","<img src=images/13.gif border=0>",$message);
$message = str_replace(";)","<img src=images/13.gif border=0>",$message);
$answer = str_replace(":computer:","<img src=images/1.gif border=0>",$answer);
$answer = str_replace(":kurivo:","<img src=images/2.gif border=0>",$answer);
$answer = str_replace(":risuem:","<img src=images/3.gif border=0>",$answer);
$answer = str_replace(":druzia:","<img src=images/4.gif border=0>",$answer);
$answer = str_replace(":yazik:","<img src=images/5.gif border=0>",$answer);
$answer = str_replace(":p","<img src=images/5.gif border=0>",$answer);
$answer = str_replace(":chto:","<img src=images/6.gif border=0>",$answer);
$answer = str_replace(":glaz:","<img src=images/7.gif border=0>",$answer);
$answer = str_replace(":smeh:","<img src=images/8.gif border=0>",$answer);
$answer = str_replace(":gi:","<img src=images/9.gif border=0>",$answer);
$answer = str_replace(":stesnyaus:","<img src=images/10.gif border=0>",$answer);
$answer = str_replace(":sled:","<img src=images/11.gif border=0>",$answer);
$answer = str_replace(":smile:","<img src=images/12.gif border=0>",$answer);
$answer = str_replace(":)","<img src=images/12.gif border=0>",$answer);
$answer = str_replace(":ugu:","<img src=images/13.gif border=0>",$answer);
$answer = str_replace(";)","<img src=images/13.gif border=0>",$answer);
fputs($editor,"$name::$message::$mail::$city::$homepage::$date::$ip::$answer\n");
}
if ($action == "забаннить")
{
$banf = fopen("$banlist","a");
$banip = ereg_replace("\*",".*",$banip);
$banip = ereg_replace("\.",".",$banip);
fputs($banf,"$ip::Решение главного!::\n");
fclose($banf);
}
}
}
fclose($editor);
$general = file("$base");
}
}
$messages = count($general);
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td bgcolor=#face7d align=center><font face=verdana size=2><a href=http://manliks.ru/manlix target=_blank>Manlix SW GuestBook v0.3</a></td></tr></table><br>";
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080 align=center><tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=000080>Меню админа</font></td></tr><tr><td bgcolor=#face7d align=center><font face=verdana size=2><a href=admin.php?p=$p&menu=messages>Сообщения</a> | <a href=admin.php?p=$p&menu=banlist>Лист запрета</a> | <a href=admin.php?p=$p&menu=design>Дизайн книги</a> | <a href=admin.php?p=$p&menu=logs>Лог файл</a> | <a href=admin.php?p=$p&menu=autochange>Автозамена</a></font></td></tr></table><br>";
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td bgcolor=#face7d align=center><font face=verdana size=2><a href=mnlxswgb.php target=_self>Войти в гостевую книгу</a></td></tr></table><br>";
if ($QUERY_STRING == "p=$password" or $menu == "messages" or $page != "")
{
if ($messages > "0")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td bgcolor=#face7d align=center><font face=verdana size=2>Всего сообщений: <font color=maroon>$messages</font></td></tr></table>";
}
$pmessages = file("$base");
if ($page == "")
{
$page = "1";
}
$first = count($pmessages) - ($onlyp * ($page - 1));
$second = count($pmessages) - ($onlyp * $page) + 1;
if ($second < 1)
{
$second = 1;
}
$pages = (int) ((count($pmessages) + $onlyp) / $onlyp);
$line = "|";
for ($onlyp = 1; $onlyp <= $pages; $onlyp++)
{
if ($onlyp != $page)
{
$line .= "<a href=\"admin.php?p=$p&page=$onlyp\"> $onlyp </a>|";
}
if ($onlyp == $page)
{
$line .= " $onlyp |";
}
}
if ($messages > "0")
{
echo "<br><table align=center width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td align=center bgcolor=face7d><font face=verdana size=1>$line</font></td></tr></table><br>";
}
for ( $i = $first-1; $i >= $second-1; $i--)
{
list($name,$message,$mail,$city,$homepage,$date,$ip,$answer) = explode("::", $general[$i]);
$message = str_replace("<img src=images/1.gif border=0>",":computer:",$message);
$message = str_replace("<img src=images/2.gif border=0>",":kurivo:",$message);
$message = str_replace("<img src=images/3.gif border=0>",":risuem:",$message);
$message = str_replace("<img src=images/4.gif border=0>",":druzia:",$message);
$message = str_replace("<img src=images/5.gif border=0>",":yazik:",$message);
$message = str_replace("<img src=images/5.gif border=0>",":p",$message);
$message = str_replace("<img src=images/6.gif border=0>",":chto:",$message);
$message = str_replace("<img src=images/7.gif border=0>",":glaz:",$message);
$message = str_replace("<img src=images/8.gif border=0>",":smeh:",$message);
$message = str_replace("<img src=images/9.gif border=0>",":gi:",$message);
$message = str_replace("<img src=images/10.gif border=0>",":stesnyaus:",$message);
$message = str_replace("<img src=images/11.gif border=0>",":sled:",$message);
$message = str_replace("<img src=images/12.gif border=0>",":smile:",$message);
$message = str_replace("<img src=images/12.gif border=0>",":)",$message);
$message = str_replace("<img src=images/13.gif border=0>",":ugu:",$message);
$message = str_replace("<img src=images/13.gif border=0>",";)",$message);
$answer = str_replace("<img src=images/1.gif border=0>",":computer:",$answer);
$answer = str_replace("<img src=images/2.gif border=0>",":kurivo:",$answer);
$answer = str_replace("<img src=images/3.gif border=0>",":risuem:",$answer);
$answer = str_replace("<img src=images/4.gif border=0>",":druzia:",$answer);
$answer = str_replace("<img src=images/5.gif border=0>",":yazik:",$answer);
$answer = str_replace("<img src=images/5.gif border=0>",":p",$answer);
$answer = str_replace("<img src=images/6.gif border=0>",":chto:",$answer);
$answer = str_replace("<img src=images/7.gif border=0>",":glaz:",$answer);
$answer = str_replace("<img src=images/8.gif border=0>",":smeh:",$answer);
$answer = str_replace("<img src=images/9.gif border=0>",":gi:",$answer);
$answer = str_replace("<img src=images/10.gif border=0>",":stesnyaus:",$answer);
$answer = str_replace("<img src=images/11.gif border=0>",":sled:",$answer);
$answer = str_replace("<img src=images/12.gif border=0>",":smile:",$answer);
$answer = str_replace("<img src=images/12.gif border=0>",":)",$answer);
$answer = str_replace("<img src=images/13.gif border=0>",":ugu:",$answer);
$answer = str_replace("<img src=images/13.gif border=0>",";)",$answer);
if ($messages != "0")
{
$answer = str_replace("<br>","\r\n",$answer);
$message = str_replace("<br>","\r\n",$message);
$id = $i;
$id++;
echo "<form action=admin.php method=\"get\" name=\"Manlix_SW_GuestBook$i\"><input type=\"hidden\" name=\"p\" value=\"$p\"><table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>";
echo "<tr><td align=center bgcolor=#face7d colspan=2><font face=verdana size=1 color=000080>ID сообщения #$id</font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center colspan=2><table align=center width=100% border=0 cellspacing=1 cellpadding=1><tr><td align=center><a href=javascript:smile('computer')><img src=images/1.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('kurivo')><img src=images/2.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('risuem')><img src=images/3.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('druzia')><img src=images/4.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('yazik')><img src=images/5.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('chto')><img src=images/6.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('glaz')><img src=images/7.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('smeh')><img src=images/8.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('gi')><img src=images/9.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('stesnyaus')><img src=images/10.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('sled')><img src=images/11.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('smile')><img src=images/12.gif border=0></a></td>
<td align=center><a href=javascript:smile$i('ugu')><img src=images/13.gif border=0></a></td></tr></table></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>Имя:</td><td align=center bgcolor=#face7d><input type=text name=name value=\"$name\" size=56></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>Город:</td><td align=center bgcolor=#face7d><input type=text name=city value=\"$city\" size=56></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>E-mail:</td><td align=center bgcolor=#face7d><input type=text name=mail value=\"$mail\" size=56></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>HomePage:</td><td align=center bgcolor=#face7d><input type=text name=homepage value=\"$homepage\" size=56></td></tr>";
echo "<input type=hidden name=date value=\"$date\" size=60>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>Ip:</td><td align=center bgcolor=#face7d><input type=text name=ip value=\"$ip\" size=56></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>Сообщение:</td><td align=center bgcolor=#face7d><textarea rows=3 cols=48 name=message>$message</textarea></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>Ответ:</td><td align=center bgcolor=#face7d><textarea rows=3 cols=48 name=answer>$answer</textarea></td></tr>";
if ($mail != "")
{
echo "<tr><td align=center colspan=2 bgcolor=#face7d><font color=de0000 face=verdana size=2>Отправить ответ пользователю на его e-mail адрес:</font> <input type=checkbox name=sam value=yes></td></tr>";
}
echo "<tr><td align=center colspan=2 bgcolor=#face7d><input type=submit name=action value=удалить> <input type=submit name=action value=\"изменить @ ответить\"> <input type=submit name=action value=забаннить></td></tr>";
echo "<input type=hidden name=menu value=message>";
echo "<input type=hidden name=page value=$page>";
echo "<input type=hidden name=number value=$i>";
echo "</table></form>";
}
}
if ($messages < "1")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td align=center bgcolor=face7d><font face=verdana size=2 color=de0000>В гостевой книге нет сообщений!</font></td></tr></table><br><table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td align=center bgcolor=face7d><font face=verdana size=2><a href=http://manliks.ru/manlix target=_blank>Скрипты от Manlix SW</a></font></td></tr></table>";
}
if ($messages > "0")
{
echo "<table align=center width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td align=center bgcolor=face7d><font face=verdana size=1>$line</font></td></tr></table><br>";
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td bgcolor=#face7d align=center><font face=verdana size=2>Всего сообщений: <font color=maroon>$messages</font></td></tr></table>";
}
}
if ($menu == "banlist")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td bgcolor=#face7d align=center colspan=3><font face=verdana size=2 color=000080>Лист запрета</font></td></tr>";
echo "<form action=\"admin.php\" method=\"get\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=\"banlist\"><tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=1 color=000080>Можете использовать звёздочку '<font color=de0000>*</font>' в качестве маски</td></tr><tr><td bgcolor=#face7d align=center width=100><font face=verdana size=2 color=000070>IP адрес</font></td><td bgcolor=#face7d align=center><font face=verdana size=2 color=000070>Причина</font></td></tr><tr><td bgcolor=#face7d align=center><input type=text name=banip value=\"$ban3\" size=12></td><td bgcolor=#face7d align=center><input type=text name=banmessage value=\"$ban4\" size=53></td></tr>";
echo "<tr><td bgcolor=#face7d align=right colspan=2><input type=submit name=ban value=добавить></td></tr></form>";
$ban1 = file($banlist);
$ban2 = count($ban1);
for ( $b = $ban2 - 1; $b > - 1; $b--)
{
list($ban3,$ban4) = explode("::","$ban1[$b]");
$ban3 = ereg_replace("\.",".",$ban3);
$ban3 = ereg_replace("\.\*","*",$ban3);
$ban3 = ereg_replace("\\\.",".",$ban3);
echo "<form action=\"admin.php\" method=\"get\"><input type=hidden name=p value=\"$p\"><input type=hidden name=nb value=\"$b\"><input type=hidden name=menu value=\"banlist\"><tr><td bgcolor=#face7d align=center width=100><font face=verdana size=2 color=000070>IP адрес</font></td><td bgcolor=#face7d align=center><font face=verdana size=2 color=000070>Причина</font></td></tr><tr><td bgcolor=#face7d align=center><input type=text name=banip value=\"$ban3\" size=12></td><td bgcolor=#face7d align=center><input type=text name=banmessage value=\"$ban4\" size=53></td></tr>";
echo "<tr><td bgcolor=#face7d align=right colspan=2><input type=submit name=ban value=изменить> <input type=submit name=ban value=удалить></td></tr></form>";
}
if ($ban3 < "1")
{
echo "<tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=2 color=de0000>Лист запрета пуст!</font></td></tr>";
}
}
if ($menu == "design" and $template == "")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Выберите шаблон!</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>1. <a href=\"admin.php?p=$p&menu=design&template=top\" target=\"_self\">Верхушка книги</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>2. <a href=\"admin.php?p=$p&menu=design&template=form\" target=\"_self\">Форма для нового сообщения</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>3. <a href=\"admin.php?p=$p&menu=design&template=center\" target=\"_self\">Место под формой</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>4. <a href=\"admin.php?p=$p&menu=design&template=message\" target=\"_self\">Внешний вид сообщения</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>5. <a href=\"admin.php?p=$p&menu=design&template=bottom\" target=\"_self\">Место под сообщениями</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>6. <a href=\"admin.php?p=$p&menu=design&template=end\" target=\"_self\">Самый низ книги</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>7. <a href=\"admin.php?p=$p&menu=design&template=okey\" target=\"_self\">Успешное добавление</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>8. <a href=\"admin.php?p=$p&menu=design&template=error\" target=\"_self\">Ошибка при добавлении</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>9. <a href=\"admin.php?p=$p&menu=design&template=empty\" target=\"_self\">Пустая гостевая книга</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2>10. <a href=\"admin.php?p=$p&menu=design&template=c\" target=\"_self\">Гостевая книга закрыта!</a></font></td></tr>\n";
echo "<tr><td bgcolor=#face7d align=right><font face=verdana size=2><a href=\"http://manliks.ru/manlix\" target=\"_blank\" title=\"Manlix SW - HomePage\">Manlix SW</a></font></td></tr>\n";
echo "</table>\n";
}
if ($template == "error")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>ОШИБКА</font>\"</font></td></tr>\n";
$t_error = file("$dtemplates/error.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($e = 0 ; $e < count($t_error); $e++)
{
$t_error[$e] = str_replace('<',"<",$t_error[$e]);
$t_error[$e] = str_replace('>',">",$t_error[$e]);
echo $t_error[$e];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_error\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Автоматическая замена</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error1% - <font color=000080>$e1</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error2% - <font color=000080>$e2</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error3% - <font color=000080>$e3</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error4% - <font color=000080>$e4</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error5% - <font color=000080>$e5</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error6% - <font color=000080>$e6</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error7% - <font color=000080>$e7</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error8% - <font color=000080>$e8</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%error9% - <font color=000080>$e9</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%script% - <font color=000080>$noos</font></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_error == "Изменить @ Применить")
{
$u_t_error = fopen("$dtemplates/error.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_error,$d_e_t);
}
if ($template == "top")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>ОШИБКА</font>\"</font></td></tr>\n";
$t_top = file("$dtemplates/top.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($t = 0 ; $t < count($t_top); $t++)
{
$t_top[$t] = str_replace('<',"<",$t_top[$t]);
$t_top[$t] = str_replace('>',">",$t_top[$t]);
echo $t_top[$t];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_top\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_top == "Изменить @ Применить")
{
$u_t_top = fopen("$dtemplates/top.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_top,$d_e_t);
}
if ($template == "form")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>ФОРМА ДЛЯ НОВОГО СООБЩЕНИЯ</font>\"</font></td></tr>\n";
$t_form = file("$dtemplates/form.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($f = 0 ; $f < count($t_form); $f++)
{
$t_form[$f] = str_replace('<',"<",$t_form[$f]);
$t_form[$f] = str_replace('>',">",$t_form[$f]);
echo $t_form[$f];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_form\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Автоматическая замена</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%name% - <font color=000080>имя взятое из cookies</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%mail% - <font color=000080>e-mail взятый из cookies</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%city% - <font color=000080>город взятый из cookies</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%homepage% - <font color=000080>домашняя страничка взятая из cookies</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%add_button% - <font color=000080>$add_b</font></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_form == "Изменить @ Применить")
{
$u_t_form = fopen("$dtemplates/form.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_form,$d_e_t);
}
if ($template == "center")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>МЕСТО ПОД ФОРМОЙ</font>\"</font></td></tr>\n";
$t_center = file("$dtemplates/center.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($c = 0 ; $c < count($t_center); $c++)
{
$t_center[$c] = str_replace('<',"<",$t_center[$c]);
$t_center[$c] = str_replace('>',">",$t_center[$c]);
echo $t_center[$c];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_center\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Автоматическая замена</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%line% - <font color=000080>навигация, |1|2|3| и т.д.</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%page% - <font color=000080>текущая страничка</font></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_center == "Изменить @ Применить")
{
$u_t_center = fopen("$dtemplates/center.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_center,$d_e_t);
}
if ($template == "message")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>ВНЕШНИЙ ВИД СООБЩЕНИЯ</font>\"</font></td></tr>\n";
$t_message = file("$dtemplates/message.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($m = 0 ; $m < count($t_message); $m++)
{
$t_message[$m] = str_replace('<',"<",$t_message[$m]);
$t_message[$m] = str_replace('>',">",$t_message[$m]);
echo $t_message[$m];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_message\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Автоматическая замена</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%name% - <font color=000080>имя пользователя</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%city% - <font color=000080>город пользователя</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%mail% - <font color=000080>e-mail пользователя</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%homepage% - <font color=000080>домашняя страничка пользователя</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%date% - <font color=000080>дата сообщения пользователя</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%message% - <font color=000080>сообщение пользователя</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%admin% - <font color=000080>имя админа ($yn)</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%answer% - <font color=000080>ответ админа</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%id% - <font color=000080>уникальный номер сообщения</font></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_message == "Изменить @ Применить")
{
$u_t_message = fopen("$dtemplates/message.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_message,$d_e_t);
}
if ($template == "bottom")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>МЕСТО ПОД СООБЩЕНИЯМИ</font>\"</font></td></tr>\n";
$t_bottom = file("$dtemplates/bottom.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($b = 0 ; $b < count($t_bottom); $b++)
{
$t_bottom[$b] = str_replace('<',"<",$t_bottom[$b]);
$t_bottom[$b] = str_replace('>',">",$t_bottom[$b]);
echo $t_bottom[$b];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_bottom\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Автоматическая замена</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%line% - <font color=000080>навигация, |1|2|3| и т.д.</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%page% - <font color=000080>текущая страничка</font></td></tr>\n";
echo "<tr><td bgcolor=#face7d><font face=verdana size=2 color=000000>%all_messages% - <font color=000080>всего сообщений</font></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_bottom == "Изменить @ Применить")
{
$u_t_bottom = fopen("$dtemplates/bottom.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_bottom,$d_e_t);
}
if ($template == "end")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>САМЫЙ НИЗ КНИГИ</font>\"</font></td></tr>\n";
$t_end = file("$dtemplates/end.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($e = 0 ; $e < count($t_end); $e++)
{
$t_end[$e] = str_replace('<',"<",$t_end[$e]);
$t_end[$e] = str_replace('>',">",$t_end[$e]);
echo $t_end[$e];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_end\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_end == "Изменить @ Применить")
{
$u_t_end = fopen("$dtemplates/end.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_end,$d_e_t);
}
if ($template == "okey")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>УСПЕШНОЕ ДОБАВЛЕНИЕ</font>\"</font></td></tr>\n";
$t_end = file("$dtemplates/okey.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($e = 0 ; $e < count($t_end); $e++)
{
$t_end[$e] = str_replace('<',"<",$t_end[$e]);
$t_end[$e] = str_replace('>',">",$t_end[$e]);
echo $t_end[$e];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_okey\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_okey == "Изменить @ Применить")
{
$u_t_okey = fopen("$dtemplates/okey.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_okey,$d_e_t);
}
if ($template == "empty")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>ПУСТАЯ ГОСТЕВАЯ КНИГА</font>\"</font></td></tr>\n";
$t_end = file("$dtemplates/empty.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($e = 0 ; $e < count($t_end); $e++)
{
$t_end[$e] = str_replace('<',"<",$t_end[$e]);
$t_end[$e] = str_replace('>',">",$t_end[$e]);
echo $t_end[$e];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_empty\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_empty == "Изменить @ Применить")
{
$u_t_empty = fopen("$dtemplates/empty.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_empty,$d_e_t);
}
if ($template == "c")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>\n";
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=maroon>Шаблон \"<font color=de0000>ГОСТЕВАЯ КНИГА ЗАКРЫТА!</font>\"</font></td></tr>\n";
$t_end = file("$dtemplates/c.htm");
echo "<form action=\"admin.php\" method=\"post\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=design>\n<tr><td bgcolor=#face7d align=center>";
echo "<textarea name=\"d_e_t\" cols=59 rows=15>";
for($e = 0 ; $e < count($t_end); $e++)
{
$t_end[$e] = str_replace('<',"<",$t_end[$e]);
$t_end[$e] = str_replace('>',">",$t_end[$e]);
echo $t_end[$e];
}
echo "\n</textarea></font></td></tr>";
echo "<tr><td bgcolor=#face7d align=center><input type=\"submit\" name=\"design_c\" value=\"Изменить @ Применить\"></td></tr>\n";
echo "</table>\n</form>";
}
if ($design_c == "Изменить @ Применить")
{
$u_t_c = fopen("$dtemplates/c.htm","w");
$d_e_t = ereg_replace("\\\'","'",$d_e_t);
$d_e_t = ereg_replace('\\\"','"',$d_e_t);
$d_e_t = str_replace('<',"<",$d_e_t);
$d_e_t = str_replace('>',">",$d_e_t);
fputs ($u_t_c,$d_e_t);
}
if ($menu == "autochange")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080><tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=2 color=000080>Автозамена слов...</font></td></tr>";
echo "<form action=\"admin.php\" method=\"get\"><input type=hidden name=p value=\"$p\"><input type=hidden name=menu value=\"autochange\"><tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=1 color=de0000>Используйте, только латиницу, цифры и русские буквы!</td></tr><tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=2 color=maroon>Новая автозамена</td></tr><tr><td bgcolor=#face7d align=center width=50%><font face=verdana size=2 color=green>С..</font></td><td bgcolor=#face7d align=center><font face=verdana size=2 color=green>на...</font></td></tr><tr><td bgcolor=#face7d align=center><input type=text name=from value=\"\" size=30></td><td bgcolor=#face7d align=center><input type=text name=into value=\"\" size=30></td></tr>";
echo "<tr><td bgcolor=#face7d align=right colspan=2><input type=submit name=auto value=добавить></td></tr></form>";
$autochange1 = file($autochange);
$autochange2 = count($autochange1);
for ( $au = $autochange2 - 1; $au > - 1; $au--)
{
$noaut = $au;
$noaut++;
list($from1,$into1) = explode("::","$autochange1[$au]");
echo "<form action=\"admin.php?p=$p&menu=autochange\" method=\"get\"><input type=hidden name=p value=\"$p\"><input type=hidden name=an value=\"$au\"><input type=hidden name=menu value=\"autochange\"><tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=2 color=de0000>Автозамена номер #$noaut</td></tr><tr><td bgcolor=#face7d align=center width=50%><font face=verdana size=2 color=green>С</font></td><td bgcolor=#face7d align=center><font face=verdana size=2 color=green>на...</font></td></tr><tr><td bgcolor=#face7d align=center><input type=text name=from value=\"$from1\" size=30></td><td bgcolor=#face7d align=center><input type=text name=into value=\"$into1\" size=30></td></tr>";
echo "<tr><td bgcolor=#face7d align=right colspan=2><input type=submit name=auto value=изменить> <input type=submit name=auto value=удалить></td></tr></form>";
}
if ($autochange2 == "0")
{
echo "<tr><td bgcolor=#face7d align=center colspan=2><font face=verdana size=2 color=de0000>Лист автозамены пуст!</font></td></tr>";
}
}
if ($menu == "logs")
{
echo "<table width=500 border=0 cellspacing=1 cellpadding=1 bgcolor=000080>";
$log_admin = file("$dlogs/admin.log");
if(count($log_admin) < "1")
{
echo "<tr><td bgcolor=#face7d align=center><font face=verdana size=2 color=de0000>Лог файл пуст!</font></td></td></tr>";
}
if(count($log_admin) == "1" or count($log_admin) > "1")
{
echo "<tr><td bgcolor=#face7d align=center colspan=4><font color=de0000 face=verdana size=2>Лог на панельку входа админа</td></tr>";
echo "<tr><td bgcolor=#face7d align=center><font color=de0000 face=verdana size=2>IP адрес</td><td bgcolor=#face7d align=center><font color=green face=verdana size=2>Хост</td><td bgcolor=#face7d align=center><font color=red face=verdana size=2>Дата</td><td bgcolor=#face7d align=center><font color=000000 face=verdana size=2>Введённый пароль</td></tr>";
}
for ($la = count($log_admin) - 1; $la > - 1; $la--)
{
list($log_ip,$log_host,$log_date,$log_password)=explode("<>", $log_admin[$la]);
echo "<tr><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>$log_ip</td><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>$log_host</td><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>$log_date</td><td bgcolor=#face7d align=center><font color=000080 face=verdana size=2>$log_password</td></tr>";
}
if(count($log_admin) == "1" or count($log_admin) > "1")
{
$coal2 = file("$dlogs/admin.log");
$coal = count($coal2);
echo "<form action=admin.php method=get><input type=hidden name=menu value=logs><input type=hidden name=p value=\"$p\"><tr><td bgcolor=#face7d align=center colspan=4><input type=submit name=logs value=\"Очистить лог файл\"></td></tr>\n<tr><td bgcolor=#face7d align=center colspan=4><font color=000080 face=verdana size=2>Попыток входа не админом: <font color=de0000>$coal</font></font></td></tr></form>";
}
echo "</table>";
}
?>
</center>
</body>
</html>
<?
}
if ($QUERY_STRING == "" and $p == "")
{
form();
}
if ($QUERY_STRING != "" and $p != "$password")
{
if(empty($log_ip))
{
if (getenv('HTTP_X_FORWARDED_FOR'))
{
$ip=getenv('HTTP_X_FORWARDED_FOR');
}
else
{
$log_ip=getenv('REMOTE_ADDR');
}
}
$log_host=gethostbyaddr("$log_ip");
$log_date=date('d\.m\.Y, H:i:s');
$log_file = fopen("$dlogs/admin.log","a+");
$p = eregi_replace("<","<","$p");
$p = eregi_replace(">",">","$p");
if($p == "")
{
$p = "не вводил";
}
fputs ($log_file,"$log_ip<>$log_host<>$log_date<>$p\n");
fclose ($log_file);
form();
}
?>