<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}

$topicsta = array(-1=>$lang['list.tpl.str8_1'],$lang['list.tpl.str1'],$lang['list.tpl.str2'],$lang['list.tpl.str3'],$lang['list.tpl.str4'],$lang['list.tpl.str5'],$lang['list.tpl.str6'],$lang['list.tpl.str7'],$lang['list.tpl_Active.str8'],$lang['list.tpl.str8']);
#array('ztop1区置顶','istop区置顶','ztop总置顶','isbest精华帖','lockfolder锁定主题','closedb投票帖','hotfolder热门主题','activefolder','folder普通主题')
$topicpic = array('ztop1','istop','ztop','isbest','lockfolder','closedb','hotfolder','activefolder','folder');
$igetmoney = array('',$lang['list.tpl.str65'],$lang['list.tpl.str66'],$lang['list.tpl.str67'],'',$lang['list.tpl.str68']);

//该版面在线会员 BEGIN
if ($fsetting['onlineuser'] == 1) {
	$TPL_online = "<a href=\"online.php?action=0&amp;boardid={$boardid}\" target=\"hiddenframe\">{$lang['list.tpl.str11_1']}</a>";
	$TPL_hiddenframe_url = "online.php?action=1&amp;boardid={$boardid}";
} else {
	$TPL_online = "<a href=\"online.php?action=1&amp;boardid={$boardid}\" target=\"hiddenframe\">{$lang['list.tpl.str11']}</a>";
	$TPL_hiddenframe_url = 'about:blank';
}

//该版面在线会员 END
?>
<div class="mainbox">
<?
#====================显示版面规则===============================
if ($boardinfo['rules'] !=''){
?>
	<div class="bbs_column" style="display:<?=($_DCACHE['all_forums'][$boardid]['showboard']?"block":"none")?>">
	<h2><em><img src="<?=$imgurl?>tab.gif" title="<?=$lang['dv_fsettings.global.str11']?>" alt="隐藏版面" onclick="collapse(this,'category_rules')"/></em><?=$lang['list.tpl.str9']?></h2>
	<ul>
	<table id="category_rules">
	<tr>
	<td>
    <?=$boardinfo['rules']?>
	</td>
	</tr>
	</table>
	</ul>
	</div>
<?}?>

