<%template _header%>
<script type="text/javascript" src="{forumpath}javascript/ajax.js"></script>
<%if {page_err}==0%>
	<script type="text/javascript">
	var templatepath = "{templatepath}";
	var fid = parseInt({forum.fid});
	var postminchars = parseInt({config.minpostsize});
	var postmaxchars = parseInt({config.maxpostsize});
	var disablepostctrl = parseInt({disablepostctrl});
	var forumurl = forumpath = "{forumpath}";
	</script>
<%/if%>
<script type="text/javascript" src="{forumpath}javascript/template_showforum.js"></script>
<div id="nav">
	<div class="wrap s_clear">
		<%if {page_err}==0%>
			<span class="right">
			<%if {ismoder}%><a href="{forumurl}modcp.aspx?operation=attention&forumid={forumid}" target="_blank">管理面板</a><%/if%>
			</span>
		<%/if%>
		<a id="forumlist" href="{forumpath}" <%if {config.forumjump}==1%>onmouseover="showMenu(this.id);" onmouseout="showMenu(this.id);"<%/if%> class="title">{config.forumtitle}</a> &raquo; {forumnav}
	</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" class="formtable">
		<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%>
<%template _pagewordadlist%>
<div class="wrap s_clear forum_blog" id="wrap">
<div class="main">
	<%if {forum.layer}!=0%>
	<div class="threadlist" style="position:relative">
	<form id="moderate" name="moderate" method="post" action="{forumpath}topicadmin.aspx?action=moderate&forumid={forumid}&infloat=1">
		<table summary="{forum.fid}" id="threadlist" cellspacing="0" cellpadding="0">
			<%loop (TopicInfo) topic topiclist%>
			<tbody>
			<tr>
				<th class="subject">
				<%if {forum.applytopictype}==1 && {forum.topictypeprefix}==1%>
					<em>
					<%if {forum.viewbytopictype}==1 && {topic.topictypename}!=""%>
					[<a href="{forumpath}showforum.aspx?forumid={forumid}&typeid={topic.typeid}" >{topic.topictypename}</a>]
					<%else if {topic.topictypename}!=""%>
					[{topic.topictypename}]
					<%/if%>
					</em>
				<%/if%>
				<%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic.tid},0)%>
				<%set (int){ishtmltitle} = Topics.GetMagicValue(topic.Magic, MagicType.HtmlTitle)%>
				<%if {ishtmltitle}==1%>
					<a href="{forumpath}{aspxrewriteurl}<%if {config.Aspxrewrite}!=1%>&forumpage={pageid}<%/if%>">{Topics.GetHtmlTitle(topic.Tid)}</a>
				<%else%>
					<a href="{forumpath}{aspxrewriteurl}<%if {config.Aspxrewrite}!=1%>&forumpage={pageid}<%/if%>">{topic.title}</a>
				<%/if%>
				</th>
			</tr>
			<tr>
				<td class="author">
					由<cite>
						<%if {topic.posterid}==-1%>
							游客
						<%else%>
							<%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic.posterid})%>
							<a href="{forumpath}{aspxrewriteurl}">{topic.poster}</a>
						<%/if%>
					</cite>于
					<em><%datetostr({topic.postdatetime}, "yyyy-MM-dd HH:mm")%></em>发表
				</td>
			</tr>
			<tr>
				<td class="postbody">
				<div style="overflow:hidden">
					{Discuz.BlogStyle.Blog.GetUbbMessage(Discuz.Forum.Posts.GetPostInfo(topic.Tid,Posts.GetFirstPostId(topic.Tid)),userid)}
				</div>
				</td>
			</tr>
			<tr>
				<td class="postmeta">
				<%if {useradminid}>0 && {ismoder}%>
					<%if {topic.closed}<=1%>
					<input type="checkbox" name="topicid" value="{topic.tid}" onclick="modclick(this);"/>
					<%else%>
					<input type="checkbox" disabled />
					<%/if%>
				<%/if%>
				<%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topic.tid},0)%>
					<a href="{forumpath}{aspxrewriteurl}<%if {config.Aspxrewrite}!=1%>&forumpage={pageid}<%/if%>">目前共有<em>{topic.replies}</em>次回应，此文章共被 {topic.views}次查阅</a>
				</td>
			</tr>
			</tbody>
			<%/loop%>
		</table>
		<%if {topiclist.Count}<=0%>
			<div class="zerothreads">当前板块暂无主题</div>
		<%/if%>
        <%if {useradminid}>0 && {ismoder}%>
            <div id="modlayer" style="display: none;position:position">
            <input type="hidden" name="optgroup" />
            <input type="hidden" name="operat" />
            <input type="hidden" name="winheight" />
            <a class="collapse" href="javascript:;" onclick="$('modlayer').className='collapsed'"><img src="{forumpath}templates/{templatepath}/images/collapsed_yes.gif" alt="缩小" title="缩小" /></a>
            <label><input class="checkbox" type="checkbox" name="chkall" onclick="if(!($('modcount').innerHTML = modclickcount = checkall(this.form, 'topicid'))) {$('modlayer').style.display = 'none';}" /> 全选</label>
            <span>选中</span><strong onmouseover="$('moremodoption').style.display='block'" onclick="$('modlayer').className=''" id="modcount"></strong><span>篇: </span>
            <strong><a href="javascript:;" onclick="modthreads(3, 'delete');return false;">删除</a></strong>
            <span class="pipe">|</span>
            <strong><a href="javascript:;" onclick="modthreads(2, 'move');return false;">移动</a></strong>
            <span class="pipe">|</span>
            <strong><a href="javascript:;" onclick="modthreads(2, 'type');return false;">分类</a></strong>
            <span class="pipe">|</span>
            <strong><a href="javascript:;" onclick="modthreads(2, 'identify');return false;">鉴定</a></strong>
            <div id="moremodoption">
            <hr class="solidline" />
            <a href="javascript:;" onclick="modthreads(1, 'displayorder');return false;">置顶</a>
            <a href="javascript:;" onclick="modthreads(1, 'highlight');return false;">高亮</a>
            <a href="javascript:;" onclick="modthreads(1, 'digest');return false;">精华</a>

            <span class="pipe">|</span>
            <a href="javascript:;" onclick="modthreads(3, 'bump');return false;">提升下沉</a>
            &nbsp;
            <a href="javascript:;" onclick="modthreads(4,'close');return false;">关闭打开</a>
            </div>
            </div>
        <%/if%>
		</form>
		<div class="pages_btns" id="footfilter">
			<div class="pages">
				<cite class="pageback" id="visitedforums"<%if {showvisitedforumsmenu}%> onmouseover="$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu(this.id)"<%/if%>><a href="{forumpath}">返回首页</a></cite>
				<%if {pagecount}!=1%>
					{pagenumbers}
					<%if {pagecount}>8%>
					<kbd><b id="pageidtxt2" title="可以输入页码按回车键自动跳转" onclick="$('pageidtxt2').style.display='none';$('pageidinput2').style.display='';$('pageidinput2').focus();">{pageid}</b>
					<input name="gopage" type="text" class="txt" id="pageidinput2" value="{pageid}" style="display:none;text-align:center;" onfocus="this.value=this.defaultValue;this.size=this.value.length;this.select();" onblur="$('pageidinput2').style.display='none';$('pageidtxt2').style.display='';" onKeyDown="if(event.keyCode==13) { if(parseInt('{config.aspxrewrite}')==1) {window.location='{forumpath}showforum-{forumid}-' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) + '{config.extname}';}else{window.location='{forumpath}showforum.aspx?forumid={forumid}&page=' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1);}}if((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode==8){this.size=this.value.length+1;return true;}else{return false;}" size="{pageid.toString().Trim().Length}" maxlength="9" />/ {pagecount}</kbd>
					<%/if%>
					{nextpage}
				<%/if%>
			</div>
			<%if {userid}<0||{canposttopic}%>
				<span onmouseover="if($('newspecial_menu').childNodes.length>0)  showMenu(this.id);" id="newspecial" class="postbtn"><a title="发新话题" id="newtopic" href="{forumpath}posttopic.aspx?forumid={forum.fid}&forumpage={pageid}" onmouseover="if($('newspecial_menu').childNodes.length>0)  showMenu(this.id);" onclick="floatwin('open_newthread', '{rooturl}posttopic.aspx?forumid={forum.fid}&forumpage={pageid}', 600, 410, '600,0');doane(event);"><img alt="发新话题" src="{forumpath}templates/{templatepath}/images/newtopic.gif"/></a></span>
			<%/if%>
		</div>
	</div>
