<%@ 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"%>
<%@ page import="com.hongshee.ejforum.data.OptionVO"%>
<%
	UserInfo userinfo = PageUtils.getAdminUser(request, response);
	if (userinfo == null) return;
	ForumSetting setting = ForumSetting.getInstance();
	String[] showHotlinks = setting.getHTMLStr(ForumSetting.DISPLAY,"showHotlinks").split(",");
	String[] showStatlinks = setting.getHTMLStr(ForumSetting.DISPLAY,"showStatlinks").split(",");
	OptionVO[] styles = setting.getStyles();
%>
<!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 onload="clickImageLinks()">
<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_display">
      <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 width="45%"><B>默认界面风格:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_1") %></SPAN></TD>
          <TD class=altbg2>
		  	<SELECT name="defaultStyle"> 
<%
	for (int i=0; i<styles.length; i++)
	{
		if (styles[i].name.startsWith("1_"))
		{
%>			
			  <OPTION value="<%= styles[i].name.substring(2) %>"><%= styles[i].value %></OPTION>
<%
		}
	}
%>			
			</SELECT></TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>显示风格下拉菜单:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_2") %></SPAN></TD>
          <TD class=altbg2>
		  	<INPUT class=radio type=radio checked value="yes" name="showStyleList" id="showStyleList[yes]"> 是 &nbsp; &nbsp; 
			<INPUT class=radio type=radio value="no" name="showStyleList" id="showStyleList[no]"> 否 </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>显示图片搜索菜单:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_2a") %></SPAN></TD>
          <TD class=altbg2>
		  	<INPUT class=radio type=radio checked value="yes" name="showSearchImage" id="showSearchImage[yes]"> 是 &nbsp; &nbsp; 
			<INPUT class=radio type=radio value="no" name="showSearchImage" id="showSearchImage[no]"> 否 </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>显示分区路径:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_3") %></SPAN></TD>
          <TD class=altbg2>
		  	<INPUT class=radio type=radio checked value="yes" name="showSectionLink" id="showSectionLink[yes]"> 是 &nbsp; &nbsp; 
			<INPUT class=radio type=radio value="no" name="showSectionLink" id="showSectionLink[no]"> 否 </TD></TR>
		 <TR>
		 	<TD width="45%" class="altbg1" ><b>是否开启简繁转换</b><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_4") %></SPAN></TD>
			<TD class="altbg2">
			<input class="radio" type="radio" name="tsExchange" id="tsExchange[none]" value="none" checked> 关闭<br/>
			<input class="radio" type="radio" name="tsExchange" id="tsExchange[chs]" value="chs"> 开启&nbsp;-&nbsp;默认简体<br/>
			<input class="radio" type="radio" name="tsExchange" id="tsExchange[cht]" value="cht"> 开启&nbsp;-&nbsp;默认繁体<br/>
			</TD></TR>			
        <TR>
          <TD class=altbg1 width="45%"><B>版块跳转方式:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_5") %></SPAN></TD>
          <TD class=altbg2>
		  	<INPUT class=radio type=radio checked value="all" name="jumpMode" id="jumpMode[all]"> 全部版块 &nbsp;
			<INPUT class=radio type=radio value="section" name="jumpMode" id="jumpMode[section]"> 仅限于分区 </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>首页设置<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 width="45%" class="altbg1" ><b>显示论坛简介:</b><br/>
				<span class="smalltxt"><%= PageUtils.getString("display_6") %></span></TD>
			<TD class="altbg2">
		<input class="radio" type="radio" name="showBoardBrief" id="showBoardBrief[yes]" value="yes" checked> 是 &nbsp; &nbsp; 
		<input class="radio" type="radio" name="showBoardBrief" id="showBoardBrief[no]" value="no"> 否</TD></TR>
		<TR>
			<TD width="45%" class="altbg1" ><b>显示论坛联盟:</b><br/>
				<span class="smalltxt"><%= PageUtils.getString("display_7") %></span></TD>
			<TD class="altbg2">
			<input class="radio" type="radio" name="showUnion" id="showUnion[yes]" value="yes" checked> 是 &nbsp; &nbsp; 
			<input class="radio" type="radio" name="showUnion" id="showUnion[no]" value="no"> 否</TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>显示在线用户数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_8") %></SPAN></TD>
          <TD class=altbg2>
	  	<INPUT class=radio type=radio value="yes" name="showOnlineUsers" id="showOnlineUsers[yes]" checked> 是 &nbsp; &nbsp; 
		<INPUT class=radio type=radio value="no" name="showOnlineUsers" id="showOnlineUsers[no]"> 否 </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>可显示的热门关键字数量:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_9") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=0 name="maxTagCount"> </TD></TR>
        <TR>
          <TD class=altbg1 vAlign=top width="45%"><B>指定热门关键字:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_10") %></SPAN></TD>
          <TD class=altbg2>
		  	<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('hotTags', 1)" src="../images/zoomin.gif"> 
			<IMG onmouseover="this.style.cursor='pointer'" onclick="zoomtextarea('hotTags', 0)" src="../images/zoomout.gif">
            <BR><TEXTAREA id=hotTags name=hotTags rows=6 cols=50 style="width:278px"></TEXTAREA></TD></TR>
		 <TR>
		 	<TD width="45%" class="altbg1" ><b>显示统计链接区</b><br/>
				<span class="smalltxt"><%= PageUtils.getString("display_11") %></span></TD>
			<TD class="altbg2">
		<input class="checkbox" type="checkbox" name="[chk]showStatlinks" value="M" id="showStatlinks[M]"> 会员总数 
		<input class="checkbox" type="checkbox" name="[chk]showStatlinks" value="I" id="showStatlinks[I]" checked> 图片主题数 
		<input class="checkbox" type="checkbox" name="[chk]showStatlinks" value="R" id="showStatlinks[R]"> 悬赏主题数 
		<input class="checkbox" type="checkbox" name="[chk]showStatlinks" value="S" id="showStatlinks[S]" checked> 订阅
		<input type="hidden" name="[chk]showStatlinks" value="" id="showStatlinks[]">
			</TD></TR>
		 <TR>
		 	<TD width="45%" class="altbg1"><b>显示主题推介区</b><br/>
				<span class="smalltxt"><%= PageUtils.getString("display_12") %></span></TD>
			<TD class="altbg2">
		<input class="checkbox" type="checkbox" name="[chk]showHotlinks" value="image" id="showHotlinks[image]" 
			   onclick="clickImageLinks()"> 最新图片
		<input class="checkbox" type="checkbox" name="[chk]showHotlinks" value="recent" id="showHotlinks[recent]"> 最新发表
		<input class="checkbox" type="checkbox" name="[chk]showHotlinks" value="digest" id="showHotlinks[digest]"> 最新精华 <br/>
		<input class="checkbox" type="checkbox" name="[chk]showHotlinks" value="cat" id="showHotlinks[cat]"> 热门分类 
		<input class="checkbox" type="checkbox" name="[chk]showHotlinks" value="hot" id="showHotlinks[hot]"> 最新热门主题 
		<input class="checkbox" type="checkbox" name="[chk]showHotlinks" value="rank" id="showHotlinks[rank]"> 最新人气主题 
		<input type="hidden" name="[chk]showHotlinks" value="" id="showHotlinks[]">
			</TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>主题推介区主题数:</B><BR><SPAN 
              class=smalltxt><%= PageUtils.getString("display_13") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=10 name="hotlinkRows"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>推介区主题所属分区:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_14") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value="" name="linksSID"> </TD></TR>
        <TBODY id=advanceoption style="DISPLAY: none">
        <TR>
          <TD class=altbg1 width="45%"><B>图片样式:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_15") %></SPAN></TD>
          <TD class=altbg2>
	  	<INPUT class=radio type=radio value="pic" name="imageMode" id="imageMode[pic]" checked> 单一图片 &nbsp; &nbsp; 
		<INPUT class=radio type=radio value="slide" name="imageMode" id="imageMode[slide]"> 图片幻灯片 </TD></TR>
		<TR>
			<TD width="45%" class="altbg1" ><b>最新图片:</b><br/>
			<span class="smalltxt"><%= PageUtils.getString("display_16") %></span></TD>
			<TD class="altbg2"><input type="text" size="50" name="imageFile" value="" ></TD></TR>
		<TR>
			<TD width="45%" class="altbg1" ><b>最新图片的目标链接:</b><br/>
			<span class="smalltxt"><%= PageUtils.getString("display_17") %></span></TD>
			<TD class="altbg2"><input type="text" size="50" name="imageLink" value="" ></TD></TR>
		<TR>
			<TD width="45%" class="altbg1" ><b>最新图片的文字说明:</b><br/>
			<span class="smalltxt"><%= PageUtils.getString("display_18") %></span></TD>
			<TD class="altbg2"><input type="text" size="50" name="imageTitle" value="" ></TD></TR>
		</TBODY></TABLE><BR>
		<A name=tb03></A>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=2>主题列表<A 
            onclick="collapse_change('tb03','../images')" href="#">
			<IMG id=menuimg_tb03 style="MARGIN-TOP: -12px; FLOAT: right; MARGIN-RIGHT: 8px" 
            src="../images/menu_reduce.gif" border=0></A> </TD></TR>
        <TBODY id=menu_tb03>
        <TR>
          <TD class=altbg1 width="45%"><B>每页显示主题数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_19") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=30 name="topicsPerPage"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>主题列表最大页数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_20") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=50 name="maxTopicPages"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>热门主题回复数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_21") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=10 name="hotTopicPosts"> 
          </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>人气主题查看数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_22") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=100 name="hotTopicVisits"> 
          </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>主题评价系数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_23") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=100 name="diggsVsVisits"> 
          </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%"><B>每页显示贴数:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_24") %></SPAN></TD>
          <TD class=altbg2><INPUT size=50 value=30 name="postsPerPage"> </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>是否显示作者头像:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_25") %></SPAN></TD>
          <TD class=altbg2>
		  <INPUT class=radio type=radio value=yes name="showAvatar" id="showAvatar[yes]" checked> 是 &nbsp; &nbsp; 
		  <INPUT class=radio type=radio value=no name="showAvatar" id="showAvatar[no]"> 否 </TD></TR>
        <TR>
          <TD class=altbg1 width="45%"><B>是否显示个性签名:</B><BR><SPAN 
            class=smalltxt><%= PageUtils.getString("display_26") %></SPAN></TD>
          <TD class=altbg2>
		  <INPUT class=radio type=radio value=yes name="showBrief" id="showBrief[yes]"> 是 &nbsp; &nbsp; 
		  <INPUT class=radio type=radio value=no name="showBrief" id="showBrief[no]" checked> 否 </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.maxTagCount.value))) {
    	alert('热门关键字数量必须为整数');
      	theform.maxTagCount.focus();
		return;
    }
    if (!filter.test(trim(theform.hotlinkRows.value))) {
    	alert('主题推介区主题数必须为整数');
      	theform.hotlinkRows.focus();
		return;
    }
    if (!filter.test(trim(theform.topicsPerPage.value))) {
    	alert('每页显示主题数必须为整数');
      	theform.topicsPerPage.focus();
		return;
    }
    if (!filter.test(trim(theform.maxTopicPages.value))) {
    	alert('主题列表最大页数必须为整数');
      	theform.maxTopicPages.focus();
		return;
    }
    if (!filter.test(trim(theform.hotTopicPosts.value))) {
    	alert('热门主题回复数必须为整数');
      	theform.hotTopicPosts.focus();
		return;
    }
    if (!filter.test(trim(theform.hotTopicVisits.value))) {
    	alert('人气主题查看数必须为整数');
      	theform.hotTopicVisits.focus();
		return;
    }
    if (!filter.test(trim(theform.diggsVsVisits.value))) {
    	alert('主题评价系数必须为整数');
      	theform.diggsVsVisits.focus();
		return;
    }
    if (!filter.test(trim(theform.postsPerPage.value))) {
    	alert('每页显示贴数必须为整数');
      	theform.postsPerPage.focus();
		return;
	}
	theform.submit();
}
function clickImageLinks() 
{
	$('advanceoption').style.display = $('showHotlinks[image]').checked ? '' : 'none';
}

