[改良] 瀏覽主題只顯示樓主&指定回帖者的帖子 For Discuz! 5.5 by bluelovers
http://discuz.bluelovers.net/thread-1653.html#pid2408
全新安裝方法 - 請根據下面的步驟操作
一.備份需要修改的三個文件
viewthread.php,
templates/default/viewthread.htm,
templates/default/template.lang.php
二.修改文件
1.打開 viewthread.php
1.1查找
复制内容到剪贴板
代码:
$thread['subjectenc'] = rawurlencode($thread['subject']);在下面添加
复制内容到剪贴板
代码:
$authorid = $thread['authorid'];1.2查找
复制内容到剪贴板
代码:
$postlist = $attachtags = $attachlist = array();在下面添加
复制内容到剪贴板
代码:
$originator = max(0, intval($originator));
$extrasql = ($originator > 0) ? "AND p.authorid IN ('$authorid', '$originator')" : '';1.3查找並刪除
复制内容到剪贴板
代码:
$multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));1.4查找
复制内容到剪贴板
代码:
WHERE p.tid='$tid' AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");替換成
复制内容到剪贴板
代码:
WHERE p.tid='$tid' $extrasql AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
if($originator && !empty($extrasql)) {
// $query_count = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$authorid'");
$query_count = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND authorid IN ('$authorid', '$originator')");
$thread['posts'] = $db->result($query_count,0);
$multipage = multi($thread['posts'], $ppp, $page, "viewthread.php?tid=$tid&extra=$extra&originator=$originator".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));
} else {
$multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));
}2.打開/templates/default/viewthread.htm
查找
复制内容到剪贴板
代码:
<!--{if $magicstatus}-->
<div class="right" style="padding-top: {TABLESPACE}px;"><a href="magic.php?action=user&pid=$post[pid]" target="_blank">{lang magics_use}</a> </div>
<!--{/if}-->替換為
复制内容到剪贴板
代码:
<!--//只看樓主(只顯示樓主)/閱讀全部 切換(適合連載論壇)-->
<div class="right" style="padding-top: {TABLESPACE}px;">
<!--{if !$originator}-->
<a href="viewthread.php?tid=$thread[tid]&extra=$extra&originator=$post[authorid]">{lang onlyreadauthor}<!--{if $post['authorid'] != $thread['authorid']}--> & $post[author]<!--{if $post['nickname'] && $post[author] != $post['nickname']}--> ($post[nickname])<!--{/if}--><!--{/if}--></a>
<!--{else}-->
<a href="viewthread.php?tid=$thread[tid]&extra=$extra">{lang readallposter}</a>
<!--{/if}-->
|
<!--{if $magicstatus}-->
<a href="magic.php?action=user&pid=$post[pid]" target="_blank">{lang magics_use}</a>
<!--{/if}-->
</div>
<!--//只看樓主(只顯示樓主)/閱讀全部 切換(適合連載論壇)-->3.打開 templates/default/template.lang.php
查找
复制内容到剪贴板
代码:
'leftmenu_index' => '論壇首頁',在下面加入
复制内容到剪贴板
代码:
'onlyreadauthor' => '只看樓主',
'readallposter' => '閱讀全部',三.登錄管理員到後台更新緩存