<!--<?php print <<<EOT
-->
<table width="100%" style="table-layout:fixed;">
	<tbody id="threadlist">
		<tr class="tr4">
<!--
EOT;
if($managecheck){print <<<EOT
-->
			<td class="icon" width="50" style="padding:0;">&nbsp;</td>
<!--
EOT;
}else{print <<<EOT
-->
			<td class="icon" width="40" style="padding:0;">&nbsp;</td>
<!--
EOT;
}
$newwindowsChecked = $_COOKIE['newwindows']=='1' ? ' checked' : '';
print <<<EOT
-->
			<td class="subject" style="padding-left:0;">
				<label class="fr mr10 cp" for="newwindows"><input style="padding:0;margin:-1px 3px 0 0;" name="newwindows" id="newwindows" type="checkbox"{$newwindowsChecked} value="1" onclick="xinchuang()" />新窗</label>
<script language="JavaScript">
var orderThreadsClass = {
	orderThreads : function(orderway){
		var orderway = orderway || 'lastpost';
		var form = document.createElement("form");
		form.action = "{$pageUrl}{$urlall}{$viewbbs}&page=$page#tabA";
		form.method = "post";
		var h_type = this.createInput("hidden","type","$type");
		var h_search = this.createInput("hidden","search","1000");
		var h_special = this.createInput("hidden","special","$special");
		var h_orderway = this.createInput("hidden","orderway",orderway);
		var h_asc = this.createInput("hidden","asc","DESC");
		form.appendChild(h_type);
		form.appendChild(h_search);
		form.appendChild(h_special);
		form.appendChild(h_orderway);
		form.appendChild(h_asc);
		document.body.appendChild(form);
		setTimeout(function(){/*ie6*/
			form.submit();
		},0);
		return false;
	},
	createInput : function(type,name,value){
		var hidden = document.createElement("input");
		hidden.type = type;
		hidden.name = name;
		hidden.value = value;//↓
		return hidden;
	}
}
function orderThreads(orderway){
	orderThreadsClass.orderThreads(orderway);
}
</script>
            <span class="mr20">排序：<a href="javascript:;" title="按发表时间排序" onclick="orderThreads('postdate');" id="thread_sort_postdate" {$orderClass[postdate]}><span>最新发帖</span></a>&nbsp;|&nbsp;<a href="javascript:;" title="按最后回复时间排序" onclick="orderThreads('lastpost');" id="thread_sort_lastpost" {$orderClass[lastpost]}><span>最后回复</span></a></span></td>
            <td class="author">作者</td>
            <td width="60">回复</td>
            <td class="author">最后发表</td>
        </tr>