$('settings').defaultStyle.value = "<%= setting.getString(ForumSetting.DISPLAY,"defaultStyle") %>";
$('showStyleList[<%= setting.getString(ForumSetting.DISPLAY,"showStyleList") %>]').checked = true;
$('showSearchImage[<%= setting.getString(ForumSetting.DISPLAY,"showSearchImage","yes") %>]').checked = true;
$('showSectionLink[<%= setting.getString(ForumSetting.DISPLAY,"showSectionLink") %>]').checked = true;
$('jumpMode[<%= setting.getString(ForumSetting.DISPLAY,"jumpMode") %>]').checked = true;
$('tsExchange[<%= setting.getString(ForumSetting.DISPLAY,"tsExchange") %>]').checked = true;
$('showUnion[<%= setting.getString(ForumSetting.DISPLAY,"showUnion") %>]').checked = true;
$('showBoardBrief[<%= setting.getString(ForumSetting.DISPLAY,"showBoardBrief","yes") %>]').checked = true;
$('showOnlineUsers[<%= setting.getString(ForumSetting.DISPLAY,"showOnlineUsers") %>]').checked = true;
$('settings').maxTagCount.value = "<%= setting.getInt(ForumSetting.DISPLAY,"maxTagCount") %>";
$('settings').hotTags.value = "<%= setting.getHTMLStr(ForumSetting.DISPLAY,"hotTags") %>";
<%
	for (int i=0; i<showHotlinks.length; i++)
	{
		if (showHotlinks[i] != null && showHotlinks[i].trim().length() > 0)
		{
%>
$('showHotlinks[<%= showHotlinks[i] %>]').checked = "true";
<%
		}
	}
	for (int i=0; i<showStatlinks.length; i++)
	{
		if (showStatlinks[i] != null && showStatlinks[i].trim().length() > 0)
		{
%>
$('showStatlinks[<%= showStatlinks[i] %>]').checked = "true";
<%
		}
	}
