發新話題
打印

[插件交流] 瀏覽主題只顯示樓主的帖子 For Discuz! 5.0

展開帖子列表 展開帖子列表

[插件交流] 瀏覽主題只顯示樓主的帖子 For Discuz! 5.0

瀏覽主題只顯示樓主的帖子 For Discuz! 5.0 Or 4.1 請選擇適合你版本的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}-->
套一句黃小琥說過的話:「你可以點歌,但是我可以選歌」

TOP

只看樓主(只顯示樓主)/閱讀全部 切換(適合連載論壇)

只看樓主(只顯示樓主)/閱讀全部 切換(適合連載論壇)
http://www.discuz.net/thread-564442-1-1.html

舊版本:
瀏覽主題只顯示樓主的帖子 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&amp;extra=$extra".(isset($highlight) ? "&amp;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&amp;extra=$extra".(isset($highlight) ? "&amp;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' => '閱讀全部',
三.登錄管理員到後台更新緩存

TOP

[改良] 瀏覽主題只顯示樓主&指定回帖者的帖子 For Discuz! 5.5

[改良] 瀏覽主題只顯示樓主&指定回帖者的帖子 For Discuz! 5.5 by bluelovers

全新安裝方法 - 請根據下面的步驟操作

一.備份需要修改的三個文件

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' => '閱讀全部',
三.登錄管理員到後台更新緩存

TOP

[改良] 瀏覽主題只顯示樓主&指定回帖者的帖子 For Discuz! 6.0

老話一句就是希望該主題的發表者所發表的內容還是一樣可以被看到
算是對發表者的尊重

不過D6之後 修改起來真是超簡易


演示 http://discuz.bluelovers.net/viewthread.php?tid=3090&page=1&authorid=1
演示需註冊純屬廣告 可以忽略不查看

開啟 viewthread.php

$query = $db-&gt;query(&quot;SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' AND authorid='$authorid'&quot;);
改為
$query = $db-&gt;query(&quot;SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' AND authorid IN ($thread[authorid], '$authorid')&quot;);
$onlyauthoradd = &quot;AND p.authorid='$authorid'&quot;;
改為
$onlyauthoradd = &quot;AND p.authorid IN ($thread[authorid], '$authorid')&quot;;
完成

TOP

RE: [插件交流] 瀏覽主題只顯示樓主的帖子 For Discuz! 5.0

我的論壇是樂透論壇需要報號統計 如果一篇一篇報號文章點點閱統計
實在累人不知道有無統計插件  可一次看全部發表人的文章 ~
請版主指教~~

TOP

RE: [插件交流] 瀏覽主題只顯示樓主的帖子 For Discuz! 5.0

用回覆預覽
利用預覽的時候 來快速統計

TOP

RE: [插件交流] 瀏覽主題只顯示樓主的帖子 For Discuz! 5.0

不好意思 版主 我不了解回覆預覽 是指每篇文章都一樣一篇一篇點閱預覽嗎
還是裝上版主貼的這個插件有這個回覆預覽功能!

TOP

RE: [插件交流] 瀏覽主題只顯示樓主的帖子 For Discuz! 5.0

功能說明
http://discuz.bluelovers.net/thread-3582.html

至於插件 你在本站搜尋一下就會找到了

TOP

發新話題