<!--
EOT;
if($page==1 && $ifsort){
if($NT_A){
$NT_A[startdate] = get_date($NT_A[startdate]);
print <<<EOT
-->
        <tr class="tr3">
            <td class="icon tac"><img src="$imgpath/$stylepath/thread/anc.gif" alt="公告" /></td>
            <td class="subject">站点公告: <a href="$NT_A[url]" class="mr10">$NT_A[subject]</a><a href="$NT_A[url]" class="f10">$NT_A[startdate]</a>
            </td>
            <td class="author">
                <a href="u.php?username=$NT_A[rawauthor]">$NT_A[author]</a>
            </td>
            <td class="num">&nbsp;</td>
            <td class="author">&nbsp;</td>
        </tr>
<!--
EOT;
}if($NT_C){
$NT_C[startdate] = get_date($NT_C[startdate]);
print <<<EOT
-->
        <tr class="tr3">
            <td class="icon tac"><img src="$imgpath/$stylepath/thread/anc.gif" alt="公告" /></td>
            <td class="subject">分类公告: <a href="$NT_C[url]" class="mr10">$NT_C[subject]</a><a href="notice.php?fid=$NT_C[fid]" class="f10">$NT_C[startdate]</a>
            </td>
            <td class="author"><a href="u.php?username=$NT_C[rawauthor]">$NT_A[author]</a></td>
            <td class="num">&nbsp;</td>
            <td class="author">&nbsp;</td>
        </tr>
<!--
EOT;
}}
$tpc_topped=0;
$tooltips = array(
	'topicnew'=>'开放主题',
	'topichot'=>'热门主题',
	'topiclock'=>'锁定主题 ',
	'topicclose'=>'关闭主题',
	'vote'=>'投票主题',
	'active'=>'活动主题',
	'reward'=>'悬赏主题',
	'trade'=>'热门主题',
	'debate'=>'辩论主题',
	'votelock'=>'锁定投票',
	'activelock'=>'锁定活动',
	'rewardlock'=>'锁定悬赏',
	'tradelock'=>'锁定热门',
	'debatelock'=>'锁定辩论'
);
foreach($threaddb as $key => $thread){
$thread['postdate'] = get_date($thread['postdate'],'Y-m-d');
list($thread['lstptime'],$thread['lstpdate']) = getLastDate($thread['lastpost']);
$tooltip = $tooltips[$thread['tooltip']];
if($page==1 && $ifsort && $thread[topped]==0 && $tpc_topped==0){
$tpc_topped=1;
print <<<EOT
-->
					<tr class="tr4"><td colspan="5" class="tac">普通主题</td></tr>
<!--
EOT;
}print <<<EOT
-->
      		<tr class="tr3">
            <td class="icon tac"><!--
EOT;
if($managecheck){
if ($thread['fid'] == $fid) {
	$thread['adminbox'] = "<input type=\"checkbox\" autocomplete=\"off\" name=\"tidarray[]\" id=tid_{$thread[tid]} value=\"$thread[tid]\" onclick=\"postManage.show('postbatch','a_ajax_{$thread[tid]}')\" />";
} else {
	$thread['adminbox'] = "&nbsp;&nbsp;&nbsp;";
}
print <<<EOT
-->$thread[adminbox]<!--
EOT;
}if($thread[topped]){print <<<EOT
-->
	<a href="read.php?tid={$thread[tid]}" target="_blank">
		<img src="$imgpath/$stylepath/file/headtopic_$thread[topped].gif" align="absmiddle" alt="置顶帖标志" title="置顶帖标志"/>
	</a>
<!--
EOT;
}else{print <<<EOT
-->
	<a title="$tooltip" href="$thread[tpcurl]" target="_blank">$thread[status]</a></td>		
<!--
EOT;
}print <<<EOT
-->
            <td class="subject" 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;" alt="精华帖标志" title="精华帖标志" />
<!--
EOT;
}if($thread[modelid]>0){
if($thread[topped] == 0){
if(isset($postTopic->topicmodeldb[$thread[modelid]])){
print<<<EOT
-->
			<a href="thread.php?fid=$fid&modelid=$thread[modelid]"  class="s4 f14">[{$postTopic->topicmodeldb[$thread[modelid]][name]}]</a>
<!--
EOT;
}}}print<<<EOT
-->
<!--
EOT;
if($thread[special]>20){
if($thread[topped] == 0){
$thread[pcid] = '';
$thread[pcid] = $thread[special]-20;
if(isset($postCate->postcatedb[$thread[pcid]])){
print<<<EOT
-->
	<a href="thread.php?fid=$fid&pcid=$thread[pcid]" class="f14 s4">[{$postCate->postcatedb[$thread[pcid]][name]}]</a>
<!--
EOT;
}}}if($thread[toolinfo]){print <<<EOT
-->
    	<span class="s2 f14">[$thread[toolinfo]]</span>
<!--
EOT;
}print <<<EOT
-->
			$thread[useriocn]