</div>
	<%if {userid<0}||{canposttopic}%>
		<ul class="popupmenu_popup newspecialmenu" id="newspecial_menu" style="display: none">
		<%if {forum.allowspecialonly}<=0%>
<li><a href="{forumpath}posttopic.aspx?forumid={forum.fid}&forumpage={pageid}" onclick="floatwin('open_newthread', '{rooturl}posttopic.aspx?forumid={forum.fid}&forumpage={pageid}', 600, 410, '600,0');doane(event);">发新主题</a></li>
		<%/if%>
		</ul>
	<%/if%>
<%/if%>
<script type="text/javascript">
	var maxpage = parseInt('{pagecount}');
	var pageid = parseInt('{pageid}');
	if(maxpage > 1) {
		document.onkeyup = function(e){
			e = e ? e : window.event;
			var tagname = is_ie ? e.srcElement.tagName : e.target.tagName;
			if(tagname == 'INPUT' || tagname == 'TEXTAREA') return;
			actualCode = e.keyCode ? e.keyCode : e.charCode;
			if(pageid < maxpage && actualCode == 39) {
				window.location = '{forumpath}{Urls.ShowForumAspxRewrite(forumid,pageid+1,forum.Rewritename)}';
			}
			if(pageid > 1 && actualCode == 37) {
				window.location = '{forumpath}{Urls.ShowForumAspxRewrite(forumid,pageid-1,forum.Rewritename)}';
			}
		}
	}
