View file troforum_v0.1/admin/update.php

File size: 4.19Kb
<?
include("config.inc.php");

if ($update == "")
 {
?>
<table border=0 borderColor=white cellPadding=1 cellSpacing=1 width=75%>
<tr><td width=100% align=center bgColor="blue"><b><font color="#FFFFFF">Изменение параметров</font></b></td></tr><tr><td align=center>
<?
echo "<table border=0 cellspacing=1 cellpadding=1 width=100% align=center>
<form action='update.php' method=post>
<tr><td align=center colspan=2>&nbsp;</td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Адрес форума:</font></td><td  align=center width=50%><input type=text name=site_url_ value=\"$site_url\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Пароль админа:</font></td><td  align=center width=50%><input type=text name=admin_password_ value=\"$admin_password\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Мэйл админа:</font></td><td  align=center width=50%><input type=text name=admin_mail_ value=\"$admin_mail\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Мэйл бота:</font></td><td  align=center width=50%><input type=text name=root_mail_ value=\"$root_mail\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Логин:</font></td><td  align=center width=50%><input type=text name=main_blank_ value=\"$main_blank\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>CHMOD:</font></td><td  align=center width=50%><input type=text name=start_page_ value=\"$start_page\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Описание форума:</font></td><td  align=center width=50%><input type=text name=descr_ value=\"$descr\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Название форума:</font></td><td  align=center width=50%><input type=text name=title_ value=\"$title\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Имя автора:</font></td><td  align=center width=50%><input type=text name=author_ value=\"$author\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Создатель:</font></td><td  align=center width=50%><input type=text name=generator_ value=\"$generator\" size=33></td></tr>
<tr><td align=center width=50%><font face=verdana size=2 color=red>Ключевые слова:</font></td><td  align=center width=50%><input type=text name=keywords_ value=\"$keywords\" size=33></td></tr>
<tr><td align=center colspan=2>&nbsp;</td></tr>
<tr><td align=center colspan=2><input type=submit name=action value=\"Обновить @ Применить\"></td></tr></table>
</td></tr></table>";
}

if ($action == "Обновить @ Применить")
 {
  $a_update_config  = "<?\n";
  $a_update_config .= "\$site_url = \"$site_url_\";\n";
  $a_update_config .= "\$admin_password = \"$admin_password_\";\n";
  $a_update_config .= "\$admin_mail = \"$admin_mail_\";\n";
  $a_update_config .= "\$root_mail = \"$root_mail_\";\n";
  $a_update_config .= "\$main_blank = \"$main_blank_\";\n";
  $a_update_config .= "\$start_page = \"$start_page_\";\n";
  $a_update_config .= "\$descr = \"$descr_\";\n";
  $a_update_config .= "\$title = \"$title_\";\n";
  $a_update_config .= "\$author = \"$author_\";\n";
  $a_update_config .= "\$generator = \"$generator_\";\n";
  $a_update_config .= "\$keywords = \"$keywords_\";\n";
  $a_update_config .= "?>";

  $u_update_config = fopen("config.inc.php","w+");
  $a_update_config = ereg_replace("\\\'","&quot;",$a_update_config);
  $a_update_config = ereg_replace('\\\"','&quot;',$a_update_config);
  $a_update_config = str_replace('&lt;',"<",$a_update_config);
  $a_update_config = str_replace('&gt;',">",$a_update_config);
  fputs ($u_update_config,$a_update_config);
  $update = "okey";
 }

if ($update == "okey")
 {
echo "<table border=0 align=center><tr><td></td></tr></table>
<table border=0 cellspacing=1 cellpadding=1 width=100%  align=center>
<tr><td  align=center><font face=verdana size=2 color=de0000>Параметры сайта успешно обновленны</font></td></tr>
<tr><td  align=center><font face=verdana size=2 color=red>перезайдите в меню администрирования</font></td></tr>
</table>";
}
?>