<%template _header%>
<script type="text/javascript"  src="{jsdir}/ajax.js"></script>
<script type="text/javascript">
var templatepath = "{templatepath}";
var imagedir = "{imagedir}";
var fid = parseInt({forum.fid});
</script>
<script type="text/javascript" src="{jsdir}/template_showforum.js"></script>
<div id="nav">
	<div class="wrap s_clear">	
		<span class="right">
		<%if {forumid}==-1%>
			<a href="forumindex.aspx">全部</a>
			<a href="showtopiclist.aspx?type=digest&amp;forums={forums}">精华帖区</a>
			<%else%>
		        <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forumid},0)%>
			<a href="{aspxrewriteurl}">全部</a>
			<a href="showtopiclist.aspx?forumid={forumid}&type=digest">精华帖区</a>
			<%/if%>
			<%if {config.rssstatus}!=0%>
			<a href="tools/rss.aspx" target="_blank"><img src="{imagedir}/icon_feed.gif" alt="Rss"/></a>
			<%/if%>
		</span>
		<a id="forumlist" href="{forumpath}" <%if {config.forumjump}==1%>onmouseover="showMenu(this.id);" onmouseout="showMenu(this.id);"<%/if%> class="title">{config.forumtitle}</a> &raquo; <strong><%if {forumid}>0%>
		<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0)%>
		<a href="{aspxrewriteurl}">{forum.name}</a>
		<%else if {type}=="digest"%>
			精华帖
		<%else%>
			新帖
		<%/if%></strong>
	</div>
</div>
<%if page_err==0%>
<%if {showforumlogin}==1%>
<div class="wrap s_clear" id="wrap">
	<div class="main">
		<h3>本版块已经被管理员设置了密码</h3>
		<form id="forumlogin" name="forumlogin" method="post" action="">
		<table cellpadding="0" cellspacing="0" border="0">
		<tbody>
		<tr>
			<th><label for="forumpassword">请输入密码</label></th>
			<td><input name="forumpassword" type="password" id="forumpassword" size="20" class="txt"/></td>
		</tr>
		</tbody>
		<%if {isseccode}%>	
		<tbody>
		<tr>
			<th><label for="vcode">输入验证码</label></th>
			<td>
				<div style="position: relative;">
				<%template _vcode%>
				</div>
		    </td>
		</tr>
		</tbody>
		<%/if%>
		<tbody>
		<tr>
			<th></th>
			<td><input type="submit"  value="确定"/></td>
		</tr>
		</tbody>
		</table>
		</form>
	</div>
