<?
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
global $imgurl;
	if($useindexstatic)
		echo '<? eval("\$lang[\'tpl.str10\']=\"{$lang[\'tpl.str10\']}\";");?>';
	else
		eval("\$lang['tpl.str10']=\"{$lang['tpl.str10']}\";");
?>
<!--<?php

if ($boardid==0){

$showtodaynum = $lang['tpl.str36']."<b class='yellow'>".(intval($index_forumnum['forumnum']['todaynum'])+intval($indivgroup_forumnum['forumnum']['todaynum']))."</b>&nbsp;".$lang['tpl.str37'];
#
$showyestodaynum= $lang['tpl.str39'].(intval($fsetting['yestodaynum'])+intval($indivgroup_forumnum['forumnum']['yestodaynum']))."&nbsp;".$lang['tpl.str37'];
#最高日
$showmaxpost= $lang['tpl.str41'].$fsetting['maxpost']."&nbsp;".$lang['tpl.str37'];
#主题
$showtopicpostnum=$lang['tpl.str38'].(intval($index_forumnum['forumnum']['topicnum'])+intval($indivgroup_forumnum['forumnum']['topicnum']));
#帖子
$showtopicnum=$lang['tpl.str40'].(intval($index_forumnum['forumnum']['forumnum'])+intval($indivgroup_forumnum['forumnum']['forumnum']));
print <<<EOT
-->

<div class="mainbox">
	<div class="notice">
<span>
<A HREF="#?">{$lang['tpl.str89']}<b>{$fsetting['forumname']}</b></A>
<br />
<a href="query.php?stype=5&s=1&psearch=0&nsearch=0" class="newlink">{$lang['tpl.str19']}</a> |&nbsp;<a href="query.php?stype=5&s=2&psearch=0&nsearch=0" class="newlink">&nbsp;{$lang['tpl.str20']}</a> |&nbsp;<a href="infolist.php?t=toplist&orders=1" class="newlink">&nbsp;{$lang['tpl.str92']}</a> |&nbsp;<a href="infolist.php?t=toplist&orders=7" class="newlink">&nbsp;{$lang['tpl.str93']}</a> |&nbsp;<a href="query.php?stype=3&psearch=0&nsearch=0"  class="newlink">&nbsp;{$lang['tpl.str5']}</a>
</span>
{$showtodaynum}  | {$showyestodaynum} | {$showmaxpost}<br />
{$showtopicpostnum} | {$showtopicnum} | {$lang['tpl.str33']}{$fsetting['usernum']} | {$lang['tpl.str35']} <a href="dispuser.php?name={$fsetting['lastuser']}" target="_blank"><b>{$fsetting['lastuser']}</b></a></div>

<!-- 
EOT;
#广告 start
if (!empty($_DCACHE['forum_news'])){
print <<<EOT
-->
<div class="rollboder">
<ul>
	<li class="rollleft">
		<div class="rollTextMenus">			
<!--
EOT;
		$i=1;
		$forum_news_count = count($_DCACHE['forum_news']);
		foreach( $_DCACHE['forum_news'] as $currnewsid => $currnews ){
			$currnews['newstitle'] = preg_replace('#<span class="runtime_timestamp">\s*([0-9]+)\s*</span>#ei', 'gmdate("Y-m-d H:i:s", "$1"+getUserTimeZoneOffset())', $currnews['newstitle']);
			$display_name = ($i===1) ? 'block' : 'none';
print <<<EOT
-->
			<div id="rollTextMenu{$i}" style="DISPLAY: {$display_name}">&nbsp;&nbsp;<strong>{$lang['tpl.str.news3']}</strong>
			<a href="javascript:openScript('announcements.php?action=showone&amp;boardid=0&amp;id={$currnewsid}',500,400)">{$currnews['newstitle']}</a></div>
<!--
EOT;
			$i++;
		}
print <<<EOT
 -->
        </div>
	</li>
	<li class="rollright" width="40"><a title="{$lang['tpl.str.news1']}" href="javascript:rollText(-1);"><img src="{$imgurl}/last.gif" alt="{$lang['tpl.str.news1']}" width="11" height="11" border="0" /></a> <a title="{$lang['tpl.str.news2']}" href="javascript:rollText(1);"><img src="{$imgurl}/next.gif" alt="{$lang['tpl.str.news2']}" width="11" height="11" border="0" /></a></li>
	<li class="rollcenter" id="pageShow" width="30">1/{$forum_news_count}</li>
</ul>
</div>
<script type="text/javascript" language="JavaScript">
	var rollText_k={$forum_news_count}; //菜单总数
	var rollText_i=1; //菜单默认值
	rollText_tt=setInterval("rollText(1)",4000);
	function rollText(a){
	clearInterval(rollText_tt);
	rollText_tt=setInterval("rollText(1)",4000);
	rollText_i+=a;
	if (rollText_i>rollText_k){rollText_i=1;}
	if (rollText_i==0){rollText_i=rollText_k;}
	 for (var j=1; j<=rollText_k; j++){
	 document.getElementById("rollTextMenu"+j).style.display="none";
	 }
	 document.getElementById("rollTextMenu"+rollText_i).style.display="block";
	 document.getElementById("pageShow").innerHTML = rollText_i+"/"+rollText_k;
	} 
</script>

<!-- 
EOT;
} //广告 END
} //boardid end

