<?php
# Subroutine: adm_config_form.php called by Admin.php
# Xinfeng Chen, 2002.11.19

require_once('bin/config.php');
require_once('admin/adm.inc');

#--- Validate dministrator ---
include('admin/adm_validate.php');
if(!$adm_validated){jumpTo('admin.php?cmd=logon'); exit;}

#--- Generate CSS file list ---
$cssOption='';
$dir=opendir('./style');
while ($file=readdir($dir)){
 if(substr($file,-4)=='.css'){
  $selected=($cssfile==$file)?'selected':'';
  $cssOption.="<option value='$file' $selected>$file</option>";
 }
}
closedir($dir);

#--- Print config form ---
page_header();

print <<<EOT
<h1>论坛参数设置</h1>
<p>设置论坛系统参数。</p>
<form action=admin.php method=post>
<input type=hidden name=cmd value="config_submit">
<table class="forumline" align="center" width="90%">
<tr>
 <th colspan="2" class="thHead">管理员信息</th>
</tr>
<tr>
 <td width=40% class="row2">管理员EMAIL：</td>
 <td class="row1"> 
  <INPUT size=30 name=f_admmail value="$admmail">
 </td>
</tr>
<tr> 
 <td width=40% class="row2">论坛系统名称：</td>
 <td class="row1"> 
  <INPUT size=30 name=f_commname value="$commname">
 </td>
</tr>
<tr> 
 <td width=40% class="row2">主页名称：</td>
 <td class="row1"> 
  <INPUT size=30 name=f_hpname value="$hpname">
 </td>
</tr>
<tr> 
 <td width=40% class="row2">主页地址：</td>
 <td class="row1"> 
  <INPUT size=30 name=f_hpurl value="$hpurl">
 </td>
</tr>
<tr> 
 <th colspan="2" class="thHead">色彩方案</th>
</tr>
<tr> 
 <td width=40% class="row2">CSS 文件：</td>
 <td class="row1">
  <SELECT name=f_cssfile>$cssOption</SELECT>
 </td>
</tr>
<tr> 
 <th colspan="2" class="thHead">系统配置信息</th>
</tr>
EOT;

$check1=($publicpost)?'checked':'';
$check0=($check1=='checked')?'':'checked';
print <<<EOT
<tr> 
 <td width=40% class="row2">是否允许访客发表文章：</td>
 <td class="row1"> 
  <input type=radio name=f_publicpost value=1 $check1>是
  <input type=radio name=f_publicpost value=0 $check0>否
 </td>
</tr>
EOT;

$check1=($autoappend)?'checked':'';
$check0=($check1=='checked')?'':'checked';
print <<<EOT
<tr> 
 <td width=40% class="row2">申请后的论坛自动添加到列表：</td>
 <td class="row1"> 
  <input type=radio name=f_autoappend value=1 $check1>是
  <input type=radio name=f_autoappend value=0 $check0>否
 </td>
</tr>
EOT;

$check1=($pubregbrd)?'checked':'';
$check0=($check1=='checked')?'':'checked';
print <<<EOT
<tr> 
 <td width=40% class="row2">是否开放论坛申请：</td>
 <td class="row1"> 
  <input type=radio name=f_pubregbrd value=1 $check1>开放
  <input type=radio name=f_pubregbrd value=0 $check0>关闭
 </td>
</tr>
EOT;

$check1=($pubregusr)?'checked':'';
$check0=($check1=='checked')?'':'checked';
print <<<EOT
<tr> 
 <td width=40% class="row2">是否开放注册用户名：</td>
 <td class="row1"> 
  <input type=radio name=f_pubregusr value=1 $check1>开放
  <input type=radio name=f_pubregusr value=0 $check0>关闭
 </td>
</tr>
EOT;

$check1=($zcodeallowed)?'checked':'';
$check0=($check1=='checked')?'':'checked';
print <<<EOT
<tr> 
 <td width=40% class="row2">是否开放ZBB代码：</td>
 <td class="row1"> 
  <input type=radio name=f_zcodeallowed value=1 $check1>开放
  <input type=radio name=f_zcodeallowed value=0 $check0>关闭
 </td>
</tr>
EOT;

$check1=($publicview)?'checked':'';
$check0=($check1=='checked')?'':'checked';
print <<<EOT
<tr> 
 <td width=40% class="row2">是否允许访客浏览论坛：</td>
 <td class="row1"> 
  <input type=radio name=f_publicview value=1 $check1>允许
  <input type=radio name=f_publicview value=0 $check0>禁止
 </td>
</tr>
EOT;

print <<<EOT
<tr> 
 <td width=40% class="row2">设定论坛每页显示的主题数：</td>
 <td class="row1"> 
  <input name=f_perpage size=8 value=$perpage>
  (默认：20条)</td>
</tr>
<tr> 
 <td width=40% class="row2">Server时区调整，小时：</td>
 <td class="row1"> 
  <input name=f_time_hour size=8 value=$time_hour>
  (默认：0)</td>
</tr>
<tr> 
 <td width=40% class="row2">统计几秒内的在线人数：</td>
 <td class="row1"> 
  <input name=f_interval size=8 value=$interval>
  (默认：300秒)</td>
</tr>
<tr> 
 <td width=40% class="row2">帖子内容大小限制：</td>
 <td class="row1"> 
  <INPUT size=8 name=f_maxpostsize value=$maxpostsize>
  字节内</td>
</tr>
<tr> 
 <td width=40% class="row2">附件大小限制：</td>
 <td class="row1"> 
  <INPUT size=8 name=f_maxannexsize value=$maxannexsize>
  字节内</td>
</tr>
<tr> 
 <td width=40% class="row2">发送邮件服务器(SMTP)：</td>
 <td class="row1"> 
  <INPUT size=31 name=f_smtp value=$smtp>
 </td>
</tr>
<tr> 
 <td colspan="2" class="catBottom"> 
  <div align="center"> 
   <input type=submit value='提 交' name="submit">
  </div>
 </td>
</tr>
</table>
</FORM>
EOT;

page_footer();

?>