<%@ page contentType="text/html;charset=UTF-8" errorPage="../error.jsp"%>
<%@ page import="com.hongshee.ejforum.util.PageUtils"%>
<%@ page import="com.hongshee.ejforum.data.UserDAO.UserInfo"%>
<%@ page import="com.hongshee.ejforum.common.ForumSetting"%>
<%
	UserInfo userinfo = PageUtils.getAdminUser(request, response);
	if (userinfo == null) return;
	ForumSetting setting = ForumSetting.getInstance();
	String[] mailEvents = setting.getHTMLStr(ForumSetting.FUNCTIONS,"mailEvents").split(",");
	StringBuilder judgeOptions = new StringBuilder();
	judgeOptions.append("垃圾广告\n").append("恶意灌水\n").append("违规内容\n").append("文不对题\n").append("重复发帖\n\n")
				.append("我很赞同\n").append("精品文章\n").append("原创内容");
%>
<!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">
<LINK href="../style/admin.css" type=text/css rel=stylesheet>
<SCRIPT src="../../js/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="../js/admin.js" type=text/javascript></SCRIPT>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD><A onclick="parent.location='../index.htm'; return false;" 
		  		href="#">后台管理首页</A>&nbsp;&raquo;&nbsp;论坛功能</TD></TR></TBODY></TABLE><BR>
      <FORM id=settings name=settings onSubmit="checkfields(this); return false;" action="../perform.jsp" method=post>
	  <INPUT type=hidden name="act" value="basic_functions">
	  <A name=tb05></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>帖子相关设置<A onClick="collapse_change('tb05','../images')" href="#">
			<IMG id=menuimg_tb05 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
            src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb05>
        <TR>
          <TD class=altbg1 width="45%"><B>帖子最大字数(K 字节):</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_1") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=10 name="maxPostLength"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>帖内最大附件数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_2") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=2 name="maxAttachNum"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>允许附件类型:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_3") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value="chm, pdf, zip, rar, tar, gz, jar, gif, jpg, jpeg, png" 
				            name="allowAttachTypes"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>最大附件总尺寸(K 字节):</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_4") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=100 name="maxAttachSize"></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>允许的最大回帖数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_5") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=2000 name="maxReplies"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>启用快速回复功能</B><BR><SPAN 
		  class=smalltxt><%= PageUtils.getString("functions_6") %></SPAN></TD>
          <TD class=altbg2>		  
			<INPUT class=radio type=radio value="yes" name="fastReply" id="fastReply[yes]" checked> 是 &nbsp;
			<INPUT class=radio type=radio value="no" name="fastReply" id="fastReply[no]"> 否 
			</TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>启用带格式复制功能</B><BR><SPAN 
		  class=smalltxt><%= PageUtils.getString("functions_7") %></SPAN></TD>
          <TD class=altbg2>		  
			<INPUT class=radio type=radio value="yes" name="copyFormat" id="copyFormat[yes]"> 是 &nbsp;
			<INPUT class=radio type=radio value="no" name="copyFormat" id="copyFormat[no]" checked> 否 
			</TD></TR>
	</TBODY></TABLE><BR>			  
	  <A name=tb04></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>页面与广告设置<A onClick="collapse_change('tb04','../images')" href="#">
			<IMG id=menuimg_tb04 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
            src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb04>
        <TR>
          <TD class=altbg1 width="45%" valign="top"><B>页首广告代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_8") %></SPAN></TD>
          <TD class=altbg2>
		    <IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('headAdCode', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('headAdCode', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id="headAdCode" name="headAdCode" rows=6 cols=50 
				 style="width:278px"><%= setting.getString(ForumSetting.FUNCTIONS,"headAdCode").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;") %></TEXTAREA></TD></TR>
        <TR>
          <TD class=altbg1 width="45%" valign="top"><B>页脚广告代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_9") %></SPAN></TD>
          <TD class=altbg2>
		    <IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('footAdCode', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('footAdCode', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id="footAdCode" name="footAdCode" rows=6 cols=50 
				 style="width:278px"><%= setting.getString(ForumSetting.FUNCTIONS,"footAdCode").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;") %></TEXTAREA> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%" valign="top"><B>主题尾部广告代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_10") %></SPAN></TD>
          <TD class=altbg2>
		    <IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('topicAdCode', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('topicAdCode', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id="topicAdCode" name="topicAdCode" rows=6 cols=50 
				 style="width:278px"><%= setting.getString(ForumSetting.FUNCTIONS,"topicAdCode").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;") %></TEXTAREA> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%" valign="top"><B>主题底部广告代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_101") %></SPAN></TD>
          <TD class=altbg2>
	    <IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('topicbarCode', 1)" src="../images/zoomin.gif"> 
		<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('topicbarCode', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id="topicbarCode" name="topicbarCode" rows=6 cols=50 
				 style="width:278px"><%= setting.getString(ForumSetting.FUNCTIONS,"topicbarCode").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;") %></TEXTAREA> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%" valign="top"><B>页顶信息代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_11") %></SPAN></TD>
          <TD class=altbg2>
		    <IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('topCode', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('topCode', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id="topCode" name="topCode" rows=6 cols=50 
				 style="width:278px"><%= setting.getString(ForumSetting.FUNCTIONS,"topCode").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;") %></TEXTAREA> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%" valign="top"><B>左下脚信息代码:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_12") %></SPAN></TD>
          <TD class=altbg2>
		    <IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('footRemark', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('footRemark', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id="footRemark" name="footRemark" rows=6 cols=50 
				 style="width:278px"><%= setting.getString(ForumSetting.FUNCTIONS,"footRemark").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;") %></TEXTAREA> </TD></TR>
	</TBODY></TABLE><BR>			  
	<A name=tb01></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>管理相关设置<A onClick="collapse_change('tb01','../images')" href="#">
			<IMG id=menuimg_tb01 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
            src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb01>
        <TR>
          <TD class=altbg1 vAlign=top width="45%"><B>管理操作理由选项:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_13") %></SPAN></TD>
          <TD class=altbg2>
		  	<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('judgeOptions', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('judgeOptions', 0)" src="../images/zoomout.gif">
			<BR><TEXTAREA id="judgeOptions" name="judgeOptions" rows=6 cols=50 style="width:278px"></TEXTAREA></TD></TR>
        <TR>
          <TD class=altbg1 
            width="45%"><B>管理记录保留时间(月):</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_14") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=3 name="logKeepMonths"> </TD></TR>
        <TR>
          <TD class=altbg1 
            width="45%"><B>帖子回收站记录保留时间(月):</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_15") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=3 name="trashKeepMonths"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>是否发送及时邮件通知:</B><BR>
			<SPAN class=smalltxt><%= PageUtils.getString("functions_16") %></SPAN></TD>
          <TD class=altbg2>		  
			<INPUT class=checkbox type=checkbox value="error" name="[chk]mailEvents" id="mailEvents[error]"> 系统错误 <br/>
			<INPUT class=checkbox type=checkbox value="audit" name="[chk]mailEvents" id="mailEvents[audit]"> 新用户审核申请 <br/>
			<INPUT class=checkbox type=checkbox value="report" name="[chk]mailEvents" id="mailEvents[report]"> 收到举报信息 <br/>
			<INPUT class=checkbox type=checkbox value="version" name="[chk]mailEvents" id="mailEvents[version]"> 本系统的升级信息 
			<INPUT type=hidden value="" name="[chk]mailEvents" id="mailEvents[]">
			</TD></TR>
		</TBODY></TABLE><BR>
		<A name=tb02></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>RSS 设置<A onClick="collapse_change('tb02','../images')" href="#">
		    <IMG id=menuimg_tb02 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
	             src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb02>
        <TR>
          <TD class=altbg1 width="45%"><B>默认的&nbsp;RSS&nbsp;输出样式:</B><BR><SPAN 
		  class=smalltxt><%= PageUtils.getString("functions_17") %></SPAN></TD>
          <TD class=altbg2>		  
			<INPUT class=radio type=radio value="A" name="RssStyle" id="RssStyle[A]" checked> 全文式 <br/>
			<INPUT class=radio type=radio value="B" name="RssStyle" id="RssStyle[B]"> 标题式 
			</TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>RSS 输出主题数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_18") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=15 name="topicsPerChannel"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>显示&nbsp;RSS&nbsp;订阅按钮:</B><BR><SPAN 
		  class=smalltxt><%= PageUtils.getString("functions_19") %></SPAN></TD>
          <TD class=altbg2>		  
			<INPUT class=radio type=radio value="yes" name="RssSub" id="RssSub[yes]" checked> 是 &nbsp;
			<INPUT class=radio type=radio value="no" name="RssSub" id="RssSub[no]"> 否 
			</TD></TR>
		</TBODY></TABLE><BR>
		<A name=tb06></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>主菜单扩展<A onClick="collapse_change('tb06','../images')" href="#">
		    <IMG id=menuimg_tb06 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
	             src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb06>
        <TR>
          <TD class=altbg1 width="45%"><B>扩展菜单1:</B><BR><SPAN 
		  class=smalltxt><%= PageUtils.getString("functions_20") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value="<%= setting.getString(ForumSetting.FUNCTIONS,"menuEx1").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace("\"","&quot;") %>" name="menuEx1"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>扩展菜单2:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("functions_21") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value="<%= setting.getString(ForumSetting.FUNCTIONS,"menuEx2").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace("\"","&quot;") %>" name="menuEx2"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>扩展菜单3:</B><BR><SPAN 
		  class=smalltxt><%= PageUtils.getString("functions_22") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value="<%= setting.getString(ForumSetting.FUNCTIONS,"menuEx3").replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace("\"","&quot;") %>" name="menuEx3"> </TD></TR>
		</TBODY></TABLE><BR>
      <CENTER><INPUT class=button type=submit value="提 交"></CENTER></FORM>
	  </TD></TR></TBODY></TABLE><BR><BR>
<script language="javascript">
function checkfields(theform) {
    var filter = /^\d+$/;
    if (!filter.test(trim(theform.logKeepMonths.value))) {
    	alert('管理记录保留时间必须为整数');
      	theform.logKeepMonths.focus();
		return;
    }
    if (!filter.test(trim(theform.trashKeepMonths.value))) {
    	alert('回收站记录保留时间必须为整数');
      	theform.trashKeepMonths.focus();
		return;
    }
    if (!filter.test(trim(theform.maxPostLength.value))) {
    	alert('帖子最大字数必须为整数');
      	theform.maxPostLength.focus();
		return;
    }
    if (!filter.test(trim(theform.maxReplies.value))) {
    	alert('允许的最大回帖数必须为整数');
      	theform.maxReplies.focus();
		return;
    }
    if (!filter.test(trim(theform.maxAttachNum.value))) {
    	alert('帖内最大附件数必须为整数');
      	theform.maxAttachNum.focus();
		return;
    }
    if (!filter.test(trim(theform.maxAttachSize.value))) {
    	alert('最大附件尺寸必须为整数');
      	theform.maxAttachSize.focus();
		return;
    }
	theform.submit();
}
$('settings').maxPostLength.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"maxPostLength") %>";
$('settings').maxAttachNum.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"maxAttachNum") %>";
$('settings').allowAttachTypes.value = 
	"<%= setting.getHTMLStr(ForumSetting.FUNCTIONS,"allowAttachTypes") %>";
$('settings').maxAttachSize.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"maxAttachSize") %>";
$('settings').maxReplies.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"maxReplies") %>";
$('settings').logKeepMonths.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"logKeepMonths") %>";
$('settings').trashKeepMonths.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"trashKeepMonths") %>";
$('settings').judgeOptions.value = "<%= setting.getHTMLStr(ForumSetting.FUNCTIONS,"judgeOptions",judgeOptions.toString()) %>";
<%
	for (int i=0; i<mailEvents.length; i++)
	{
		if (mailEvents[i] != null && mailEvents[i].trim().length() > 0)
		{
%>
$('mailEvents[<%= mailEvents[i] %>]').checked = true;
<%
		}
	}
%>
$('RssStyle[<%= setting.getHTMLStr(ForumSetting.FUNCTIONS,"RssStyle") %>]').checked = true;
$('settings').topicsPerChannel.value = "<%= setting.getInt(ForumSetting.FUNCTIONS,"topicsPerChannel") %>";
$('RssSub[<%= setting.getString(ForumSetting.FUNCTIONS,"RssSub","yes") %>]').checked = true;
$('fastReply[<%= setting.getString(ForumSetting.FUNCTIONS,"fastReply","yes") %>]').checked = true;
$('copyFormat[<%= setting.getString(ForumSetting.FUNCTIONS,"copyFormat","no") %>]').checked = true;
</script>
<%= PageUtils.getAdminFooter(request) %>
</BODY></HTML>
