<%template _header%>
<div id="foruminfo" style="margin-bottom:0;">
	<div id="userinfo">
		<div id="nav">
		<p><a id="forumlist" href="{config.forumurl}" <%if {config.forumjump}==1%>onmouseover="showMenu(this.id);" onmouseout="showMenu(this.id);"<%/if%>>{config.forumtitle}</a>		主题:<em>{totaltopic}</em>, 帖子:<em>{totalpost}</em> 
		</p>
		<p class="firstchild">
		<%if {userid}==-1%>
		<form id="loginform" name="login" method="post" action="login.aspx?loginsubmit=true">
			<input type="hidden" name="referer" value="index.aspx" />
			<input onclick="if(this.value=='用户名')this.value = ''" value="用户名" maxlength="40" size="15" name="username" id="username" 
	type="text" />
			<input type="password" size="10" name="password" id="password" />
			<button value="true" type="submit" name="userlogin" onclick="javascript:window.location.replace('?agree=yes')"> 登录 </button>
		</form>
		<%else%>
		您上次访问是在: {userinfo.lastvisit} 		
		<%if {config.enablespace}==1%>
			<%if {isactivespace}%>
			<a href="{spaceurl}space">个人空间</a>
			<%else if {isallowapply}%>
			<a href="spaceregister.aspx">申请空间</a>
			<%/if%>
		<%/if%>
			<a href="showtopiclist.aspx">查看新帖</a>
		<%/if%>	
		</p>
		</div>
	</div>
	<div id="forumstats">
		<p class="coutstats" style="margin-bottom:15px;">
		今日:<em>{todayposts}</em>, 昨日:<em>{yesterdayposts}</em>, 
		<%if {highestpostsdate}!=""%>
		最高日:<em>{highestposts}</em>({highestpostsdate})
		<%/if%>
			<a href="showtopiclist.aspx?type=digest&amp;forums=all">精华区</a>
		<%if {config.rssstatus}!=0%>	
			<a href="tools/rss.aspx" target="_blank"><img src="templates/{templatepath}/images/rss.gif" alt="rss"/></a>
		<%/if%>
		</p>
		<%if {usergroupinfo.allowsearch}>0%>
			<%template _quicksearch%>
		<%/if%>
	</div>
</div>
<%if {announcementcount}>0%>
<div onmouseout="annstop = 0" onmouseover="annstop = 1" id="announcement">
	<div id="announcementbody">
		<ul>		
			<%loop announcement announcementlist%>
        <li><a href="announcement.aspx#{announcement[id]}">{announcement[title]}<em>{announcement[starttime]}</em></a></li>
		<%/loop%>
		</ul>
	</div>
</div>
<script type="text/javascript">
	var anndelay = 3000;
	var annst = 0;
	var annstop = 0;
	var annrowcount = 0;
	var anncount = 0;
	var annlis = $('announcementbody').getElementsByTagName("LI");
	var annrows = new Array();
	var annstatus;

	function announcementScroll() {
		if(annstop) {
			annst = setTimeout('announcementScroll()', anndelay);
			return;
		}
		if(!annst) {
			var lasttop = -1;
			for(i = 0;i < annlis.length;i++) {

				if(lasttop != annlis[i].offsetTop) {
					if(lasttop == -1) {
						lasttop = 0;
					}
					annrows[annrowcount] = annlis[i].offsetTop - lasttop;
					annrowcount++;
				}
				lasttop = annlis[i].offsetTop;
			}

			if(annrows.length == 1) {
				$('announcement').onmouseover = $('announcement').onmouseout = null;
			} else {
				annrows[annrowcount] = annrows[1];
				$('announcementbody').innerHTML += '<br style="clear:both" />' + $('announcementbody').innerHTML;
				annst = setTimeout('announcementScroll()', anndelay);
			}
			annrowcount = 1;
			return;
		}

		if(annrowcount >= annrows.length) {
			$('announcementbody').scrollTop = 0;
			annrowcount = 1;
			annst = setTimeout('announcementScroll()', anndelay);
		} else {
			anncount = 0;
			announcementScrollnext(annrows[annrowcount]);
		}
	}

	function announcementScrollnext(time) {
		$('announcementbody').scrollTop++;
		anncount++;
		if(anncount != time) {
			annst = setTimeout('announcementScrollnext(' + time + ')', 10);
		} else {
			annrowcount++;
			annst = setTimeout('announcementScroll()', anndelay);
		}
	}
	announcementScroll();