<?#====================显示发帖===============================?>
<div class="notice">
<span>
	  <ul class="menu2" onmouseover="this.className='menu1'" onmouseout="this.className='menu2'" onclick="javasrcipt:document.location.href='post.php?action=new&amp;boardid=<?=$boardid?>'">&nbsp;  
	  <li class="list">
		<a href="post.php?action=new&amp;boardid=<?=$boardid?><?=($topicmode)?'&amp;topicmode='.$topicmode:''?>"><span><img src="<?=$imgurl?>post/posticon.gif" border="0" alt="" /></span><?=$lang['list.tpl_Active.str2']?></a> 	<!-- if( $board_settings[57] == 1 ){ -->
		<!-- //交易贴 -->
		<a href="post.php?action=new&boardid=<?=$boardid?>&stype=1" ><span><img src="<?=$imgurl?>post/posticon.gif" border="0" alt="" /></span><?=$lang['list.tpl_Active.str5']?></a>
		<a href="post.php?action=argue_topic&amp;boardid=<?=$boardid?>"><span><img src="<?=$imgurl?>post/posticon.gif" border="0" alt="" /></span><?=$lang['list.tpl_Active.str4']?></a>
		<a href="post.php?action=active_topic&amp;boardid=<?=$boardid?>"><span><img src="<?=$imgurl?>post/posticon.gif" border="0" alt="" /></span><?=$lang['list.tpl_Active.str1']?></a>
	  <div style="clear:both"></div>
	  </li>
	  </ul>
	  <div><a href="post.php?action=vote&amp;boardid=<?=$boardid?>" class="post" style="_margin-left:52px;"></a></div>
</span>
<img src="<?=$imgurl?>team2.gif" align="absmiddle">
<?//版主
	function boardmateronline($uname,$url){
		global $db,$dv,$lang,$boardmaster_online,$_DCACHE,$boardid;
		require_once CACHE_PATH.'Create_online_boardmaster.php';
		foreach ( $boardmaster_online['online'] as $bmoarr){
			if($uname==$bmoarr['username']){
				if(empty($_DCACHE['all_forums'][$boardid]['showboardmaster'])){
					$isonline='<a href='.$url.' title="在线"><font color="#fb591a"><b>'.$uname.'</b></font></a>';
				}
				else{
					$isonline='<a href='.$url.' title="在线">'.$uname.'</a>';					
				}
			}
			else{
				if(empty($_DCACHE['all_forums'][$boardid]['showboardmaster'])){
					$isonline='<a href='.$url.'><font color="#cccccc">'.$uname.'</font></a>';
				}
				else{
					$isonline='<a href='.$url.'>'.$uname.'</a>';					
				}
			}
		}
		if(empty($isonline))$isonline='<a href='.$url.'>'.$uname.'</a>';
		return $isonline;
	}
	echo $lang['list.tpl.str19'];
	$boardinfo['boardmaster']=explode('|',$boardinfo['boardmaster']);
	foreach ($boardinfo['boardmaster'] as $val){
		$url=_urlrewrite("dispuser.php?name=".urlencode($val));
?>
		<?=boardmateronline($val,$url)?>&nbsp;
<?
	}
$lang['list.tpl.str25']=str_replace('{$imgurl}',$imgurl,$lang['list.tpl.str25']);
?>
	<br /><!-- //精华 -->
	<a href="query.php?stype=6&amp;boardid=<?=$boardid?>&amp;nsearch=0&amp;psearch=0" title="<?=$lang['list.tpl.str59']?>"><?=$lang['list.tpl.str13']?></a> | <a href="boardstat.php?reaction=online&amp;boardid=<?=$boardid?>" title="<?=$lang['list.tpl.str60']?>"><?=$lang['list.tpl.str14']?></a> | <a href="infolist.php?t=even&amp;boardid=<?=$boardid?>" title="<?=$lang['list.tpl.str61']?>"><?=$lang['list.tpl.str15']?></a> |  <a href="boardpermission.php?boardid=<?=$boardid?>" title="<?=$lang['list.tpl.str62']?>"><?=$lang['list.tpl.str16']?></a>  | <a href="admin_boardset.php?boardid=<?=$boardid?>&page=<?=$page?>&action=batch"><?=$lang['list.tpl.str17']?></a> | <a href="accesstopic.php?boardid=<?=$boardid?>" title="<?=$lang['list.tpl.str63']?>"><?=$lang['list.tpl.str18']?></a>
</div>


<?
# 版面公告 本版专题
function ShowAnnoun () {
	global $_SERVER, $_DCACHE, $boardid, $boardinfo, $imgurl;
if(strpos($_SERVER['PHP_SELF'],'announcements.php')===false && strpos($_SERVER['PHP_SELF'],'post_upload')===false && strpos($_SERVER['PHP_SELF'],'plus_tools_magiclist.php')===false){//如果是查看所有公告，则不显示
	$arrforumnews = $_DCACHE['all_forums'][$boardid]['forumnews'];
	if (!empty($arrforumnews)){
		$arrforumnews = preg_replace('#<span class="runtime_timestamp">\s*([0-9]+)\s*</span>#ei', 'gmdate("Y-m-d H:i:s", "$1"+getUserTimeZoneOffset())',$arrforumnews);
		
//广告 start
print <<<EOT
<div class="rollboder" style="margin-bottom:0px;">
<ul>
	<li class="rollleft">
		<div class="rollTextMenus">			
EOT;
				$i=1;
				$forum_news_count = count($arrforumnews);
				foreach( $arrforumnews as $currnewsid => $currnews ){
					$currnews = preg_replace('#<span class="runtime_timestamp">\s*([0-9]+)\s*</span>#ei', 'gmdate("Y-m-d H:i:s", "$1"+getUserTimeZoneOffset())', $currnews);
					$display_name = ($i===1) ? 'block' : 'none';

print <<<EOT
					<div id="rollTextMenu{$i}" style="DISPLAY: {$display_name}">&nbsp;&nbsp;<strong>{$lang['list.tpl.str77']}</strong>
					<a href="javascript:openScript('announcements.php?action=showone&amp;boardid={$boardid}&amp;id={$currnewsid}',500,400)">{$currnews}</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;
	}
}
//本版专题
if ($boardinfo['board_setting'] !=''){
	$board_setting = explode('$$',$boardinfo['board_setting']);
print <<<EOT
<div class="thematic border" style=" margin:0px; border-top:none;">
	<ul>
		<li>本版{$lang['list.tpl.str12']}：</li>
EOT;
	for ($i=0;$i<=count($board_setting);$i++){
		if ($board_setting[$i] !=''){
print <<<EOT
		<li><a href="index.php?boardid={$boardid}&amp;topicmode={$i}">{$board_setting[$i]}</a></li>
EOT;
		}
	}
print <<<EOT
	</ul>
</div>
EOT;
}

}
ShowAnnoun ();# 版面公告 本版专题?>
</div><!-- header mainbox end -->
</div>
<table class="mainbox tableborder" cellspacing="0" cellpadding="0">
<form action="admin_batch.php?boardid=<?=$boardid?>" method="post" name="batch">
<tr>
	<th><?=$lang['list.tpl.str24']?></th>
	<th style="text-align:center;"><?=$lang['list.tpl.str25']?></th>
	<th><?=$lang['list.tpl.str20']?></th>
	<th><?=$lang['list.tpl.str21']?> | <?=$lang['list.tpl.str22']?></th>
	<th><?=$lang['list.tpl.str23']?></th>
</tr>
<?
$t = 0;
$i = 0;
foreach( $_topics as $key=>$topic ){
	$topic['lastpost']=explode('$',$topic['lastpost']);
	$topic['lastpost'][2] = gmdate('Y-m-d H:i:s', $topic['lastpost'][2]+getUserTimeZoneOffset());
	(-1 == $topic['isvote']) AND ($topic['title'] = '['.$lang['list.tpl.str70'].']&nbsp;'.$topic['title']);
	$datedifftime = 0;
	if ( intval($board_settings[64]) > 0 ){
		if ( intval($board_settings[63]) == 0 ){
			$datedifftime = dateDiff('M',$topic['lastpost'][2],$nowtimes);
		}else{
			$datedifftime = dateDiff('M',$topic['dateandtime'],$nowtimes);
		}
		if ( $datedifftime > intval($board_settings[64]) ){
			$datedifftime = 0;
		}
	}
	if(trim(@$topic['lastpost'][0]) == '')
		$topic['lastpost'][0]= $topic['postusername'];
	if(trim(@$topic['lastpost'][5]) == '')
		$topic['lastpost'][5]= $topic['postuserid'];
	$dispfile = ((-1 == $topic['isvote']) ? 'dispargue.php' : 'dispbbs.php');

	if (($is_top==1) and ($topicpic[$topic['istop']]!='ztop1' and $topicpic[$topic['istop']]!='istop' and $topicpic[$topic['istop']]!='ztop' ) and ($board_settings[101]==1)){
	?>
	<tr><td colspan=5  class="topline"><?=$lang['list.tpl.str75']?></td></tr>
	<?
	}
	$is_top = ($topicpic[$topic['istop']]=='ztop1' || $topicpic[$topic['istop']]=='istop' || $topicpic[$topic['istop']]=='ztop' ) ? 1 : 0 ;
	if ($is_top ==1 and $i ==0 )
	{
	?>
	<tr><td colspan=5 class="topline"><?=$lang['list.tpl.str74']?></td></tr>
	<?
		$i++;
	}else if ($is_top ==0 and $i ==0){
	?>
		<tr><td colspan=5  class="topline"><?=$lang['list.tpl.str75']?></td></tr>
		<?
	$i++;
	}
	?>

<tr onmouseover="this.className='tableboxon'" onmouseout="this.className='tableboxonout'">
	<td class="list1">
<?
		if ($action == 'batch'){
?>
			<input type="checkbox" name="announceid[]" value="<?=$topic['topicid']?>" class="chkbox">
<?
		}
		elseif (-1 == $topic['isvote']) {
			$url=_urlrewrite("{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}");
?>
			<a href="<?=$url?>" target="_blank"><img border="0" src="<?=$imgurl?>argue_arrow.gif" alt="<?=$topicsta[-1]?>&#xA;<?=$lang['list.tpl.str29']?>" /></a>
<?
		}
		else {
			$url=_urlrewrite("{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}");
?>
			<a href="<?=$url?>" target="_blank"><img border="0" src="<?=$imgurl.$topicpic[$topic['istop']]?>.gif" alt="<?=$topicsta[$topic['istop']]?>&#xA;<?=$lang['list.tpl.str29']?>" /></a>
<?
		}
?></td>
	<td class="list2">
		<span><!-- span begin-->
<?
		if ($topic['usetools'] != '')	//显示道具
		{
			$S= explode(',',$topic['usetools']);
			for($i=0;$i<count($S);$i++)
			{
				if($S[$i] != "")
				{
					$isprint= true;
					for($j=0;$j<$i;$j++)
						if($S[$j] == $S[$i])
						{
							$isprint= false;
							break;
						}
					if($isprint){

?>
						<img src="dv_plus/tools/minipic/tools<?=$S[$i]?>.gif" border="0" alt="<?=$lang['list.tpl.str73']?>" onclick="openScript('plus_tools_pay.php?action=BuyTools&amp;toolsid=<?=$S[$i]?>',600,450);" style="cursor : pointer;"/>
<?
					}
				}
			}
		}
		if ($topic['getmoneytype'] > 0){
?>
			<img src="<?=$imgurl?>mini_query.gif" border="0" alt="<?=$igetmoney[$topic['getmoneytype']]?>" onclick="openScript('viewinfo.php?t=2&amp;action=view&amp;boardid=<?=$topic['boardid']?>&amp;id=<?=$topic['topicid']?>',600,450);" style="cursor : pointer; " />
<?
		}
		if ($topic['issmstopic'] == 1){
?>
		<a href="/wap/index.php?action=readme" target="_blank" title="<?=$lang['list.tpl.str27']?>" ><img src="<?=$imgurl?>wap00.gif" border="0"/></a>
<?
		}
		elseif($topic['issmstopic'] == 2){
?>
			<img src="images/alipay/alipay_icon.gif" border="0" alt="<?=$lang['list.tpl.str28']?>"/>
<?
		}
?>
		</span><!-- span end-->
<?
			if ($topic['child'] > 0){
?>
				<span id="followImg<?=$topic['topicid']?>"><a href="loadtree1.php?boardid=<?=$topic['boardid']?>&amp;rootid=<?=$topic['topicid']?>&amp;action=1" target="hiddenframe"></a></span>
<?
			}else{
?>
<?
			}
			if ($topic['lastpost'][4] != ''){
?>
				<img src="images/filetype/<?=$topic['lastpost'][4]?>.gif"/>
<?
			}
			$topic['lastpost'][3] = preg_replace( '/<([^<>]*?)>/i' ,'' ,$topic['lastpost'][3]);
			$topic['dateandtime'] = gmdate("Y-m-d H:i:s",$topic['dateandtime']+getUserTimeZoneOffset());
			$html_locktopic = htmlspecialchars($topic['locktopic']);
			$html_postusername = htmlspecialchars($topic['postusername']);
			$html_lastpost = htmlspecialchars($topic['lastpost'][3]);
			$url=_urlrewrite("{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}");
?>
			<?=get_special_type($topic['mode'],$boardinfo['board_setting'])?><a href="<?=$url?>" <?=$topic['topicmode']?>><?=$topic['title']?></a>
<?
			echo $topic['newsign'];
			if ($topic['isvote'] != -1 AND ($topic['child'] + 1) > $board_settings[61]){
				$pagelinks = '';
				if ($board_settings[61] < 1) {
					$board_settings[61] = 20;
				}
				$topicpages = ceil(($topic['child'] + 1) / $board_settings[61]);
				for ($i = 1; $i <= $topicpages; $i++) {
					$pagelinks .= "<a href=\"{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}&star={$i}\"><font color=red>{$i}</font></a> ";
					if($i == 6) {
						$i = $topicpages + 1;
					}
				}
				if($topicpages > 6) {
					$pagelinks .= " .. <a href=\"{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&page={$page}&star={$topicpages}\"><font color=red>{$topicpages}</font></a> ";
				}
?>
				[ <img src="<?=$imgurl?>pagelist.gif"/>&nbsp;<b><?=$pagelinks?></b> ]
<?
			}
			if ($datedifftime > 0){
?>
				<img src="<?=$board_settings[65]?>" alt="<?=$datedifftime.$lang['list.tpl.str69']?>"/>
<?
			}
?>
	</td>
	<td class="list3">
<?
		if ($topic['hidename'] == 0 || $board_settings[58] == 0 || $master == true){
			$url=_urlrewrite("dispuser.php?id={$topic['postuserid']}");
?>
			<a href="<?=$url?>" target="_blank"><?=$topic['postusername']?></a>
			<br /><a href="#" class="font10"><?$datearr=explode(' ',$topic['dateandtime']);echo $datearr[0];?></a>
<?
		}else{
?>
		<font color="gray"><?=$lang['list.tpl.str26']?></font>
<?
		}
?>
	</td>
	<td class="list4 font10"><span><?=$topic['child']?>
</span>| <?
	if ($topic['isvote'] == 1){
?>
			<font color="red"><b><?=$topic['votetotal']?></b></font>
<?
		}else{
			echo $topic['hits'];
		}
		$url=_urlrewrite("{$dispfile}?boardid={$topic['boardid']}&id={$topic['topicid']}&star=1&page={$page}#{$topic['lastpost'][1]}");
?></td>
	<td class="list5"><a href="#" class="font10"><?=$topic['lastpost'][2]?></a><br /><a href="dispuser.php?id=<?=$topic['lastpost'][5]?>" target="_blank"><?=$topic['lastpost'][0]?></a></td>
</tr>
<?
$t++;
}
//循环到此结束

$jumplist = boardjumplist($boardid);
$jumplist1 = boardjumplist($boardid,$lang['list.tpl.str34']);
if ($action == 'batch'){ #管理
?>
<tr><td colspan=5  class="topline">
	<select name="newboard" id="newboard">
			<?=$jumplist1?>
	</select>
		&nbsp;&nbsp;
	<select name="mode">
		<option><?=$lang['list.tpl.str35']?></option>
		<option value="0"><?=$lang['list.tpl.str36']?></option>
		<option class="BrightClass"><?=$lang['list.tpl.str37']?></option>
<?
		if( $boardinfo['board_setting'] != '' ){
		$BoardTopic = explode('$$',$boardinfo['board_setting']);
			if( is_array($BoardTopic) ){
			for ($i=0;$i<=count($BoardTopic);$i++){
				if ($BoardTopic[$i] !=''){
?>
					<option value="<?=$i?>"><?=$BoardTopic[$i]?></option>
<?
				}
			}
			}
		}
?>
	</select><BR>
	<input type="hidden" value="<?=$boardid?>" name="boardid"/>
	<input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form);" class="chkbox"/><?=$lang['list.tpl.str38']?> <input type="radio" name="action" value="dele" checked="checked" class="radio"/><?=$lang['list.tpl.str40']?> 
	<input type="radio" name="action" value="move" class="radio"/><?=$lang['list.tpl.str41']?> <input type="radio" name="action" value="isbest" class="radio"/>
	<?=$lang['list.tpl.str42']?> <input type="radio" name="action" value="lock" class="radio"/><?=$lang['list.tpl.str43']?> <input type="radio" name="action" value="topicmode" class="radio"/>
	<?=$lang['list.tpl.str39']?> 
	<button type="submit" name="Submit" onmousemove="button_move(this)" onmouseout="button_out(this)" style=" margin-left:5px; text-indent:0px;" onclick="return clicksubmit(this.form);" ><?=$lang['list.tpl.str64']?></button>
<SCRIPT LANGUAGE="JavaScript">
<!--
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
	{
	var e = form.elements[i];
	if (e.name == 'announceid[]')
	   e.checked = form.elements['chkall'].checked;
	}
}
function clicksubmit(form)
{
	if(confirm('<?=$lang['list.tpl.str44']?>'))
	{	this.document.batch.submit();
		return true;
	}else{
		return false;
	}
}
//-->
</SCRIPT>
</td></tr>
<?}#batch end?>
</form>
</table>
  <div class="mainbox notice">
	<h1>