%>
$('settings').linksSID.value = "<%= setting.getString(ForumSetting.DISPLAY,"linksSID") %>";
$('imageMode[<%= setting.getString(ForumSetting.DISPLAY,"imageMode") %>]').checked = true;
$('settings').imageFile.value = '<%= setting.getString(ForumSetting.DISPLAY,"imageFile").replace("'","\\'") %>';
$('settings').imageLink.value = '<%= setting.getString(ForumSetting.DISPLAY,"imageLink").replace("'","\\'") %>';
$('settings').imageTitle.value = '<%= setting.getString(ForumSetting.DISPLAY,"imageTitle").replace("'","\\'") %>';
$('settings').hotlinkRows.value = "<%= setting.getInt(ForumSetting.DISPLAY,"hotlinkRows",10) %>";
$('settings').topicsPerPage.value = "<%= setting.getInt(ForumSetting.DISPLAY,"topicsPerPage") %>";
$('settings').maxTopicPages.value = "<%= setting.getInt(ForumSetting.DISPLAY,"maxTopicPages") %>";
$('settings').hotTopicPosts.value = "<%= setting.getInt(ForumSetting.DISPLAY,"hotTopicPosts") %>";
$('settings').hotTopicVisits.value = "<%= setting.getPInt(ForumSetting.DISPLAY,"hotTopicVisits",100) %>";
$('settings').diggsVsVisits.value = "<%= setting.getPInt(ForumSetting.DISPLAY,"diggsVsVisits",2) %>";
$('settings').postsPerPage.value = "<%= setting.getInt(ForumSetting.DISPLAY,"postsPerPage") %>";
$('showAvatar[<%= setting.getString(ForumSetting.DISPLAY,"showAvatar") %>]').checked = true;
$('showBrief[<%= setting.getString(ForumSetting.DISPLAY,"showBrief") %>]').checked = true;

if ($('showHotlinks[image]').checked)
	$('advanceoption').style.display = "";		
else
	$('advanceoption').style.display = "none";
</script>	  
<%= PageUtils.getAdminFooter(request) %>
</BODY></HTML>