</script>
<%/if%>
<%template _pagewordadlist%>
<%template _newpmmsgbox%>
<!--topic-->
<%set (int){lastforumlayer} = -1%>
<%set (int){lastcolcount} = 1%>
<%set (int){lastforumid} = 0%>
<%set (int){subforumcount} = 0%>
<%loop (IndexPageForumInfo) forum forumlist%>
	<%if {forum.layer}==0%>
		<%if {lastforumlayer}>-1%>
		<%if {lastcolcount}!=1%>
			<%if {subforumcount}!=0%>
			<%repeat("<td>&nbsp;</td>", {lastcolcount}-{subforumcount})%>
		</tr>
			<%/if%>
		</table>
</div>
		<%else%>
		</table>
	</div>			
		<%/if%>
<div id="ad_intercat_{lastforumid}"></div>
	<%/if%>
	<%if {forum.colcount}==1%>
<div class="mainbox forumlist">
	<span class="headactions">
		<%if {forum.moderators}!=""%>
			分类版主: {forum.moderators}
		<%/if%><img id="category_{forum.fid}_img"  
		<%if {forum.collapse}!=""%>
		src="templates/{templatepath}/images/collapsed_yes.gif"
		<%else%>
		src="templates/{templatepath}/images/collapsed_no.gif"
		<%/if%>
		 alt="展开/收起" onclick="toggle_collapse('category_{forum.fid}');"/>
	</span>
	<h3>
		<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0,{forum.rewritename})%>
		<a href="{aspxrewriteurl}">{forum.name}</a>
	</h3>	
	<table id="category_{forum.fid}" summary="category_{forum.fid}" cellspacing="0" cellpadding="0"  style="{forum.collapse}">
	<thead class="category">
		<tr>
			<th>版块</th>
			<td class="nums">主题</td>
			<td class="nums">帖子</td>
			<td class="lastpost">最后发表</td>
		</tr>
	</thead>
	<%else%>
	<%set {subforumcount}=0%>