<!--
EOT;
if($forumset['addtpctype'] && $t_db[$thread['type']] && $thread['fid']==$fid){
if ($upid = $t_db[$thread['type']]['upid']) {
$tempTypeUpName = strip_tags($t_db[$upid][name]);
$secondTempTypeUpName = str_ireplace($tempTypeUpName,'['.$tempTypeUpName.']',$t_db[$upid][name]);
$upname = $t_db[$upid][logo] ? "<img src=\"{$t_db[$upid][logo]}\" alt=\"&nbsp;\">" : "$secondTempTypeUpName";
print <<<EOT
-->
			<a href="thread.php?fid=$fid&type=$upid{$viewbbs}" class="f14 view s4">$upname</a>
<!--
EOT;
}
$tempTypeName = strip_tags($t_db[$thread[type]][name]);
$secondTempTypeName = str_ireplace($tempTypeName,'['.$tempTypeName.']',$t_db[$thread[type]][name]);
$topictype = $t_db[$thread[type]][logo] ? "<img src=\"{$t_db[$thread[type]][logo]}\" alt=\"&nbsp;\">" : "$secondTempTypeName";
print <<<EOT
-->
			<a href="thread.php?fid=$fid&type=$thread[type]{$viewbbs}" class="f14 s4 view">$topictype</a>
<!--
EOT;
}if($thread['state'] == 0 && $thread['rewcredit'] > 0){print <<<EOT
-->
			<span class="s2"> &#8212; 悬赏金额:$thread[rewcredit] &#8212; </span>
<!--
EOT;
}
$isNewWindowOpen = $newwindows == 1 ? 'target="_blank"' : '';
print <<<EOT
-->
<a href="$thread[tpcurl]" name="readlink" $isNewWindowOpen id="a_ajax_$thread[tid]" class="subject_t f14">$thread[subject]</a>&nbsp; $thread[ifmark] $thread[titleadd] $thread[recommendadd]
<!--
EOT;
if(isset($thread['colony'])){print <<<EOT
-->
			<span class="s6 w" style="display:none;">[来自群：<a href="apps.php?q=group&cyid={$thread[colony][cyid]}" class="s6">{$thread[colony][cname]}</a>]</span>
<!--
EOT;
}if($timestamp-$thread[lastpost]<=$db_newtime){print <<<EOT
-->
			<img src="$imgpath/$stylepath/file/new.gif" align="absmiddle" title="新帖标志" alt="新帖标志" />
<!--
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>
            <td class="author"><a href="{$db_userurl}$thread[authorid]">$thread[author]</a><p>$thread[postdate]</p></td>
            <td class="num"><em>$thread[replies]</em>/$thread[hits]</td>
            <td class="author"><a href="u.php?username=$thread[lastposter]">$thread[lastposter]</a><p><a href="read.php?tid={$thread[tid]}&page=e#a" title="$thread[lstpdate]">$thread[lstptime] <span>&raquo;</span></a></p></td>
        </tr>
<!--
EOT;
if($managemode==1){
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="4"></td></td></tr>
<!--
EOT;
}}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
	</tbody>
</table>
<script LANGUAGE="JavaScript">
function delload(){
	var objTrs = getElementsByClassName('tr3',getObj('threadlist'));
	var mover =	 function (){
		var delObj = getElementsByClassName('s6 w',this);
		if(delObj.length>0){
			delObj[0].style.display='';
		}
	};
	var mout = function (){
		var delObj = getElementsByClassName('s6 w',this);
		if(delObj.length>0){
			delObj[0].style.display='none';
		}
	};
	for (var i=0;i<objTrs.length ; i++ ){
		objTrs[i].onmouseover = mover;
		objTrs[i].onmouseout =  mout;
	}
}
window.onReady(delload);

//判断是否选中新窗口
function xinchuang() { //新窗
	var i;
	var val = document.getElementById("newwindows");
	var va  = document.getElementsByName("readlink");
	if (val.checked == true) { //选中
		for (i=0;i<va.length;i++) {
			var vaa = va[i].setAttribute("target","_blank");
		}
		SetCookie("newwindows",1);
	} else {
		for (i=0;i<va.length;i++) {
			var vaa = va[i].setAttribute("target","_self");
		}
		SetCookie("newwindows",0);
	}
}
//自动加载
//window.onReady(xinchuang);
</script>
<!--
EOT;
?>