Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

浏览主题只显示楼主的帖子 For Discuz! 5.0 Or 4.1

[复制链接]
fengxue 发表于 2006-3-30 17:49:27 | 显示全部楼层 |阅读模式
演示 http://nt.discuz.net/showtopic-68.aspx

请选择适合你版本的Discuz!软件进行修改

Discuz! 5 修改方法如下

打开 viewthread.php



1 找到
  1. $thread['subjectenc'] = rawurlencode($thread['subject']);
复制代码


下面添加
  1. $authorid = $thread['authorid'];
复制代码


2 找到

  1.         $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));
复制代码


删除

3 找到
  1.         $postlist = $attachtags = array();
复制代码


下面添加
  1.         $extrasql = !empty($originator) ? "AND p.authorid='$authorid'" : '';
复制代码


4 找到
  1.                 WHERE p.tid='$tid' AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
复制代码


替换成
  1.                 WHERE p.tid='$tid' $extrasql AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
复制代码


替换后在下面添加
  1.         if(!empty($originator)) {
  2.                 $query_count = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$authorid'");
  3.                 $thread['posts'] = $db->result($query_count,0);
  4.                 $multipage = multi($thread['posts'], $ppp, $page, "viewthread.php?tid=$tid&extra=$extra&originator=yes".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));       
  5.         } else {
  6.                 $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));

  7.         }
复制代码


打开viewthread.htm文件

1 找到

  1. <a href="viewthread.php?action=printable&tid=$tid" target="_blank">{lang thread_printable}</a> |
复制代码


下面添加
  1. <!--{if !$originator}--><a href="viewthread.php?tid=$thread[tid]&extra=$extra&originator=yes">只看楼主</a><!--{else}--><a href="viewthread.php?tid=$thread[tid]&extra=$extra">阅读全部</a><!--{/if}-->
复制代码





========================分隔线================================



Discuz! 4.1修改方法如下


打开 viewthread.php

1 找到
  1. $thread['subjectenc'] = rawurlencode($thread['subject']);
复制代码


下面添加
  1. $authorid = $thread['authorid'];
复制代码


2 找到
        $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));


删除

3 找到
  1.         $postlist = $attachtags = array();
复制代码


下面添加
  1.         $extrasql = !empty($originator) ? "AND p.authorid='$authorid'" : '';
复制代码


4 找到
  1.                 WHERE p.tid='$tid' AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
复制代码


替换成
  1.                 WHERE p.tid='$tid' $extrasql AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
复制代码


替换后在下面添加
  1.         if(!empty($originator)) {
  2.                 $query_count = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$authorid'");
  3.                 $thread['posts'] = $db->result($query_count,0);
  4.                 $multipage = multi($thread['posts'], $ppp, $page, "viewthread.php?tid=$tid&extra=$extra&originator=yes".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));       
  5.         } else {
  6.                 $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));

  7.         }
复制代码


打开viewthread.htm文件

1 找到
  1. <tr style="color: {HEADERTEXT}"><td class="bold" width="65%">{lang subject}: $thread[subject]</td>
  2. <td width="35%" align="right" nowrap>
复制代码


下面添加
  1. <!--{if !$originator}--><a href="viewthread.php?tid=$thread[tid]&extra=$extra&originator=yes">只看楼主</a><!--{else}--><a href="viewthread.php?tid=$thread[tid]&extra=$extra">阅读全部</a><!--{/if}-->
复制代码

[ 本帖最后由 fengxue 于 2006-9-5 15:13 编辑 ]
tshilu 发表于 2006-3-30 18:06:12 | 显示全部楼层
哦?sf啊
回复

使用道具 举报

ggggxxx 发表于 2006-3-30 18:46:00 | 显示全部楼层
good
回复

使用道具 举报

简单生活 发表于 2006-3-30 18:47:00 | 显示全部楼层
........
回复

使用道具 举报

madly 发表于 2006-3-30 19:10:04 | 显示全部楼层
有时候蛮有用的。
回复

使用道具 举报

kenron 发表于 2006-3-30 19:15:13 | 显示全部楼层
看不出来有什么作用..不过也支持下
回复

使用道具 举报

聿歆 发表于 2006-3-30 19:29:35 | 显示全部楼层
官方插件,聿歆留名支持.

/////////////广告位招租////////////////
回复

使用道具 举报

sw08 发表于 2006-3-30 19:40:09 | 显示全部楼层
用处不大。
回复

使用道具 举报

我是肖飞 发表于 2006-3-30 19:42:36 | 显示全部楼层
没有什么用,支持
回复

使用道具 举报

tryer 发表于 2006-3-30 19:53:56 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-4-24 23:05 , Processed in 0.106635 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表