<%@ Page language="c#" Codebehind="showforum.aspx.cs" AutoEventWireup="false" EnableViewState="false" Inherits="Discuz.ForumPage.showforum" %>
<%@ 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:15:54.
		本页面代码由Discuz!NT模板引擎生成于 2007-11-15 11:15:54. 
	*/

	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("<!--header start-->\r\n");
	templateBuilder.Append("<div id=\"headerbody\">\r\n");
	templateBuilder.Append("<div id=\"nthead\">\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.jpg\" alt=\"Discuz! Board NT|BBS|论坛\"/></a>\r\n");
	templateBuilder.Append("		</h2>\r\n");

	if (pagename=="forumindex.aspx")
	{

	templateBuilder.Append("	<ul id=\"iconmenu\">\r\n");

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

	templateBuilder.Append("		<li>\r\n");
	templateBuilder.Append("					<a href=\"" + config.Forumurl.ToString().Trim() + "\"><img src=\"templates/" + templatepath.ToString() + "/images/Headforum.jpg\" alt=\"论坛\"/></a>\r\n");
	templateBuilder.Append("			<h3><a href=\"" + config.Forumurl.ToString().Trim() + "\">论坛</a></h3>\r\n");
	templateBuilder.Append("		</li>\r\n");

	}	//end if


	if (config.Enablespace==1)
	{

	templateBuilder.Append("				<li>\r\n");
	templateBuilder.Append("					<a href=\"" + config.Spaceurl.ToString().Trim() + "\"><img src=\"templates/" + templatepath.ToString() + "/images/headspace.jpg\"  alt=\"个人空间\"/></a>\r\n");
	templateBuilder.Append("			<h3><a href=\"" + config.Spaceurl.ToString().Trim() + "\">" + config.Spacename.ToString().Trim() + "</a></h3>\r\n");
	templateBuilder.Append("		</li>\r\n");

	}	//end if


	if (config.Enablealbum==1)
	{

	templateBuilder.Append("				<li>\r\n");
	templateBuilder.Append("			<a href=\"" + config.Albumurl.ToString().Trim() + "\"><img src=\"templates/" + templatepath.ToString() + "/images/headphoto.jpg\" alt=\"相册\"/></a>\r\n");
	templateBuilder.Append("			<h3><a href=\"" + config.Albumurl.ToString().Trim() + "\">" + config.Albumname.ToString().Trim() + "</a></h3>\r\n");
	templateBuilder.Append("		</li>\r\n");

	}	//end if

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

	}	//end if

	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 (pagename!="forumindex.aspx")
	{


	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


	}	//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=\"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("</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<div id=\"container\">\r\n");
	templateBuilder.Append("<div id=\"wraper\">\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 type=\"text/javascript\" src=\"templates/" + templatepath.ToString() + "/ajax.js\"></" + "script>\r\n");

	if (page_err==0)
	{

	templateBuilder.Append("	<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("	var templatepath = \"" + templatepath.ToString() + "\";\r\n");
	templateBuilder.Append("	var fid = parseInt(" + forum.Fid.ToString().Trim() + ");\r\n");
	templateBuilder.Append("	var postminchars = parseInt(" + config.Minpostsize.ToString().Trim() + ");\r\n");
	templateBuilder.Append("	var postmaxchars = parseInt(" + config.Maxpostsize.ToString().Trim() + ");\r\n");
	templateBuilder.Append("	var disablepostctrl = parseInt(" + disablepostctrl.ToString() + ");\r\n");
	templateBuilder.Append("	</" + "script>\r\n");

	}	//end if

	templateBuilder.Append("<script type=\"text/javascript\" src=\"templates/" + templatepath.ToString() + "/showforum.js\"></" + "script>\r\n");
	templateBuilder.Append("<!--TheCurrent area start-->\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><span>" + forumnav.ToString() + "</span>\r\n");
	templateBuilder.Append("		</h2>\r\n");

	if (page_err==0)
	{

	templateBuilder.Append("		<p>  版主: \r\n");
	templateBuilder.Append("			<em>\r\n");

	if (forum.Moderators!="")
	{

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

	}
	else
	{

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

	}	//end if

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

	}	//end if

	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");

	if (page_err==0)
	{

	templateBuilder.Append("			<ul>\r\n");
	templateBuilder.Append("				<li><a href=\"showtopiclist.aspx?type=digest&amp;forums=" + forum.Fid.ToString().Trim() + "\">精华帖区</a></li>\r\n");

	if (config.Rssstatus!=0)
	{

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

	}	//end if

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

	}	//end if

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

	if (page_err==0)
	{


	if (config.Forumjump==1)
	{

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

	}	//end if

	templateBuilder.Append("<!--position area end-->\r\n");

	if (showforumlogin==1)
	{

	templateBuilder.Append("	<div class=\"ntforumbox\">\r\n");
	templateBuilder.Append("		<div class=\"titlebar\">\r\n");
	templateBuilder.Append("			<h2>本版块已经被管理员设置了密码</h2>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<form id=\"forumlogin\" name=\"forumlogin\" method=\"post\" action=\"\">\r\n");
	templateBuilder.Append("				<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n");
	templateBuilder.Append("					<tbody>\r\n");
	templateBuilder.Append("					<tr class=\"list\">\r\n");
	templateBuilder.Append("						<th class=\"formlabel\">请输入密码:</th>\r\n");
	templateBuilder.Append("						<td class=\"formbody\"><input name=\"forumpassword\" type=\"password\" id=\"forumpassword\" size=\"20\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" /></td>\r\n");
	templateBuilder.Append("					</tr>\r\n");
	templateBuilder.Append("					</tbody>\r\n");

	if (isseccode)
	{

	templateBuilder.Append("					<tbody>\r\n");
	templateBuilder.Append("					<tr class=\"list\">\r\n");
	templateBuilder.Append("						<th class=\"formlabel\">输入验证码:</th>\r\n");
	templateBuilder.Append("						<td class=\"formbody\"><p class=\"formcode\">\r\n");

	templateBuilder.Append("<!-- onkeydown=\"return (event.keyCode ? event.keyCode : event.which ? event.which : event.charCode) != 13\"-->\r\n");
	templateBuilder.Append("<input size=\"10\"  style=\"width:50px;\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" onkeyup=\"changevcode(this.form, this.value);\" />\r\n");
	templateBuilder.Append("&nbsp;\r\n");
	templateBuilder.Append("<img src=\"tools/VerifyImagePage.aspx?time=" + Processtime.ToString() + "\" class=\"cursor\" id=\"vcodeimg\"  width=\"90\" height=\"50\" onclick=\"this.src='tools/VerifyImagePage.aspx?id=" + olid.ToString() + "&time=' + Math.random();\" />\r\n");
	templateBuilder.Append("<input name=\"reloadvcade\" type=\"button\" class=\"colorblue\" id=\"reloadvcade\" value=\"刷新验证码\"  onclick=\"document.getElementById('vcodeimg').src='tools/VerifyImagePage.aspx?time=' + Math.random();\" tabindex=\"-1\"  style=\"color:#99cc00; width:75px;\" />\r\n");
	templateBuilder.Append("<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("	$('vcodeimg').src='tools/VerifyImagePage.aspx?time=' + Math.random();\r\n");
	templateBuilder.Append("	//document.getElementById('vcode').value = \"\";\r\n");
	templateBuilder.Append("	function changevcode(form, value)\r\n");
	templateBuilder.Append("	{\r\n");
	templateBuilder.Append("		if (!$('vcode'))\r\n");
	templateBuilder.Append("		{\r\n");
	templateBuilder.Append("			var vcode = document.createElement('input');\r\n");
	templateBuilder.Append("			vcode.id = 'vcode';\r\n");
	templateBuilder.Append("			vcode.name = 'vcode';\r\n");
	templateBuilder.Append("			vcode.type = 'hidden';\r\n");
	templateBuilder.Append("			vcode.value = value;\r\n");
	templateBuilder.Append("			form.appendChild(vcode);\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("		else\r\n");
	templateBuilder.Append("		{\r\n");
	templateBuilder.Append("			$('vcode').value = value;\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("	}\r\n");
	templateBuilder.Append("</" + "script>\r\n");


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

	}	//end if

	templateBuilder.Append("					<tbody>\r\n");
	templateBuilder.Append("					<tr class=\"list\">\r\n");
	templateBuilder.Append("						<td colspan=\"2\" class=\"formarea\">\r\n");
	templateBuilder.Append("									<input type=\"submit\"  value=\"确定\" class=\"sbutton\"/>\r\n");
	templateBuilder.Append("						</td>\r\n");
	templateBuilder.Append("					</tr>\r\n");
	templateBuilder.Append("					</tbody>\r\n");
	templateBuilder.Append("				</table>\r\n");
	templateBuilder.Append("		</form>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>\r\n");

	}
	else
	{



	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 (forum.Rules!="")
	{

	templateBuilder.Append("<!--NtForumLink start-->\r\n");
	templateBuilder.Append("<div class=\"ntforumbox forumrules\">\r\n");
	templateBuilder.Append("	<h4>本版规则</h4>\r\n");
	templateBuilder.Append("	<p>" + forum.Rules.ToString().Trim() + "</p>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--NtForumLink end-->\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




	if (subforumcount>0)
	{



	if (forum.Colcount==1)
	{

	templateBuilder.Append("<!--ntforumboxstart-->\r\n");
	templateBuilder.Append("	<div class=\"ntforumbox\">\r\n");
	templateBuilder.Append("			<div class=\"titlebar\">\r\n");
	templateBuilder.Append("					<div class=\"open\"><a href=\"###\" onclick=\"toggle_collapse('category_" + forum.Fid.ToString().Trim() + "');\"><img src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" id=\"category_" + forum.Fid.ToString().Trim() + "_img\" /></a></div>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("			<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\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>最后发布</th>\r\n");
	templateBuilder.Append("				</tr>\r\n");
	templateBuilder.Append("				</thead>\r\n");
	templateBuilder.Append("			<div id=\"category_" + forum.Fid.ToString().Trim() + "\">\r\n");

	int subforum__loop__id=0;
	foreach(IndexPageForumInfo subforum in subforumlist)
	{
		subforum__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\">\r\n");
	 aspxrewriteurl = this.ShowTopicAspxRewrite(subforum.Lasttid,0);
	
	templateBuilder.Append("						<a href=\"" + aspxrewriteurl.ToString() + "\" target=\"_blank\"><img src=\"templates/" + templatepath.ToString() + "/images/forum_" + subforum.Havenew.ToString().Trim() + ".gif\"  alt=\"主题\"/></a>\r\n");
	templateBuilder.Append("					</td>\r\n");
	 aspxrewriteurl = this.ShowForumAspxRewrite(subforum.Fid,0);
	
	templateBuilder.Append("					<th class=\"topictitle\" ondblclick=\"\r\n");

	if (subforum.Redirect=="")
	{

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

	}
	else
	{

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

	}	//end if

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

	if (subforum.Icon!="")
	{

	templateBuilder.Append("								<img src=\"" + subforum.Icon.ToString().Trim() + "\" alt=\"主题图\"  hspace=\"5\" />\r\n");

	}	//end if


	if (subforum.Redirect=="")
	{

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

	}
	else
	{

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

	}	//end if

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

	if (subforum.Todayposts>0)
	{

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

	}	//end if

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

	if (subforum.Moderators!="")
	{

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

	}
	else
	{

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

	}	//end if

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

	if (subforum.Status==-1)
	{

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

	}
	else
	{


	if (subforum.Lasttid!=0)
	{

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

	if (subforum.Lastposter!="")
	{


	if (subforum.Lastposterid==-1)
	{

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

	}
	else
	{

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

	}	//end if


	}
	else
	{

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

	}	//end if

	 aspxrewriteurl = this.ShowTopicAspxRewrite(subforum.Lasttid,0);
	
	templateBuilder.Append("										<a href=\"" + aspxrewriteurl.ToString() + "\" title=\"" + subforum.Lasttitle.ToString().Trim() + "\"><span><script type=\"text/javascript\">document.write(convertdate('" + subforum.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");

	}	//end loop

	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("			</table>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("<!--ntforumbox end-->\r\n");

	}
	else
	{

	templateBuilder.Append("<!--ntforumbox start-->\r\n");
	templateBuilder.Append("<div class=\"ntforumbox\">\r\n");
	templateBuilder.Append("				<div class=\"titlebar\">\r\n");
	templateBuilder.Append("				<h2>子论坛</h2>\r\n");
	templateBuilder.Append("				<span class=\"open\"><a href=\"###\" onclick=\"toggle_collapse('category_" + forum.Fid.ToString().Trim() + "');\"><img src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" id=\"category_" + forum.Fid.ToString().Trim() + "_img\" /></a></span>\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");

	int subforum__loop__id=0;
	foreach(IndexPageForumInfo subforum in subforumlist)
	{
		subforum__loop__id++;

	double colwidth = 99.6 / 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 (subforum.Icon!="")
	{

	templateBuilder.Append("									<img src=\"" + subforum.Icon.ToString().Trim() + "\" alt=\"主题图\" hspace=\"5\" />\r\n");

	}	//end if


	if (subforum.Redirect=="")
	{

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

	}
	else
	{

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

	}	//end if

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

	}	//end loop

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

	if (subforumcount==forum.Colcount)
	{

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

	}	//end if

	templateBuilder.Append("				</table>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--ntforumbox end-->\r\n");

	}	//end if




	}	//end if


	if (forum.Layer!=0)
	{

	templateBuilder.Append("<div class=\"forumpages\">\r\n");
	templateBuilder.Append("  <div class=\"forumpagesnumbers\">\r\n");
	templateBuilder.Append("  			<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
	templateBuilder.Append("				<tr>\r\n");
	templateBuilder.Append("					<td class=\"forumallpages\"><strong>" + pageid.ToString() + "</strong>&nbsp;&nbsp;/&nbsp;&nbsp;" + pagecount.ToString() + "&nbsp;&nbsp;页</td>\r\n");
	templateBuilder.Append("					<td width=\"10\">&nbsp;</td>\r\n");
	templateBuilder.Append("					<td class=\"forumallpages\">" + pagenumbers.ToString() + "</td>\r\n");
	templateBuilder.Append("					<td class=\"forumallpages3\">跳转<input name=\"gopage\" type=\"text\" id=\"gopage\" onKeyDown=\"if(event.keyCode==13) { if(parseInt('" + config.Aspxrewrite.ToString().Trim() + "')==1) {window.location='showforum-" + forumid.ToString() + "-' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) + '" + config.Extname.ToString().Trim() + "';}else{window.location='showforum.aspx?forumid=" + forumid.ToString() + "&page=' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1)}}\" size=\"4\" maxlength=\"9\" class=\"colorblue2\"/>页</td>\r\n");
	templateBuilder.Append("				</tr>\r\n");
	templateBuilder.Append("			</table>\r\n");
	templateBuilder.Append("  </div>\r\n");
	templateBuilder.Append("  <div class=\"pagesothers\">\r\n");

	if (canposttopic)
	{

	templateBuilder.Append("		<a href=\"posttopic.aspx?forumid=" + forum.Fid.ToString().Trim() + "\"><img src=\"templates/" + templatepath.ToString() + "/images/write-bbs.gif\" alt=\"发布新帖\" /></a>\r\n");

	}	//end if

	templateBuilder.Append("  </div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<form id=\"moderate\" name=\"moderate\" method=\"post\" action=\"topicadmin.aspx?action=moderate&forumid=" + forumid.ToString() + "\">\r\n");
	templateBuilder.Append("<div class=\"ntforumbox forumlist\">\r\n");
	templateBuilder.Append("	<div class=\"titlebar\">\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("			<em>(主题:" + topiccount.ToString() + "篇 帖子:" + forum.Posts.ToString().Trim() + "个 今日帖子:" + forum.Todayposts.ToString().Trim() + "个)</em>\r\n");
	templateBuilder.Append("		</h2>\r\n");
	templateBuilder.Append("		<div class=\"open\">\r\n");

	if (forum.Applytopictype==1 && forum.Viewbytopictype==1)
	{

	templateBuilder.Append("					&nbsp;" + topictypeselectlink.ToString() + "\r\n");

	}	//end if

	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\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=\"listicon\">&nbsp;</th>\r\n");
	templateBuilder.Append("				<th class=\"forumlisttitle\" style=\"text-align:center\">标题</th>\r\n");
	templateBuilder.Append("				<th class=\"listitem\"  style=\"text-align:center\">作者</th>\r\n");
	templateBuilder.Append("				<th class=\"listitem viewnumbers\">回复/查看</th>\r\n");
	templateBuilder.Append("				<th class=\"listitem listlast\">最后发布</th>\r\n");
	templateBuilder.Append("			</tr>\r\n");
	templateBuilder.Append("		</thead>\r\n");
	templateBuilder.Append("		<!--announcement start-->\r\n");

	int announcement__loop__id=0;
	foreach(DataRow announcement in announcementlist.Rows)
	{
		announcement__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/announcement.gif\" alt=\"announcement\" /></td>\r\n");
	templateBuilder.Append("				<td>&nbsp;</td>\r\n");
	templateBuilder.Append("				<th class=\"forumlisttitle\">\r\n");
	templateBuilder.Append("					<a href=\"announcement.aspx#" + announcement["id"].ToString().Trim() + "\">" + announcement["title"].ToString().Trim() + "</a>\r\n");
	templateBuilder.Append("				</th>\r\n");
	templateBuilder.Append("				<td colspan=3>\r\n");

	if (Utils.StrToInt(announcement["posterid"].ToString().Trim(), 0)==-1)
	{

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

	}
	else
	{

	 aspxrewriteurl = this.UserInfoAspxRewrite(announcement["posterid"].ToString().Trim());
	
	templateBuilder.Append("							<a href=\"" + aspxrewriteurl.ToString() + "\">" + announcement["poster"].ToString().Trim() + "</a>\r\n");

	}	//end if

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

	}	//end loop

	templateBuilder.Append("		<!--announcement end-->\r\n");
	templateBuilder.Append("		<!--NtForumList start-->\r\n");

	int toptopic__loop__id=0;
	foreach(ShowforumPageTopicInfo toptopic in toptopiclist)
	{
		toptopic__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\">\r\n");
	 aspxrewriteurl = this.ShowTopicAspxRewrite(toptopic.Tid,0);
	
	templateBuilder.Append("					<a href=\"" + aspxrewriteurl.ToString() + "\" target=\"_blank\"><img src=\"templates/" + templatepath.ToString() + "/images/t_top" + toptopic.Displayorder.ToString().Trim() + ".gif\" alt=\"topicicon\"/></a>\r\n");
	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("				<td class=\"listicon\">\r\n");

	if (toptopic.Iconid!=0)
	{

	templateBuilder.Append("							<img src=\"images/posticons/" + toptopic.Iconid.ToString().Trim() + ".gif\" alt=\"listicon\" />\r\n");

	}
	else
	{

	templateBuilder.Append("							&nbsp;\r\n");

	}	//end if

	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("				<th class=\"forumlisttitle\">\r\n");

	if (useradminid>0 && ismoder)
	{


	if (toptopic.Fid==forum.Fid)
	{

	templateBuilder.Append("						<input type=\"checkbox\" name=\"topicid\" value=\"" + toptopic.Tid.ToString().Trim() + "\" />\r\n");

	}
	else
	{

	templateBuilder.Append("						<input type=\"checkbox\" disabled />\r\n");

	}	//end if


	}	//end if


	if (toptopic.Replies>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/topItem_exp.gif\" id=\"imgButton_" + toptopic.Tid.ToString().Trim() + "\" onclick=\"showtree(" + toptopic.Tid.ToString().Trim() + "," + ppp.ToString() + "," + config.Aspxrewrite.ToString().Trim() + ");\" class=\"cursor\" alt=\"展开帖子列表\" title=\"展开帖子列表\" />\r\n");

	}
	else
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/no-sublist.gif\" id=\"imgButton_" + toptopic.Tid.ToString().Trim() + "\" alt=\"闭合帖子列表\"/>\r\n");

	}	//end if


	if (forum.Applytopictype==1 && forum.Topictypeprefix==1)
	{

	templateBuilder.Append("							" + toptopic.Topictypename.ToString().Trim() + "\r\n");

	}	//end if

	 aspxrewriteurl = this.ShowTopicAspxRewrite(toptopic.Tid,0);
	
	templateBuilder.Append("					<a href=\"" + aspxrewriteurl.ToString() + "\">" + toptopic.Title.ToString().Trim() + "</a>\r\n");

	if (toptopic.Price>0)
	{

	templateBuilder.Append("						- [售价 " + userextcreditsinfo.Name.ToString().Trim() + " <span class=\"bold\">" + toptopic.Price.ToString().Trim() + "</span> " + userextcreditsinfo.Unit.ToString().Trim() + "] \r\n");

	}	//end if


	if (toptopic.Readperm>0)
	{

	templateBuilder.Append("						- [阅读权限 <span class=\"bold\">" + toptopic.Readperm.ToString().Trim() + "</span>] \r\n");

	}	//end if


	if (toptopic.Digest>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/digest" + toptopic.Digest.ToString().Trim() + ".gif\" alt=\"digtest\"/>\r\n");

	}	//end if


	if (toptopic.Poll>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/pollsmall.gif\" alt=\"投票\" />\r\n");

	}	//end if


	if (toptopic.Attachment>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/attachment.gif\" alt=\"附件\"/>\r\n");

	}	//end if


	if (toptopic.Replies/ppp>0)
	{

	templateBuilder.Append("							<span class=\"platepage\"><script type=\"text/javascript\">getpagenumbers(\"" + config.Extname.ToString().Trim() + "\"," + toptopic.Replies.ToString().Trim() + "," + ppp.ToString() + ",0,\"\"," + toptopic.Tid.ToString().Trim() + ");</" + "script></span>					\r\n");

	}	//end if

	templateBuilder.Append("				</th>\r\n");
	templateBuilder.Append("				<td class=\"listitem\">\r\n");
	templateBuilder.Append("						<h3>\r\n");

	if (toptopic.Posterid==-1)
	{

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

	}
	else
	{

	 aspxrewriteurl = this.UserInfoAspxRewrite(toptopic.Posterid);
	
	templateBuilder.Append("							<a href=\"" + aspxrewriteurl.ToString() + "\">" + toptopic.Poster.ToString().Trim() + "</a>\r\n");

	}	//end if

	templateBuilder.Append("</h3>\r\n");
	templateBuilder.Append("						<p><script type=\"text/javascript\">document.write(convertdate('" + toptopic.Postdatetime.ToString().Trim() + "'));</" + "script></p>\r\n");
	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("				<td class=\"listitem viewnumbers\"><em>" + toptopic.Replies.ToString().Trim() + "</em> / " + toptopic.Views.ToString().Trim() + "</td>\r\n");
	templateBuilder.Append("				<td class=\"listitem listlast\">\r\n");

	if (toptopic.Replies>0)
	{

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

	if (toptopic.Lastposterid==-1)
	{

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

	}
	else
	{

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

	}	//end if

	templateBuilder.Append("<a href=\"showtopic.aspx?topicid=" + toptopic.Tid.ToString().Trim() + "&page=end\"><img src=\"templates/" + templatepath.ToString() + "/images/writer2.gif\" border=\"0\" alt=\"发布者\"/></a>\r\n");
	templateBuilder.Append("						</h4>\r\n");
	templateBuilder.Append("							<p><script type=\"text/javascript\">document.write(convertdate('" + toptopic.Lastpost.ToString().Trim() + "'));</" + "script></p>\r\n");

	}
	else
	{

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

	}	//end if

	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("			</tr>\r\n");
	templateBuilder.Append("		</tbody>\r\n");
	templateBuilder.Append("		<tbody>\r\n");
	templateBuilder.Append("			<tr><td colspan=6 id=\"divTopic" + toptopic.Tid.ToString().Trim() + "\"></td></tr>\r\n");
	templateBuilder.Append("		</tbody>\r\n");

	}	//end loop

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

	if (showsplitter)
	{

	templateBuilder.Append("	<div class=\"forumdetailline\">&nbsp;</div>\r\n");

	}	//end if

	templateBuilder.Append("	<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n");

	int topic__loop__id=0;
	foreach(ShowforumPageTopicInfo topic in topiclist)
	{
		topic__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\">\r\n");

	if (topic.Folder!="")
	{

	 aspxrewriteurl = this.ShowTopicAspxRewrite(topic.Tid,0);
	
	templateBuilder.Append("					<a href=\"" + aspxrewriteurl.ToString() + "\" target=\"_blank\"><img src=\"templates/" + templatepath.ToString() + "/images/folder_" + topic.Folder.ToString().Trim() + ".gif\" alt=\"topicicon\" /></a>\r\n");

	}	//end if

	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("				<td class=\"listicon\">\r\n");

	if (topic.Iconid!=0)
	{

	templateBuilder.Append("						<img src=\"images/posticons/" + topic.Iconid.ToString().Trim() + ".gif\" alt=\"listicon\"/>\r\n");

	}
	else
	{

	templateBuilder.Append("						&nbsp;\r\n");

	}	//end if

	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("				<th class=\"forumlisttitle\">\r\n");

	if (useradminid>0 && ismoder)
	{

	templateBuilder.Append("						<input type=\"checkbox\" name=\"topicid\" value=\"" + topic.Tid.ToString().Trim() + "\" />\r\n");

	}	//end if


	if (topic.Replies>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/topItem_exp.gif\" id=\"imgButton_" + topic.Tid.ToString().Trim() + "\" onclick=\"showtree(" + topic.Tid.ToString().Trim() + "," + ppp.ToString() + "," + config.Aspxrewrite.ToString().Trim() + ");\" class=\"cursor\" alt=\"展开帖子列表\" title=\"展开帖子列表\" />\r\n");

	}
	else
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/no-sublist.gif\" id=\"imgButton_" + topic.Tid.ToString().Trim() + "\" alt=\"闭合帖子列表\" />\r\n");

	}	//end if


	if (pageid==1 && forum.Allowthumbnail==1)
	{


	if (topic.Attachment==2)
	{

	templateBuilder.Append("							<span id=\"t_thumbnail_" + topic.Tid.ToString().Trim() + "\" onmouseover=\"showMenu(this.id, 0, 0, 1, 0)\">\r\n");

	if (forum.Applytopictype==1 && forum.Topictypeprefix==1)
	{

	templateBuilder.Append("								" + topic.Topictypename.ToString().Trim() + "\r\n");

	}	//end if

	 aspxrewriteurl = this.ShowTopicAspxRewrite(topic.Tid,0);
	
	templateBuilder.Append("							<a href=\"" + aspxrewriteurl.ToString() + "\">" + topic.Title.ToString().Trim() + "</a>\r\n");

	if (topic.Folder=="new")
	{

	templateBuilder.Append("								<img src=\"templates/" + templatepath.ToString() + "/images/posts_new.gif\" />\r\n");

	}	//end if

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

	}
	else
	{


	if (forum.Applytopictype==1 && forum.Topictypeprefix==1)
	{

	templateBuilder.Append("								" + topic.Topictypename.ToString().Trim() + "\r\n");

	}	//end if

	 aspxrewriteurl = this.ShowTopicAspxRewrite(topic.Tid,0);
	
	templateBuilder.Append("						   <a href=\"" + aspxrewriteurl.ToString() + "\">" + topic.Title.ToString().Trim() + "</a>\r\n");

	if (topic.Folder=="new")
	{

	templateBuilder.Append("								<img src=\"templates/" + templatepath.ToString() + "/images/posts_new.gif\"/>\r\n");

	}	//end if


	}	//end if


	}
	else
	{


	if (forum.Applytopictype==1 && forum.Topictypeprefix==1)
	{

	templateBuilder.Append("							" + topic.Topictypename.ToString().Trim() + "\r\n");

	}	//end if

	 aspxrewriteurl = this.ShowTopicAspxRewrite(topic.Tid,0);
	
	templateBuilder.Append("					<a href=\"" + aspxrewriteurl.ToString() + "\">" + topic.Title.ToString().Trim() + "</a>\r\n");

	if (topic.Folder=="new")
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/posts_new.gif\"/>\r\n");

	}	//end if


	}	//end if


	if (topic.Price>0)
	{

	templateBuilder.Append("						- [售价 " + userextcreditsinfo.Name.ToString().Trim() + " <span class=\"bold\">" + topic.Price.ToString().Trim() + "</span> " + userextcreditsinfo.Unit.ToString().Trim() + "] \r\n");

	}	//end if


	if (topic.Readperm>0)
	{

	templateBuilder.Append("						- [阅读权限 <span class=\"bold\">" + topic.Readperm.ToString().Trim() + "</span>] \r\n");

	}	//end if


	if (topic.Digest>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/digest" + topic.Digest.ToString().Trim() + ".gif\" />\r\n");

	}	//end if


	if (topic.Poll>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/pollsmall.gif\" />\r\n");

	}	//end if


	if (topic.Attachment>0)
	{

	templateBuilder.Append("						<img src=\"templates/" + templatepath.ToString() + "/images/attachment.gif\" />\r\n");

	}	//end if


	if (topic.Replies/ppp>0)
	{

	templateBuilder.Append("						<span class=\"platepage\"><script type=\"text/javascript\">getpagenumbers(\"" + config.Extname.ToString().Trim() + "\", " + topic.Replies.ToString().Trim() + "," + ppp.ToString() + ",0,\"\"," + topic.Tid.ToString().Trim() + ");</" + "script></span>\r\n");

	}	//end if

	templateBuilder.Append("				</th>\r\n");
	templateBuilder.Append("				<td class=\"listitem\">\r\n");
	templateBuilder.Append("						<h3>\r\n");

	if (topic.Posterid==-1)
	{

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

	}
	else
	{

	 aspxrewriteurl = this.UserInfoAspxRewrite(topic.Posterid);
	
	templateBuilder.Append("							<a href=\"" + aspxrewriteurl.ToString() + "\">" + topic.Poster.ToString().Trim() + "</a>\r\n");

	}	//end if

	templateBuilder.Append("</h3>\r\n");
	templateBuilder.Append("						<p><script type=\"text/javascript\">document.write(convertdate('" + topic.Postdatetime.ToString().Trim() + "'));</" + "script></p>\r\n");
	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("				<td class=\"listitem viewnumbers\"><em>" + topic.Replies.ToString().Trim() + "</em> / " + topic.Views.ToString().Trim() + "</td>\r\n");
	templateBuilder.Append("				<td class=\"listitem listlast\">							\r\n");

	if (topic.Replies>0)
	{

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

	if (topic.Lastposterid==-1)
	{

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

	}
	else
	{

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

	}	//end if

	templateBuilder.Append("							<a href=\"showtopic.aspx?topicid=" + topic.Tid.ToString().Trim() + "&page=end\"><img src=\"templates/" + templatepath.ToString() + "/images/writer2.gif\"/></a>\r\n");
	templateBuilder.Append("							</h4>\r\n");
	templateBuilder.Append("							<p><script type=\"text/javascript\">document.write(convertdate('" + topic.Lastpost.ToString().Trim() + "'));</" + "script></p>\r\n");

	}
	else
	{

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

	}	//end if

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

	if (pageid==1 && forum.Allowthumbnail==1)
	{


	if (topic.Attachment==2)
	{

	string timg = Attachments.GetThumbnailByTid(topic.Tid,160,ThumbnailType.Thumbnail);
	

	if (timg!="")
	{

	templateBuilder.Append("					<div id=\"t_thumbnail_" + topic.Tid.ToString().Trim() + "_menu\" style=\"display: none;\" class=\"popupmenu_popup\"><img src=\"" + timg.ToString() + "\" /></div>\r\n");

	}	//end if


	}	//end if


	}	//end if

	templateBuilder.Append("		<tbody>\r\n");
	templateBuilder.Append("			<tr><td colspan=6 id=\"divTopic" + topic.Tid.ToString().Trim() + "\"></td></tr>\r\n");
	templateBuilder.Append("		</tbody>\r\n");

	}	//end loop

	templateBuilder.Append("		<!--NtForumList end-->\r\n");
	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("	<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n");

	if (useradminid>0 && ismoder)
	{

	templateBuilder.Append("		<tbody>\r\n");
	templateBuilder.Append("			<tr>\r\n");
	templateBuilder.Append("				<td colspan=6 class=\"froumlistmanager\"><strong>批量管理选项</strong> &nbsp;\r\n");
	templateBuilder.Append("					<input class=\"radio\" name=\"operat\" type=\"hidden\" />\r\n");
	templateBuilder.Append("					<input class=\"checkbox\" name=\"chkall\" onclick=\"checkall(this.form, 'topicid')\" type=\"checkbox\" />全选\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'delete';document.moderate.submit()\" value=\"删除主题\" type=\"button\" /> \r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'move';document.moderate.submit()\" value=\"移动主题\" type=\"button\" />\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'highlight';document.moderate.submit()\" value=\"高亮显示\" type=\"button\" />\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'type';document.moderate.submit()\" value=\"主题分类\" type=\"button\" />\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'identify';document.moderate.submit()\" value=\"鉴定主题\" type=\"button\" />\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'close';document.moderate.submit()\" value=\"关闭/打开主题\" type=\"button\" />\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'displayorder';document.moderate.submit()\" value=\"置顶/解除置顶\" type=\"button\" />\r\n");
	templateBuilder.Append("					<input class=\"lightbutton\" onclick=\"document.moderate.operat.value = 'digest';document.moderate.submit()\" value=\"加入/解除精华\" type=\"button\" />\r\n");
	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("			</tr>\r\n");
	templateBuilder.Append("		</tbody>\r\n");

	}	//end if

	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</form>\r\n");
	templateBuilder.Append("<div class=\"forumpages\">\r\n");
	templateBuilder.Append("  <div class=\"forumpagesnumbers\">\r\n");
	templateBuilder.Append("	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
	templateBuilder.Append("		<tr>\r\n");
	templateBuilder.Append("			<td class=\"forumallpages\"><strong>" + pageid.ToString() + "</strong>&nbsp;&nbsp;/&nbsp;&nbsp;" + pagecount.ToString() + "&nbsp;&nbsp;页</td>\r\n");
	templateBuilder.Append("			<td width=\"10\">&nbsp;</td>\r\n");
	templateBuilder.Append("			<td class=\"forumallpages\">" + pagenumbers.ToString() + "</td>\r\n");
	templateBuilder.Append("			<td class=\"forumallpages3\">跳转<input name=\"gopage\" type=\"text\" id=\"gopage\" onKeyDown=\"if(event.keyCode==13) { if(parseInt('" + config.Aspxrewrite.ToString().Trim() + "')==1) {window.location='showforum-" + forumid.ToString() + "-' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) + '" + config.Extname.ToString().Trim() + "';}else{window.location='showforum.aspx?forumid=" + forumid.ToString() + "&page=' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1)}}\" size=\"4\" maxlength=\"9\" class=\"colorblue2\"/>页</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("  </div>\r\n");
	templateBuilder.Append("  <div class=\"pagesothers\">\r\n");

	if (canposttopic)
	{

	templateBuilder.Append("		<a href=\"posttopic.aspx?forumid=" + forum.Fid.ToString().Trim() + "\"><img src=\"templates/" + templatepath.ToString() + "/images/write-bbs2.gif\" alt=\"发布新帖\" /></a>\r\n");

	}	//end if

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

	if (canquickpost)
	{

	templateBuilder.Append("<!--快速发表主题-->\r\n");


	if (quickeditorad!="")
	{

	templateBuilder.Append("<div class=\"leaderboard\">" + quickeditorad.ToString() + "</div>\r\n");

	}	//end if

	templateBuilder.Append("<script type=\"text/javascript\" src=\"editor/post.js\"></" + "script>\r\n");
	templateBuilder.Append("<div class=\"ntforumbox\">\r\n");
	templateBuilder.Append("	<div class=\"titlebar\">\r\n");
	templateBuilder.Append("		<h3>快速发布主题</h3>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<form method=\"post\" name=\"postform\" id=\"postform\" action=\"posttopic.aspx?forumid=" + forumid.ToString() + "\"\r\n");
	templateBuilder.Append("	enctype=\"multipart/form-data\" onsubmit=\"return validate(this);\">\r\n");
	templateBuilder.Append("	<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel quicklabel\">标题</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\">\r\n");

	if (forum.Applytopictype==1 && topictypeselectoptions!="")
	{

	templateBuilder.Append("						<select name=\"typeid\" ID=\"typeid\">" + topictypeselectoptions.ToString() + "</select>\r\n");

	}	//end if

	templateBuilder.Append("					<input type=\"text\" id=\"title\" name=\"title\" size=\"84\" tabindex=\"1\" value=\"\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" />\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		 <tr>\r\n");
	templateBuilder.Append("			<td class=\"formlabel editorbody quicklabel\">\r\n");
	templateBuilder.Append("						<input type=\"checkbox\" value=\"1\" name=\"parseurloff\" ID=\"parseurloff\"\r\n");

	if (parseurloff==1)
	{

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

	}	//end if

	templateBuilder.Append("						 /> 禁用 URL 识别<br /><input type=\"checkbox\" value=\"1\" name=\"smileyoff\" ID=\"smileyoff\"\r\n");

	if (smileyoff==1)
	{

	templateBuilder.Append("								checked disabled\r\n");

	}	//end if

	templateBuilder.Append("						 /> 禁用表情<br /><input type=\"checkbox\" value=\"1\" name=\"bbcodeoff\" ID=\"bbcodeoff\"\r\n");

	if (bbcodeoff==1)
	{

	templateBuilder.Append("								checked disabled\r\n");

	}	//end if

	templateBuilder.Append("						 /> 禁用 Discuz!NT 代码<br /><input type=\"checkbox\" value=\"1\" name=\"usesig\" ID=\"usesig\"\r\n");

	if (usesig==1)
	{

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

	}	//end if

	templateBuilder.Append("						 /> 使用个人签名\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("			<td class=\"formbody editorbody\">\r\n");
	templateBuilder.Append("					<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >\r\n");
	templateBuilder.Append("					  <tr>\r\n");
	templateBuilder.Append("						<td valign=\"top\" class=\"navtextarea\"><textarea rows=\"7\" cols=\"80\" name=\"message\" id=\"message\" onKeyDown=\"ctlent(event);\" tabindex=\"2\" class=\"autosave colorblue\" onfocus=\"this.className='autosave colorfocus';\" onblur=\"this.className='autosave colorblue';\" ></textarea>\r\n");

	if (isseccode)
	{

	templateBuilder.Append("<p class=\"formcode\">验证码:\r\n");

	templateBuilder.Append("<!-- onkeydown=\"return (event.keyCode ? event.keyCode : event.which ? event.which : event.charCode) != 13\"-->\r\n");
	templateBuilder.Append("<input size=\"10\"  style=\"width:50px;\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" onkeyup=\"changevcode(this.form, this.value);\" />\r\n");
	templateBuilder.Append("&nbsp;\r\n");
	templateBuilder.Append("<img src=\"tools/VerifyImagePage.aspx?time=" + Processtime.ToString() + "\" class=\"cursor\" id=\"vcodeimg\"  width=\"90\" height=\"50\" onclick=\"this.src='tools/VerifyImagePage.aspx?id=" + olid.ToString() + "&time=' + Math.random();\" />\r\n");
	templateBuilder.Append("<input name=\"reloadvcade\" type=\"button\" class=\"colorblue\" id=\"reloadvcade\" value=\"刷新验证码\"  onclick=\"document.getElementById('vcodeimg').src='tools/VerifyImagePage.aspx?time=' + Math.random();\" tabindex=\"-1\"  style=\"color:#99cc00; width:75px;\" />\r\n");
	templateBuilder.Append("<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("	$('vcodeimg').src='tools/VerifyImagePage.aspx?time=' + Math.random();\r\n");
	templateBuilder.Append("	//document.getElementById('vcode').value = \"\";\r\n");
	templateBuilder.Append("	function changevcode(form, value)\r\n");
	templateBuilder.Append("	{\r\n");
	templateBuilder.Append("		if (!$('vcode'))\r\n");
	templateBuilder.Append("		{\r\n");
	templateBuilder.Append("			var vcode = document.createElement('input');\r\n");
	templateBuilder.Append("			vcode.id = 'vcode';\r\n");
	templateBuilder.Append("			vcode.name = 'vcode';\r\n");
	templateBuilder.Append("			vcode.type = 'hidden';\r\n");
	templateBuilder.Append("			vcode.value = value;\r\n");
	templateBuilder.Append("			form.appendChild(vcode);\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("		else\r\n");
	templateBuilder.Append("		{\r\n");
	templateBuilder.Append("			$('vcode').value = value;\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("	}\r\n");
	templateBuilder.Append("</" + "script>\r\n");


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

	}	//end if

	templateBuilder.Append("</td>\r\n");
	templateBuilder.Append("						<td valign=\"top\">\r\n");
	templateBuilder.Append("								<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("								var textobj = $('message');\r\n");
	templateBuilder.Append("								var lang = new Array();\r\n");
	templateBuilder.Append("								if (is_ie >= 5 || is_moz >= 2) {\r\n");
	templateBuilder.Append("									window.onbeforeunload = function () {\r\n");
	templateBuilder.Append("										saveData(textobj.value);\r\n");
	templateBuilder.Append("									};\r\n");
	templateBuilder.Append("									lang['post_autosave_none'] = \"没有可以恢复的数据\";\r\n");
	templateBuilder.Append("									lang['post_autosave_confirm'] = \"本操作将覆盖当前帖子内容，确定要恢复数据吗？\";\r\n");
	templateBuilder.Append("								}\r\n");
	templateBuilder.Append("								else {\r\n");
	templateBuilder.Append("									$('restoredata').style.display = 'none';\r\n");
	templateBuilder.Append("								}\r\n");
	templateBuilder.Append("								var bbinsert = parseInt('1');\r\n");
	templateBuilder.Append("								var smileyinsert = parseInt('1');\r\n");
	templateBuilder.Append("								var editor_id = 'posteditor';\r\n");
	templateBuilder.Append("								var smiliesCount = 9;\r\n");
	templateBuilder.Append("								var colCount = 3;\r\n");
	templateBuilder.Append("								var showsmiliestitle = 0;\r\n");
	templateBuilder.Append("								var smiliesIsCreate = 0;\r\n");
	templateBuilder.Append("								var scrMaxLeft; //表情滚动条宽度\r\n");
	templateBuilder.Append("					var smilies_HASH = {};\r\n");
	templateBuilder.Append("				</" + "script>\r\n");
	string defaulttypname = string.Empty;
	
	templateBuilder.Append("			<div class=\"navcontrol\">\r\n");
	templateBuilder.Append("			<div class=\"smiliepanel\">\r\n");
	templateBuilder.Append("					<div id=\"scrollbar\" class=\"scrollbar\">\r\n");
	templateBuilder.Append("							<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n");
	templateBuilder.Append("								<tr>\r\n");

	int stype__loop__id=0;
	foreach(DataRow stype in smilietypes.Rows)
	{
		stype__loop__id++;


	if (stype__loop__id==1)
	{

	 defaulttypname = stype["code"].ToString().Trim();
	

	}	//end if

	templateBuilder.Append("									<td id=\"t_s_" + stype__loop__id.ToString() + "\"><div id=\"s_" + stype__loop__id.ToString() + "\" onclick=\"showsmiles(" + stype__loop__id.ToString() + ", '" + stype["code"].ToString().Trim() + "');\">" + stype["code"].ToString().Trim() + "</div></td>\r\n");

	}	//end loop

	templateBuilder.Append("								</tr>\r\n");
	templateBuilder.Append("							</table>\r\n");
	templateBuilder.Append("					</div>\r\n");
	templateBuilder.Append("					<div id=\"scrlcontrol\">\r\n");
	templateBuilder.Append("						<img src=\"editor/images/smilie_prev_default.gif\" alt=\"向前\" onmouseover=\"if($('scrollbar').scrollLeft>0)this.src=this.src.replace(/_default|_selected/, '_hover');\" onmouseout=\"this.src=this.src.replace(/_hover|_selected/, '_default');\" onmousedown=\"if($('scrollbar').scrollLeft>0){this.src=this.src.replace(/_hover|_default/, '_selected');this.boder=1;}\" onmouseup=\"if($('scrollbar').scrollLeft>0)this.src=this.src.replace(/_selected/, '_hover');else{this.src=this.src.replace(/_selected|_hover/, '_default');}this.border=0;\" onclick=\"scrollSmilieTypeBar($('scrollbar'), 0-$('t_s_1').clientWidth);\"/>&nbsp;\r\n");
	templateBuilder.Append("						<img src=\"editor/images/smilie_next_default.gif\" alt=\"向后\" onmouseover=\"if($('scrollbar').scrollLeft<scrMaxLeft)this.src=this.src.replace(/_default|_selected/, '_hover');\" onmouseout=\"this.src=this.src.replace(/_hover|_selected/, '_default');\" onmousedown=\"if($('scrollbar').scrollLeft<scrMaxLeft){this.src=this.src.replace(/_hover|_default/, '_selected');this.boder=1;}\" onmouseup=\"if($('scrollbar').scrollLeft<scrMaxLeft)this.src=this.src.replace(/_selected/, '_hover');else{this.src=this.src.replace(/_selected|_hover/, '_default');}this.border=0;\" onclick=\"scrollSmilieTypeBar($('scrollbar'), $('t_s_1').clientWidth);\" />\r\n");
	templateBuilder.Append("					</div>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("			<div id=\"showsmilie\"></div>\r\n");
	templateBuilder.Append("			<div id=\"showsmilie_pagenum\">&nbsp;</div>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("				<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("		            function getSmilies(func){\r\n");
	templateBuilder.Append("		                var c=\"tools/ajax.aspx?t=smilies\";\r\n");
	templateBuilder.Append("		                _sendRequest(c,function(d){var e={};try{e=eval(\"(\"+d+\")\")}catch(f){e={}}var h=e?e:null;func(h);e=null;func=null},false,true)\r\n");
	templateBuilder.Append("	                }\r\n");
	templateBuilder.Append("					window.onload = function() {\r\n");
	templateBuilder.Append("		                getSmilies(function(obj){ \r\n");
	templateBuilder.Append("	                    smilies_HASH = obj; \r\n");
	templateBuilder.Append("	                    showsmiles(1, '" + defaulttypname.ToString() + "');\r\n");
	templateBuilder.Append("	                    });\r\n");
	templateBuilder.Append("						$('scrollbar').scrollLeft = 10000;\r\n");
	templateBuilder.Append("						scrMaxLeft = $('scrollbar').scrollLeft;\r\n");
	templateBuilder.Append("						$('scrollbar').scrollLeft = 1;	\r\n");
	templateBuilder.Append("						if ($('scrollbar').scrollLeft > 0)\r\n");
	templateBuilder.Append("						{\r\n");
	templateBuilder.Append("							$('scrlcontrol').style.display = '';\r\n");
	templateBuilder.Append("							$('scrollbar').scrollLeft = 0;	\r\n");
	templateBuilder.Append("						}\r\n");
	templateBuilder.Append("					}\r\n");
	templateBuilder.Append("				</" + "script>\r\n");
	templateBuilder.Append("				       </td>\r\n");
	templateBuilder.Append("				     </tr>\r\n");
	templateBuilder.Append("				  </table>\r\n");
	templateBuilder.Append("				</td>\r\n");
	templateBuilder.Append("			  </tr>\r\n");
	templateBuilder.Append("			 </tbody>\r\n");
	templateBuilder.Append("			 <tbody>\r\n");
	templateBuilder.Append("			 	<tr class=\"list quickpost\">\r\n");
	templateBuilder.Append("					<td colspan=2  class=\"formarea\"><input class=\"sbutton\" type=\"submit\" id=\"postsubmit\" name=\"topicsubmit\" value=\"发表帖子\" tabindex=\"3\" />\r\n");
	templateBuilder.Append("					[完成后可按 Ctrl+Enter 发布]&nbsp;&nbsp;<input class=\"lightbutton\" name=\"restoredata\" id=\"restoredata\" value=\"恢复数据\" tabindex=\"5\" title=\"恢复上次自动保存的数据\" onclick=\"loadData();\" type=\"button\" />&nbsp;<input name=\"topicsreset\" class=\"lightbutton\" value=\"清空内容\" tabindex=\"6\" type=\"reset\" />\r\n");
	templateBuilder.Append("					<input type=\"hidden\" id=\"postbytopictype\" name=\"postbytopictype\" value=\"" + forum.Postbytopictype.ToString().Trim() + "\" tabindex=\"3\" />\r\n");
	templateBuilder.Append("					</td>\r\n");
	templateBuilder.Append("				</tr>\r\n");
	templateBuilder.Append("			 </tbody>\r\n");
	templateBuilder.Append("	  </table>\r\n");
	templateBuilder.Append("</form>\r\n");
	templateBuilder.Append("</div>\r\n");



	}	//end if

	templateBuilder.Append("<div id=\"forumjumping\">\r\n");
	templateBuilder.Append("	<div class=\"jumpmodule\">\r\n");

	if (config.Forumjump==1)
	{

	templateBuilder.Append("    <select onchange=\"if(this.options[this.selectedIndex].value != '') { if(" + config.Aspxrewrite.ToString().Trim() + ") { window.location='showforum-' + this.options[this.selectedIndex].value + '" + config.Extname.ToString().Trim() + "';}else{window.location='showforum.aspx?forumid=' + this.options[this.selectedIndex].value;}}\">\r\n");
	templateBuilder.Append("				<option>论坛跳转...</option>\r\n");
	templateBuilder.Append("				" + forumlistboxoptions.ToString() + "\r\n");
	templateBuilder.Append("			</select>\r\n");

	}	//end if


	if (config.Visitedforums>0)
	{

	templateBuilder.Append("    <select name=\"select2\" onchange=\"if(this.options[this.selectedIndex].value != '') {if(" + config.Aspxrewrite.ToString().Trim() + ") {window.location='showforum-'+this.options[this.selectedIndex].value+'" + config.Extname.ToString().Trim() + "';}else{window.location='showforum.aspx?forumid='+this.options[this.selectedIndex].value;}}\">\r\n");
	templateBuilder.Append("			  <option>最近访问...</option>" + visitedforumsoptions.ToString() + "\r\n");
	templateBuilder.Append("			</select>\r\n");

	}	//end if

	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"jumpingright\">\r\n");
	templateBuilder.Append("		<form name=\"LookBySearch\" method=\"post\" action=\"showforum.aspx?search=1&forumid=" + forumid.ToString() + "&typeid=" + topictypeid.ToString() + "\">\r\n");

	if (topictypeid==0)
	{

	templateBuilder.Append("			查看\r\n");
	templateBuilder.Append("				<select name=\"cond\" id=\"cond\">\r\n");
	templateBuilder.Append("					  <option value=\"0\"\r\n");

	if (cond==0)
	{

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

	}	//end if

	templateBuilder.Append("							  >全部主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"1\"\r\n");

	if (cond==1)
	{

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

	}	//end if

	templateBuilder.Append("							  >1 天以来主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"2\"\r\n");

	if (cond==2)
	{

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

	}	//end if

	templateBuilder.Append("							  >2 天以来主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"7\"\r\n");

	if (cond==7)
	{

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

	}	//end if

	templateBuilder.Append("							  >1 周以来主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"30\"\r\n");

	if (cond==30)
	{

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

	}	//end if

	templateBuilder.Append("							  >1 个月以来主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"90\"\r\n");

	if (cond==90)
	{

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

	}	//end if

	templateBuilder.Append("							  >3 个月以来主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"180\"\r\n");

	if (cond==180)
	{

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

	}	//end if

	templateBuilder.Append("							  >6 个月以来主题</option>\r\n");
	templateBuilder.Append("					  <option value=\"365\"\r\n");

	if (cond==365)
	{

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

	}	//end if

	templateBuilder.Append("							  >1 年以来主题</option>\r\n");
	templateBuilder.Append("				</select>\r\n");

	}	//end if

	templateBuilder.Append("			排序方式\r\n");
	templateBuilder.Append("				<select name=\"order\" id=\"order\">\r\n");
	templateBuilder.Append("				  <option value=\"1\"\r\n");

	if (order==1)
	{

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

	}	//end if

	templateBuilder.Append("						  >最后回复时间</option>\r\n");
	templateBuilder.Append("				  <option value=\"2\"\r\n");

	if (order==2)
	{

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

	}	//end if

	templateBuilder.Append("						  >发布时间</option>\r\n");
	templateBuilder.Append("				</select>\r\n");
	templateBuilder.Append("				<select name=\"direct\" id=\"direct\">\r\n");
	templateBuilder.Append("				  <option value=\"0\"\r\n");

	if (direct==0)
	{

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

	}	//end if

	templateBuilder.Append("						  >按升序排列</option>\r\n");
	templateBuilder.Append("				  <option value=\"1\"\r\n");

	if (direct==1)
	{

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

	}	//end if

	templateBuilder.Append("						  >按降序排列</option>\r\n");
	templateBuilder.Append("				</select>\r\n");
	templateBuilder.Append("				<input src=\"templates/" + templatepath.ToString() + "/images/button_true.gif\" alt=\"提交\" type=\"image\" />\r\n");
	templateBuilder.Append("			</form>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("</div>\r\n");

	}	//end if


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

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

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

	templateBuilder.Append("				<a href=\"showforum.aspx?forumid=" + forumid.ToString() + "&showonline=no#online\">\r\n");

	}
	else
	{

	templateBuilder.Append("				<a href=\"showforum.aspx?forumid=" + forumid.ToString() + "&showonline=no#online\">\r\n");

	}	//end if

	templateBuilder.Append("				<img src=\"templates/" + templatepath.ToString() + "/images/open_no.gif\" alt=\"展开/收起\" />\r\n");
	templateBuilder.Append("			</a>\r\n");
	templateBuilder.Append("	</span>\r\n");
	templateBuilder.Append("	<h4>\r\n");
	templateBuilder.Append("		<strong>在线用户:" + forumtotalonline.ToString() + "人</strong>\r\n");
	templateBuilder.Append("	</h4>\r\n");
	templateBuilder.Append("	<dl class=\"onlineuserlist\">\r\n");
	templateBuilder.Append("			<dt>\r\n");
	templateBuilder.Append("				<ul>\r\n");
	templateBuilder.Append("					<li>" + onlineiconlist.ToString() + "</li>\r\n");
	templateBuilder.Append("				</ul>\r\n");
	templateBuilder.Append("			</dt>\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=\"showforum.aspx?forumid=" + forumid.ToString() + "&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


	if (forum.Layer!=0)
	{

	templateBuilder.Append("<div class=\"forumcutline\">\r\n");
	templateBuilder.Append("			<ul>\r\n");
	templateBuilder.Append("				<li><img src=\"templates/" + templatepath.ToString() + "/images/folder_new.gif\" alt=\"有新的回复\"/>有新的回复</li>\r\n");
	templateBuilder.Append("				<li>(<img src=\"templates/" + templatepath.ToString() + "/images/folder_newhot.gif\" alt=\"多于15篇回复\"/>多于15篇回复)</li>\r\n");
	templateBuilder.Append("				<li><img src=\"templates/" + templatepath.ToString() + "/images/folder_closed.gif\" alt=\"关闭的主题\"/>关闭的主题</li>\r\n");
	templateBuilder.Append("				<li><img src=\"templates/" + templatepath.ToString() + "/images/folder_old.gif\" alt=\"无新回复\"/>无新回复</li>\r\n");
	templateBuilder.Append("				<li>(<img src=\"templates/" + templatepath.ToString() + "/images/folder_oldhot.gif\" alt=\"多于15篇回复\" />多于15篇回复)</li>\r\n");
	templateBuilder.Append("				<li><img src=\"templates/" + templatepath.ToString() + "/images/folder_move.gif\" alt=\"参与的主题\"/>跳转的主题</li>\r\n");
	templateBuilder.Append("			</ul>\r\n");
	templateBuilder.Append("</div>\r\n");

	}	//end if

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

	}	//end if


	}
	else
	{


	if (needlogin)
	{


	templateBuilder.Append("<form id=\"formlogin\" name=\"formlogin\" method=\"post\" onsubmit=\"submitLogin(this);\">\r\n");
	templateBuilder.Append("<div class=\"ntforumbox\">\r\n");
	templateBuilder.Append("	<div class=\"titlebar\">\r\n");
	templateBuilder.Append("		<h3>用户登录</h3>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"forumform\">\r\n");
	templateBuilder.Append("	<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("		<td colspan=\"2\">\r\n");
	templateBuilder.Append("			<div class=\"forumerror\">\r\n");
	templateBuilder.Append("				<p>您无权进行当前操作，这可能因以下原因之一造成</p>\r\n");
	templateBuilder.Append("				<p>\r\n");
	templateBuilder.Append("				<b>" + msgbox_text.ToString() + "</b>\r\n");
	templateBuilder.Append("				</p>\r\n");
	templateBuilder.Append("				<p>您还没有登录，请填写下面的登录表单后再尝试访问。</p>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("		 </td>\r\n");
	templateBuilder.Append("		 </tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">用户名:</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\"><input name=\"username\" type=\"text\" id=\"username\" size=\"20\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\"	onblur=\"this.className='colorblue';\" value=\"\"  />  &nbsp; <a href=\"register.aspx\" tabindex=\"-1\" accesskey=\"r\" title=\"立即注册 (ALT + R)\">立即注册</a>\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">密码:</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\"><input name=\"password\" type=\"password\" id=\"password\" size=\"20\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" /> &nbsp; <a href=\"getpassword.aspx\" tabindex=\"-1\" accesskey=\"g\" title=\"忘记密码 (ALT + G)\">忘记密码</a>\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");

	if (isseccode)
	{

	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("	<tr class=\"list\">\r\n");
	templateBuilder.Append("		<th class=\"formlabel\">验证码:</th>\r\n");
	templateBuilder.Append("		<td class=\"formbody\"><p class=\"formcode\">\r\n");

	templateBuilder.Append("<!-- onkeydown=\"return (event.keyCode ? event.keyCode : event.which ? event.which : event.charCode) != 13\"-->\r\n");
	templateBuilder.Append("<input size=\"10\"  style=\"width:50px;\" class=\"colorblue\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" onkeyup=\"changevcode(this.form, this.value);\" />\r\n");
	templateBuilder.Append("&nbsp;\r\n");
	templateBuilder.Append("<img src=\"tools/VerifyImagePage.aspx?time=" + Processtime.ToString() + "\" class=\"cursor\" id=\"vcodeimg\"  width=\"90\" height=\"50\" onclick=\"this.src='tools/VerifyImagePage.aspx?id=" + olid.ToString() + "&time=' + Math.random();\" />\r\n");
	templateBuilder.Append("<input name=\"reloadvcade\" type=\"button\" class=\"colorblue\" id=\"reloadvcade\" value=\"刷新验证码\"  onclick=\"document.getElementById('vcodeimg').src='tools/VerifyImagePage.aspx?time=' + Math.random();\" tabindex=\"-1\"  style=\"color:#99cc00; width:75px;\" />\r\n");
	templateBuilder.Append("<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("	$('vcodeimg').src='tools/VerifyImagePage.aspx?time=' + Math.random();\r\n");
	templateBuilder.Append("	//document.getElementById('vcode').value = \"\";\r\n");
	templateBuilder.Append("	function changevcode(form, value)\r\n");
	templateBuilder.Append("	{\r\n");
	templateBuilder.Append("		if (!$('vcode'))\r\n");
	templateBuilder.Append("		{\r\n");
	templateBuilder.Append("			var vcode = document.createElement('input');\r\n");
	templateBuilder.Append("			vcode.id = 'vcode';\r\n");
	templateBuilder.Append("			vcode.name = 'vcode';\r\n");
	templateBuilder.Append("			vcode.type = 'hidden';\r\n");
	templateBuilder.Append("			vcode.value = value;\r\n");
	templateBuilder.Append("			form.appendChild(vcode);\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("		else\r\n");
	templateBuilder.Append("		{\r\n");
	templateBuilder.Append("			$('vcode').value = value;\r\n");
	templateBuilder.Append("		}\r\n");
	templateBuilder.Append("	}\r\n");
	templateBuilder.Append("</" + "script>\r\n");


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

	}	//end if


	if (config.Secques==1)
	{

	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">安全问题:</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\">\r\n");
	templateBuilder.Append("				<select name=\"question\" id=\"question\">\r\n");
	templateBuilder.Append("				<option value=\"0\" selected=\"selected\">无</option>\r\n");
	templateBuilder.Append("				<option value=\"1\">母亲的名字</option>\r\n");
	templateBuilder.Append("				<option value=\"2\">爷爷的名字</option>\r\n");
	templateBuilder.Append("				<option value=\"3\">父亲出生的城市</option>\r\n");
	templateBuilder.Append("				<option value=\"4\">您其中一位老师的名字</option>\r\n");
	templateBuilder.Append("				<option value=\"5\">您个人计算机的型号</option>\r\n");
	templateBuilder.Append("				<option value=\"6\">您最喜欢的餐馆名称</option>\r\n");
	templateBuilder.Append("				<option value=\"7\">驾驶执照的最后四位数字</option>\r\n");
	templateBuilder.Append("				</select>\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">答案:</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\"><input name=\"answer\" type=\"text\" class=\"colorblue\" id=\"answer\" onfocus=\"this.className='colorfocus';\" onblur=\"this.className='colorblue';\" size=\"50\" /><br/>如果您设置了安全提问，请在此输入正确的问题和回答\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");

	}	//end if

	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">有效时间:</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\"><input type=\"radio\" name=\"expires\" value=\"5256000\" />\r\n");
	templateBuilder.Append("							  永远\r\n");
	templateBuilder.Append("							<input name=\"expires\" type=\"radio\" value=\"43200\" />\r\n");
	templateBuilder.Append("							一个月  \r\n");
	templateBuilder.Append("							<input type=\"radio\" name=\"expires\" value=\"1440\" />\r\n");
	templateBuilder.Append("							一天  \r\n");
	templateBuilder.Append("							<input type=\"radio\" name=\"expires\" value=\"60\" />\r\n");
	templateBuilder.Append("							一小时 \r\n");
	templateBuilder.Append("							<input type=\"radio\" name=\"expires\" value=\"0\" checked=\"checked\" />\r\n");
	templateBuilder.Append("							浏览器进程\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	<tbody style=\"display:none;\">\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">界面风格:</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\">\r\n");
	templateBuilder.Append("					<select name=\"templateid\"><option value=\"0\">- 使用默认 -</option>\r\n");
	templateBuilder.Append("					" + templatelistboxoptions.ToString() + "\r\n");
	templateBuilder.Append("					</select>\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	<tbody>\r\n");
	templateBuilder.Append("		<tr class=\"list\">\r\n");
	templateBuilder.Append("			<th class=\"formlabel\">&nbsp;</th>\r\n");
	templateBuilder.Append("			<td class=\"formbody\">\r\n");
	templateBuilder.Append("				<input name=\"login\" type=\"submit\" id=\"login\" value=\"登录\" onclick=\"javascript:window.location.replace('?agree=yes')\" class=\"sbutton\" />\r\n");
	templateBuilder.Append("						&nbsp;&nbsp;\r\n");
	templateBuilder.Append("				<input name=\"cancel\" type=\"button\" id=\"cancel\" value=\"取消\" onclick=\"javascript:window.location.replace('./index.aspx')\" class=\"sbutton\" />\r\n");
	templateBuilder.Append("			</td>\r\n");
	templateBuilder.Append("		</tr>\r\n");
	templateBuilder.Append("	</tbody>\r\n");
	templateBuilder.Append("	</table>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</form>\r\n");
	templateBuilder.Append("<script type=\"text/javascript\">\r\n");
	templateBuilder.Append("	document.getElementById(\"username\").focus();\r\n");
	templateBuilder.Append("	function submitLogin(loginForm)\r\n");
	templateBuilder.Append("	{\r\n");
	templateBuilder.Append("		loginForm.action = 'login.aspx?reurl='+window.location;\r\n");
	templateBuilder.Append("		loginForm.submit();\r\n");
	templateBuilder.Append("	}\r\n");
	templateBuilder.Append("</" + "script>\r\n");



	}
	else
	{


	templateBuilder.Append("<div class=\"ntforumbox\">\r\n");
	templateBuilder.Append("	<div class=\"titlebar\">\r\n");
	templateBuilder.Append("		<h3>出现了" + page_err.ToString() + "个错误</h3>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"forumerror\">\r\n");
	templateBuilder.Append("				" + msgbox_text.ToString() + "\r\n");
	templateBuilder.Append("				<p class=\"errorback\">\r\n");
	templateBuilder.Append("						<script language=\"javascript\">\r\n");
	templateBuilder.Append("							if(" + msgbox_showbacklink.ToString() + ")\r\n");
	templateBuilder.Append("							{\r\n");
	templateBuilder.Append("								document.write(\"<a href=\\\"" + msgbox_backlink.ToString() + "\\\">返回上一步</a> &nbsp; &nbsp;|&nbsp; &nbsp  \");\r\n");
	templateBuilder.Append("							}\r\n");
	templateBuilder.Append("						</" + "script>\r\n");
	templateBuilder.Append("						<a href=\"forumindex.aspx\">论坛首页</a>\r\n");

	if (usergroupid==7)
	{

	templateBuilder.Append("						 &nbsp; &nbsp|&nbsp; &nbsp; <a href=\"register.aspx\">注册</a>\r\n");

	}	//end if

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



	}	//end if

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

	}	//end if



	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("<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>
