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

	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.Spacename.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() + "/main.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=\"headerbody\">\r\n");
	templateBuilder.Append("<div id=\"container\">\r\n");
	templateBuilder.Append("<div id=\"header\">\r\n");
	templateBuilder.Append("	<h2><a href=\"" + forumurl.ToString() + "forumindex.aspx\" title=\"Discuz! Board NT|BBS|论坛 - Powered by Discuz!NT\" id=\"NtForumLogo\"><img src=\"templates/" + templatepath.ToString() + "/images/logo.jpg\" alt=\"Discuz! Board NT|BBS|论坛 - Powered by Discuz!NT\"/></a>\r\n");
	templateBuilder.Append("	</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() + "\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\" class=\"reg\" target=\"_blank\">系统设置</a>\r\n");

	}	//end if


	}	//end if


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

	templateBuilder.Append("				<a href=\"" + forumurl.ToString() + "forumindex.aspx\">论坛</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");



	if (page_err==0)
	{

	templateBuilder.Append("<div id=\"ntforummenu\">\r\n");
	templateBuilder.Append("	<div class=\"ntmenubar\">\r\n");
	templateBuilder.Append("		<a href=\"" + spaceurl.ToString() + "space/?uid=" + userid.ToString() + "\">我的空间</a> \r\n");

	if (config.Enablealbum==1)
	{

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

	}	//end if

	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<div id=\"Wraper\">\r\n");
	templateBuilder.Append("<div id=\"ntforumposition\">\r\n");

	if (announcementcount>0)
	{

	templateBuilder.Append("	<div class=\"ntforumnote\">\r\n");
	templateBuilder.Append("		<dl>\r\n");
	templateBuilder.Append("			<dt>公告:</dt>\r\n");
	templateBuilder.Append("			<dd><marquee width=\"98%\" 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><a href=\"" + forumurl.ToString() + "announcement.aspx#" + announcement["id"].ToString().Trim() + "\">" + announcement["title"].ToString().Trim() + "</a><cite>\r\n");
templateBuilder.Append(Convert.ToDateTime(announcement["starttime"].ToString().Trim()).ToString("MM.dd"));
	templateBuilder.Append("</cite></li>\r\n");

	}	//end loop

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

	}	//end if

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

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


	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("<!--message end-->\r\n");
	templateBuilder.Append("<div id=\"ntforumbody\">\r\n");
	templateBuilder.Append("<div id=\"ntspaceleft\">\r\n");
	templateBuilder.Append("	<div class=\"modulebox\" style=\"margin-top:0;\">\r\n");
	templateBuilder.Append("		<div class=\"forumtitle\">\r\n");
	templateBuilder.Append("			<h2>推荐日志</h2>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<div class=\"nttable\" style=\"border-bottom:none;\">\r\n");
	templateBuilder.Append("			<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");

	int __spacepostrecommend__loop__id=0;
	foreach(SpaceShortPostInfo __spacepostrecommend in spacepostlist)
	{
		__spacepostrecommend__loop__id++;


	if (__spacepostrecommend.Author!="")
	{

	templateBuilder.Append("				  <tr>\r\n");
	templateBuilder.Append("					<td class=\"topiccontent\" width=\"70%\">· <a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + __spacepostrecommend.Postid.ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__spacepostrecommend.Title,0,70,"..."));
	templateBuilder.Append("</a> </td>\r\n");
	templateBuilder.Append("					<td width=\"20%\"><a href=\"" + spaceurl.ToString() + "space/?uid=" + __spacepostrecommend.Uid.ToString().Trim() + "\">" + __spacepostrecommend.Author.ToString().Trim() + "</a></td>\r\n");
	templateBuilder.Append("					<td width=\"10%\">\r\n");
templateBuilder.Append(Convert.ToDateTime(__spacepostrecommend.Postdatetime).ToString("yyyy-MM-dd"));
	templateBuilder.Append("</td>\r\n");
	templateBuilder.Append("				  </tr>\r\n");

	}	//end if


	}	//end loop

	templateBuilder.Append("			</table>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>		\r\n");
	templateBuilder.Append("	<div class=\"spacearticle\">\r\n");
	templateBuilder.Append("		<div class=\"commentsarticle\">\r\n");
	templateBuilder.Append("			<div class=\"modulebox\">\r\n");
	templateBuilder.Append("				<div class=\"forumtitle\">\r\n");
	templateBuilder.Append("					<h2>最多评论文章</h2>\r\n");
	templateBuilder.Append("				</div>\r\n");
	templateBuilder.Append("				<div class=\"nttable\">\r\n");
	templateBuilder.Append("					<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");

	int __spacepostbycomment__loop__id=0;
	foreach(DataRow __spacepostbycomment in topspacepostcommentcount.Rows)
	{
		__spacepostbycomment__loop__id++;


	if (__spacepostbycomment["commentcount"].ToString().Trim()!="")
	{

	templateBuilder.Append("						<tr>\r\n");
	templateBuilder.Append("							<td class=\"topiccontent\">· <a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + __spacepostbycomment["postid"].ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__spacepostbycomment["title"].ToString().Trim(),0,35,"..."));
	templateBuilder.Append("</a>\r\n");
	templateBuilder.Append("							<cite>( " + __spacepostbycomment["commentcount"].ToString().Trim() + " )</cite>\r\n");
	templateBuilder.Append("							</td>\r\n");
	templateBuilder.Append("					   </tr>\r\n");

	}	//end if


	}	//end loop

	templateBuilder.Append("					</table>\r\n");
	templateBuilder.Append("				</div>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<div class=\"browserarticle\">\r\n");
	templateBuilder.Append("			<div class=\"modulebox\">\r\n");
	templateBuilder.Append("				<div class=\"forumtitle\">\r\n");
	templateBuilder.Append("					<h2>最多浏览文章</h2>\r\n");
	templateBuilder.Append("				</div>\r\n");
	templateBuilder.Append("				<div class=\"nttable\">\r\n");
	templateBuilder.Append("					<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");

	int __spacepostbyviews__loop__id=0;
	foreach(DataRow __spacepostbyviews in topspacepostviews.Rows)
	{
		__spacepostbyviews__loop__id++;


	if (__spacepostbyviews["commentcount"].ToString().Trim()!="")
	{

	templateBuilder.Append("						<tr>\r\n");
	templateBuilder.Append("							<td class=\"topiccontent\">· <a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + __spacepostbyviews["postid"].ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__spacepostbyviews["title"].ToString().Trim(),0,35,"..."));
	templateBuilder.Append("</a>\r\n");
	templateBuilder.Append("							<cite>( " + __spacepostbyviews["views"].ToString().Trim() + " )</cite>\r\n");
	templateBuilder.Append("							</td>\r\n");
	templateBuilder.Append("					   </tr>\r\n");

	}	//end if


	}	//end loop

	templateBuilder.Append("					</table>\r\n");
	templateBuilder.Append("				</div>\r\n");
	templateBuilder.Append("			</div>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"modulebox\">\r\n");
	templateBuilder.Append("		<div class=\"forumtitle\">\r\n");
	templateBuilder.Append("			<h2>推荐空间</h2>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<div class=\"hotblog\">\r\n");
	templateBuilder.Append("			<ul>\r\n");

	int __spaceconfig__loop__id=0;
	foreach(SpaceConfigInfoExt __spaceconfig in spaceconfigs)
	{
		__spaceconfig__loop__id++;


	if (__spaceconfig.Spacepic!="")
	{

	templateBuilder.Append("			<li>\r\n");
	templateBuilder.Append("				<a href=\"" + spaceurl.ToString() + "space/?uid=" + __spaceconfig.Userid.ToString().Trim() + "\"><img src=\"" + __spaceconfig.Spacepic.ToString().Trim() + "\" alt=\"blogphoto\" width=\"52\" height=\"52\" onerror=\"this.src='avatars/common/0.gif';\"/></a>\r\n");
	templateBuilder.Append("				<h3><a href=\"" + spaceurl.ToString() + "space/?uid=" + __spaceconfig.Userid.ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__spaceconfig.Spacetitle,0,35,"..."));
	templateBuilder.Append("</a></h3>\r\n");
	templateBuilder.Append("				<p><a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + __spaceconfig.Postid.ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__spaceconfig.Posttitle,0,35,"..."));
	templateBuilder.Append("</a></p>\r\n");
	templateBuilder.Append("				<p>日志: <em>" + __spaceconfig.Postcount.ToString().Trim() + "</em>   \r\n");

	if (config.Enablealbum==1)
	{

	templateBuilder.Append("相册: <em>" + __spaceconfig.Albumcount.ToString().Trim() + "</em>\r\n");

	}	//end if

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

	}	//end if


	}	//end loop

	templateBuilder.Append("			</ul>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"modulebox\">\r\n");
	templateBuilder.Append("		<div class=\"forumtitle\">\r\n");
	templateBuilder.Append("			<h2>最多评论空间</h2>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<div class=\"hotblog\">\r\n");
	templateBuilder.Append("			<ul>\r\n");

	int __topcommentcountspaceinfo__loop__id=0;
	foreach(DataRow __topcommentcountspaceinfo in topspacelistbycommentcount.Rows)
	{
		__topcommentcountspaceinfo__loop__id++;


	if (__topcommentcountspaceinfo["userid"].ToString().Trim()!="")
	{

	templateBuilder.Append("			<li>\r\n");
	templateBuilder.Append("				<a href=\"" + spaceurl.ToString() + "space/?uid=" + __topcommentcountspaceinfo["userid"].ToString().Trim() + "\"><img src=\"" + __topcommentcountspaceinfo["avatar"].ToString().Trim() + "\" alt=\"blogPhoto\" width=\"52\" height=\"52\" onerror=\"this.src='avatars/common/0.gif';\"/></a>\r\n");
	templateBuilder.Append("				<h3><a href=\"" + spaceurl.ToString() + "space/?uid=" + __topcommentcountspaceinfo["userid"].ToString().Trim() + "\" >\r\n");
templateBuilder.Append(Utils.GetSubString(__topcommentcountspaceinfo["spacetitle"].ToString().Trim(),0,35,"..."));
	templateBuilder.Append("</a></h3>\r\n");
	templateBuilder.Append("				<p><a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + __topcommentcountspaceinfo["postid"].ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__topcommentcountspaceinfo["posttitle"].ToString().Trim(),0,35,"..."));
	templateBuilder.Append("</a></p>\r\n");
	templateBuilder.Append("				<p>日志:<em>" + __topcommentcountspaceinfo["postcount"].ToString().Trim() + "</em>   最后更新:<em>\r\n");
templateBuilder.Append(Convert.ToDateTime(__topcommentcountspaceinfo["updatedatetime"].ToString().Trim()).ToString("yyyy-MM-dd"));
	templateBuilder.Append("</em></p>\r\n");
	templateBuilder.Append("			</li>\r\n");

	}	//end if


	}	//end loop

	templateBuilder.Append("			</ul>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"modulebox\">\r\n");
	templateBuilder.Append("		<div class=\"forumtitle\">\r\n");
	templateBuilder.Append("			<h2>最多访问空间</h2>\r\n");
	templateBuilder.Append("		</div>\r\n");
	templateBuilder.Append("		<div class=\"hotblog\" style=\"border-bottom:none;\">\r\n");
	templateBuilder.Append("			<ul>\r\n");

	int __topvisitedtimesspaceinfo__loop__id=0;
	foreach(DataRow __topvisitedtimesspaceinfo in topspacelistbyvisitedtimes.Rows)
	{
		__topvisitedtimesspaceinfo__loop__id++;


	if (__topvisitedtimesspaceinfo["userid"].ToString().Trim()!="")
	{

	templateBuilder.Append("			<li>\r\n");
	templateBuilder.Append("				<a href=\"" + spaceurl.ToString() + "space/?uid=" + __topvisitedtimesspaceinfo["userid"].ToString().Trim() + "\"><img src=\"" + __topvisitedtimesspaceinfo["avatar"].ToString().Trim() + "\" alt=\"blogPhoto\" width=\"52\" height=\"52\" onerror=\"this.src='avatars/common/0.gif';\"/></a>\r\n");
	templateBuilder.Append("				<h3><a href=\"" + spaceurl.ToString() + "space/?uid=" + __topvisitedtimesspaceinfo["userid"].ToString().Trim() + "\" >\r\n");
templateBuilder.Append(Utils.GetSubString(__topvisitedtimesspaceinfo["spacetitle"].ToString().Trim(),0,35,"..."));
	templateBuilder.Append("</a></h3>\r\n");
	templateBuilder.Append("				<p><a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + __topvisitedtimesspaceinfo["postid"].ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__topvisitedtimesspaceinfo["posttitle"].ToString().Trim(),0,35,"..."));
	templateBuilder.Append("</a></p>\r\n");
	templateBuilder.Append("				<p>日志:<em>" + __topvisitedtimesspaceinfo["postcount"].ToString().Trim() + "</em>   最后更新:<em>\r\n");
templateBuilder.Append(Convert.ToDateTime(__topvisitedtimesspaceinfo["updatedatetime"].ToString().Trim()).ToString("yyyy-MM-dd"));
	templateBuilder.Append("</em></p>\r\n");
	templateBuilder.Append("			</li>\r\n");

	}	//end if


	}	//end loop

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

	if (rotatepicdata!=null && rotatepicdata!="")
	{


	templateBuilder.Append("<div class=\"modulebox sidebox\" style=\"padding:1px;margin-top:0;\">\r\n");
	templateBuilder.Append("<script type='text/javascript'>\r\n");
	templateBuilder.Append("var imgwidth = 228;\r\n");
	templateBuilder.Append("var imgheight = 127;\r\n");
	templateBuilder.Append("</" + "script>			\r\n");
	templateBuilder.Append("<!--图片轮换代码开始-->\r\n");
	templateBuilder.Append("<script type='text/javascript' src='templates/" + templatepath.ToString() + "/rotatepic.js'></" + "script>\r\n");
	templateBuilder.Append("<script type='text/javascript'>\r\n");
	templateBuilder.Append("var data = { };\r\n");
	templateBuilder.Append("" + rotatepicdata.ToString() + "\r\n");
	templateBuilder.Append("var ri = new MzRotateImage();\r\n");
	templateBuilder.Append("ri.dataSource = data;\r\n");
	templateBuilder.Append("ri.width = 228;\r\n");
	templateBuilder.Append("ri.height = 127;\r\n");
	templateBuilder.Append("ri.interval = 3000;\r\n");
	templateBuilder.Append("ri.duration = 2000;\r\n");
	templateBuilder.Append("document.write(ri.render());\r\n");
	templateBuilder.Append("</" + "script>\r\n");
	templateBuilder.Append("<!--图片轮换代码结束-->	   	\r\n");
	templateBuilder.Append("</div>\r\n");


	templateBuilder.Append("	<div class=\"sidebox sideboxbg\">\r\n");

	}
	else
	{

	templateBuilder.Append("	<div class=\"sidebox sideboxbg\" style=\"margin-top:0px;\">\r\n");

	}	//end if

	templateBuilder.Append("		<h4>最新空间评论</h4>\r\n");
	templateBuilder.Append("		<ul class=\"newslist\">\r\n");

	int comment__loop__id=0;
	foreach(DataRow comment in topspacecomments.Rows)
	{
		comment__loop__id++;

	templateBuilder.Append("				<li><a href=\"" + spaceurl.ToString() + "space/viewspacepost.aspx?postid=" + comment["postid"].ToString().Trim() + "\">" + comment["content"].ToString().Trim() + "</a> [" + comment["author"].ToString().Trim() + "]</li>	\r\n");

	}	//end loop

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

	if (config.Enablealbum==1)
	{

	templateBuilder.Append("	<div class=\"sidebox sideboxbg\">\r\n");
	templateBuilder.Append("		<h4>推荐相册</h4>\r\n");
	templateBuilder.Append("		<ul class=\"newslist\">\r\n");

	int album__loop__id=0;
	foreach(AlbumInfo album in recommendalbumlist)
	{
		album__loop__id++;

	templateBuilder.Append("				<li><a href=\"" + albumurl.ToString() + "showalbum.aspx?albumid=" + album.Albumid.ToString().Trim() + "\">" + album.Title.ToString().Trim() + "</a> (" + album.Imgcount.ToString().Trim() + ") [<a href=\"showalbumlist.aspx?uid=" + album.Userid.ToString().Trim() + "\">" + album.Username.ToString().Trim() + "</a>]</li>	\r\n");

	}	//end loop

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

	}	//end if

	templateBuilder.Append("	<div class=\"sidebox sideboxbg\">\r\n");
	templateBuilder.Append("		<h4>最近更新的空间</h4>\r\n");
	templateBuilder.Append("		<ul class=\"newslist\">\r\n");

	int __space__loop__id=0;
	foreach(DataRow __space in recentupdatespaceList.Rows)
	{
		__space__loop__id++;

	templateBuilder.Append("				<li><a href=\"" + spaceurl.ToString() + "space/?uid=" + __space["userid"].ToString().Trim() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__space["spacetitle"].ToString().Trim(),0,30,"..."));
	templateBuilder.Append("</a></li>\r\n");

	}	//end loop

	templateBuilder.Append("		</ul>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("	<div class=\"sidebox newstopicbg\">\r\n");
	templateBuilder.Append("		<h2>新帖</h2>\r\n");
	templateBuilder.Append("		<ul class=\"newslist\">\r\n");

	int __newtopicinfo__loop__id=0;
	foreach(DataRow __newtopicinfo in newtopiclist.Rows)
	{
		__newtopicinfo__loop__id++;

	templateBuilder.Append("			<li>\r\n");
	 aspxrewriteurl = this.ShowTopicAspxRewrite(__newtopicinfo["tid"].ToString().Trim(),0);
	
	templateBuilder.Append("			<a href=\"" + aspxrewriteurl.ToString() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__newtopicinfo["title"].ToString().Trim(),0,30,"..."));
	templateBuilder.Append("</a></li>\r\n");

	}	//end loop

	templateBuilder.Append("		</ul>\r\n");
	templateBuilder.Append("		<h2>热帖</h2>\r\n");
	templateBuilder.Append("		<ul class=\"newslist\">\r\n");

	int __hottopicinfo__loop__id=0;
	foreach(DataRow __hottopicinfo in hottopiclist.Rows)
	{
		__hottopicinfo__loop__id++;

	templateBuilder.Append("			<li>\r\n");
	 aspxrewriteurl = this.ShowTopicAspxRewrite(__hottopicinfo["tid"].ToString().Trim(),0);
	
	templateBuilder.Append("			<a href=\"" + aspxrewriteurl.ToString() + "\">\r\n");
templateBuilder.Append(Utils.GetSubString(__hottopicinfo["title"].ToString().Trim(),0,30,"..."));
	templateBuilder.Append("</a></li>\r\n");

	}	//end loop

	templateBuilder.Append("		</ul>\r\n");
	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\r\n");
	templateBuilder.Append("</div>\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 type=\"text/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 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;&nbsp; " + config.Linktext.ToString().Trim() + "\r\n");
	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</em> \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() + "\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=\"返顶部\" border=\"0\" onclick=\"window.scrollTo(0,0)\"/></span>\r\n");

	if (config.Stylejump==1)
	{

	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

	templateBuilder.Append("	</div>\r\n");
	templateBuilder.Append("</div>\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("</div>\r\n");
	templateBuilder.Append("</body>\r\n");
	templateBuilder.Append("</html>\r\n");



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