<?php
include("qs.php");
require( '../data/config.php');
$conn=mysql_connect($db_host,$db_user,$db_pass);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);
if (PHP_VERSION >= '5.1' && !empty($timezone))
{
    date_default_timezone_set($timezone);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META http-equiv="Pragma" content="no-cache" />
<LINK href="css/general.css" rel="stylesheet" type="text/css" />
<LINK href="css/main.css" rel="stylesheet" type="text/css" />
</HEAD><BODY>
<div class="h2">系统管理 >> 用户交流设置</div>
<div class="list-div">
<?php
$action=_post('action');
if($action=="edit")
   {
   $jlsz=$_POST[jlsz];
   $art_sh=$_POST[art_sh];
   $sql="select * from tm_user_setup where id=1";
   $rsql=mysql_query($sql);
   $rs=mysql_fetch_object($rsql);
   if($rs)
   mysql_query("update tm_user_setup set jlsz='$jlsz',art_sh='$art_sh' where id=1");
   else
   mysql_query("insert tm_user_setup(jlsz,art_sh) values('$jlsz','$art_sh')");
   echo "<script>alert('信息修改成功！');</script>";
   }
$sql="select * from tm_user_setup where id=1";
$rsql=mysql_query($sql);
$rs=mysql_fetch_object($rsql);
$retsh=$rs->retsh;
?>
<table cellspacing='1' cellpadding='3'>
<tr>
  <th align='left'><table width="100" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><div align="left">&nbsp;&nbsp; 用户交流设置</div></td>
        <td width="150">&nbsp;</td>
      </tr>
    </table></th>
</tr>
<tr><td align="left" valign="top" style="background:#F5F5F5;padding-bottom:8px;">
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 
            CALLPADDING="0">
<form id="form1" name="form1" method="post" action="user_setup.php">
	<TR BORDER="0" WIDTH="100%">
			    <TD width="100%" height=30 
                align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px">是否关闭：
			      <input type="radio" name="jlsz" value="0" <?php if($jlsz==0) echo 'checked="checked"';?> />
		        是	        
		        <input type="radio" name="jlsz" value="1" <?php if($jlsz==1) echo 'checked="checked"';?> />
		        否
		        <span class="post_date">(关闭后，评论功能在博客中不可用！) </span></TD>
    </TR>
	<TR BORDER="0" WIDTH="100%">
			    <TD width="100%" height=30 
                align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px">文章审核：
			      <input type="radio" name="art_sh" value="0" <?php if($art_sh==0) echo 'checked="checked"';?> />
		        是	        
		        <input type="radio" name="art_sh" value="1" <?php if($art_sh==1) echo 'checked="checked"';?> />
		        否
		        <span class="post_date">(关闭后，评论功能在博客中不可用！) </span></TD>
    </TR>
			  <TR BORDER="0" WIDTH="100%">
			    <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left height=30><span class="help">
			      <input type="image" src="images/submit.gif" align="absmiddle" border="0" name="submit" />
			      <input name="action" type="hidden" id="action" value="edit" />
			    </span></TD>
    </TR>
</form>
</TABLE>
</td>
</tr></table></div>

<?php include "boot.php";?>
</body></html>