</script>
<%/if%>
<div class="sidebar">
	<div id="forumheader" class="s_clear">
		<h1><%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0)%>{forum.name}</h1>
		<p class="forumstats">[ <em>{topiccount}</em> 主题 / {forum.Posts} 帖子 / {forum.Todayposts} 今日帖子 ]</p>
		<p class="channelinfo f_clear">{forum.description}</p>
		<p id="modedby" class="f_clear">
	<%if {page_err}==0%>版主: <span class="lightlink">
		<%if {forum.moderators}!=""%>
			{forum.moderators}
		<%else%>
			*空缺中*
		<%/if%></span>
	<%/if%>
		</p>
	</div>
	<%if {forum.rules}!=""%>
	<div class="box rules">
		<h3>本版规则</h3>
		<div id="rules_link">{forum.rules}</div>
	</div>
	<%/if%>
	<%if {forum.Subforumcount}>0%>
	<div id="subforum" class="box list">
		<h3>子版块</h3>
		<table id="category_{forum.fid}"  cellspacing="0" cellpadding="0" summary="category_{forum.fid}">
		<tbody>	
		<%if {forum.colcount}==1%>
			<%loop (IndexPageForumInfo) subforum subforumlist%>
				<tr>
					<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({subforum.fid},0)%>
					<th <%if {subforum.havenew}=="new" %>class="new"<%/if%>>
						<h2>
							<%if {subforum.icon}!=""%>
								<img src="{subforum.icon}" border="0" align="left" hspace="5" alt="{subforum.name}"/>
							<%/if%>
							<%if {subforum.redirect}==""%>
								<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({subforum.fid},0,{subforum.rewritename})%>
								<a href="{forumurl}{aspxrewriteurl}">
							<%else%>
								<a href="{subforum.redirect}" target="_blank">
							<%/if%>
							{subforum.name}</a><%if {subforum.todayposts}>0%><span class="today">({subforum.todayposts})</span><%/if%>
						</h2>
						<%if {subforum.description}!=""%><p>{subforum.description}</p><%/if%>
					</th>
				  </tr>
			<%/loop%>
		<%/if%>
		</tbody>
		</table>
	</div>
	<%/if%>
	<%if {config.whosonlinestatus}!=0 && {config.whosonlinestatus}!=1%>
	<div class="box s_clear">
		<h3>当前在线</h3>
		<%if {showforumonline}%>
		<ul class="userlist s_clear">
			<%set (int){invisiblecount} = 0%>
			<%loop (OnlineUserInfo) onlineuser onlineuserlist%>
				<%if {onlineuser.invisible}==1%>
					<%set {invisiblecount} = {invisiblecount} + 1%>
					<li>(隐身会员)</li>
				<%else%>
					<li>
						<%set (string){avatarurl}=Avatars.GetAvatarUrl({onlineuser.userid}, AvatarSize.Small) %>
							<img src="{avatarurl}" onerror="this.onerror=null;this.src='{forumpath}templates/{templatepath}/images/noavatar_small.gif';"  alt="头像" id="memberinfo_{onlineuser[_id]}" onmouseover="showauthor(this,{onlineuser.userid}{onlineuser[_id]})" style="vertical-align:center;"/>
						<%if {onlineuser.userid}==-1%>
							<p>{onlineuser.username}</p>
						<%else%>
						   <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({onlineuser.userid})%>
							<a href="{aspxrewriteurl}" target="_blank">{onlineuser.username}</a>
						<%/if%>
					</li>
				<%/if%>
			<%/loop%>
			<%if {invisiblecount}>0%>
				<script type="text/javascript">$('invisible').innerHTML = '({invisiblecount}' + " 隐身)";</script>
			<%/if%>
		</ul>
		<%/if%>
	</div>
	<%/if%>
</div>
</div>
<%else%>
	<%if {needlogin}%>
		<%template _login%>
	<%else%>
		<%template _errmsgbox%>
	<%/if%>
<%/if%>
<%if {config.forumjump}==1%>
	{navhomemenu}
<%/if%>
<%if {showvisitedforumsmenu}%>
<ul class="popupmenu_popup" id="visitedforums_menu" style="display: none">
<%loop (SimpleForumInfo) simpforuminfo visitedforums%>
    <%if {simpforuminfo.Fid}!=forumid%>
    <li><a href="{forumpath}{simpforuminfo.Url}">{simpforuminfo.Name}</a></li>
    <%/if%>
<%/loop%>
</ul>
<%/if%>
<%template _adlist%>
{mediaad}
<%template _copyright%>
<%template _footer%>