<div class="mainbox forumlist">
	<span class="headactions">
		<%if {forum.moderators}!=""%>
			分类版主: {forum.moderators}
		<%/if%>
		<img id="category_{forum.fid}_img"
		<%if {forum.collapse}!=""%>
		src="templates/{templatepath}/images/collapsed_yes.gif"
		<%else%>
		src="templates/{templatepath}/images/collapsed_no.gif"
		<%/if%>
		alt="展开/收起" onclick="toggle_collapse('category_{forum.fid}');"/>
	</span>
	<h3>
		<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0,{forum.rewritename})%>
		<a href="{aspxrewriteurl}">{forum.name}</a>					
	</h3>
	<table id="category_{forum.fid}" summary="category_{forum.fid}" cellspacing="0" cellpadding="0"  style="{forum.collapse}">	
	<%/if%>
		<%set {lastforumlayer}=0%>
		<%set {lastcolcount}={forum.colcount}%>
		<%set {lastforumid}={forum.fid}%>
		<%else%>
		<%if {forum.colcount}==1%>
		<tbody id="forum{forum.fid}">
			<tr>
				<%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({forum.lasttid},0)%>
				<th <%if {forum.havenew}=="new" %>class="new"<%/if%>>
				<%if {forum.icon}!=""%>
					<img src="{forum.icon}" border="0" align="left" hspace="5" alt="{forum.name}"/>
				<%/if%>
					<h2>
					<%if {forum.redirect}==""%>
						<%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0,{forum.rewritename})%>
						<a href="{aspxrewriteurl}">
					<%else%>
						<a href="{forum.redirect}" target="_blank">
					<%/if%>
					{forum.name}</a><%if {forum.todayposts}>0%><em>({forum.todayposts})</em><%/if%>
					</h2>
					<%if {forum.description}!=""%><p>{forum.description}</p><%/if%>
					<%if {forum.moderators}!=""%><p class="moderators">版主: {forum.moderators}</p><%/if%>
				</th>
				<td class="nums"><%if {forum.istrade}!=1%>{forum.topics}<%else%>&nbsp;<%/if%></td>
				<td class="nums"><%if {forum.istrade}!=1%>{forum.posts}<%else%>&nbsp;<%/if%></td>
				<td class="lastpost">
				<%if {forum.istrade}!=1%>
				<%if {forum.status}==-1%>
					私密版块
				<%else%>
					<%if {forum.lasttid}!=0%>
					<p>
					   <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({forum.lasttid},0)%>
						<a href="{aspxrewriteurl}">{forum.lasttitle}</a>
					</p>
					<div class="topicbackwriter">by
						<%if {forum.lastposter}!=""%>
							<%if {forum.lastposterid}==-1%>
								游客
							<%else%>
							   <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({forum.lastposterid})%>
								<a href="{aspxrewriteurl}" target="_blank">{forum.lastposter}</a>
							<%/if%>
						<%else%>
							匿名
						<%/if%>						
						- <a href="showtopic.aspx?topicid={forum.lasttid}&page=end#lastpost" title="{forum.lastpost}"><span><script type="text/javascript">document.write(convertdate('{forum.lastpost}'));</script></span></a>
					</div>
					<%else%>
						从未
					<%/if%>
				<%/if%>
				<%else%>
				   <p>{forum.description}</p>
				<%/if%>
				</td>
			</tr>
		</tbody>
	<%else%>
	<%set {subforumcount}={subforumcount}+1%>
	<%set (double){colwidth} = 99.9 / {forum.colcount} %>
		<%if {subforumcount}==1%>
		<tbody>
		<tr>
		<%/if%>
			<th style="width:{colwidth}%;"<%if {forum.havenew}=="new" %>class="new"<%/if%>>
				<h2>
				<%if {forum.icon}!=""%>
					<img src="{forum.icon}" border="0" align="left" hspace="5" alt="{forum.name}"/>
				<%/if%>
				<%if {forum.redirect}==""%>
				    <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0,{forum.rewritename})%>
					<a href="{aspxrewriteurl}">
				<%else%>
					<a href="{forum.redirect}" target="_blank">
				<%/if%>
				{forum.name}</a>
				<%if {forum.todayposts}>0%>
				<em>({forum.todayposts})</em>
				<%/if%>
				</h2>
				<p><%if {forum.istrade}!=1%>主题:{forum.topics}, 帖数:{forum.posts}<%/if%></p>
				<%if {forum.istrade}!=1%>
				<%if {forum.status}==-1%>
				<p>私密版块</p>
				<%else%>
					<%if {forum.lasttid}!=0%>
						<p>最后: <a href="showtopic.aspx?topicid={forum.lasttid}&page=end#lastpost" title="{forum.lasttitle}"><span><script type="text/javascript">document.write(convertdate('{forum.lastpost}'));</script></span></a> by 
							<%if {forum.lastposter}!=""%>
								<%if {forum.lastposterid}==-1%>
									游客
								<%else%>
								   <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({forum.lastposterid})%>
									<a href="{aspxrewriteurl}" target="_blank">{forum.lastposter}</a>
								<%/if%>
							<%else%>
								匿名
							<%/if%>
						</p>
					<%/if%>				
				<%/if%>
				<%else%>
				  <p>{forum.description}</p>
				<%/if%>
			</th>
<%if {subforumcount}=={forum.colcount}%>
		</tr>
		</tbody>
	<%set {subforumcount}=0%>
<%/if%>
<%/if%>
	<%set {lastforumlayer}=1%>
	<%set {lastcolcount}={forum.colcount}%>
<%/if%>
<%/loop%>
<%if {lastcolcount}!=1 && {subforumcount}!=0%>
		<%repeat("<td>&nbsp;</td>", {lastcolcount}-{subforumcount})%>
		</tr>
<%/if%>
	</table>
</div>
<!--end topic-->
<%template _hottagbox%>
<%if {forumlinkcount}>0%>
<div class="box">
	<span class="headactions"><img id="forumlinks_img" src="templates/{templatepath}/images/collapsed_no.gif" alt="" onclick="toggle_collapse('forumlinks');"/></span>
	<h4>友情链接</h4>
	<div id="forumlinks">
	<%set (bool){forumlinkend} = false%>
	<%loop forumlink forumlinklist%>
		<%if {forumlink[_id]}==1%>
	<div class="forumlinks">	
		<ul>	
		<%/if%>
	<%if {forumlink[logo]}!=""%>
		<li>
			<a href="{forumlink[url]}" target="_blank"><img src="{forumlink[logo]}" alt="{forumlink[name]}"  class="forumlink_logo"/></a>
			<h5><a href="{forumlink[url]}" target="_blank">{forumlink[name]}</a></h5>
			<p>{forumlink[note]}</p>
		</li>
	<%else if {forumlink[name]}!="$$otherlink$$"%>
		<li>
			<h5>
				<a href="{forumlink[url]}" target="_blank">{forumlink[name]}</a>
			</h5>
			<p>{forumlink[note]}</p>
		</li>
	<%else%>
	<%if {forumlinkend}==false%>
		</ul>
	</div>
		<%set {forumlinkend} = true%>
	<%/if%>
	<div class="{forumlink[url]}">
		{forumlink[note]}
	</div>
	<%/if%>
	<%/loop%>
	<%if {forumlinkend}==false%>
	</ul>
	</div>
	<%/if%>
	</div>