<?
	//版面列表分页涵数显示
	if ($boardinfo['topicnum'] > 0){
		if(intval($topicmode) != 0){
			if($location='querysort'){
				$boardinfo['topicnum'] = $db->scalar("SELECT /*!40001 SQL_CACHE */ COUNT('topicid') AS count FROM {$dv}topic WHERE mode='$topicmode' AND boardid='$boardid' {$whereQuery}");
			}
		}
		$multipage = pagelist($boardinfo['topicnum'],$board_settings[60],$page,"index.php?boardid={$boardid}&action={$action}&topicmode={$topicmode}&TopicDate={$TopicDate}&TopicOrder={$TopicOrder}&TopicDA={$TopicDA}&location={$location}",$t,1000,'',1);
		print $multipage;//分页显示
	}
	$tmp_boardtype = strip_tags($boardinfo['boardtype']);
?>	</h1>

	<span>
	<?=$lang['list.tpl.str76']?>
	<select name="BoardJumpList" id="BoardJumpList" onchange="if(this.options[this.selectedIndex].value!='')location='index.php?boardid='+this.options[this.selectedIndex].value;">
	<?=$jumplist?>
	</select>
	</span>&nbsp;
  </div>
  <div class="mainbox border searchbox" >
     <span>
		<form METHOD=POST ACTION="query.php">
			<input type="text" name="keyword" />
			<select name="stype">
			<option value=2><?=$lang['global.so1']?></option>
			<option value=1><?=$lang['global.so2']?></option>
			<option value=3><?=$lang['global.so3']?></option>
			</select>
			<input type="hidden" name="substype" value="<?=(isset($substype)?strval($substype):"")?>">
			<button onmousemove="button_move(this)" onmouseout="button_out(this)" style=" margin-left:5px; text-indent:0px;" type="submit" name="so"><?=$lang['online_str18']?></button>
		</form>
	 </span>
    <!--查询显示BEGIN-->
		<form method="get" action="index.php">
			<input type="hidden" name="boardid" value="<?=$boardid?>" />
			<input type="hidden" name="action" value="<?=$action?>" />
			<input type="hidden" name="topicmode" value="<?=$topicmode?>" />
			<input type="hidden" name="location" value="querysort" />
			<?=$lang['order_str1']?>
			<select name="TopicDate" id="TopicDate">
				<option value="0" <?print ($check=(empty($TopicDate))? 'selected':'')?>><?=$lang['order_str2']?></option>
				<option value="1" <?print ($check=($TopicDate==1)? 'selected':'')?>><?=$lang['order_str3']?></option>
				<option value="2" <?print ($check=($TopicDate==2)? 'selected':'')?>><?=$lang['order_str4']?></option>
				<option value="7" <?print ($check=($TopicDate==7)? 'selected':'')?>><?=$lang['order_str5']?></option>
				<option value="30" <?print ($check=($TopicDate==30)? 'selected':'')?>><?=$lang['order_str6']?></option>
				<option value="90" <?print ($check=($TopicDate==90)? 'selected':'')?>><?=$lang['order_str7']?></option>
				<option value="180" <?print ($check=($TopicDate==180)? 'selected':'')?>><?=$lang['order_str8']?></option>
				<option value="360" <?print ($check=($TopicDate==360)? 'selected':'')?>><?=$lang['order_str9']?></option>
			</select>
					<?=$lang['order_str10']?>
			<select name="TopicOrder">
				<option value="1" <?print ($check=($TopicOrder==1 or $TopicOrder=='')? 'selected':'')?>><?=$lang['order_str11']?></option>
				<option value="2" <?print ($check=($TopicOrder==2)? 'selected':'')?>><?=$lang['order_str12']?></option>
				<option value="3" <?print ($check=($TopicOrder==3)? 'selected':'')?>><?=$lang['order_str13']?></option>
				<option value="4" <?print ($check=($TopicOrder==4)? 'selected':'')?>><?=$lang['order_str14']?></option>
			</select>
			<select name="TopicDA">
				<option value="DESC" <?print ($check=($TopicDA=='DESC')? 'selected':'')?>><?=$lang['order_str15']?></option>
				<option value="ASC" <?print ($check=($TopicDA=='ASC')? 'selected':'')?>><?=$lang['order_str16']?></option>
			</select>
			<button type="submit" onmousemove="button_move(this)" onmouseout="button_out(this)" style=" margin-left:5px; text-indent:0px;"><?=$lang['order_str17']?></button>
		</form>
	<!--查询显示END-->
  </div>
  

