演示 http://nt.discuz.net/showtopic-68.aspx
请选择适合你版本的Discuz!软件进行修改
Discuz! 5 修改方法如下
打开 viewthread.php
1 找到
- $thread['subjectenc'] = rawurlencode($thread['subject']);
复制代码
下面添加
- $authorid = $thread['authorid'];
复制代码
2 找到
- $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));
复制代码
删除
3 找到
- $postlist = $attachtags = array();
复制代码
下面添加
- $extrasql = !empty($originator) ? "AND p.authorid='$authorid'" : '';
复制代码
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) : ''));
- }
复制代码
打开viewthread.htm文件
1 找到
- <a href="viewthread.php?action=printable&tid=$tid" target="_blank">{lang thread_printable}</a> |
复制代码
下面添加
- <!--{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 找到
- $thread['subjectenc'] = rawurlencode($thread['subject']);
复制代码
下面添加
- $authorid = $thread['authorid'];
复制代码
2 找到
$multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));
删除
3 找到
- $postlist = $attachtags = array();
复制代码
下面添加
- $extrasql = !empty($originator) ? "AND p.authorid='$authorid'" : '';
复制代码
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) : ''));
- }
复制代码
打开viewthread.htm文件
1 找到
- <tr style="color: {HEADERTEXT}"><td class="bold" width="65%">{lang subject}: $thread[subject]</td>
- <td width="35%" align="right" nowrap>
复制代码
下面添加
- <!--{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 编辑 ] |