<%template _header%>

<%if page_err==0%>
<script type="text/javascript" src="templates/{templatepath}/ajax.js"></script>
<script type="text/javascript">
var templatepath = "{templatepath}";
var fid = parseInt({forum.fid});
</script>
<script type="text/javascript" src="templates/{templatepath}/showforum.js"></script>
<!--TheCurrent start-->
<div id="foruminfo">
	<div class="userinfo">
		<h2><a href="{config.forumurl}">{config.forumtitle}</a>{forumnav}</h2>
	</div>
	<div class="forumstats focusstats" style="width:500px;">
		<ul id="submenu">
			<%if {usergroupinfo.allowsearch}>0%>
			<li  class="lastitem" style="width:230px;">
					<%template _quicksearch%>
			</li>
			<%/if%>
			<%if {forumid}==-1%>
			<li><a href="forumindex.aspx">全部</a></li>
			<li><a href="showtopiclist.aspx?type=digest&amp;forums={forums}">精华帖区</a></li>
			<%else%>
		        <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forumid},0)%>
			<li><a href="{aspxrewriteurl}">全部</a></li>
			<li><a href="showtopiclist.aspx?forumid={forumid}&type=digest">精华帖区</a></li>
			<%/if%>
			<%if {config.rssstatus}!=0%>
			<li class="lastitem"><a href="tools/rss.aspx" target="_blank"><img src="templates/{templatepath}/images/rss.gif" alt="Rss"/></a></li>
			<%/if%>
		</ul>
	</div>
</div>
<!--TheCurrent end-->

<%if {showforumlogin}==1%>
	<div class="ntforumbox">
		<div class="titlebar">
			<h2>本版块已经被管理员设置了密码</h2>
		</div>
		<div class="NtTopicList">
			<div class="NtForumPassword">
				<form id="forumlogin" name="forumlogin" method="post" action="">
						<label for="password">请输入密码:</label><input name="forumpassword" type="password" id="forumpassword" size="20" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" />
						<%if {isseccode}%>
							<br />				
							<label for="code">输入验证码:</label>
							<%template _vcode%>
						<%/if%>
						<br />
						<input type="submit"  value="确定" class="sbutton"/><br />
				</form>
			</div>
		</div>
	</div>
<%else%>

<div class="forumpages">
  <div class="forumpagesnumbers">
				   <table border="0" cellpadding="0" cellspacing="0" style="margin-bottom:8px;">
				   <tr>
					<td class="forumallpages"><strong>{pageid}</strong>/&nbsp;&nbsp;{pagecount}页</td>
					<td width="10">&nbsp;</td>
					<td class="forumallpages">{pagenumbers}</td>
					</tr>
				  </table>
  </div>
</div>
<div class="ntforumbox">
	<div class="titlebar">
		<h2>
		<%if {forumid}>0%>
		<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0)%>
		<a href="{aspxrewriteurl}">{forum.name}</a>
		<%else if {type}=="digest"%>
			精华帖
		<%else%>
			新帖
		<%/if%>
		</h2>
	</div>
	<div class="ntforumplate">
		<table cellpadding="0" cellspacing="0" border="0">
				<thead>
				<tr>
						<td>&nbsp;</td>
						<th>标题</th>
						<th>作者</th>
						<th class="ntnumbers">回复/查看</th>
						<th>最后发布</th>
				</tr>
				</thead>
		<!--announcement area start-->
		<%loop announcement announcementlist%>
				<tbody>
				<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
					<td class="topicicon" style="height:32px;"><img src="templates/{templatepath}/images/announcement.gif" alt="announcement"/></td>
					<th class="forumlisttitle"><a href="announcement.aspx#{announcement[id]}">{announcement[title]}</a></th>
					<td colspan="3">
						<%if {strtoint({announcement[posterid]})}==-1%>
							游客
						<%else%>
						    <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({announcement[posterid]})%>
							<a href="{aspxrewriteurl}">{announcement[poster]}</a>
						<%/if%>
					</td>
				</tr>
				</tbody>
		<%/loop%>
		<!--announcement area end-->
		<!--NtForumList start-->
		<%loop (ShowforumPageTopicInfo) topic topiclist%>
				<tbody>
				<tr class="list" onmouseover="this.className='liston'" onmouseout="this.className='list'">
				<td class="topicicon">
				<%if {topic.folder}!=""%>
				    <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic.tid},0)%>
					<a href="{aspxrewriteurl}" target="_blank"><img src="templates/{templatepath}/images/folder_{topic.folder}.gif" alt="主题图标"/></a>
				<%else%>
					&nbsp;
				<%/if%>
				</td>
				<th class="forumlisttitle">
					<%if {topic.iconid}!=0%>
						<img src="images/posticons/{topic.iconid}.gif" alt="示图"/>
					<%else%>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<%/if%>
					<%if {topic.replies}>0%>
						<img src="templates/{templatepath}/images/topItem_exp.gif" id="imgButton_{topic.tid}" onclick="showtree({topic.tid},{config.ppp});" class="cursor" alt="展开帖子列表" title="展开帖子列表" />
					<%else%>
						<img src="templates/{templatepath}/images/no-sublist.gif" id="imgButton_{topic.tid}"/>
					<%/if%>
					<%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic.tid},0)%>
					<a href="{aspxrewriteurl}">{topic.title}</a>
					<%if {topic.digest}>0%>
						<img src="templates/{templatepath}/images/digest{topic.digest}.gif" />
					<%/if%>
					<%if {topic.poll}>0%>
						<img src="templates/{templatepath}/images/pollsmall.gif"/>
					<%/if%>
					<%if {topic.attachment}>0%>
						<img src="templates/{templatepath}/images/attachment.gif"/>
					<%/if%>
					<%if {topic.replies}/{config.ppp}>0%>
						<script type="text/javascript">getpagenumbers("{config.extname}", {topic.replies},{config.ppp},0,"",{topic.tid},"","",{config.aspxrewrite});</script>
					<%/if%>
				</th>
				<td>
						<h3>
						<%if {topic.posterid}==-1%>
							游客
						<%else%>
						    <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic.posterid})%>
							<a href="{aspxrewriteurl}">{topic.poster}</a>
						<%/if%></h3>
						<p><%datetostr({topic.postdatetime},"yy.MM.dd HH:mm")%></p>
				</td>
				<td class="ntnumbers"><em>{topic.replies}</em> / {topic.views}</td>
				<td>
						<%if {topic.replies}>0%>
							<h4>
							<%if {topic.lastposterid}==-1%>
								游客
							<%else%>
							    <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic.lastposterid})%>
								<a href="{aspxrewriteurl}" target="_blank">{topic.lastposter}</a>
							<%/if%>
							<a href="showtopic.aspx?topicid={topic.tid}&page=end"><img src="templates/{templatepath}/images/writer2.gif" alt="发布者"/></a>
							</h4>
							<p><%datetostr({topic.lastpost},"yy.MM.dd HH:mm")%></p>
						<%else%>
							从未
						<%/if%>
				</td>
				</tr>
			</tbody>
			</tbody>
				<tr>
					<td colspan="5"><div id="divTopic{topic.tid}"></div></td>
				</tr>
			</tbody>
		<%/loop%>
		<!--NtForumList end-->
	</table>
	</div>
