<!--<?php print <<<EOT
-->
	<tbody style="table-layout:fixed;">
	<tr class="tr2">
		<td width="2%"></td>
		<td class="tac">文章</td>
<!--
EOT;
foreach ($fielddb as $key => $value) {
if(!$value['threadshow']) continue;
print<<<EOT
-->
		<td class="tal">$value[name]</td>
<!--
EOT;
}print<<<EOT
-->
	</tr>
<!--
EOT;
$tpc_topped=0;
$searchname && $target= '_blank';
foreach($threaddb as $key => $thread){
$forumset['cutnums'] && $thread['subject'] = substrs($thread['subject'],$forumset['cutnums']);
$thread['postdate'] = get_date($thread['postdate'],'Y-m-d');
$thread['lstptime'] = get_date($thread['lastpost']);
print <<<EOT
-->
	<tr align="center" class="tr3 t_one"><td style="padding-right:0;"><a title="打开新窗口" href="$thread[tpcurl]" target="_blank">$thread[status]</a>
	</td>
	<td class="tal" id="td_$thread[tid]">
<!--
EOT;
if($thread[digest]){print <<<EOT
-->
			<img class="fr" src="$imgpath/$stylepath/file/digest_$thread[digest].gif" align="absmiddle" style="margin-top:4px;" title="精华帖标志" />
<!--
EOT;
}if($thread[adminbox] && $managecheck){print <<<EOT
-->
			<span class="v-in">$thread[adminbox]</span>
<!--
EOT;
}if($thread[toolinfo]){print <<<EOT
-->
    	<span class="subject s3">[$thread[toolinfo]]</span>
<!--
EOT;
}if($thread[topped]){print <<<EOT
-->
			<img src="$imgpath/$stylepath/file/headtopic_$thread[topped].gif" style="margin-right:5px;" align="absmiddle" title="置顶帖标志"/>
<!--
EOT;
}print <<<EOT
-->
			$thread[useriocn]
<!--
EOT;
if($forumset['addtpctype'] && $t_db[$thread['type']] && $thread['fid']==$fid){
if ($upid = $t_db[$thread['type']]['upid']) {print <<<EOT
-->
			<a href="thread.php?fid=$fid&type=$upid" class="subject">[{$t_db[$upid][name]}]</a>
<!--
EOT;
}print <<<EOT
-->
			<a href="thread.php?fid=$fid&type=$thread[type]" class="subject">[{$t_db[$thread[type]][name]}]</a>
<!--
EOT;
}if($thread['state'] == 0 && $thread['rewcredit'] > 0){print <<<EOT
-->
			<span class="s1 subject"> &#8212; 悬赏金额:$thread[rewcredit] &#8212; </span>
<!--
EOT;
}print <<<EOT
-->
			<a href="$thread[tpcurl]" id="a_ajax_$thread[tid]" target="$target" class="subject">$thread[subject]</a>&nbsp; $thread[ifmark] $thread[titleadd]
<!--
EOT;
if(isset($thread['colony'])){print <<<EOT
-->
			<span class="gray w">[来自群：<a href="mode.php?m=o&q=group&a=thread&cyid={$thread[colony][cyid]}">{$thread[colony][cname]}</a>]</span>
<!--
EOT;
}if($timestamp-$thread[lastpost]<=$db_newtime){print <<<EOT
-->
			<img src="$imgpath/$stylepath/file/new.gif" align="absmiddle" title="新帖标志" />
<!--
EOT;
}if($forumset['inspect'] && $thread['inspect']){print <<<EOT
-->
			<span class="w"><font color="red">[{$thread[inspect][1]} 阅至 {$thread[inspect][0]}楼]</font></span>
<!--
EOT;
}if($thread[ispage]){print <<<EOT
-->
			<span class="w">$thread[ispage]</span>
<!--
EOT;
}print <<<EOT
-->
	</td>
<!--
EOT;
foreach($threadshowfield as $key => $value){
$value[fieldvalue] = $thread[topic][$value[fieldname]];
$value['rules'] && $value['rules'] = unserialize($value['rules']);
if ($value['type'] == 'radio') {
	$newradio = array();
	foreach($value['rules'] as $rk => $rv){
		list($rv_value,$rv_name) = explode("=",$rv);
		$newradio[$rv_value] = $rv_name;
	}
	$topicvalue = "{$newradio[$value[fieldvalue]]}";

} elseif ($value['type'] == 'checkbox') {
	$newcheckbox = array();
	foreach($value['rules'] as $ck => $cv){
		list($cv_value,$cv_name) = explode("=",$cv);
		$newcheckbox[$cv_value] = $cv_name;
	}
	$topicvalues = '';
	foreach (explode(",",$value['fieldvalue']) as $value) {
		if ($value) {
			$topicvalues .= $topicvalues ? ",".$newcheckbox[$value] : $newcheckbox[$value];
		}
	}
	$topicvalue = $topicvalues;

} elseif ($value['type'] == 'select') {
	$newselect = array();
	foreach($value['rules'] as $sk => $sv){
		list($sv_value,$sv_name) = explode("=",$sv);
		$newselect[$sv_value] = $sv_name;
	}
	$topicvalue = "{$newselect[$value[fieldvalue]]}";
} elseif ($value['type'] == 'url') {
	$topicvalue = "<a href=\"$value[fieldvalue]\" target=\"_blank\">$value[fieldvalue]</a>";
} elseif ($value['type'] == 'img') {
	$topicvalue = "<img src=\"$value[fieldvalue]\">";
} elseif ($value['type'] == 'calendar') {
	$topicvalue = get_date($value['fieldvalue'],'Y-n-d');
} else {
	$topicvalue = "$value[fieldvalue]";
}
if ($value['fieldname'] == 'limitnum' && !$value[fieldvalue]) {
	$topicvalue = '不限制';
}
print<<<EOT
-->
	<td class="tal">$topicvalue</td>
<!--
EOT;
}print<<<EOT
-->
	</tr>
<!--
EOT;
if($managemode==1){
$managemode_colspan = $colspannum -2;
if($db_ajax & 1){print <<<EOT
-->
    <tr class="tr3"><td></td><td>
	<div class="fr s8">[
<!--
EOT;
if($isGM || $pwSystem[digestadmin]){print <<<EOT
-->
		<a id="digest_$thread[tid]" style="cursor:pointer" onclick="sendmsg('mawhole.php?ajax=1&action=digest&fid=$thread[fid]&seltid=$thread[tid]','',this.id)" title="加入精华帖">精</a>
<!--
EOT;
}if($isGM || $pwSystem[lockadmin]){print <<<EOT
-->
		<a id="lock_$thread[tid]" style="cursor:pointer" onclick="sendmsg('mawhole.php?ajax=1&action=lock&fid=$thread[fid]&seltid=$thread[tid]','',this.id)" title="锁定帖子不让会员再回复帖子">锁定</a>
<!--
EOT;
}if($isGM || $pwSystem[pushadmin]){print <<<EOT
-->
		<a id="pushtopic_$thread[tid]" style="cursor:pointer" onclick="sendmsg('mawhole.php?ajax=1&action=pushtopic&fid=$thread[fid]&seltid=$thread[tid]','',this.id)" title="提前帖子">提</a>
<!--
EOT;
}if($isGM || $pwSystem[downadmin]){print <<<EOT
-->
		<a id="downtopic_$thread[tid]" style="cursor:pointer" onclick="sendmsg('mawhole.php?ajax=1&action=downtopic&fid=$thread[fid]&seltid=$thread[tid]','',this.id)" title="将帖子往后压">压帖</a>
<!--
EOT;
}if($isGM || $pwSystem[coloradmin]){print <<<EOT
-->
		<a id="edit_$thread[tid]" style="cursor:pointer" onclick="sendmsg('mawhole.php?ajax=1&action=edit&fid=$thread[fid]&seltid=$thread[tid]','',this.id)" title="编辑标题">亮</a>
<!--
EOT;
}if($isGM || $pwSystem[topped]){print <<<EOT
-->
<a id="headtopic_$thread[tid]" style="cursor:pointer" onclick="sendmsg('mawhole.php?ajax=1&action=headtopic&fid=$thread[fid]&seltid=$thread[tid]','',this.id)" title="置顶主题:将主题置顶,以便会员查看">顶</a>
<!--
EOT;
}print <<<EOT
-->
] </div><td colspan="4"></td></td></tr>
<!--
EOT;
}else{print <<<EOT
-->
    <tr class="tr3"><td></td><td>
	<div class="fr s8"> [
<!--
EOT;
if($isGM || $pwSystem['digestadmin']){print <<<EOT
-->
		<a id="digest_$thread[tid]" href="mawhole.php?action=digest&fid=$thread[fid]&seltid=$thread[tid]" title="加入精华帖">精</a>
<!--
EOT;
}if($isGM || $pwSystem['lockadmin']){print <<<EOT
-->
		<a id="lock_$thread[tid]" href="mawhole.php?action=lock&fid=$thread[fid]&seltid=$thread[tid]" title="锁定帖子不让会员再回复帖子">锁定</a>
<!--
EOT;
}if($isGM || $pwSystem['pushadmin']){print <<<EOT
-->
		<a id="pushtopic_$thread[tid]" href="mawhole.php?action=pushtopic&fid=$thread[fid]&seltid=$thread[tid]" title="提前帖子">提</a>
<!--
EOT;
}if($isGM || $pwSystem['downadmin']){print <<<EOT
-->
		<a id="downtopic_$thread[tid]" href="mawhole.php?action=downtopic&fid=$thread[fid]&seltid=$thread[tid]" title="将帖子往后压">压帖</a>
<!--
EOT;
}if($isGM || $pwSystem['coloradmin']){print <<<EOT
-->
		<a id="edit_$thread[tid]" href="mawhole.php?action=edit&fid=$thread[fid]&seltid=$thread[tid]" title="编辑标题">亮</a>
<!--
EOT;
}if($isGM || $pwSystem[topped]){print <<<EOT
-->
	<a id="headtopic_$thread[tid]" href="mawhole.php?action=headtopic&fid=$thread[fid]&seltid=$thread[tid]" title="置顶主题:将主题置顶,以便会员查看">顶</a>
<!--
EOT;
}print <<<EOT
-->
		] </div><td colspan="$managemode_colspan"></td></td></tr>
<!--
EOT;
}}print <<<EOT
-->

<!--
EOT;
}print <<<EOT
-->
	<tr><td colspan="$colspannum" class="f_one" style="height:8px"></td></tr>
	</tbody>
