isset($ascdesc) && in_array($ascdesc, array('ASC', 'DESC')) ? $forumdisplayadd .= "&ascdesc=$ascdesc" : $ascdesc = $_DCACHE['forums'][$fid]['ascdesc'] ? $_DCACHE['forums'][$fid]['ascdesc'] : 'DESC';
//e_zailai----鼠標指向主題表格時顯示最後回復等內容--------開始
$dotadd1 = $dotadd2 = '';
if($dotfolders && $discuz_uid) {
$dotadd1 = "DISTINCT p.authorid AS dotauthor, p.subject AS re_subject, p.message, ";
$dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND p.authorid='$discuz_uid')";
}else {
$dotadd1 = "p.subject AS re_subject, p.message, ";
$dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND t.lastpost=p.dateline)";
}
//e_zailai----鼠標指向主題表格時顯示最後回復等內容--------結束
$thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
$thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
//e_zailai----鼠標指向主題表格時顯示最後回復等內容--------開始
if($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) {
$thread['message'] = "謝謝您的訪問!由於權限不夠,您僅可瀏覽本版主題標題。";
} elseif($thread['creditsrequire'] && $thread['creditsrequire'] > $credit && !$ismoderator) {
include language('messages');
eval("\$show_message = \"".$language[thread_nopermission]."\";");
$thread['message'] = $show_message;
} else {
$thread['message'] = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "**** 回復後才可查看信息 *****", $thread['message'] );
$thread['message'] = preg_replace("/\[sell=?\d*\](.+?)\[\/sell\]/is", "**** 付費信息,已經隱藏 *****", $thread['message'] );
$thread['message'] = preg_replace("/\[php](.+?)\[\/php\]/is", "**** 內容為PHP代碼 *****", $thread['message'] );
$thread['message'] = preg_replace("/\[code](.+?)\[\/code\]/is", "**內容為普通代碼**", $thread['message'] );
$thread['message'] = preg_replace("/\[quote](.+?)\[\/quote\]/is", "**圖片引用**", $thread['message'] );
$thread['message'] = preg_replace("/\[url=?(.+?)\](.+?)\[\/url\]/is", "**** 此處為超級鏈接 *****", $thread['message'] );
$thread['message'] = preg_replace("/\[img](.+?)\[\/img\]/is", "**此處為圖片鏈接**", $thread['message'] );
$thread['message'] = str_replace('"', '"', $thread['message']);
$thread['message'] = str_replace('<', '<', $thread['message']);
$thread['message'] = str_replace('>', '>', $thread['message']);
//$thread['message'] = str_replace("\r\n", " ◇ ", $thread['message']); //去掉回車,緊湊顯示
$thread['message'] = cutstr($thread['message'],100); //內容截斷
}
if($thread[replies]) {
$thread['shortmsg'] = $thread[message].' by:'.$thread[lastposter];
} else {
$thread['shortmsg'] = $thread[subject].$thread[message].'主題作者:'.$thread[author].' 發表時間:'.$thread[dateline];
}
//e_zailai----鼠標指向主題表格時顯示最後回復等內容--------結束
$query = $db->query("SELECT t.* FROM {$tablepre}threads t
/*$query = $db->query("SELECT t.* FROM {$tablepre}threads t*/
$query = $db->query("SELECT $dotadd1 t.* FROM {$tablepre}threads t $dotadd2
<span id="thread_$thread[tid]"><a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a></span>
<span id="thread_$thread[tid]"><a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight] title="$thread[shortmsg]">$thread[subject]</a></span>