<!---------------底部友情链接部分------------------->
<?
print <<<EOT
<div class="mainbox tableborder">
		<div class="tabtitle">
		<div id="bot_link">
		<p class="link_on">{$lang['online_str1']}</p>
		<p class="link_on">{$lang['online_str2']}</p>
		<div style="clear:both;"></div>
		</div>
		<div id="body_link">
		<dl>
			<div class="count">
				<ul>
				<li>{$lang['online_str3']}<img src="{$imgurl}ztop.gif" alt="" /> {$lang['online_str4']}　　<img src="{$imgurl}istop.gif" alt="" /> {$lang['online_str5']}　　<img src="{$imgurl}ztop1.gif" alt="" /> {$lang['online_str6']}　　<img src="{$imgurl}folder.gif" alt="" /> {$lang['online_str7']}　　<img src="{$imgurl}hotfolder.gif" alt="" /> {$lang['online_str8']}　　<img src="{$imgurl}isbest.gif" alt="" /> {$lang['online_str9']}　　<img src="{$imgurl}closedb.gif" alt="" /> {$lang['online_str10']}</li>
				</ul>
			</div>
		</dl>
		<dl>
EOT;
	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';
	}
?>
			<div class="friendlink">
				<ul>
				<li><?=$lang['online_str11'].$totalonline.$lang['tpl.str34']?>  <?=$lang['online_str12'].$boardmemberonline?>  <?=$lang['online_str13'].$boardguestonline?>  <?=$lang['online_str14'].$boardinfo['todaynum']?> [ <span id="showstr"><?=$TPL_online?></span> ] </li>
				<li style="overflow:hidden; height:100%;">
<?
			foreach ($OnlineInfo as $k=>$v){
?>
				<div><img src="<?=$imgurl?>group.gif" alt="<?=$v[userclass]?>" /><br><?=$v[username]?></div>
<?
}	
?>
				</li>
				</ul>
			<div style="clear:both"></div>
			</div>
		<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>
<!---------------end 底部友情链接部分------------------->
<script type="text/javascript" language="JavaScript">

//底部与我同在和帖子图例说明切换
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();


</script>