</table></div>
<!--
EOT;
if($managecheck){print <<<EOT
-->
<div class="t5 tac f_one" style="padding:15px 0 15px; margin-bottom:2px;margin-top:2px;">
	<div>管理选项:
<!--
EOT;
if($foruminfo['f_check'] && $search=='check' && ($isGM || $pwSystem['tpccheck'])){print <<<EOT
-->
		<input name="action" type="radio" value="check" />验证主题
<!--
EOT;
}if($isGM || $pwSystem[topped]){print <<<EOT
-->
		<input name="action" type="radio" value="headtopic" />置顶
<!--
EOT;
}if($isGM || $pwSystem['digestadmin']){print <<<EOT
-->
		<input name="action" type="radio" value="digest" />精华
<!--
EOT;
}if($isGM || $pwSystem['lockadmin']){print <<<EOT
-->
		<input name="action" type="radio" value="lock" />锁定
<!--
EOT;
}if($isGM || $pwSystem['pushadmin']){print <<<EOT
-->
		<input name="action" type="radio" value="pushtopic" />提前
<!--
EOT;
}if($isGM || $pwSystem['downadmin']){print <<<EOT
-->
		<input name="action" type="radio" value="downtopic" />压帖
<!--
EOT;
}if($isGM || $pwSystem['coloradmin']){print <<<EOT
-->
		<input name="action" type="radio" value="edit" />加亮
<!--
EOT;
}if($isGM || $pwSystem[tpctype]){print <<<EOT
-->
		<input name="action" type="radio" value="type" />主题分类
<!--
EOT;
}if($isGM || $pwSystem[moveatc]){print <<<EOT
-->
		<input name="action" type="radio" value="move" />移动
<!--
EOT;
}if($isGM || $pwSystem[copyatc]){print <<<EOT
-->
		<input name="action" type="radio" value="copy" />复制
<!--
EOT;
}if($isGM || $pwSystem[unite]){print <<<EOT
-->
		<input name="action" type="radio" value="unite" />合并
<!--
EOT;
}if($isGM || $pwSystem[delatc]){print <<<EOT
-->
		<input name="action" type="radio" value="del" checked />删除
<!--
EOT;
}print <<<EOT
-->
	</div>
	<div style="margin-top:10px;">
	     <input class="bt" type="button" name="chkall" value="全 选" onclick="CheckAll(this.form)" />
		 <input class="bt" type="button" value="帖子管理" onclick="location.href='thread.php?fid=$fid&search=$search&page=$page&concle=$concle'" />
		 <input class="btn" type="button" name="hello" value="提 交" onclick="this.form.submit();" />
	</div>
</div>
</form>
<!--
EOT;
}print <<<EOT
-->
<div class="t3"><table cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td>
		<form action="thread.php?fid=$fid&page=$page" method="post">
		<input type="hidden" name="type" value="$type">
		<input type="hidden" name="pcid" value="$pcid">
		<input type="hidden" name="modelid" value="$modelid">
		<input type="hidden" name="special" value="$special">
		<select name="search">
			<option value="digest" $condisel[digest]>本版精华区</option>
			<option value="1" $condisel[1]>1天内的主题</option>
			<option value="2" $condisel[2]>2天内的主题</option>
			<option value="7" $condisel[7]>1星期内的主题</option>
			<option value="30" $condisel[30]>1个月内的主题</option>
			<option value="60" $condisel[60]>2个月内的主题</option>
			<option value="90" $condisel[90]>3个月内的主题</option>
			<option value="180" $condisel[180]>6个月内的主题</option>
			<option value="365" $condisel[365]>1年内的主题</option>
		</select>