</div>
<%/if%>

<%if {config.whosonlinestatus}!=0 && {config.whosonlinestatus}!=2%>
<div class="box" id="online">
	<span class="headactions">
		<%if {showforumonline}%>
		<a href="?showonline=no#online"><img src="templates/{templatepath}/images/collapsed_no.gif" alt="收起" /></a>			
		<%else%>
		<a href="?showonline=yes#online"><img src="templates/{templatepath}/images/collapsed_yes.gif" alt="展开" /></a>
		<%/if%>
	</span>
	<h4>
		<strong><a href="{forumurl}onlineuser.aspx">在线用户</a></strong> - <em>{totalonline}</em> 人在线 <%if {showforumonline}%>- {totalonlineuser} 会员<span id="invisible"></span>, {totalonlineguest} 游客<%/if%>- 最高记录是 <em>{highestonlineusercount}</em> 于 <em>{highestonlineusertime}</em>
		<em>共<strong>{totalusers}</strong>位会员 <span class="newuser">新会员:<a href="{UserInfoAspxRewrite(lastuserid)}">{lastusername}</a></span></em>
		<%if {showforumonline}==false%>
		<em><a href="?showonline=yes#online">点击查看在线列表</a></em>
		<%/if%>
	</h4>

	<%if {showforumonline}%>
	<dl id="onlinelist">
		<dt>{onlineiconlist}</dt>
		<dd>
			<ul class="userlist">
				<%set (int){invisiblecount} = 0%>
				<%loop (OnlineUserInfo) onlineuser onlineuserlist%>
					<%if {onlineuser.invisible}==1%>
						<%set {invisiblecount} = {invisiblecount} + 1%>
					
				
						<%if {useradminid}==1%>
						  <li>{onlineuser.olimg} 
						  <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({onlineuser.userid})%>
							<a href="{aspxrewriteurl}" target="_blank" 
									<%if {onlineuser.forumname}!=""%>
									title="时间: {onlineuser.lastupdatetime}
操作: {onlineuser.actionname}
版块: {onlineuser.forumname}"
									<%else if {onlineuser.actionname}!=""%>
									title="时间: {onlineuser.lastupdatetime}
操作: {onlineuser.actionname}"
									<%else%>
									title="时间: {onlineuser.lastupdatetime}"
									<%/if%>
>{onlineuser.username}</a>(隐身)</li>
						<%else%>
							<li>(隐身会员)</li>
						<%/if%>
				
					<%else%>
				<li>{onlineuser.olimg}
						<%if {onlineuser.userid}==-1%>
							{onlineuser.username}
						<%else%>
						   <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({onlineuser.userid})%>
							<a href="{aspxrewriteurl}" target="_blank" 
									<%if {onlineuser.forumname}!=""%>
									title="时间: {onlineuser.lastupdatetime}
操作: {onlineuser.actionname}
版块: {onlineuser.forumname}"
									<%else if {onlineuser.actionname}!=""%>
									title="时间: {onlineuser.lastupdatetime}
操作: {onlineuser.actionname}"
									<%else%>
									title="时间: {onlineuser.lastupdatetime}"
									<%/if%>
>{onlineuser.username}</a>
						<%/if%>
				</li>
					<%/if%>
				<%/loop%>
				<%if {invisiblecount}>0%>
					<script type="text/javascript">$('invisible').innerHTML = '({invisiblecount}' + " 隐身)";</script>
				<%/if%>
			</ul>
		</dd>
	</dl>
	<%/if%>

</div>
<%/if%>

<div class="legend">
	<label><img src="templates/{templatepath}/images/forum_new.gif" alt="有新帖的版块" />有新帖的版块</label>
	<label><img src="templates/{templatepath}/images/forum.gif" alt="无新帖的版块" />无新帖的版块</label>
</div>
<%if {config.forumjump}==1%>
	{navhomemenu}
<%/if%>
</div>
<%template _copyright%>
<%template _adlist%>
{mediaad}
{inforumad}
<%template _footer%>