if($forum_ads[20]==1){//滚动文字广告 start
EOT;?>
-->
	<? include_once 'scroll.php';?>
<!--
<?php
}//滚动文字广告 end
print <<<EOT
-->
</div>
<!--
EOT;

//文字广告 start
if ( $forum_ads[14] == 1 ){

	$textadwidth = 100 / $forum_ads[16];
	$textad = explode("\r\n",$forum_ads[17]);
	$adcontent = '<table cellpadding="3"  cellspacing="1" align="center" style="margin-bottom:10px; width:100%; border-right:none; background:#7AADC8;">';

	$ii = 1;
	for($i=0; $i<count($textad); $i++){
		if ( $i == 0 ){
			$adcontent .= "<tr align=center><td width=\"{$textadwidth}%\" bgcolor=\"#ffffff\" height=23>{$textad[$i]}</td>";
		}else{
			$adcontent .= "<td width=\"{$textadwidth}%\" bgcolor=\"#ffffff\" height=23>{$textad[$i]}</td>";
		}
		if ( $ii == $forum_ads[16] ){
			$ii = 1;
			$adcontent .= '</tr>';
			if ( $i != count($textad)-1 ){
				$adcontent .= '<tr align=center>';
			}
		}else{
			$ii += 1;
		}
	}
	if ( $ii != $forum_ads[16] + 1 && $ii != 1 ){
		for($i=1; $i<=count($textad)-$ii; $i++){
			$adcontent .= "<td width=\"{$textadwidth}%\" bgcolor=\"#ffffff\" height=23>&nbsp;</td>";
		}
		$adcontent .= '</tr>';
	}
	$adcontent .= '</table>';

print <<<EOT
-->
<div class="mainbox" style="margin-top:0px">
{$adcontent}
</div>
<!--
EOT;
}//文字广告 end
print <<<EOT
-->
<div class="mainbox" style="margin-top:0px">
<!-- 
EOT;

