<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
require_once INC_PATH.'DV_Encoding.class.php';
$_objEnc = null;
$debug = false;
$spacecache =& getIndexSpaceCache($debug);
if (!empty($spacecache) AND is_array($spacecache)) {
	if (empty($objenc)) {
		$objenc =& DV_Encoding::GetEncoding($charset);
	}
}
global $fsetting, $spaceSystemUpSetting, $spaceuploadbasedir;
//$spaceuploadbasedir = basename($fsetting['forumuploadname']).'/'.basename($spaceSystemUpSetting[19]).'/';
$skinpath = $spaceConfig_System['s_path'];
if ($userid <= 0) {
	$memberinfo_imgpath = "{$skinpath}images/memberlogon.gif";
} else {
	$memberinfo_imgpath = "{$skinpath}images/membersys.gif";
}
print <<<EOT
		<style type="text/css">
/* 主栏目1开始 */
	#MainBody { padding-top: 10px; height: 446px!important; height: auto; margin-bottom:-14px !important; margin-bottom:0px;  }
	.MbLeft { width: 219px; float: left; margin: 0px 0px 0px 0px; }
	.MbLeft .TodayRecommend { height: 236px; text-align:center; background: url("{$skinpath}ad_images/pbg.gif") #fff no-repeat top left; padding-top: 6px; }
	.PicButton { text-align: left; padding-left: 0px; margin-top: -6px; }
	.TodayStar { margin: auto; clear: both; border: 1px solid #96BAD3; margin-top: 10px; text-align: left; height: 148px; width: 215px; text-align: center; }
	.TodayStar h1 { height: 26px; background-color: #E0E9F0; font-size: 14px; font-weight: bold; text-align: left; margin: 1px 1px 0px 1px; }
	.TodayStar h1 img { vertical-align: middle; }
	.TodayStarPicBlock { margin: 6px 4px 1px 5px !important; margin: 6px 1px 1px 1px; text-align: center; height: 106px; width: 206px; }
	.TodayStarPic { float: left; width: 90px; height: 96px; border: 1px solid #96BAD3; text-align: center; padding: 3px 3px 1px 3px; margin: 2px; }
	.TodayStarPic div { text-align: center; margin-top: 5px; padding: 0px; }

	.MbCenter { float: left; width: 370px; line-height: 21px; margin: 0px; text-align: left; padding-left: 9px; }
	.MbCenter .TopNews { padding: 0px; text-align: left; width: 380px; height:114px; }
	.MbCenter .TopNews div { padding: 0px; text-align: left; width: 380px; }
	.MbCenter .TopNews img { border-width: 0px; }
	.SearchForm { width: 356px; margin: 0px 0px 10px 0px; line-height: 21px; border: 1px solid #96BAD3; background: #E0E9F0 no-repeat top left ; padding: 6px 12px 6px 12px; }
	.SearchForm form { display: inline; }
	.SearchForm button, .MemberLogin button { background: #1D6292 no-repeat 0px 0px; height: 23px; width: 60px; font-size: 12px; border: #063060 1px solid; color: #ffffff; }
	.SearchForm .search { font-size: 12px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #ffffff; }
	.NewlyPost { margin: 0px; border-bottom: #ffffff 0px solid; width:382px; }
	.NewlyPost h3 { padding-left: 10px; padding-top: 5px; font-size: 14px; background: url("{$skinpath}images/mini_tab_line.gif") #E0E9F0 repeat-x 0px 27px; margin: 0px; overflow: hidden; height: 22px; color: #000; text-align: left; }
	.NewlyPost ul { padding: 0px; background: url("{$skinpath}images/dotline_list.gif"); margin: 4px 4px 4px; line-height: 24px; list-style-type: none; }
	.NewlyPost li { padding-left: 10px; border-bottom:1px solid #eee; overflow: hidden; height: 22px; color: red; }
	.NewlyPostList { border: 1px solid #96BAD3; background: #FFFFFF; height: 238px !important; height: 240px; margin:0px; }
	.NewlyPostList em { font-size: 10px; font-family: Arial, Helvetica, sans-serif; font-style: normal; background:#f9f9f9; color: #999999; padding: 0px 10px 0px 10px; margin: 0px; /*background: #F3F6F9;*/ float: right; }

	.MbRight { width: 162px; float: right; margin: 0px; text-align: center; }
	.MbRight .MemberLogin { background:url("{$memberinfo_imgpath}"); height: 153px; }
	.MbRight .MemberLogin div { width: auto; height: 21px; overflow: hidden; text-align: left; padding-left: 10px; color: #FFFFFF; padding-bottom: 2px; }
	.MbRight .MemberLogin input, .MbRight .MemberLogin select { border: 1px solid #063060; font-size: 12px; }
	.MbRight .MemberLogin .LoginButton { text-align: center; margin: 0px; padding: 0px; }
	.MbRight .MemberLogin .LoginButton button { text-align: center; height: auto; width: auto; line-height: 18px; }
	.HotSpace { margin: 8px 0px 0px 0px; border: 1px solid #2D9FE5; background: #EFF9FF no-repeat top left; height: 268px; }
	.HotSpace h3 { margin: 0px; height: 22px; background: #2D9FE5; padding-top: 6px; text-align: center; font-size: 14px; font-weight: bold; color: #ffffff; }
	.HotSpace ul { padding: 0px; margin: 8px 0px 0px 0px; list-style-type: none; background: #2D9FE5 no-repeat top left; }
	.HotSpace li { padding: 0px 3px 0px 10px; background: #EFF9FF no-repeat top left; margin-left: 0px; height: 23px; text-align: left; }
/* 主栏目1结束 */

/* 文章导航菜单开始 */
	.ArticleBlock { margin-top: 8px; width: 780px; }
	.ArticleNavLeft { height: 34px; width: 6px; float: left; background: url("{$skinpath}images/menuleft.gif") #fff no-repeat top left; }
	.ArticleNavCenter { float: left; color: #fff; height:24px; background:#1799E0; width: 768px; margin:0px 0px 0px 0px; padding-top:10px; border: 0px; }
	.ArticleNavCenter h1 { float: left; margin-top: 0px; font-size: 14px; color: #fff; text-align: left; width: 68px; margin:0px 0px 0px 0px; padding-top: 0px; border: 0px; }
	.ArticleNavCenter h1 img { vertical-align: middle; }
	.ArticleNavCenter ul, .ArticleNavCenter li { display: inline; list-style-type: none; }
	.ArticleNavCenter h2 { color: #fff; text-align: center; float: right; width: 60px; margin: -20px 0px 0px 0px; padding-top:0px; border: 0px; }
	.ArticleNavRight { height: 34px; width: 6px; float: right; background: url("{$skinpath}images/menuright.gif") #fff no-repeat top left; }
/* 文章导航菜单结束 */

/* 推荐阅读区开始 */
	.CommendRead { height: 306px!important; height: 270px; width: 780px; text-align: left; margin-bottom:0px !important; margin-bottom:-5px; }
	.CommendRead .Left { width: 230px; height: 274px !important; height: 274px; float: left; margin: 0px; padding: 0px; margin: 0px; background: url("{$skinpath}images/centerleft.gif"); }
	.CommendRead .Left h3 { height: 16px; padding-left: 6px; padding-top: 8px; text-align: left; font-size: 12px; font-weight: bold; margin: 0px 0px 6px 0px; }
	.CommendRead .Left div { text-align: left; float: left; padding-left: 12px; padding-top: 0px; width: 195px; margin: 0px; }
	.CommendRead .Left div h2 { height: 22px; text-align: left; font-size: 12px; background: url("{$skinpath}images/icon_bg.gif"); font-weight: 100; margin: 0px; padding: 1px 0px 1px 0px; }
	.CommendRead .Left div h2 em { font-style: normal; float: right; padding: 0px 3px 0px 3px; margin: 0px; }
	
	.CommendRead .CenterAndRight { width: 273px!important; width: 271px; height: 270px; padding: 0px; float: left; margin: 0px; background: #ffffff no-repeat top left; }
	.CommendRead .CenterAndRight .Content { width: 100%; height: 100%; margin: 0px; border: 1px solid #96BAD3; padding: 1px; background: #FFFFFF no-repeat top left; }
	.CommendRead .CenterAndRight .Content h1 { width: 100%; height: 20px; font-size: 12px; font-weight: bold; margin: 0px; text-align: left; padding-top: 4px; background: #E5F0F7 no-repeat top left; }
	.CommendRead .CenterAndRight .Content ul { height: 230px; overflow: hidden; font-size: 12px; margin: 0px; text-align: left; padding: 4px; list-style-type: none; }
	.CommendRead .CenterAndRight .Content ul li { color: #ff6600; height: 19px; border-bottom: #EEEEEE 1px solid; padding-left: 6px; padding-top:4px; text-align: left; }
/* 推荐阅读区结束 */

/* 最新图片/相册开始 */
	#NewlyPhotos { height: 300px; width: 776px; border: 0px; margin:10px auto 0px auto; border: 1px solid #96BAD3; background: #E5F0F7 no-repeat top left; padding-left:3px !important; padding: 0px; clear: both; }
	#NewlyPhotos h1 { float:left; width: 110px; background:#fff; height: 130px !important; height: 110px; padding: 4px; margin: 4px; border: 1px solid #B9DCF1; line-height: 12px; }
	#NewlyPhotos h1 div { font-size:12px; font-weight:100; padding-top:4px;}
/* 最新图片/相册结束 */

/* 最新播客、最新收藏、最新书签导航菜单开始 */
	.ArticleNavCenter div { padding: 0px 3px 0px 0px; margin: 0px 0px 0px 10px; list-style-type: none; }
	.ArticleNavCenter div h3 { font-size: 14px; text-align: left; float: left; width: 230px;	margin: 0px; padding-top: 0px; border: 0px; }
	.ArticleNavCenter div h4 { font-size: 14px; text-align: left; float: left; width: 280px; margin: 0px; padding-top: 0px; border: 0px; }
/* 最新播客、最新收藏、最新书签导航菜单结束 */

/* 交易部分开始 */
	#BuyBlock { height: 128px; margin-top: 10px; }
	#BuyBlock .Buy1 { width: 82px; height: 129px; float: left; background: url("{$skinpath}images/buyleft.gif") #EFF9FF no-repeat top left; }
	#BuyBlock .Buy1 h1 { font-size: 14px; text-align: left; float: left; width: 78px; margin: 6px 0px 4px 0px; padding-left: 4px; border: 0px; color:#fff; }
	#BuyBlock .Buy1 h2 { font-size: 12px; font-weight: 100; text-align: left; margin: 4px 0px 0px 0px; padding-left: 15px; border: 0px; color:#fff; }
	#BuyBlock .Buy2 { width: 3px; height: 129px; float: left; background: url("{$skinpath}images/buybgleft.gif") #EFF9FF no-repeat top left; }
	#BuyBlock .Buy3 { width: 689px; height: 127px; float: left; border-top: #1799E0 1px solid; border-bottom: #1799E0 1px solid; }
	#BuyBlock .Buy3 div { height: 79px; width: 104px; border-right: #dddddd 1px solid; background: #FFFFFF no-repeat top left ; float: left; padding: 3px; margin-top: 10px; }
	#BuyBlock .Buy3 div p { margin: -3px 0px 0px; line-height: 18px; height: 18px; text-align: center; padding-top: 6px; font-size: 12px; font-weight: 100; }
	#BuyBlock .Buy4 { width: 4px; height: 129px; float: left; background: url("{$skinpath}images/buybgright.gif") #EFF9FF no-repeat top left; }
/* 交易部分结束 */

/* 分类列表开始 */
	#SiteList { width: 764px; border: 0px; margin-top: 10px; border: 1px solid #96BAD3; background: #F3FBFF no-repeat top left; padding: 6px; }
	#SiteList h2 { height: 16px; padding: 4px; text-align: left; font-size: 12px; background: url("{$skinpath}images/icon_bg.gif"); font-weight: 100; margin: 0px auto 0px auto; }
/* 分类列表结束 */

/* 友情链接开始 */
	#FriendLink { width: 766px; border: 0px; margin:10px auto 0px auto; border: 1px solid #96BAD3; background: #ffffff no-repeat top left; padding: 6px; text-align: left; color:#ccc; }
/* 友情链接结束 */
		</style>
		<script language="javascript" type="text/javascript">
		<!--
		var fadeimages = new Array;
		var linkarr = new Array;
		var numimg = new Array;
		fadeimages[0] = '{$spaceConfig_System['today_recommend'][0][0]}';
		linkarr[0] = '{$spaceConfig_System['today_recommend'][0][1]}';
		numimg[0] = '{$skinpath}ad_images/p01.gif';
		fadeimages[1] = '{$spaceConfig_System['today_recommend'][1][0]}';
		linkarr[1] = '{$spaceConfig_System['today_recommend'][1][1]}';
		numimg[1] = '{$skinpath}ad_images/p02.gif';
		fadeimages[2] = '{$spaceConfig_System['today_recommend'][2][0]}';
		linkarr[2] = '{$spaceConfig_System['today_recommend'][2][1]}';
		numimg[2] = '{$skinpath}ad_images/p03.gif';
		fadeimages[3] = '{$spaceConfig_System['today_recommend'][3][0]}';
		linkarr[3] = '{$spaceConfig_System['today_recommend'][3][1]}';
		numimg[3] = '{$skinpath}ad_images/p04.gif';
		fadeimages[4] = '{$spaceConfig_System['today_recommend'][4][0]}';
		linkarr[4] = '{$spaceConfig_System['today_recommend'][4][1]}';
		numimg[4] = '{$skinpath}ad_images/p05.gif';
		var cliImg = '';
		var cliImgSrc = '';
		var n = Math.round(Math.random() * 4);
		var interval = 3000;
		var setTimeId = '';
		var MaxRollCount = 30;
		var CurrRollCount = 0;
		function rotateStop(){
			clearTimeout(setTimeId);
		}
		function rotateStart(){
			rotate();
		}
		function chki(ci, no){
			var pImg = document.images['RollImg'];
			var pUrl = document.getElementById('RollUrl');
			if(cliImg == '') {
				cliImg = ci;
				cliImgSrc = ci.src;
				ci.src = numimg[no];
				n=no;
				pImg.src = fadeimages[no];
				pUrl.href = linkarr[no];
			} else if(cliImg != ci) {
				cliImg.src = cliImgSrc;
				cliImg = ci;
				cliImgSrc = ci.src;
				ci.src = numimg[no];
				n=no;
				pImg.src = fadeimages[no];
				pUrl.href = linkarr[no];
			}
		}
		function rotate(){
		 CurrRollCount = CurrRollCount + 1;
		 if (CurrRollCount>MaxRollCount) return;
			n = (n >= 4) ? 0 : n+1;
			setimgurl();
			setTimeId=setTimeout('rotate()',interval);
		}
		function setimgurl(){
			var ci = document.images['num_img'+n]
			try {
			document.images['RollImg'].filters.blendTrans.apply();
			} catch (e){ }
			document.getElementById('RollUrl').href=linkarr[n];
			document.images['RollImg'].src=fadeimages[n];
			try {
			document.images['RollImg'].filters.blendTrans.play();
			} catch (e){ }
			if(cliImg == '') {
				cliImg = ci;
				cliImgSrc = ci.src;
				ci.src = numimg[n];
			} else if(cliImg != ci) {
				cliImg.src = cliImgSrc;
				cliImg = ci;
				cliImgSrc = ci.src;
				ci.src = numimg[n];
			}
		}
		window.onload = rotateStart;
		//-->
		</script>
		<base target="_blank" />
		<!--主栏目1开始-->
		<div class="width780" id="MainBody">
			<div class="MbLeft">
				<div class="TodayRecommend"><a onfocus="this.blur()" href="#" target="_top" id="RollUrl" name="RollUrl"><img alt=""  src="{$skinpath}ad_images/000.gif" name="RollImg" width="208" height="225" border="0" style1="filter: blendTrans(duration=1);" /></a></div>
				<div class="PicButton"><img alt="" src="{$skinpath}ad_images/new.gif" /><img alt="" onclick="chki(this,0);" src="{$skinpath}ad_images/01.gif" border="0" id="num_img0" /><img alt="" onclick="chki(this,1);" src="{$skinpath}ad_images/02.gif" border="0" id="num_img1" /><img alt="" onclick="chki(this,2)" src="{$skinpath}ad_images/03.gif" border="0" id="num_img2" /><img alt="" onclick="chki(this,3);" src="{$skinpath}ad_images/04.gif" border="0" id="num_img3" /><img alt="" onclick="chki(this,4);" src="{$skinpath}ad_images/05.gif" border="0" id="num_img4" /></div>
				<div id="TodayStar" class="TodayStar">
					<h1><img alt="" src="{$skinpath}images/star.gif" width="32" height="23" align="middle" />{$lang['tpl.str61']}</h1>
EOT;
$defaulttodaystar = array('user_photo'=>"{$skinpath}images/today_star.gif", 'user_preview_photo'=>"{$skinpath}images/today_star.gif", 'a_username'=>"{$lang['tpl.str62']}", 'href'=>'spacemanage.php?s=8');
$todaystar1 =& $spaceConfig_System['today_star'][0];
if (empty($todaystar1['user_preview_photo'])) {
	$todaystar1 =& $defaulttodaystar;
} else {
	$todaystar1['user_photo'] = $spaceuploadbasedir.$todaystar1['user_photo'];
	$todaystar1['user_preview_photo'] = $spaceuploadbasedir.$todaystar1['user_preview_photo'];
	if ($objenc->StrLength($todaystar1['nickname']) > 4) {
		$todaystar1['nickname'] = $objenc->SubString($todaystar1['nickname'], 0, 4).'...';
	}
	$todaystar1['a_username'] = "{$todaystar1['nickname']}";
	$todaystar1['href'] = "{$GLOBALS['ModHtmlLinked']}UserID_{$todaystar1['userid']}.index.html";
}
$todaystar2 =& $spaceConfig_System['today_star'][1];
if (empty($todaystar2['user_preview_photo'])) {
	$todaystar2 =& $defaulttodaystar;
} else {
	$todaystar2['user_photo'] = $spaceuploadbasedir.$todaystar2['user_photo'];
	$todaystar2['user_preview_photo'] = $spaceuploadbasedir.$todaystar2['user_preview_photo'];
	if ($objenc->StrLength($todaystar2['nickname']) > 4) {
		$todaystar2['nickname'] = $objenc->SubString($todaystar2['nickname'], 0, 4).'...';
	}
	$todaystar2['a_username'] = "{$todaystar2['nickname']}";
	$todaystar2['href'] = "{$GLOBALS['ModHtmlLinked']}UserID_{$todaystar2['userid']}.index.html";
}
print <<<EOT
					<div class="TodayStarPicBlock">
						<div class="TodayStarPic">
							<a href="{$todaystar1['href']}"><img alt="" src="{$todaystar1['user_preview_photo']}" width="89" height="75" border="0" /></a><div><a href="{$todaystar1['href']}">{$todaystar1['a_username']}</a></div>
						</div>
						<div class="TodayStarPic">
							<a href="{$todaystar2['href']}"><img alt="" src="{$todaystar2['user_preview_photo']}" width="89" height="75" border="0" /></a><div><a href="{$todaystar2['href']}">{$todaystar2['a_username']}</a></div>
						</div>
					</div>
				</div>
			</div>
			<div class="MbCenter">
				<div class="TopNews">
					{$spaceConfig_System['s_topnews']}
				</div>
				<!--站内搜索开始-->
				<div class="SearchForm">
					<form method="post" action="?show_topic" onSubmit="this.action = '?show_topic.'+(parseInt(this.stype.options[this.stype.selectedIndex].value)+1)+'.html'" style="display: inline;">
						<input name="searchword" type="text" size="18" /><input type="radio" name="sel" value="0" checked="true">{$lang['tpl.str63']}<input type="radio" name="sel" value="1">{$lang['tpl.str64']}
						<!--<span class1="outbdr">-->
						<span class="outbdr">
							<span>
								<select name="stype">
EOT;
if (!empty($lang['spaceStype']) AND is_array($lang['spaceStype'])) {
	foreach ($lang['spaceStype'] AS $index => $val) {
		print <<<EOT
									<option value="{$index}">{$val}</option>
EOT;
	}
}
print <<<EOT
								</select>
							</span>
						</span>
						<button name="loginsubmit" type="submit" value="true"><span class="search">Search</span></button>
					</form>
				</div>
				<!--站内搜索结束-->
				<!--最新发表开始-->
				<div class="NewlyPost">
					<h3><img alt="" src="{$skinpath}images/green_arrow.gif" align="middle" />{$lang['tpl.str65']}</h3>
					<div class="NewlyPostList">
EOT;
if (!empty($spacecache['newly_post']) AND is_array($spacecache['newly_post'])) {
	print <<<EOT
						<ul>
EOT;
	foreach ($spacecache['newly_post'] AS $val) {
		$posttime = gmdate("Y-m-d H:i:s",$val['posttime']+getUserTimeZoneOffset());
		$stype = $lang['spaceStype'][$val['stype']];
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		print <<<EOT
							<li class="topth"><em>{$posttime}</em>[{$stype}] <a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></li>
EOT;
	}
	print <<<EOT
						</ul>
EOT;
}
print <<<EOT
                    </div>
				</div>
				<!--最新发表结束-->
			</div>
			<div class="MbRight">
EOT;
if ($userid <= 0) {	//	未登录个人空间
	print <<<EOT
				<div id="MemberLogin" class="MemberLogin">
					<form method="post" action="login.php?action=chk" target="_top" style="display: inline;">
						<input type="hidden" value="spaceindex.php" name="comeurl" />
						<div style="height: 22px;"></div>
						<div class="MemberName">
							<span>{$lang['tpl.str66']}</span>&nbsp;&nbsp;&nbsp;&nbsp;<input name="username" type="text" size="8" style="width:90px" />
						</div>
						<div class="MemberPassword">
							<span>{$lang['tpl.str67']}</span>&nbsp;&nbsp;&nbsp;&nbsp;<input name="password" type="password" size="8" style="width:90px" />
						</div>
EOT;
	if (0 == $fsetting['logingetcode']) {
		print <<<EOT
						<div class="ValidateCode"></div>
						<div class="MemberOptions">
							<span>{$lang['tpl.str68']}</span>&nbsp;&nbsp;&nbsp;<span class="outbdr2"><span>
							<select name="CookieDate"> 
							<option value="item" selected="selected">{$lang['tpl.str69']}</option> 
							<option value="member">{$lang['tpl.str70']}</option> 
							<option value="space">{$lang['tpl.str71']}</option> 
							<option value="space">{$lang['tpl.str72']}</option></select></span></span>
						</div>
EOT;
	} else {
			$getcodehtml=get_cercode(60,18,0,3);
		print <<<EOT
						<div class="ValidateCode" >						
								<span>{$lang['tpl.str73']}</span>&nbsp;&nbsp;&nbsp;$getcodehtml;
						</div>
						<div class="MemberOptions">
							<span>{$lang['tpl.str68']}</span>&nbsp;&nbsp;&nbsp;<span class="outbdr2"><span>
							<select name="CookieDate"> 
							<option value="item" selected="selected">{$lang['tpl.str69']}</option> 
							<option value="member">{$lang['tpl.str70']}</option> 
							<option value="space">{$lang['tpl.str71']}</option> 
							<option value="space">{$lang['tpl.str72']}</option></select></span></span>
						</div>
EOT;
	}
	print <<<EOT
						<div style="height: 6px;"></div>
						<div class="LoginButton">
							<button class="LoginButton" name="loginsubmit" type="submit" value="true" style="width: 40px;">{$lang['tpl.str74']}</button>&nbsp;&nbsp;
							<button class="LoginButton" name="loginsubmit" type="submit" value="true" style="width: 90px;">{$lang['tpl.str75']}</button>
						</div>
					</form>
				</div>
EOT;
} else {	//	成功登录
	if ($spaceUserID <= 0) {
		$tmpname = $GLOBALS['membername'];
	} else {
		$tmpname = $GLOBALS['spaceName'];
	}
	print <<<EOT
				<div id="MemberLogin" class="MemberLogin">
					<div style="height: 22px;"></div>
					<div style=" margin:0px; padding:0px 0px 0px 15px; line-height:18px; height:98px;">
						{$lang['tpl.str76']}{ {$tmpname} <br /> 
						{$lang['tpl.str77']}{$spaceUserInfo['todaynum']} <br />
						{$lang['tpl.str78']}{$spaceUserInfo['topicnum']} <br />
						{$lang['tpl.str79']}{$spaceUserInfo['photonum']} <br />
						{$lang['tpl.str80']}{$spaceUserInfo['postnum']} 
					</div>
					<div class="LoginButton">
EOT;
	if ($spaceUserID > 0) {
		print <<<EOT
						<button class="LoginButton" name="loginsubmit" type="button" value="true" style="width: 60px;" onclick="top.window.location.href='{$GLOBALS['ModHtmlLinked']}{$GLOBALS['spaceName']}.index.html'">{$lang['tpl.str2']}</button>&nbsp;&nbsp;
						<button class="LoginButton" name="loginsubmit" type="button" value="true" style="width: 60px;" onclick="top.window.location.href='spacemanage.php'">		{$lang['tpl.str81']}</button>
EOT;
	} else {
		print <<<EOT
						<button class="LoginButton" name="loginsubmit" type="button" value="true" style="width: 140px;" onclick="top.window.location.href='spaceapply.php'">		{$lang['tpl.str82']}</button>
EOT;
	}
	print <<<EOT
					</div>
				</div>
EOT;
}
print <<<EOT
				<div class="HotSpace">
					<h3>{$lang['tpl.str83']}</h3>
EOT;
if (!empty($spacecache['hot_space']) AND is_array($spacecache['hot_space'])) {
	print <<<EOT
					<ul>
EOT;
	foreach ($spacecache['hot_space'] AS $index => $val) {
		$ordernum = $index + 1;
		$fulltitle = htmlspecialchars($val['username']);
		print <<<EOT
						<li><img alt="" src="{$skinpath}images/top{$ordernum}.gif" /> <a title="{$fulltitle}{$lang['tpl.str84']}" href="{$GLOBALS['ModHtmlLinked']}{$val['spacename']}.index.html">{$val['SubUserName']}{$lang['tpl.str84']}</a></li>
EOT;
	}
	print <<<EOT
					</ul>
EOT;
}
print <<<EOT
				</div>
			</div>
		</div>
		<!--主栏目1结束-->

		<!--广告条开始-->
		<!--<div class="width780" style="margin-top: 8px;"><img alt="" src="{$skinpath}images/2006.gif" width="780" height="86" /></div>-->
		<!--广告条结束-->

		<!--文章导航区开始-->
		<div class="ArticleBlock">
			<div class="ArticleNavLeft"></div>
			<div class="ArticleNavCenter">
				<h1><img alt="" src="{$skinpath}images/left01.gif" align="middle" /> {$lang['tpl.str85']}</h1>
				<ul>
					<li><a class="menu" href="?show_topic.1.17.html">{$lang['tpl.str86']}</a> | <a class="menu" href="?show_topic.1.18.html">{$lang['tpl.str87']}</a> | <a class="menu" href="?show_topic.1.19.html">{$lang['tpl.str88']}</a> | <a class="menu" href="?show_topic.1.20.html">{$lang['tpl.str89']}</a> | <a class="menu" href="?show_topic.1.21.html">{$lang['tpl.str90']}</a> | <a class="menu" href="?show_topic.1.22.html">{$lang['tpl.str91']}</a> | <a class="menu" href="?show_topic.1.23.html">{$lang['tpl.str92']}</a> | <a class="menu" href="?show_topic.1.24.html">{$lang['tpl.str93']}</a> | <a class="menu" href="?show_topic.1.25.html">{$lang['tpl.str94']}</a></li>
				</ul>
				<h2><img alt="" src="{$skinpath}images/more3.gif" style="padding-top:4px;" /></h2>
			</div>
			<div class="ArticleNavRight"></div>
		</div>
		<!--文章导航区结束-->

		<!--推荐阅读开始-->
		<div class="CommendRead">
			<div class="Left">
				<h3><img alt="" src="{$skinpath}images/icon_quote.gif" align="middle" />{$lang['tpl.str95']}</h3>
EOT;
if (!empty($spacecache['newly_besttopic']) AND is_array($spacecache['newly_besttopic'])) {
	print <<<EOT
					<div>
EOT;
	foreach ($spacecache['newly_besttopic'] AS $val) {
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		print <<<EOT
						<h2> {$lang['tpl.str126']}<a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></h2>
EOT;
	}
	print <<<EOT
					</div>
EOT;
}
print <<<EOT
            </div>
			<div class="CenterAndRight">
				<div class="Content">
					<h1><img alt="" src="{$skinpath}images/green_arrow.gif" width="12" height="17" align="middle" />{$lang['tpl.str96']}</h1>
EOT;
if (!empty($spacecache['newly_article']) AND is_array($spacecache['newly_article'])) {
	print <<<EOT
					<ul>
EOT;
	foreach ($spacecache['newly_article'] AS $val) {
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		$posttime = gmdate("Y-m-d H:i:s",$val['posttime']+getUserTimeZoneOffset());
		$stype = $lang['spaceStype'][$val['stype']];
		print <<<EOT
						<li class="topth">[{$stype}] <a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></li>
EOT;
	}
	print <<<EOT
					</ul>
EOT;
}
print <<<EOT
				</div>
			</div>
			<div class="CenterAndRight">
				<div class="Content">
					<h1><img alt="" src="{$skinpath}images/green_arrow.gif" width="12" height="17" align="middle" />{$lang['tpl.str97']}</h1>
EOT;
if (!empty($spacecache['hot_article']) AND is_array($spacecache['hot_article'])) {
	print <<<EOT
					<ul>
EOT;
if (!empty($spacecache['hot_article']) AND is_array($spacecache['hot_article'])) {
	foreach ($spacecache['hot_article'] AS $val) {
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		$stype = $lang['spaceStype'][$val['stype']];
		print <<<EOT
						<li class="topth">[{$stype}] <a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></li>
EOT;
	}
}
	}
	print <<<EOT
					</ul>
EOT;
print <<<EOT
                </div>
			</div>
		</div>
		<!--推荐阅读结束-->

		<!--最新图片/相册开始-->
EOT;
if (!empty($spacecache['newly_photos']) AND is_array($spacecache['newly_photos'])) {
	print <<<EOT
		<div id="NewlyPhotos" class="width780">
EOT;
	foreach ($spacecache['newly_photos'] AS $val) {
		$title = trim($val['SubTitle']);
		$imgsrc = trim($val['previewimage']);
		if ('' === $imgsrc) {
			$imgsrc = $val['filename'];
		}
		$fulltitle = htmlspecialchars($val['title']);
		print <<<EOT
		<h1><a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html"><img src="{$spaceuploadbasedir}{$imgsrc}" alt="photo" alt="" width="110" height="110" border="0" /></a><div><a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></div></h1>
EOT;
	}
	print <<<EOT
		</div>
EOT;
} else {
	print <<<EOT
			<div id="NewlyPhotos" class="width780" style="height:54px !important;padding-top:46px !important;margin:10px auto 0px auto !important;">{$lang['tpl.str98']}</div>
EOT;
}
print <<<EOT
		<!--最新图片/相册结束-->
		
		<!--最新播客、最新收藏、最新书签导航菜单开始-->
		<div class="ArticleBlock">
			<div class="ArticleNavLeft"></div>
			<div class="ArticleNavCenter">
				<div>
					<h3><span style=" float:right; width:70px;padding-top:2px;"><a href="?show_topic.6.html"><img alt="" src="{$skinpath}images/more3.gif" border="0" /></a></span><img alt="" src="{$skinpath}images/left01.gif" align="middle" /> {$lang['tpl.str99']}</h3>
					<h4><span style=" float:right; width:70px;padding-top:2px;"><a href="?show_topic.6.html"><img alt="" src="{$skinpath}images/more3.gif" border="0" /></a></span><img alt="" src="{$skinpath}images/left01.gif" align="middle" /> {$lang['tpl.str100']}</h4>
					<h3><span style=" float:right;padding-top:2px;"><a href="?show_topic.6.html"><img alt="" src="{$skinpath}images/more3.gif" border="0" /></a></span><img alt="" src="{$skinpath}images/left01.gif" align="middle" /> {$lang['tpl.str101']}</h3>
				</div>
			</div>
			<div class="ArticleNavRight"></div>
		</div>
		<!--最新播客、最新收藏、最新书签导航菜单结束-->

		<!--推荐阅读开始-->
		<div class="CommendRead">
			<div class="Left">
				<h3><img alt="" src="{$skinpath}images/icon_quote.gif" align="middle" />{$lang['tpl.str102']}</h3>
EOT;
if (!empty($spacecache['newly_music']) AND is_array($spacecache['newly_music'])) {
	print <<<EOT
				<div>
EOT;
	foreach ($spacecache['newly_music'] AS $val) {
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		print <<<EOT
					<h2><em><img alt="" src="{$skinpath}images/player.gif"></em> {$lang['tpl.str126']}<a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></h2>
EOT;
	}
	print <<<EOT
				</div>
EOT;
}
print <<<EOT
			</div>
			<div class="CenterAndRight">
				<div class="Content">
					<h1><img alt="" src="{$skinpath}images/green_arrow.gif" width="12" height="17" align="middle" />{$lang['tpl.str103']}</h1>
EOT;
if (!empty($spacecache['newly_favorite']) AND is_array($spacecache['newly_favorite'])) {
	print <<<EOT
					<ul>
EOT;
	foreach ($spacecache['newly_favorite'] AS $val) {
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		$stype = $lang['spaceStype'][$val['stype']];
		print <<<EOT
						<li class="topth">[{$stype}] <a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></li>
EOT;
	}
	print <<<EOT
					</ul>
EOT;
}
print <<<EOT
				</div>
			</div>
			<div class="CenterAndRight">
				<div class="Content">
					<h1><img alt="" src="{$skinpath}images/green_arrow.gif" width="12" height="17" align="middle" />{$lang['tpl.str104']}</h1>
EOT;
if (!empty($spacecache['newly_bookmark']) AND is_array($spacecache['newly_bookmark'])) {
	print <<<EOT
					<ul>
EOT;
	foreach ($spacecache['newly_bookmark'] AS $val) {
		$title = trim($val['SubTitle']);
		$fulltitle = htmlspecialchars($val['title']);
		$stype = $lang['spaceStype'][$val['stype']];
		print <<<EOT
						<li class="topth">[{$stype}] <a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></li>
EOT;
	}
	print <<<EOT
					</ul>
EOT;
}
print <<<EOT
                </div>
			</div>
		</div>
		<!--推荐阅读结束-->
		
		<!--交易部分开始-->
		<div id="BuyBlock" class="width780">
			<div class="Buy1">
				<h1><img alt="" src="{$skinpath}images/left01.gif" align="middle" /> {$lang['tpl.str105']}</h1>
				<h2><a href="?show_topic.4.37.html" style="color:white;">{$lang['tpl.str106']}</a></h2>
				<h2><a href="?show_topic.4.38.html" style="color:white;">{$lang['tpl.str107']}</a></h2>
				<h2><a href="?show_topic.4.39.html" style="color:white;">{$lang['tpl.str108']}</a></h2>
				<h2><a href="?show_topic.4.40.html" style="color:white;">{$lang['tpl.str109']}</a></h2>
				<h2><a href="?show_topic.4.41.html" style="color:white;">{$lang['tpl.str110']}</a></h2>
			</div>
			<div class="Buy2"></div>
			<div class="Buy3">
EOT;
		if (!empty($spacecache['newly_buy']) AND is_array($spacecache['newly_buy'])) {
			foreach ($spacecache['newly_buy'] AS $val) {
				$title = trim($val['SubTitle']);
				$fulltitle = htmlspecialchars($val['title']);
				print <<<EOT
				<div><a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html"><img alt="" src="{$val['previewimage']}" height="80" width="80" border="0" /></a><p><a title="{$fulltitle}" href="{$GLOBALS['ModHtmlLinked']}UserID_{$val['userid']}.showtopic.{$val['topicid']}.html">{$title}</a></p></div>
EOT;
			}//end foreach
		}
		print <<<EOT
			</div>
			<div class="Buy4"></div>
		</div>
		<!--交易部分结束-->
		
		<!--分类列表开始-->
		<div id="SiteList" class="width780">
EOT;
$syschatcat_parent = array(0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => '');
if (!empty($spaceConfig_Syschatcat_parent) AND is_array($spaceConfig_Syschatcat_parent)) {
	foreach ($syschatcat_parent AS $index => $val1) {
		if (!empty($spaceConfig_Syschatcat_parent[$index]) AND is_array($spaceConfig_Syschatcat_parent[$index])) {
			foreach ($spaceConfig_Syschatcat_parent[$index] AS $val2) {
				$itmp = $index + 1;
				$syschatcat_parent[$index] .= "{$lang['tpl.str127']} <a href=\"?show_topic.{$itmp}.{$val2['scatid']}.html\">{$val2['scattitle']}</a>";
			}
		}
	}
}
print <<<EOT
			<h2>{$lang['tpl.str111']}{$syschatcat_parent[0]}</h2>
			<h2>{$lang['tpl.str112']}{$syschatcat_parent[4]}</h2>
			<h2>{$lang['tpl.str113']}{$syschatcat_parent[3]}</h2>
			<h2>{$lang['tpl.str114']}{$syschatcat_parent[5]}</h2>
			<h2>{$lang['tpl.str115']}{$syschatcat_parent[1]}</h2>
			<h2>{$lang['tpl.str116']}{$syschatcat_parent[2]}</h2>
		</div>
		<!--分类列表结束-->

		<!--友情链接开始-->
		<div id="FriendLink" class="width780">
			<img alt="" src="{$skinpath}images/btlogo.gif" width="88" height="31" /> <img src="{$skinpath}images/bola.gif" alt="link" width="88" height="31" />
					<hr /><a href="http://asp.dvbbs.net">{$lang['tpl.str118']}</a> | <a href="http://bbs.dvbbs.net/">{$lang['tpl.str119']}</a> | <a href="http://www.cndw.com/">{$lang['tpl.str120']}</a> | <a href="http://php.dvbbs.net">{$lang['tpl.str121']}</a>
		</div>
		<!--友情链接结束-->
EOT;
?>