<!--
EOT;
if($_G[alloworder]){print <<<EOT
-->
		<select name="orderway">
			<option value="lastpost" $ordersel[lastpost]>按最后回复</option>
			<option value="postdate" $ordersel[postdate]>按主题发表时间</option>
			<option value="hits" $ordersel[hits]>按人气</option>
			<option value="replies" $ordersel[replies]>按回复次数</option>
			<option value="favors" $ordersel[favors]>按收藏次数</option>
		</select>
		<select name="asc">
			<option value="ASC" $ascsel[ASC]>正序</option>
			<option value="DESC" $ascsel[DESC]>倒序</option>
		</select>
<!--
EOT;
}print <<<EOT
-->
		<input class="btn" type="button" value="提 交" onclick="this.form.submit();">
		</form>
		</td>
		<td align="right" width="40%">
		<form name="jump" method="post">
<!--
EOT;
if($winduid){print <<<EOT
-->
		<a class="bta fr" onclick="showViewLog('pw_ajax.php?action=readlog','',this.id);" id="readlog" href="javascript:;">帖子浏览记录<span class="f9">▼</span></a>
		<a class="bta fr" id="threadlog" onclick="showViewLog('pw_ajax.php','action=threadlog',this.id);" href="javascript:;">版块浏览记录<span class="f9">▼</span></a>
<!--
EOT;
}print <<<EOT
-->
		<a class="bta fr" href="profile.php?action=permission&fid=$fid" title="查看您在本版块的权限" target="_blank">版块权限查看</a>
		</form>
		</td>
	</tr>
</table></div>
<div class="t3">

<!--
EOT;
if($N_allowtypeopen || $N_allowtopicopen || $N_allowpostcateopen){print <<<EOT
-->
<span class="fr"><a href="post.php?fid=$fid" title="发表新帖"><img src="$imgpath/$stylepath/post.png" id="td_post1" /></a></span>
<!--
EOT;
}print <<<EOT
-->

	<span class="fl">$pages</span>
	<div class="c"></div>
</div>
<!--
EOT;
?>