旧版本:
浏览主题只显示楼主的帖子 For Discuz! 5.0 Or 4.1
演示地址: http://nt.discuz.net/showtopic.aspx?topicid=7766&onlyauthor=1
5.5.0版本,请根据下面的步骤操作
一.备份需要修改的三个文件
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();
复制代码
在下面添加
- $extrasql = !empty($originator) ? "AND p.authorid='$authorid'" : '';
复制代码
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(!empty($originator)) {
- $query_count = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$authorid'");
- $thread['posts'] = $db->result($query_count,0);
- $multipage = multi($thread['posts'], $ppp, $page, "viewthread.php?tid=$tid&extra=$extra&originator=yes".(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 $post['authorid'] == $authorid}-->
- <!--{if !$originator}-->
- <a href="viewthread.php?tid=$thread[tid]&extra=$extra&originator=yes">{lang onlyreadauthor}</a>
- <!--{else}-->
- <a href="viewthread.php?tid=$thread[tid]&extra=$extra">{lang readallposter}</a>
- <!--{/if}-->
- <!--{/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' => '阅读全部',
复制代码
三.登录管理员到后台更新缓存
[ 本帖最后由 Arice 于 2007-3-25 02:11 编辑 ] |