</div>
<div class="forumpages">
  <div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom:8px;">
				   <tr>
					<td class="forumallpages"><strong>{pageid}</strong>/&nbsp;&nbsp;{pagecount}页</td>
					<td width="10">&nbsp;</td>
					<td class="forumallpages">{pagenumbers}</td>
					</tr>
		</table>
  </div>
</div>
<script type="text/javascript">
function CheckAll(form)
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
		if (e.id == "fidlist"){
		   e.checked = form.chkall.checked;
		}
	}
}

function SH_SelectOne(obj)
{
	for (var i = 0; i < document.getElementById("LookBySearch").elements.length; i++)
	{
		var e = document.getElementById("LookBySearch").elements[i];
		if (e.id == "fidlist"){
		   if (!e.checked){
			document.getElementById("chkall").checked = false;
			return;
		   }
		}
	}
	document.getElementById("chkall").checked = true;

}

function ShowDetailGrid(tid)
{
   if({config.aspxrewrite})
   {
       window.location.href = "showforum-" + tid + "{config.extname}";
   }
   else
   {
       window.location.href = "showforum.aspx?forumid=" + tid ;
   }
}
</script>
<%if {forumid}==-1%>
<form name="LookBySearch" method="post" action="showtopiclist.aspx?search=1&forumid={forumid}&type={type}&newtopic={newtopic}&forums={forums}" ID="LookBySearch">
	<div class="ntforumbox">
		<div class="titlebar">
			<h3>以下论坛版块:</h3>
		</div>
		<div style="clear:both;">
		<table width="100%" border="0" cellspacing="3" cellpadding="0" style="text-align:left;">
			<tr>
				 {forumcheckboxlist}
			</tr>
		</table>
		</div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="framelistselect">
			<tr>
				<td style="width:50%;text-align:left;padding-left:15px;">
					 <input checked="checked" title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall" ID="chkall">全选/取消全选
				</td>
				<td style="width:50%;text-align:right;">
						 排序方式
					<select name="order" id="order">
					  <option value="1"
							  <%if {order}==1%>
								selected
							  <%/if%>
							  >最后回复时间</option>
					  <option value="2"
							  <%if {order}==2%>
								selected
							  <%/if%>
							  >发布时间</option>
					</select>
	
					<select name="direct" id="direct">
					  <option value="0"
							  <%if {direct}==0%>
								selected
							  <%/if%>
							  >按升序排列</option>
					  <option value="1"
							  <%if {direct}==1%>
								selected
							  <%/if%>
							  >按降序排列</option>
					</select>
					</td>
					<td style="width:120px;"><input type="image" src="templates/{templatepath}/images/button_true.gif" onclick="document.LookBySearch.submit();"/></td>
			</tr>
		</table>
</div>
</form>
<div id="forumjumping">
		<div class="jumpmodule">
			<%if {config.forumjump}==1%>
    <select onchange="if(this.options[this.selectedIndex].value != '') {
            if({config.aspxrewrite})
            {
			    window.location='showforum-' + this.options[this.selectedIndex].value + '{config.extname}';
			}
			else
			{
			    window.location='showforum.aspx?forumid=' + this.options[this.selectedIndex].value;
			}}">
      <option>论坛跳转...</option>
				{forumlistboxoptions}
    </select>
   			 <%/if%>
    		 <%if {config.visitedforums}>0%>
    <select name="select2" onchange="if(this.options[this.selectedIndex].value != '') {
            if({config.aspxrewrite})
            {
		        window.location='showforum-'+this.options[this.selectedIndex].value+'{config.extname}'; 
		    }
		    else
		    {
		        window.location='showforum.aspx?forumid='+this.options[this.selectedIndex].value; 
		    }}">
      <option>最近访问...</option>{visitedforumsoptions}
    </select>
    		<%/if%>
		</div>
</div>
<%/if%>

<%/if%>
</div>
<%template _copyright%>
<%else%>
<%template _errmsgbox%>
</div>
<%/if%>
<%template _footer%>
