<%@ Page language="c#" Codebehind="forumindex.aspx.cs" AutoEventWireup="false" EnableViewState="false" Inherits="Discuz.ForumPage.forumindex" %>
<%@ Import namespace="System.Data" %>
<%@ Import namespace="Discuz.Common" %>
<%@ Import namespace="Discuz.Forum" %>
<%@ Import namespace="Discuz.Entity" %>

<script runat="server">
override protected void OnInit(EventArgs e)
{

	/* 
		This page was created by Discuz!NT Template Engine at 2007-11-15 11:16:24.
		本页面代码由Discuz!NT模板引擎生成于 2007-11-15 11:16:24. 
	*/

	base.OnInit(e);


	templateBuilder.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
	templateBuilder.Append("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
	templateBuilder.Append("<head>\r\n");
	templateBuilder.Append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n");
	templateBuilder.Append("" + meta.ToString() + "\r\n");
	templateBuilder.Append("<title>" + pagetitle.ToString() + " " + config.Seotitle.ToString().Trim() + " - " + config.Forumtitle.ToString().Trim() + " - Powered by Discuz!NT</title>\r\n");
	templateBuilder.Append("<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\r\n");
	templateBuilder.Append("<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\" />\r\n");
	templateBuilder.Append("<!-- 调用样式表 -->\r\n");
	templateBuilder.Append("<link rel=\"stylesheet\" href=\"templates/" + templatepath.ToString() + "/dnt.css\" type=\"text/css\" media=\"all\"  />\r\n");
	templateBuilder.Append("" + link.ToString() + "\r\n");
	templateBuilder.Append("<script type=\"text/javascript\" src=\"templates/" + templatepath.ToString() + "/report.js\"></" + "script>\r\n");
	templateBuilder.Append("<script type=\"text/javascript\" src=\"templates/" + templatepath.ToString() + "/common.js\"></" + "script>\r\n");
	templateBuilder.Append("<script type=\"text/javascript\" src=\"editor/common.js\"></" + "script>\r\n");
	templateBuilder.Append("<script type=\"text/javascript\" src=\"editor/menu.js\"></" + "script>\r\n");
	templateBuilder.Append("" + script.ToString() + "\r\n");
	templateBuilder.Append("</head>\r\n");


	templateBuilder.Append("<body>\r\n");
	templateBuilder.Append("<div id=\"append_parent\"></div>\r\n");
	templateBuilder.Append("<div id=\"container\">\r\n");
	templateBuilder.Append("<!--header start-->\r\n");
	templateBuilder.Append("<div id=\"header\">\r\n");
	templateBuilder.Append("	<h2><a href=\"" + config.Forumurl.ToString().Trim() + "\" title=\"Discuz!NT|BBS|论坛 - Powered by Discuz!NT\"><img src=\"templates/" + templatepath.ToString() + "/images/logo.gif\" alt=\"Discuz! Board NT|BBS|论坛\"/></a></h2>\r\n");
	templateBuilder.Append("	<p id=\"topmenu\">\r\n");

	if (userid==-1)
	{

	templateBuilder.Append("			<a href=\"" + forumurl.ToString() + "login.aspx\" class=\"reg\">登录</a>\r\n");
	templateBuilder.Append("			<a href=\"" + forumurl.ToString() + "register.aspx\" class=\"reg\">注册</a>\r\n");

	}
	else
	{

	templateBuilder.Append("			欢迎: " + username.ToString() + "&nbsp;\r\n");
	templateBuilder.Append("			<a href=\"" + forumurl.ToString() + "logout.aspx?userkey=" + userkey.ToString() + "\" class=\"reg\">退出</a>\r\n");
	templateBuilder.Append("			<a href=\"" + forumurl.ToString() + "usercp.aspx\" class=\"reg\">用户中心</a>\r\n");

	if (useradminid==1)
	{

	templateBuilder.Append("				<a href=\"" + forumurl.ToString() + "admin/index.aspx\" target=\"_blank\"  class=\"reg\">系统设置</a>\r\n");

	}	//end if


	}	//end if


	if (config.Enablespace==1 || config.Enablealbum==1)
	{

	templateBuilder.Append("			<a href=\"" + config.Forumurl.ToString().Trim() + "\">论坛</a>\r\n");

	}	//end if


	if (config.Enablespace==1)
	{

	templateBuilder.Append("			<a href=\"" + config.Spaceurl.ToString().Trim() + "\">" + config.Spacename.ToString().Trim() + "</a>\r\n");

	}	//end if


	if (config.Enablealbum==1)
	{

	templateBuilder.Append("			<a href=\"" + config.Albumurl.ToString().Trim() + "\">" + config.Albumname.ToString().Trim() + "</a>\r\n");

	}	//end if


	if (usergroupinfo.Allowsearch>0)
	{

	templateBuilder.Append("			<a href=\"" + forumurl.ToString() + "search.aspx\">搜索</a>\r\n");

	}	//end if

	templateBuilder.Append("		<a href=\"" + forumurl.ToString() + "help.aspx\" target=\"_blank\">帮助</a>	\r\n");
	templateBuilder.Append("	</p>\r\n");

	if (headerad!="")
	{

	templateBuilder.Append("		<div id=\"ad\">" + headerad.ToString() + "</div>\r\n");

	}	//end if

	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<div id=\"wraper\">\r\n");
	templateBuilder.Append("<div id=\"menubar\">\r\n");
	templateBuilder.Append("	<div class=\"selectmode\">\r\n");
	templateBuilder.Append("	<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("		if(top == self) {\r\n");
	templateBuilder.Append("			document.write('<a href=\"frame.aspx?f=1\" target=\"_top\">分栏模式<\\/a>');\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("	</" + "script>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<ul id=\"navigation\">\r\n");

	if (userid!=-1)
	{

	templateBuilder.Append("		<li><a href=\"" + forumurl.ToString() + "usercpinbox.aspx\">短消息</a></li>\r\n");

	}	//end if

	templateBuilder.Append("		<li><a href=\"" + forumurl.ToString() + "showuser.aspx\">会员</a></li>\r\n");

	if (userid!=-1)
	{

	templateBuilder.Append("		<li id=\"my\" onMouseOver=\"showMenu(this.id);\" onMouseOut=\"showMenu(this.id);\"><a href=\"###\" class=\"mycontent\">我的</a></li>\r\n");

	}	//end if

	templateBuilder.Append("		<li><a href=\"" + forumurl.ToString() + "showtemplate.aspx\">界面</a></li>\r\n");
	templateBuilder.Append("		<li><a href=\"" + forumurl.ToString() + "archiver/index.aspx\">简洁版本</a></li>\r\n");
	templateBuilder.Append("		<li class=\"noground\"><a href=\"" + forumurl.ToString() + "onlineuser.aspx\">在线</a></li>\r\n");
	templateBuilder.Append("	</ul>\r\n");
	templateBuilder.Append("</div>\r\n");


	templateBuilder.Append("<!--foruminfo-->\r\n");
	templateBuilder.Append("<div id=\"foruminfo\">\r\n");
	templateBuilder.Append("	<div class=\"userinfo\">\r\n");
	templateBuilder.Append("		<h2><a id=\"NavHome\" href=\"" + config.Forumurl.ToString().Trim() + "\" \r\n");

	if (config.Forumjump==1)
	{

	templateBuilder.Append("		onmouseover=\"showMenu(this.id);\" onmouseout=\"showMenu(this.id);\"\r\n");

	}	//end if

	templateBuilder.Append(">" + config.Forumtitle.ToString().Trim() + "</a></h2>\r\n");
	templateBuilder.Append("		<p>主题:<em>" + totaltopic.ToString() + "</em>篇 　帖子:<em>" + totalpost.ToString() + "</em>个 　今日帖子:<em>" + todayposts.ToString() + "</em>个</p>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"forumstats\">\r\n");
	templateBuilder.Append("		<div id=\"search\">\r\n");

	if (usergroupinfo.Allowsearch>0)
	{


	templateBuilder.Append("			<form method=\"post\" action=\"search.aspx\" target=\"_blank\" onsubmit=\"bind_keyword(this);\">\r\n");
	templateBuilder.Append("			<input type=\"hidden\" name=\"poster\" />\r\n");
	templateBuilder.Append("			<input type=\"hidden\" name=\"keyword\" />\r\n");
	templateBuilder.Append("			<input type=\"hidden\" name=\"type\" value=\"\" />\r\n");
	templateBuilder.Append("			<input id=\"keywordtype\" type=\"hidden\" name=\"keywordtype\" value=\"0\"/>\r\n");
	templateBuilder.Append("			<div id=\"searchbar\">\r\n");
	templateBuilder.Append("				<dl>\r\n");
	templateBuilder.Append("					<dt id=\"quicksearch\" class=\"s2\" onclick=\"showMenu(this.id, false);\" onmouseover=\"MouseCursor(this);\">帖子标题</dt>\r\n");
	templateBuilder.Append("					<dd class=\"textinput\"><input type=\"text\" name=\"keywordf\" value=\"\" class=\"text\"/></dd>\r\n");
	templateBuilder.Append("					<dd><input name=\"searchsubmit\" type=\"submit\" value=\"\" class=\"s3\"/></dd>\r\n");
	templateBuilder.Append("				</dl>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("			</form>\r\n");
	templateBuilder.Append("			<script type=\"text/javascript\">function bind_keyword(form){if(form.keywordtype.value=='8'){form.keyword.value='';form.poster.value=form.keywordf.value; } else { form.poster.value=''; form.keyword.value=form.keywordf.value;if(form.keywordtype.value == '2')form.type.value = 'spacepost';if(form.keywordtype.value == '3')form.type.value = 'album';}}</" + "script>\r\n");



	}	//end if

	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<ul>\r\n");

	if (config.Enablespace==1)
	{


	if (isactivespace)
	{

	templateBuilder.Append("			<li><a href=\"" + spaceurl.ToString() + "space\">个人空间</a></li>\r\n");

	}
	else if (isallowapply)
	{

	templateBuilder.Append("			<li><a href=\"spaceregister.aspx\">申请个人空间</a></li>\r\n");

	}	//end if


	}	//end if

	templateBuilder.Append("			<li><a href=\"showtopiclist.aspx?type=newtopic&amp;newtopic=" + newtopicminute.ToString() + "&amp;forums=all\">查看新帖</a></li>\r\n");
	templateBuilder.Append("			<li><a href=\"showtopiclist.aspx?type=digest&amp;forums=all\">精华帖区</a></li>\r\n");

	if (config.Rssstatus!=0)
	{

	templateBuilder.Append("			<li class=\"lastitem\"><a href=\"tools/rss.aspx\" target=\"_blank\"><img src=\"templates/" + templatepath.ToString() + "/images/rss.gif\" alt=\"rss\"/></a></li>\r\n");

	}	//end if

	templateBuilder.Append("		</ul>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--foruminfo-->\r\n");

	if (announcementcount>0)
	{

	templateBuilder.Append("<!--announcement-->\r\n");
	templateBuilder.Append("<div id=\"announcement\">\r\n");
	templateBuilder.Append("	<div id=\"announcementbody\">\r\n");
	templateBuilder.Append("		<strong>公告:</strong>\r\n");
	templateBuilder.Append("		<marquee width=\"92%\" direction=\"left\" scrollamount=\"2\" scrolldelay=\"1\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\">\r\n");
	templateBuilder.Append("		<ul>\r\n");

	int announcement__loop__id=0;
	foreach(DataRow announcement in announcementlist.Rows)
	{
		announcement__loop__id++;

	templateBuilder.Append("			<li class=\"fontfamily\">" + announcement["starttime"].ToString().Trim() + "<a href=\"announcement.aspx#" + announcement["id"].ToString().Trim() + "\">" + announcement["title"].ToString().Trim() + "</a></li>\r\n");

	}	//end loop

	templateBuilder.Append("		</ul>\r\n");
	templateBuilder.Append("		</marquee>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--announcement-->\r\n");

	}	//end if



	if (pagewordad!="")
	{

	templateBuilder.Append("<!--adtext-->\r\n");
	templateBuilder.Append("<div id=\"adtext\">\r\n");
	templateBuilder.Append("	<div class=\"adtextbody\">\r\n");
	templateBuilder.Append("		<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
	templateBuilder.Append("			" + pagewordad.ToString() + "\r\n");
	templateBuilder.Append("		</table>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--adtext-->\r\n");

	}	//end if





	if (newpmcount>0 && showpmhint)
	{

	templateBuilder.Append("<!--短信息 area start-->\r\n");
	templateBuilder.Append("<div class=\"ntforumbox\">\r\n");

	if (pmsound>0)
	{

	templateBuilder.Append("		<bgsound src=\"sound/pm" + pmsound.ToString() + ".wav\" />\r\n");

	}	//end if

	templateBuilder.Append("	<div class=\"titlebar\">\r\n");
	templateBuilder.Append("		<span class=\"open\"><a href=\"usercpinbox.aspx\" target=\"_blank\">查看详情</a> <a href=\"###\" onclick=\"document.getElementById('frmnewpm').submit();\">不再提示</a></span>\r\n");
	templateBuilder.Append("		<h3>您有 " + newpmcount.ToString() + " 条新的短消息</h3>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"notelist\">\r\n");
	templateBuilder.Append("	<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n");

	int pm__loop__id=0;
	foreach(PrivateMessageInfo pm in pmlist)
	{
		pm__loop__id++;

	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\" onmouseover=\"this.className='liston'\" onmouseout=\"this.className='list'\">\r\n");
	templateBuilder.Append("			<td class=\"topicicon\"><img src=\"templates/" + templatepath.ToString() + "/images/message_" + pm.New.ToString().Trim() + ".gif\" alt=\"短信息\"/></td>\r\n");
	templateBuilder.Append("			<th class=\"forumlisttitle\"><a href=\"usercpshowpm.aspx?pmid=" + pm.Pmid.ToString().Trim() + "\">" + pm.Subject.ToString().Trim() + "</a></th>\r\n");
	templateBuilder.Append("			<td>\r\n");
	templateBuilder.Append("				<a href=\"userinfo.aspx?userid=" + pm.Msgfromid.ToString().Trim() + "\" target=\"_blank\">" + pm.Msgfrom.ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("				<span class=\"fontfamily\">" + pm.Postdatetime.ToString().Trim() + "</span>\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");

	}	//end loop

	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<form id=\"frmnewpm\" name=\"frmnewpm\" method=\"post\" action=\"#\">\r\n");
	templateBuilder.Append("		<input id=\"ignore\" name=\"ignore\" type=\"hidden\" value=\"yes\" />\r\n");
	templateBuilder.Append("	</form>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--短信息 area end-->\r\n");

	}	//end if



	templateBuilder.Append("<!--forumtopic-->\r\n");
	int lastforumlayer = -1;
	
	int lastcolcount = 1;
	
	int lastforumid = 0;
	
	int subforumcount = 0;
	

	int forum__loop__id=0;
	foreach(IndexPageForumInfo forum in forumlist)
	{
		forum__loop__id++;


	if (forum.Layer==0)
	{


	if (lastforumlayer>-1)
	{


	if (lastcolcount!=1)
	{


	if (subforumcount!=0)
	{

	templateBuilder.Append("		</tr>\r\n");

	}	//end if

	templateBuilder.Append("		</table>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");

	}
	else
	{

	templateBuilder.Append("			</table>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>			\r\n");

	}	//end if

	templateBuilder.Append("<div id=\"ad_intercat_" + lastforumid.ToString() + "\"></div>\r\n");

	}	//end if


	if (forum.Colcount==1)
	{

	templateBuilder.Append("<div class=\"ntforumbox forumtopic\">\r\n");
	templateBuilder.Append("	<div class=\"titlebar\">\r\n");
	templateBuilder.Append("		<span class=\"open\">\r\n");

	if (forum.Moderators!="")
	{

	templateBuilder.Append("			分类版主: " + forum.Moderators.ToString().Trim() + "\r\n");

	}	//end if

	templateBuilder.Append("<a href=\"###\" onclick=\"toggle_collapse('category_" + forum.Fid.ToString().Trim() + "');\" class=\"opentopic\"><img id=\"category_" + forum.Fid.ToString().Trim() + "_img\"  src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" /></a>\r\n");
	templateBuilder.Append("		</span>\r\n");
	templateBuilder.Append("		<h2>\r\n");
	 aspxrewriteurl = this.ShowForumAspxRewrite(forum.Fid,0);
	
	templateBuilder.Append("		<a href=\"" + aspxrewriteurl.ToString() + "\">" + forum.Name.ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("		</h2>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div id=\"category_" + forum.Fid.ToString().Trim() + "\">\r\n");
	templateBuilder.Append("	<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n");
	templateBuilder.Append("	<thead>\r\n");
	templateBuilder.Append("		<tr>\r\n");
	templateBuilder.Append("			<th class=\"topicicon\">&nbsp;</th>\r\n");
	templateBuilder.Append("			<th class=\"topictitle viewnumbers\">论坛</th>\r\n");
	templateBuilder.Append("			<th class=\"ntnumbers\">主题</th>\r\n");
	templateBuilder.Append("			<th class=\"ntnumbers\">帖子</th>\r\n");
	templateBuilder.Append("			<th class=\"lastposter viewnumbers\">最后发布</th>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</thead>\r\n");

	}
	else
	{

	templateBuilder.Append("<div class=\"ntforumbox forumtopic\">\r\n");
	templateBuilder.Append("	<div class=\"titlebar\">\r\n");
	templateBuilder.Append("		<span class=\"open\">\r\n");

	if (forum.Moderators!="")
	{

	templateBuilder.Append("			分类版主: " + forum.Moderators.ToString().Trim() + "\r\n");

	}	//end if

	templateBuilder.Append("<a href=\"###\" onclick=\"toggle_collapse('category_" + forum.Fid.ToString().Trim() + "');\" class=\"opentopic\"><img id= \"category_" + forum.Fid.ToString().Trim() + "_img\" src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" /></a>\r\n");
	templateBuilder.Append("		</span>\r\n");
	templateBuilder.Append("		<h2>\r\n");
	 aspxrewriteurl = this.ShowForumAspxRewrite(forum.Fid,0);
	
	templateBuilder.Append("			<a href=\"" + aspxrewriteurl.ToString() + "\">" + forum.Name.ToString().Trim() + "</a>					\r\n");
	templateBuilder.Append("		</h2>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div id=\"category_" + forum.Fid.ToString().Trim() + "\">\r\n");
	templateBuilder.Append("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">								\r\n");

	}	//end if

	 lastforumlayer = 0;
	
	 lastcolcount = forum.Colcount;
	
	 lastforumid = forum.Fid;
	

	}
	else
	{


	if (forum.Colcount==1)
	{

	templateBuilder.Append("		<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\" onmouseover=\"this.className='liston'\" onmouseout=\"this.className='list'\">\r\n");
	templateBuilder.Append("			<td class=\"topicicon\">\r\n");
	 aspxrewriteurl = this.ShowTopicAspxRewrite(forum.Lasttid,0);
	
	templateBuilder.Append("			<a href=\"" + aspxrewriteurl.ToString() + "\" target=\"_blank\"><img src=\"templates/" + templatepath.ToString() + "/images/forum_" + forum.Havenew.ToString().Trim() + ".gif\" border=\"0\" alt=\"图例\"/></a></td>\r\n");
	 aspxrewriteurl = this.ShowForumAspxRewrite(forum.Fid,0);
	
	templateBuilder.Append("			<th class=\"topictitle\" ondblclick=\"\r\n");

	if (forum.Redirect=="")
	{

	templateBuilder.Append("window.location.href='" + aspxrewriteurl.ToString() + "';\r\n");

	}
	else
	{

	templateBuilder.Append("window.open('" + forum.Redirect.ToString().Trim() + "');\r\n");

	}	//end if

	templateBuilder.Append("\">\r\n");

	if (forum.Icon!="")
	{

	templateBuilder.Append("						<img src=\"" + forum.Icon.ToString().Trim() + "\" border=\"0\" align=\"left\" hspace=\"5\" alt=\"图例\"/>\r\n");

	}	//end if

	templateBuilder.Append("				<h3>\r\n");

	if (forum.Redirect=="")
	{

	 aspxrewriteurl = this.ShowForumAspxRewrite(forum.Fid,0);
	
	templateBuilder.Append("						<a href=\"" + aspxrewriteurl.ToString() + "\">\r\n");

	}
	else
	{

	templateBuilder.Append("						<a href=\"" + forum.Redirect.ToString().Trim() + "\" target=\"_blank\">\r\n");

	}	//end if

	templateBuilder.Append("					" + forum.Name.ToString().Trim() + "</a>\r\n");

	if (forum.Todayposts>0)
	{

	templateBuilder.Append("<span class=\"today\">(" + forum.Todayposts.ToString().Trim() + ")</span>\r\n");

	}	//end if

	templateBuilder.Append("				</h3>\r\n");
	templateBuilder.Append("				<p>" + forum.Description.ToString().Trim() + "</p>\r\n");
	templateBuilder.Append("				<p class=\"topicmanager\"><span>版主:</span>\r\n");

	if (forum.Moderators!="")
	{

	templateBuilder.Append("" + forum.Moderators.ToString().Trim() + "\r\n");

	}
	else
	{

	templateBuilder.Append("空缺\r\n");

	}	//end if

	templateBuilder.Append("</p>\r\n");
	templateBuilder.Append("			</th>\r\n");
	templateBuilder.Append("			<td class=\"ntnumbers\">" + forum.Topics.ToString().Trim() + "</td>\r\n");
	templateBuilder.Append("			<td class=\"ntnumbers\">" + forum.Posts.ToString().Trim() + "</td>\r\n");
	templateBuilder.Append("			<td class=\"lastposter\">\r\n");

	if (forum.Status==-1)
	{

	templateBuilder.Append("				私密论坛\r\n");

	}
	else
	{


	if (forum.Lasttid!=0)
	{

	templateBuilder.Append("					<h4>\r\n");
	 aspxrewriteurl = this.ShowTopicAspxRewrite(forum.Lasttid,0);
	
	templateBuilder.Append("						<a href=\"" + aspxrewriteurl.ToString() + "\">" + forum.Lasttitle.ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("					</h4>\r\n");
	templateBuilder.Append("					<div class=\"topicbackwriter\">\r\n");

	if (forum.Lastposter!="")
	{


	if (forum.Lastposterid==-1)
	{

	templateBuilder.Append("								游客\r\n");

	}
	else
	{

	 aspxrewriteurl = this.UserInfoAspxRewrite(forum.Lastposterid);
	
	templateBuilder.Append("								<a href=\"" + aspxrewriteurl.ToString() + "\" target=\"_blank\">" + forum.Lastposter.ToString().Trim() + "</a>\r\n");

	}	//end if


	}
	else
	{

	templateBuilder.Append("							匿名\r\n");

	}	//end if

	 aspxrewriteurl = this.ShowTopicAspxRewrite(forum.Lasttid,0);
	
	templateBuilder.Append("						(<a href=\"" + aspxrewriteurl.ToString() + "\" title=\"" + forum.Lasttitle.ToString().Trim() + "\"><span><script type=\"text/javascript\">document.write(convertdate('" + forum.Lastpost.ToString().Trim() + "'));</" + "script></span></a>)\r\n");
	templateBuilder.Append("					</div>\r\n");

	}
	else
	{

	templateBuilder.Append("					从未\r\n");

	}	//end if


	}	//end if

	templateBuilder.Append("		  </td>\r\n");
	templateBuilder.Append("	   </tr>\r\n");
	templateBuilder.Append("	   </tbody>\r\n");

	}
	else
	{

	 subforumcount = subforumcount+1;
	
	double colwidth = 99.9 / forum.Colcount;
	

	if (subforumcount==1)
	{

	templateBuilder.Append("		<tr class=\"list\" onmouseover=\"this.className='liston'\" onmouseout=\"this.className='list'\">\r\n");

	}	//end if

	templateBuilder.Append("			<td style=\"width:" + colwidth.ToString() + "%;\" class=\"hlist\">\r\n");
	templateBuilder.Append("				<h4>\r\n");

	if (forum.Icon!="")
	{

	templateBuilder.Append("					<img src=\"" + forum.Icon.ToString().Trim() + "\" border=\"0\" align=\"left\" hspace=\"5\" alt=\"图例\"/>\r\n");

	}	//end if


	if (forum.Redirect=="")
	{

	 aspxrewriteurl = this.ShowForumAspxRewrite(forum.Fid,0);
	
	templateBuilder.Append("					<a href=\"" + aspxrewriteurl.ToString() + "\">\r\n");

	}
	else
	{

	templateBuilder.Append("					<a href=\"" + forum.Redirect.ToString().Trim() + "\" target=\"_blank\">\r\n");

	}	//end if

	templateBuilder.Append("				" + forum.Name.ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("				</h4>\r\n");
	templateBuilder.Append("				<p>主题:<strong>" + forum.Topics.ToString().Trim() + "</strong> 今日发帖:<strong>" + forum.Todayposts.ToString().Trim() + "</strong></p>\r\n");
	templateBuilder.Append("				<p class=\"topicmanager\">版主:\r\n");

	if (forum.Moderators!="")
	{

	templateBuilder.Append("" + forum.Moderators.ToString().Trim() + "\r\n");

	}
	else
	{

	templateBuilder.Append("空缺\r\n");

	}	//end if

	templateBuilder.Append("</p>\r\n");
	templateBuilder.Append("			</td>\r\n");

	if (subforumcount==forum.Colcount)
	{

	templateBuilder.Append("		</tr>\r\n");
	 subforumcount = 0;
	

	}	//end if


	}	//end if

	 lastforumlayer = 1;
	
	 lastcolcount = forum.Colcount;
	

	}	//end if


	}	//end loop


	if (lastcolcount!=1)
	{


	if (subforumcount!=0)
	{

	templateBuilder.Append("		</tr>\r\n");

	}	//end if

	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</div>\r\n");

	}
	else
	{

	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</div>\r\n");

	}	//end if

	templateBuilder.Append("<!--forumtopic-->\r\n");

	if (forumlinkcount>0)
	{

	templateBuilder.Append("<div class=\"ntforumbox forumlink\">\r\n");
	templateBuilder.Append("	<span class=\"open\"><a href=\"###\" onclick=\"toggle_collapse('linklist');\" class=\"opentopic\"><img id =\"linklist_img\" src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" /></a></span>\r\n");
	templateBuilder.Append("	<h4>友情链接</h4>\r\n");
	templateBuilder.Append("	<div id=\"linklist\">\r\n");
	templateBuilder.Append("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n");

	int forumlink__loop__id=0;
	foreach(DataRow forumlink in forumlinklist.Rows)
	{
		forumlink__loop__id++;


	if (forumlink["logo"].ToString().Trim()!="")
	{

	templateBuilder.Append("			<tbody>	\r\n");
	templateBuilder.Append("				<tr class=\"list\" >\r\n");
	templateBuilder.Append("					<td  class=\"topicicon\">\r\n");
	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/parters02.gif\" alt=\"友情链接\"/>\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("					<td class=\"linktitle\">\r\n");
	templateBuilder.Append("					<h3>\r\n");
	templateBuilder.Append("						<a href=\"" + forumlink["url"].ToString().Trim() + "\" target=\"_blank\">" + forumlink["name"].ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("					</h3>\r\n");
	templateBuilder.Append("					<p>" + forumlink["note"].ToString().Trim() + "</p>\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("					<td class=\"linklogo\">\r\n");
	templateBuilder.Append("						<a href=\"" + forumlink["url"].ToString().Trim() + "\" target=\"_blank\"><img src=\"" + forumlink["logo"].ToString().Trim() + "\" alt=\"" + forumlink["name"].ToString().Trim() + "\"/></a>\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("				</tr>\r\n");
	templateBuilder.Append("			</tbody>\r\n");

	}
	else if (forumlink["name"].ToString().Trim()!="$$otherlink$$")
	{

	templateBuilder.Append("			<tbody>\r\n");
	templateBuilder.Append("				<tr class=\"list\">\r\n");
	templateBuilder.Append("					<td class=\"topicicon\">\r\n");
	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/parters02.gif\" alt=\"友情链接\"/>\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("					<td colspan=\"2\"  class=\"linktitle\">\r\n");
	templateBuilder.Append("					<h3>\r\n");
	templateBuilder.Append("						<a href=\"" + forumlink["url"].ToString().Trim() + "\" target=\"_blank\">" + forumlink["name"].ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("					</h3>\r\n");
	templateBuilder.Append("					<p>" + forumlink["note"].ToString().Trim() + "</p>\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("				</tr>\r\n");
	templateBuilder.Append("			</tbody>\r\n");

	}
	else
	{

	templateBuilder.Append("			<tbody>\r\n");
	templateBuilder.Append("				<tr class=\"list\">\r\n");
	templateBuilder.Append("					<td  class=\"topicicon\">\r\n");
	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/parters02.gif\" alt=\"友情链接\"/>\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("					<td colspan=\"2\"  class=\"linktitle\">\r\n");
	templateBuilder.Append("						" + forumlink["note"].ToString().Trim() + "\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("			   </tr>\r\n");
	templateBuilder.Append("			</tbody>\r\n");

	}	//end if


	}	//end loop

	templateBuilder.Append("		</table>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");

	}	//end if


	if (config.Whosonlinestatus!=0 && config.Whosonlinestatus!=2)
	{

	templateBuilder.Append("<div class=\"onlineuser\">\r\n");
	templateBuilder.Append("	<span class=\"open\">\r\n");

	if (DNTRequest.GetString("showonline")=="no")
	{

	templateBuilder.Append("			<a href=\"?showonline=yes#online\" class=\"opentopic\"><img src=\"templates/" + templatepath.ToString() + "/images/open_yes.gif\" alt=\"展开/收起\" />\r\n");

	}
	else
	{

	templateBuilder.Append("			<a href=\"?showonline=no#online\"  class=\"opentopic\"><img src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" />\r\n");

	}	//end if

	templateBuilder.Append("	</a>\r\n");
	templateBuilder.Append("	</span>\r\n");
	templateBuilder.Append("	<h4>\r\n");
	templateBuilder.Append("		<strong>在线用户:" + totalonline.ToString() + "人</strong>\r\n");
	templateBuilder.Append("		<em>最高纪录是 <strong>" + highestonlineusercount.ToString() + "</strong>  于 /  " + highestonlineusertime.ToString() + " </em>	\r\n");
	templateBuilder.Append("	</h4>\r\n");
	templateBuilder.Append("	<dl class=\"onlineuserlist\">\r\n");
	templateBuilder.Append("		<dt>" + onlineiconlist.ToString() + "</dt>\r\n");
	templateBuilder.Append("		<dd class=\"onlineusernumber\">\r\n");
	templateBuilder.Append("			共<strong>" + totalusers.ToString() + "</strong>位会员 <span class=\"newuser\">新会员:\r\n");
	 aspxrewriteurl = this.UserInfoAspxRewrite(lastuserid);
	
	templateBuilder.Append("			<a href=\"" + aspxrewriteurl.ToString() + "\">" + lastusername.ToString() + "</a></span>\r\n");
	templateBuilder.Append("		</dd>\r\n");
	templateBuilder.Append("		<dd>\r\n");
	templateBuilder.Append("			<ul id=\"online\">\r\n");

	if (showforumonline)
	{


	int onlineuser__loop__id=0;
	foreach(OnlineUserInfo onlineuser in onlineuserlist)
	{
		onlineuser__loop__id++;


	if (onlineuser.Invisible==1)
	{

	templateBuilder.Append("				<li>(隐身会员)</li>\r\n");

	}
	else
	{

	templateBuilder.Append("				<li>" + onlineuser.Olimg.ToString().Trim() + "\r\n");

	if (onlineuser.Userid==-1)
	{

	templateBuilder.Append("							" + onlineuser.Username.ToString().Trim() + "\r\n");

	}
	else
	{

	 aspxrewriteurl = this.UserInfoAspxRewrite(onlineuser.Userid);
	
	templateBuilder.Append("							<a href=\"" + aspxrewriteurl.ToString() + "\" target=\"_blank\">" + onlineuser.Username.ToString().Trim() + "</a>\r\n");

	}	//end if

	templateBuilder.Append("				</li>\r\n");

	}	//end if


	}	//end loop


	}
	else
	{

	templateBuilder.Append("				<li class=\"seelist\"><a href=\"?showonline=yes#online\">点击查看在线列表</a></li>\r\n");

	}	//end if

	templateBuilder.Append("			</ul>\r\n");
	templateBuilder.Append("		</dd>\r\n");
	templateBuilder.Append("	</dl>\r\n");
	templateBuilder.Append("</div>\r\n");

	}	//end if

	templateBuilder.Append("<div id=\"navcutline\">\r\n");
	templateBuilder.Append("		<strong>无新帖的论坛</strong>\r\n");
	templateBuilder.Append("		<em>有新帖的论坛</em>\r\n");
	templateBuilder.Append("</div>\r\n");

	if (config.Forumjump==1)
	{

	templateBuilder.Append("	" + navhomemenu.ToString() + "\r\n");

	}	//end if

	templateBuilder.Append("</div>\r\n");


	if (footerad!="")
	{

	templateBuilder.Append("<!--底部广告显示-->\r\n");
	templateBuilder.Append("<div id=\"bottomad\">" + footerad.ToString() + "</div>\r\n");
	templateBuilder.Append("<!--底部广告结束-->\r\n");

	}	//end if

	templateBuilder.Append("<div id=\"forumfooter\">\r\n");
	templateBuilder.Append("	<div class=\"footercopy\">\r\n");
	templateBuilder.Append("	 	<p>\r\n");
	templateBuilder.Append("			版权所有 <a href=\"" + config.Weburl.ToString().Trim() + "\" target=\"_blank\">" + config.Webtitle.ToString().Trim() + "</a>&nbsp; " + config.Linktext.ToString().Trim() + "\r\n");

	if (config.Sitemapstatus==1)
	{

	templateBuilder.Append("&nbsp;<a href=\"tools/sitemap.aspx\" target=\"_blank\" title=\"百度论坛收录协议\">Sitemap</a>\r\n");

	}	//end if

	templateBuilder.Append("		</p>\r\n");
	templateBuilder.Append("		<span>Powered by <a href=\"http://nt.discuz.net\" target=\"_blank\" title=\"Discuz!NT 2.0 (.net Framework 1.1)\"><em>Discuz!NT</em></a>&nbsp;<em>2.0.1115 \r\n");

	if (config.Licensed==1)
	{

	templateBuilder.Append("				(<a href=\"\" onclick=\"this.href='http://nt.discuz.net/certificate/?host='+location.href.substring(0, location.href.lastIndexOf('/'))\" target=\"_blank\">Licensed</a>)\r\n");

	}	//end if

	templateBuilder.Append("				&nbsp;&nbsp; " + config.Forumcopyright.ToString().Trim() + "</em>\r\n");

	if (config.Debug!=0)
	{

	templateBuilder.Append("<br/>\r\n");
	templateBuilder.Append("				Processed in " + this.Processtime.ToString().Trim() + " second(s)\r\n");

	if (isguestcachepage==1)
	{

	templateBuilder.Append("						(Cached).\r\n");

	}
	else if (querycount>1)
	{

	templateBuilder.Append("				        , " + querycount.ToString() + " queries.\r\n");

	}
	else
	{

	templateBuilder.Append("				        , " + querycount.ToString() + " query.\r\n");

	}	//end if


	}	//end if

	templateBuilder.Append("				" + config.Icp.ToString().Trim() + "\r\n");
	templateBuilder.Append("		 </span>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"footergoto\">\r\n");
	templateBuilder.Append("		<span><img src=\"templates/" + templatepath.ToString() + "/images/gototop2.gif\" alt=\"返顶部\" onclick=\"window.scrollTo(0,0)\" /></span>\r\n");

	if (config.Stylejump==1)
	{


	if (userid!=-1 || config.Guestcachepagetimeout<=0)
	{

	templateBuilder.Append("		<select onchange=\"if(this.options[this.selectedIndex].value != '') {window.location=('showtemplate.aspx?templateid='+this.options[this.selectedIndex].value) }\">\r\n");
	templateBuilder.Append("			<option selected>切换界面...</option>\r\n");
	templateBuilder.Append("			" + templatelistboxoptions.ToString() + "\r\n");
	templateBuilder.Append("		</select>\r\n");

	}	//end if


	}	//end if

	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<div id=\"my_menu\" class=\"ntdropmenu\" style=\"display: none;\">\r\n");
	templateBuilder.Append("		<a href=\"mytopics.aspx\">我的主题</a>\r\n");
	templateBuilder.Append("		<a href=\"myposts.aspx\">我的帖子</a>\r\n");
	templateBuilder.Append("		<a href=\"search.aspx?posterid=" + userid.ToString() + "&amp;type=digest\">我的精华</a>\r\n");

	if (config.Enablespace==1)
	{

	templateBuilder.Append("		<a href=\"" + spaceurl.ToString() + "space/\">我的空间</a>\r\n");

	}	//end if


	if (config.Enablealbum==1)
	{

	templateBuilder.Append("		<a href=\"showalbumlist.aspx?uid=" + userid.ToString() + "\">我的相册</a>\r\n");

	}	//end if

	templateBuilder.Append("		<script type=\"text/javascript\" src=\"javascript/mymenu.js\"></" + "script>\r\n");
	templateBuilder.Append("</div>\r\n");




	if (floatad!="")
	{

	templateBuilder.Append("	<script type=\"text/javascript\" src=\"templates/" + templatepath.ToString() + "/floatadv.js\"></" + "script>\r\n");
	templateBuilder.Append("	" + floatad.ToString() + "\r\n");
	templateBuilder.Append("	<script type=\"text/javascript\">theFloaters.play();</" + "script>\r\n");

	}
	else
	{


	if (doublead!="")
	{

	templateBuilder.Append("		<script type=\"text/javascript\" src=\"templates/" + templatepath.ToString() + "/floatadv.js\"></" + "script>\r\n");
	templateBuilder.Append("		" + doublead.ToString() + "\r\n");
	templateBuilder.Append("		<script type=\"text/javascript\">theFloaters.play();</" + "script>\r\n");

	}	//end if


	}	//end if



	templateBuilder.Append("" + mediaad.ToString() + "\r\n");
	templateBuilder.Append("" + inforumad.ToString() + "\r\n");

	templateBuilder.Append("<div id=\"quicksearch_menu\" class=\"searchmenu\" style=\"display: none;\">\r\n");
	templateBuilder.Append("				<div onclick=\"document.getElementById('keywordtype').value='0';document.getElementById('quicksearch').innerHTML='帖子标题';document.getElementById('quicksearch_menu').style.display='none';\" onmouseover=\"MouseCursor(this);\">帖子标题</div>\r\n");
	templateBuilder.Append("				<div onclick=\"document.getElementById('keywordtype').value='2';document.getElementById('quicksearch').innerHTML='空间日志';document.getElementById('quicksearch_menu').style.display='none';\" onmouseover=\"MouseCursor(this);\">空间日志</div>\r\n");
	templateBuilder.Append("				<div onclick=\"document.getElementById('keywordtype').value='3';document.getElementById('quicksearch').innerHTML='相册标题';document.getElementById('quicksearch_menu').style.display='none';\" onmouseover=\"MouseCursor(this);\">相册标题</div>\r\n");
	templateBuilder.Append("				<div onclick=\"document.getElementById('keywordtype').value='8';document.getElementById('quicksearch').innerHTML='作&nbsp;&nbsp;者';document.getElementById('quicksearch_menu').style.display='none';\" onmouseover=\"MouseCursor(this);\">作&nbsp;&nbsp;者</div>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</body>\r\n");
	templateBuilder.Append("</html>\r\n");



	Response.Write(templateBuilder.ToString());
}
</script>