if($fsetting['showindexright'] != 0 and ($boardid==0 or empty($boardid))){ //右边开关 start
print <<<EOT
-->
	<!-- right start -->
	<div class="page_right"> 

 <!---------------论坛搜索------------------->
<!-- 
EOT;
	if($fsetting['showindexsearch'] != 0){
print <<<EOT
 -->
	<div class="page_box">
		<div class="tabtitle">
			<div id="search_bot">
				<p class="tabgroup_on">{$lang['indexstr.info1']}</p>
				<p class="tabgroup_on">{$lang['indexstr.info2']}</p>
				<p class="tabgroup_on">{$lang['indexstr.info3']}</p>
			</div>
			<div id="searchbody">
				<dl>
					<div class="nav_search">
						<FORM METHOD=POST ACTION="query.php?stype=2">
							&nbsp;&nbsp;<input type="text" name="keyword">  
							<button onmousemove="button_move(this)" onmouseout="button_out(this)" style=" margin-left:5px; text-indent:0px;" type="submit" name="so3">{$lang['indexstr.info21']}</button>
						</FORM>
					</div>
				</dl>
				<dl>
					<div class="nav_search">
						<FORM METHOD=POST ACTION="query.php?stype=1">
							&nbsp;&nbsp;<input type="text" name="keyword">  
							<button onmousemove="button_move(this)" onmouseout="button_out(this)" style=" margin-left:5px; text-indent:0px;" type="submit" name="so3">{$lang['indexstr.info21']}</button>
						</FORM>
					</div>
				</dl>
				<dl>
					<div class="nav_search">
						<FORM METHOD=POST ACTION="query.php?stype=3">
							&nbsp;&nbsp;<input type="text" name="keyword">  
							<button onmousemove="button_move(this)" onmouseout="button_out(this)" style=" margin-left:5px; text-indent:0px;" type="submit" name="so3">{$lang['indexstr.info21']}</button>
						</FORM>
					</div>
				</dl>
			</div>
		</div>
	</div>
<!-- 
EOT;
	}
print <<<EOT
 -->
<!---------------end 论坛搜索------------------->
	<div class="tabtitle">{$Index_Right_Ads_1}</div>
<!-- 
EOT;
	if($fsetting['showindexgroup'] == 1){ //群组开关 start
	print <<<EOT
 -->  <div class="page_box">
		<div class="tabtitle">
			<div id="tabgroup_bot">
				<p class="tabgroup_on">{$lang['indexstr.info4']}</p>
				<p class="tabgroup_on">{$lang['indexstr.info5']}</p>
				<p class="tabgroup_on">{$lang['indexstr.info6']}</p>
			</div>
		<div id="tabgroupbody">
			<dl>
				<div class="nav_group">
					<ul>
<!-- 
EOT;
		if(!empty($Forum_group['topuser'])){
			if(is_array($Forum_group['topuser'])){
				$Forum_group_arr= $Forum_group['topuser'];
				$i= 0;
				foreach($Forum_group_arr as $k => $arrdb){
					if($i++>5)
						break;
					$_titlelength = $objenc->StrLength($arrdb['groupname']);
					if ( $_titlelength > 10){
						$arrdb['groupname'] = $objenc->SubString(strip_tags($arrdb['groupname']), 0, 8).'...';
					}
					$_infolength = $objenc->StrLength($arrdb['groupinfo']);
					if ( $_infolength > 10){
						$arrdb['groupinfo'] = $objenc->SubString(strip_tags($arrdb['groupinfo']), 0, 8).'...';
					}
		print <<<EOT
-->
					<li>
						<div><img src="{$arrdb['grouppic']}" width="42" height="42" /></div>
						<a href="indivgroup_index.php?groupid={$arrdb['groupid']}" title="{$arrdb['groupinfo']}" >{$arrdb['groupname']}</a> ({$arrdb['usernum']})<br />
						{$arrdb['groupinfo']}&nbsp;<br />
						{$lang['indexstr.info7']}<a target="_blank" href="dispuser.php?name={$arrdb['appusername']}">{$arrdb['appusername']}</a>
					</li>
<!-- 
EOT;
				}
			}
		}
print <<<EOT
-->
					</ul>
			</div>
		</dl>
		<dl>
			<div class="nav_group">
				<ul>
<!-- 
EOT;
		if(!empty($Forum_group['tophots'])){
			if(is_array($Forum_group['tophots'])){
				$i= 0;
				$Forum_group_arr= $Forum_group['tophots'];
				foreach($Forum_group_arr as $k => $arrdb){
					if($i++>5)
						break;
					$_titlelength = $objenc->StrLength($arrdb['groupname']);
					if ( $_titlelength > 10){
						$arrdb['groupname'] = $objenc->SubString(strip_tags($arrdb['groupname']), 0, 8).'...';
					}
					$_infolength = $objenc->StrLength($arrdb['groupinfo']);
					if ( $_infolength > 10){
						$arrdb['groupinfo'] = $objenc->SubString(strip_tags($arrdb['groupinfo']), 0, 8).'...';
					}
		print <<<EOT
-->
					<li>
						<div><img src="{$arrdb['grouppic']}" width="42" height="42" /></div>
						<a href="indivgroup_index.php?groupid={$arrdb['groupid']}" title="{$arrdb['groupinfo']}" >{$arrdb['groupname']}</a> ({$arrdb['usernum']})<br />
						{$arrdb['groupinfo']}&nbsp;<br />
						{$lang['indexstr.info7']}<a target="_blank" href="dispuser.php?name={$arrdb['appusername']}">{$arrdb['appusername']}</a>
					</li>
<!-- 
EOT;


				}
			}
		}
		print <<<EOT
-->

				</ul>
			</div>
		</dl>
		<dl>
			<div class="nav_group">
				<ul>
<!-- 
EOT;
		if(!empty($Forum_group['topnew'])){
			if(is_array($Forum_group['topnew'])){
				$i= 0;
				$Forum_group_arr= $Forum_group['topnew'];
				foreach($Forum_group_arr as $k => $arrdb){
					if($i++>5)
						break;
					$_titlelength = $objenc->StrLength($arrdb['groupname']);
					if ( $_titlelength > 10){
						$arrdb['groupname'] = $objenc->SubString(strip_tags($arrdb['groupname']), 0, 8).'...';
					}
					$_infolength = $objenc->StrLength($arrdb['groupinfo']);
					if ( $_infolength > 10){
						$arrdb['groupinfo'] = $objenc->SubString(strip_tags($arrdb['groupinfo']), 0, 8).'...';
					}
		print <<<EOT
-->
					<li>
						<div><img src="{$arrdb['grouppic']}" width="42" height="42" /></div>
						<a href="indivgroup_index.php?groupid={$arrdb['groupid']}" title="{$arrdb['groupinfo']}" >{$arrdb['groupname']}</a> ({$arrdb['usernum']})<br />
						{$arrdb['groupinfo']}&nbsp;<br />
						{$lang['indexstr.info7']}<a target="_blank" href="dispuser.php?name={$arrdb['appusername']}">{$arrdb['appusername']}</a>
					</li>
<!-- 
EOT;
				}
			}
		}
print <<<EOT
-->				</ul>
			</div>
		</dl>
		</div>
	  </div>
   </div>
<!-- 
EOT;
	} //群组开关 end
	print <<<EOT
 -->
  <div class="tabtitle">{$Index_Right_Ads_2}</div>
<!-- 
EOT;
	if($fsetting['showindextopic'] != 0){ //帖子开关 start
	print <<<EOT
 -->
      <div class="page_box">
		<div class="tabtitle">
			<div id="topic_bot">
			<p class="tabgroup_on">{$lang['indexstr.info11']}</p>
			<p class="tabgroup_on">{$lang['indexstr.info12']}</p>
			<p class="tabgroup_on">{$lang['indexstr.info13']}</p>
			</div>
		<div id="topicbody">
		<dl>
			<div class="nav_topic">
				<ul>
<!-- 
EOT;
		if(!empty($ForumTopicList['best'])){
			if(is_array($ForumTopicList['best'])){
				$ForumTopicArr= $ForumTopicList['best'];
				foreach($ForumTopicArr as $k => $arrdb){
					$_titlelength = $objenc->StrLength($arrdb['title']);
					if ( $_titlelength > 10){
						$strTitle = '<a href="'._urlrewrite("dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['id']."&page=1").'" title="'.htmlspecialchars($arrdb['title']).'">'.$objenc->SubString(strip_tags($arrdb['title']), 0, 10).'...</a>';
					}else{
						$strTitle = '<a href="'._urlrewrite("dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['id']."&page=1").'">'.htmlspecialchars($arrdb['title']).'</a>';
					}
						$strDate ='['.gmdate("Y-m-d",$arrdb['dateandtime']+getUserTimeZoneOffset()).']';
				print <<<EOT
-->
				<li><em>({$arrdb['child']})</em>$strTitle</li>
<!--
EOT;
				}
			}
		}
print <<<EOT
-->				
				</ul>
			</div>
		</dl>
		<dl>
			<div class="nav_topic">
				<ul>
<!--
EOT;
		if(!empty($ForumTopicList['tophits'])){
			if(is_array($ForumTopicList['tophits'])){
				$ForumTopicArr= $ForumTopicList['tophits'];
				foreach($ForumTopicArr as $k => $arrdb){
					$_titlelength = $objenc->StrLength($arrdb['title']);
					if ( $_titlelength > 10){
						$strTitle = '<a href="'._urlrewrite("dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['id']."&page=1").'" title="'.htmlspecialchars($arrdb['title']).'">'.$objenc->SubString(strip_tags($arrdb['title']), 0, 10).'...</a>';
					}else{
						$strTitle = '<a href="'._urlrewrite("dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['id']."&page=1").'">'.htmlspecialchars($arrdb['title']).'</a>';
					}
				print <<<EOT
-->
				<li><em>({$arrdb['hits']})</em>$strTitle</li>
<!--
EOT;
				}
			}
		}
print <<<EOT
-->				
				</ul>
			</div>
		</dl>
		<dl>
			<div class="nav_topic">
				<ul>
<!-- 
EOT;
		if(!empty($ForumTopicList['new'])){
			if(is_array($ForumTopicList['new'])){
				$ForumTopicArr= $ForumTopicList['new'];
				foreach($ForumTopicArr as $k => $arrdb){
					$_titlelength = $objenc->StrLength($arrdb['title']);
					if ( $_titlelength > 10){
						$strTitle = '<a href="'._urlrewrite("dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['id']."&page=1").'" title="'.htmlspecialchars($arrdb['title']).'">'.$objenc->SubString(strip_tags($arrdb['title']), 0, 10).'...</a>';
					}else{
						$strTitle = '<a href="'._urlrewrite("dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['id']."&page=1").'">'.htmlspecialchars($arrdb['title']).'</a>';
					}
				print <<<EOT
-->
				<li><em>({$arrdb['hits']})</em>$strTitle</li>
<!--
EOT;
				}
			}
		}
print <<<EOT
-->		
				</ul>
			</div>
		</dl>
		</div>
		</div>
	</div>	
<!-- 
EOT;
	} //帖子开关 end
print <<<EOT
-->
       <div class="tabtitle">{$Index_Right_Ads_3}</div>

<!-- 
EOT;
	if($fsetting['showindexsavvy'] != 0){ //知道帖子开关 start
	print <<<EOT
 -->
      <div class="page_box">
		<div class="tabtitle">
			<div id="savvy_bot">
			<p class="tabgroup_on">{$lang['indexstr.info14']}</p>
			<p class="tabgroup_on">{$lang['indexstr.info15']}</p>
			</div>
		<div id="savvybody">
		<dl>
			<div class="nav_savvy">
				<ul>
<!-- 
EOT;
		if(!empty($savvy_board['tmphotinfo'])){
			if(is_array($savvy_board['tmphotinfo'])){
				$i= 1;
				$ForumTopicArr= $savvy_board['tmphotinfo'];
				foreach($ForumTopicArr as $k => $arrdb){
					if($i++ > 10)
						break;
					$_titlelength = $objenc->StrLength($arrdb['title']);
					if ( $_titlelength > 9){
						$strTitle = '<a href="'._urlrewrite("savvy_dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['topicid']."&page=1").'" title="'.htmlspecialchars($arrdb['title']).'">'.$objenc->SubString(strip_tags($arrdb['title']), 0, 8).'...</a>';
					}else{
						$strTitle = '<a href="'._urlrewrite("savvy_dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['topicid']."&page=1").'">'.htmlspecialchars($arrdb['title']).'</a>';
					}
						$strDate ='['.gmdate("Y-m-d",$arrdb['dateandtime']+getUserTimeZoneOffset()).']';
				print <<<EOT
-->
				<li><em>({$arrdb['child']})</em>$strTitle</li>
<!--
EOT;
				}
			}
		}
print <<<EOT
-->	
				</ul>
			</div>
		</dl>
		<dl>
			<div class="nav_savvy">
				<ul>
<!-- 
EOT;
		if(!empty($savvy_board['tmpbestinfo'])){
			if(is_array($savvy_board['tmpbestinfo'])){
				$i= 1;
				$ForumTopicArr= $savvy_board['tmpbestinfo'];
				foreach($ForumTopicArr as $k => $arrdb){
					if($i++ > 10)
						break;
					$_titlelength = $objenc->StrLength($arrdb['title']);
					if ( $_titlelength > 9){
						$strTitle = '<a href="'._urlrewrite("savvy_dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['topicid']."&page=1").'" title="'.htmlspecialchars($arrdb['title']).'">'.$objenc->SubString(strip_tags($arrdb['title']), 0, 8).'...</a>';
					}else{
						$strTitle = '<a href="'._urlrewrite("savvy_dispbbs.php?boardid=".$arrdb['boardid']."&id=".$arrdb['topicid']."&page=1").'">'.htmlspecialchars($arrdb['title']).'</a>';
					}
						$strDate ='['.gmdate("Y-m-d",$arrdb['dateandtime']+getUserTimeZoneOffset()).']';
				print <<<EOT
-->
				<li><em>{$strDate}</em>$strTitle</li>
<!--
EOT;
				}
			}
		}
print <<<EOT
-->	
				</ul>
			</div>
		</dl>
		</div>
		</div>
	</div>	
<!-- 
EOT;
	} //知道帖子开关 end
print <<<EOT
-->

	</div>
<!-- 
EOT;
} //右边开关 end
print <<<EOT
 -->
  
	<!-- rigth end -->

	<!-- left start -->
<!-- 
EOT;
$page_left = (($boardid == 0 ) && (intval($fsetting['showindexright']) != 0)) ? 'page_left' :  'page_left_per';
print <<<EOT
 -->
	<div class="{$page_left}">
<!-- 
EOT;
//allowpost=0作为父分类不许发帖/=1开放/=2锁定(有权限用户可发帖)
//ischeckout是否认证版面
//ishidden是否隐含版面
//listmod版面列表模式，0为列表模式，大于0为每行版面个数
function _forumArrFilter($var)
{
	global $arrFilterboardid;
	return(($var[parentid] == $arrFilterboardid));
}

foreach( $_forum as $key=>$forum ) 
{
	$ishidden= 0;
	$forum['boardmaster']=explode('|', $forum['boardmaster']);
	$forum['lastpost']=explode('$', $forum['lastpost']);
	if($forum['lastpost'][2] > 0) $forumlastlogin = gmdate('Y-m-d H:i:s', $forum['lastpost'][2] + getUserTimeZoneOffset());
	$boardmaster_name='';
	foreach ($forum['boardmaster'] as $val){ #版主
		$url=urlencode($val);
		$boardmaster_name .='<a href="dispuser.php?name='.$url.'" title="'.$lang['tpl.str59'].'" target="_blank">'.$val.'</a>  ';
	}
	if ( $forum['parentid'] == 0 || $forum['boardid'] == $boardid ) 
	{ //父类 start
		if($forum['ishidden'] == 0)
			$classStr= '';
		else{
			$classStr = ' hidboard';
		}
		$forumchildcount=0;		
		if(isset($_COOKIE[$cookieprename."indexlist{$forum['boardid']}"])) {
			$listmod = get_cookie("indexlist{$forum['boardid']}");
		} else {
			$listmod = $forum['showtype'] != 0 ? ($forum['showtype'] == 2 ? 1 : 0) : $fsetting['showtype'];  
		}
		$arrFilterboardid=$forum['boardid'];
		$arrFilterishidden=$forum['ishidden'];
		$arrFilter = array_filter($_forum, "_forumArrFilter");
		$forumchildcount =  count($arrFilter);
		$forumonclick = ($forumchildcount > 0) ? "onclick=\"collapse(this,'category".$forum['boardid']."')\"":'';
		$bbs_column='';
		$bbs_column = ($listmod == 1 && $forum['ishidden']  == 0)?'bbs_column2':'bbs_column';
		$bbs_column.= $classStr;
		$colspan='';
		$i = 0;
		$ii = 0;
		#bbs_column列表模式 bbs_column2横向模式 start
	print <<<EOT
 -->
		<div class="{$bbs_column}" >
		<h2><em><img src="{$imgurl}tab.gif" {$forumonclick} title="隐藏版面" /></em><A HREF="index.php?boardid={$forum['boardid']}"  title="{$lang['tpl.str45']}" class="newlink">{$forum['boardtype']}</A></h2>
		<ul>
<!--
EOT;
	} else { //父类 start
		//掩藏开始
		if($forum['ishidden'] == 0)
			$classStr= 'style="display:\'\'"';
		else{
			$classStr = 'class="hidboard"';
		}
		$forum['ishidden']= 0;
		$ishidden = ($forum['ishidden'] == 1)?1:0;
		$todaynew = ($forum['todaynum'] >0 )?'todaynew':'today';
		//$boardreadme = htmlspecialchars($forum['readme']);
		$boardreadme = $forum['readme'];
		$boardreadmeT = preg_replace('/(\<(.*?)\>)/','',$forum['readme']);
		if( $listmod == 1){
			$_boardmaster[$i] = $forum['boardmaster'];
			$i++;
			$ii++;
			#横向模式
			if ($i == 1) {print <<<EOT
 -->
		<div id="category{$forum['parentid']}" {$classStr}>
		<table {$classStr}>
		<tr>
<!--
EOT;
			}
			if ($ii <= 3){print <<<EOT
 -->
			<td width="60"><div class="{$todaynew}" title="{$boardreadmeT}">{$forum['todaynum']}<p>{$lang['tpl.str46']}</p></div></td>
			<td width="33%"  title="{$boardreadme}">
			<b><a href="index.php?boardid={$forum['boardid']}" class="newlink">{$forum['boardtype']}</a></b><br />
			<span>{$lang['tpl.str49']}{$boardmaster_name}<br /><em>{$lang['tpl.str48']}{$forum['topicnum']} | {$lang['tpl.str47']}{$forum['postnum']}</em></span></td>
<!--
EOT;
			}
			if ($ii <> 3 and $forumchildcount==$i){print <<<EOT
-->
			<td width="*">&nbsp;</td>
<!--
EOT;
			}
			if ($ii == 3 and $forumchildcount!=$i){print <<<EOT
 -->
		</tr>
		</table>
		<table {$classStr}>
		<tr>
<!--
EOT;
			}
			$ii= ($ii == 3) ? 0: $ii;
			if ($forumchildcount==$i){ 
			print <<<EOT
-->
		</tr>
		</table>
		</div>
<!--
EOT;
			}
		}#版面 不掩藏 横向结束
		elseif($ishidden == 0){	#列表开始
		$i++;
		if ($i == 1) {
		print <<<EOT
-->
 		<div id="category{$forum['parentid']}" {$classStr}>
<!--
EOT;
			}
			if ('dv_argumentation' == $forum['lastpost'][4]) {
				$realurl = 'dispargue.php';
			} else {
				$realurl = 'dispbbs.php';
			}
		print <<<EOT
-->
		<table {$classStr}>
		<tr>
			<td width="60"><div class="{$todaynew}" title="{$boardreadmeT}">{$forum['todaynum']}<p>{$lang['tpl.str46']}</p></div></td>
			<td >
			<b><a href="index.php?boardid={$forum['boardid']}" class="newlink">{$forum['boardtype']}</a></b><br />
			{$boardreadme}
			<span>{$lang['tpl.str49']}{$boardmaster_name}  | {$lang['tpl.str54']}<a href="{$realurl}?boardid={$forum['lastpost'][7]}&amp;id={$forum['lastpost'][6]}&amp;replyid={$forum['lastpost'][1]}&amp;skin=1" title="{$lang['tpl.str55']}{$forum['lastpost'][0]}&#13;{$lang['tpl.str56']}{$forumlastlogin}">{$forum['lastpost'][3]}..</a>  <em>( {$lang['tpl.str48']}{$forum['topicnum']} | {$lang['tpl.str47']}{$forum['postnum']} )</em></span></td>
<!--
EOT;
		if(!empty($forum['indeximg'])){print <<<EOT
-->
			<td width="1%"><a href="?boardid={$forum['boardid']}"><img src="{$forum['indeximg']}" width="80" height="50"></a></td>
<!--
EOT;
		}
		print <<<EOT
-->
		</tr>
		</table>
<!-- 
EOT;
		if ($forumchildcount==$i){ 
			print <<<EOT
 -->
		</div>
<!-- 
EOT;
			}
		}#列表结束
	} #父类 end
	if ( $ishidden == 0 and  $forumchildcount==$i ){ 
print <<<EOT
 -->
		</ul>
		</div>
<!-- 
EOT;
		#bbs_column列表模式 bbs_column2横向模式 end
	}
}//for循环结束

   #生日
	if ( $fsetting['showbirthuser'] == 1 && $fsetting['birthuser'] != '' && empty($boardid) ){
	$showbirthuser = str_replace(array('{tpl.str74}', "{tpl.str75}", "{tpl.str103}", "{tpl.str104}", "{tpl.str95}", "{tpl.str101}", "{tpl.str102}"), 
		array($lang['tpl.str74'], $lang['tpl.str74'], $lang['tpl.str103'], $lang['tpl.str104'], $lang['tpl.str95'], $lang['tpl.str101'], $lang['tpl.str102']),
		$fsetting['birthuser']);
	}
print <<<EOT
-->
	</div>
	<div style="clear:both"></div>
	</div>
	<!-- left end -->
<!--
EOT;

if ($boardid == 0)//再首页开始
{

#link or online start 

	$ibrowser = browser($_SERVER["HTTP_USER_AGENT"]);
	$isystem = sysinfo($_SERVER["HTTP_USER_AGENT"]);
	if ($fsetting['onlineuser'] == 1) {
		$TPL_hiddenframe_src = 'online.php?action=1&amp;boardid=0';
		$TPL_online = "<a href=\"online.php?action=0&amp;boardid=0\" target=\"hiddenframe\"><font id=\"ifOnlineStr\">{$lang['tpl.str62_1']}</font></a>";
	} else {
		$TPL_online = "<a href=\"online.php?action=1&amp;boardid=0\" target=\"hiddenframe\"><font id=\"ifOnlineStr\">{$lang['tpl.str62']}</font></a>";
		$TPL_hiddenframe_src = 'about:blank';
	}

	$fsetting['maxonlinedate'] = gmdate('Y-m-d H:i:s', $fsetting['maxonlinedate']+getUserTimeZoneOffset());

$totalonline_str = ($useindexstatic)? '<?=$totalonline?>': $totalonline;
$memberonline_str = ($useindexstatic)? '<?=$memberonline?>': $memberonline;//在线会员
$guestonline_str = ($useindexstatic)? '<?=$guestonline?>': $guestonline;//游客
print <<<EOT
-->
<div class="mainbox" style="margin-top:0px;">
        {$showbirthuser}
		<div class="tabtitle border">
		<div id="bot_link">
		<p class="link_on">{$lang['tpl.str60']}</p>
		<p class="link_on">{$lang['tpl.str64']}<span>({$totalonline_str})</span></p>
		<div style="clear:both;"></div>
		</div>
		
		<div id="body_link">
		<dl>
			<div class="friendlink">
				<ul>
				<li>
<!--
EOT;
	if (!empty($_DCACHE['forum_link_1'])){
		foreach( $_DCACHE['forum_link_1'] as $currlinkid => $currlink ){
		print <<<EOT
-->
				<a href="{$currlink['linkurl']}" title="{$currlink['linkname']}&#xA;{$currlink['readme']}" target="_blank"><img src="{$currlink['linklogo']}" border=0 height=31 width=88></a>
<!--
EOT;
		}
	}
print <<<EOT
-->
				</li>
				<li>
<!--
EOT;
	if (!empty($_DCACHE['forum_link_2'])){
		foreach( $_DCACHE['forum_link_2'] as $currlinkid => $currlink ){
		print <<<EOT
-->
				<a href="{$currlink['linkurl']}" title="{$currlink['readme']}" target="_blank">{$currlink['linkname']}</a> | 
<!--
EOT;
		}
	}
print <<<EOT
-->				</li>
				</ul>
			<div style="clear:both"></div>
			</div>
		</dl>
		<dl> 
			<div class="count">
				<ul>
				<li>{$lang['tpl.str64']}{$totalonline_str}{$lang['tpl.str34']}({$lang['tpl.str65']}{$memberonline_str} / {$lang['tpl.str66']}{$guestonline_str}) | {$lang['tpl.str68']}{$fsetting['maxonline']} {$lang['tpl.str34']} | {$lang['tpl.str67']}{$fsetting['forumstarttime']}</li>
				<li ><span id="showstr">{$TPL_online}</span> | <a href="boardstat.php?reaction=online">{$lang['tpl.str63']}</a></li>
				<li>{$lang['tpl.str73']}
<!--
EOT;
			$i=0;
			foreach( $_DCACHE['forum_groups'] as $currgroupid => $currgroups ){
				$i++;
				if ($i > 1) $splitstr = '  '.$lang['tpl.str77'].' ';
print <<<EOT
-->				
				{$splitstr}
				<img src="{$imgurl}{$currgroups['titlepic']}">
				{$currgroups['usertitle']}
<!--
EOT;
				$splitstr = '';
			}
print <<<EOT
-->
				</li>
				</ul>
			</div>
		<hr style="width:98%; text-align:center;" />
		<div class="bar0" style="padding:5px 10px 5px 10px;line-height:18px;text-align : left;display:none;" id="onlinetr"></div>
		<iframe style="border:0px;width:0px;height:0px;" src="{$TPL_hiddenframe_src}" name="hiddenframe"></iframe>
		</dl>
		</div>
		</div>
</div><!-- link or online end -->

<!--
EOT;
} //boraid 

if ( $forum_ads[2] == 1 || $forum_ads[7] == 1 ){print <<<EOT
-->
<script language="javascript" src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/dv_adv.js" type="text/javascript"></script>
<!--
EOT;
} 
if ( $forum_ads[2] == 1 ){print <<<EOT
-->
	<script language="JavaScript" type="text/javascript">
		move_ad('{$forum_ads[3]}','{$forum_ads[4]}','{$forum_ads[5]}','{$forum_ads[6]}');
	</script>
<!--
EOT;
} 
if ( $forum_ads[7] == 1 ){print <<<EOT
-->
	<script language="JavaScript" type="text/javascript">
		fix_up_ad('{$forum_ads[8]}','{$forum_ads[10]}','{$forum_ads[11]}','{$forum_ads[9]}');
	</script>
<!--
EOT;
}
print <<<EOT
-->
<iframe style="border:0px;width:0px;height:0px;" src="about:blank" name="hiddenframe1"></iframe>

<script type="text/javascript" language="JavaScript">
//右边群组切换
var new1 = new NewsSpanBar();
new1.f=2;
new1.titleid = "tabgroup_bot";
new1.bodyid = "tabgroupbody";
new1.class_hiton = "tabgroup_on";
new1.class_hitno = "tabgroup";
new1.load();

//右边帖子列表切换
var new3 = new NewsSpanBar();
new3.f=0;
new3.titleid = "topic_bot";
new3.bodyid = "topicbody";
new3.class_hiton = "tabgroup_on";
new3.class_hitno = "tabgroup";
new3.load();

//右边知道帖子列表切换
var new4 = new NewsSpanBar();
new4.f=0;
new4.titleid = "savvy_bot";
new4.bodyid = "savvybody";
new4.class_hiton = "tabgroup_on";
new4.class_hitno = "tabgroup";
new4.load();

//底部友情链接和在线统计切换
var new_link = new NewsSpanBar();
new_link.f=0;
new_link.titleid = "bot_link";
new_link.bodyid = "body_link";
new_link.class_hiton = "link_on";
new_link.class_hitno = "link";
new_link.load();

//右边搜索切换
var new2 = new NewsSpanBar();
new2.f=0;
new2.event = "move"
new2.titleid = "search_bot";
new2.bodyid = "searchbody";
new2.class_hiton = "tab_search_on";
new2.class_hitno = "tab_search";
new2.load();

</script>
<!--
EOT;
?>-->