</div>
<%else%>
<div class="wrap s_clear"  id="wrap">
<div class="main hslice" id="threadlist">
	<div id="forumheader" class="s_clear">
		<h1  class="entry-title"><%if {forumid}>0%>
		<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0)%>
		<a href="{aspxrewriteurl}">{forum.name}</a>
		<%else if {type}=="digest"%>
			精华帖
		<%else%>
			新帖
		<%/if%></h1>
	</div>
	<div class="pages_btns">
		<div class="pages">
			{pagenumbers}<em>{pageid} / {pagecount}</em>
		</div>
	</div>
	<div class="threadlist entry-content">
	<table cellpadding="0" cellspacing="0" border="0" summary="帖子">
	<thead class="category">
	<tr>
		<td class="folder">&nbsp;</td>
		<td class="icon">&nbsp;</td>
		<th>标题</th>
		<td class="author">作者</td>
		<td class="nums">回复/查看</td>
		<td class="lastpost"><cite>最后发表</cite></td>
	</tr>
	</thead>
	<!--announcement area start-->
	<%loop announcement Announcements.GetSimplifiedAnnouncementList(nowdatetime)%>
	<tbody>
	<tr>
		<td><img src="{imagedir}/announcement.gif" alt="announcement"/></td>
		<td>&nbsp;</td>
		<th class="subject"><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-->
	<%if {topiclist.count}>0%>
	<!--showtopiclist start-->
	<%loop (TopicInfo) topic topiclist%>
	<tbody id="normalthread_{topic.tid}" >
	<tr>
		<td class="folder">
		<%if {topic.folder}!=""%>
			<%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic.tid},0)%>
			<a href="{aspxrewriteurl}" target="_blank"><img src="{imagedir}/folder_{topic.folder}.gif" alt="主题图标"/></a>
		<%else%>
			&nbsp;
		<%/if%>
		</td>
		<td class="icon">
		<%if {topic.iconid}!=0%>
				<img src="{posticondir}/{topic.iconid}.gif" alt="示图"/>
			<%else%>
				&nbsp;
			<%/if%>
		</td>
		<th class="subject">	
			<label class="right">
			<%if {topic.digest}>0%>
				<img src="{imagedir}/digest{topic.digest}.gif" alt="digtest"/>
			<%/if%>
			<%if {topic.special}==1%>
				<img src="{imagedir}/pollsmall.gif" alt="投票" />
			<%/if%>
			<%if {topic.special}==2 || {topic.special}==3%>
				<img src="{imagedir}/bonus.gif" alt="悬赏"/>
			<%/if%>
			<%if {topic.special}==4%>
				<img src="{imagedir}/debatesmall.gif" alt="辩论"/>
			<%/if%>
			</label>
			<%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic.tid},0)%>
			<a href="{aspxrewriteurl}">{topic.title}</a>
			<%if {topic.attachment}>0%>
				<img src="{imagedir}/attachment.gif" alt="附件"/>
			<%/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 class="author">
			<cite>
			<%if {topic.posterid}==-1%>
				游客
			<%else%>
				<%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic.posterid})%>
				<a href="{aspxrewriteurl}">{topic.poster}</a>
			<%/if%></cite>
			<em><%datetostr({topic.postdatetime},"yy-MM-dd HH:mm")%></em>
		</td>
		<td class="nums"><em>{topic.replies}</em> / {topic.views}</td>
		<td class="lastpost">
			<em><a href="showtopic.aspx?topicid={topic.tid}&page=end#lastpost"><%datetostr({topic.lastpost},"yy-MM-dd HH:mm")%></a></em>
			<cite>by
			<%if {topic.lastposterid}==-1%>
				游客
			<%else%>
				<a href="{UserInfoAspxRewrite(topic.lastposterid)}" target="_blank">{topic.lastposter}</a>
			<%/if%>
			</cite>
		</td>
	</tr>
	</tbody>
    <%/loop%>
	<%else%>
	<tbody id="zerothreads"><tr><td colspan="6"><div class="zerothreads">暂无帖子</div></td></tr></tbody>
	<%/if%>
	<!--showtopiclist end-->
	</table>
	</div>
	<div id="footfilter">
		<%if {config.forumjump}==1%>
		<select onchange="if(this.options[this.selectedIndex].value != '') { jumpurl(this.options[this.selectedIndex].value,{config.aspxrewrite},'{config.extname}');}">
			<option>论坛跳转...</option>
			{Caches.GetForumListBoxOptionsCache()}
		</select>
		<%/if%>
		<%if {config.visitedforums}>0%>
		<select name="select2" onchange="if(this.options[this.selectedIndex].value != '') {jumpurl(this.options[this.selectedIndex].value,{config.aspxrewrite},'{config.extname}');}">
			<option>最近访问...</option>{ForumUtils.GetVisitedForumsOptions(config.Visitedforums)}
		</select>
		<%/if%>
		<script type="text/javascript">
		var categorydata = {goodscategoryfid};		
		function jumpurl(fid, aspxrewrite, extname) {
			for(var i in categorydata) {
			   if(categorydata[i].fid == fid) {
				   if(aspxrewrite) {
					   window.location='showgoodslist-' +categorydata[i].categoryid + extname;
				   }
				   else {
					   window.location='showgoodslist.aspx?categoryid=' +categorydata[i].categoryid;
				   }
				   return;
			   } 
			}
			if(aspxrewrite) {
				window.location='showforum-' + fid + extname;
			}
			else {
				window.location='showforum.aspx?forumid=' + fid ;
			}
		}
		</script>
	</div>
	<div class="pages_btns">
		<div class="pages">
			{pagenumbers}<em>{pageid} / {pagecount}</em>		
		</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%>
	<hr class="solidline"/>
	<div id="forumheader" class="s_clear">
		<h1>以下论坛版块:</h1>
	</div>
	<form name="LookBySearch" method="post" action="showtopiclist.aspx?search=1&forumid={forumid}&type={type}&newtopic={newtopic}&forums={forums}" ID="LookBySearch">
	<table width="100%" border="0" cellspacing="3" cellpadding="0">
		<tr>
			 {GetForumCheckBoxListCache(forums)}
		</tr>
	</table>
	<div id="footfilter">
		<span class="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>
			<button type="submit" onclick="document.LookBySearch.submit();">提交</button>
		</span>
		<input title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall" id="chkall">全选/取消全选
	</div>
	</form>
	</div>
</div>
<%/if%>
<%/if%>
<%else%>
<%template _errmsgbox%>
<%/if%>
<%if {config.forumjump}==1%>
	{navhomemenu}
<%/if%>
<%template _copyright%>
<%template _footer%>