トップ  >  趣味の部屋  >  XOOPSサイト構築  >  d3forum側で統合コメントのツリー全表示
xoops コメント統合 d3forum

本情報はいささか古く、現在ではハック無しで組み込まれた、こちらのXoopsX版をどうぞご使用ください。

コメント統合で d3forumのツリー全表示 anchor.png

元ネタ - XUGJ
上の内容から以下の機能を追加しました。

  1. 「投稿の新しいものから」「投稿の古いものから」をクリックした時の、ツリー表示の降順/昇順切り替え。(「ツリー構造順」は追いきれなかったので反映できていません。)(「ツリー構造順」も反映しました。)
  2. 表示中のツリーを判別するためのインジケータ (テンプレート側で編集)
    1. ツリー(トピック)が2つ以上の場合のみ表示するように変更しました。
  3. 当該元記事についた全コメントをツリー表示するか、そのトピだけツリー表示として他のトピックはトピックリスト表示とするか、テンプレートの編集のみで対応できます。

まだまだ未熟ですが、現状でよろしければどうぞお試しください。

実装済みのサイト(参考まで) : モバイルテンプハウス

背景 anchor.png

 コメント統合で付いたコメント。 質問内容が変わったりしてトピック分けしたりすると、d3forum側で「このトピックの投稿一覧へ」で閲覧してもトピック内の投稿しか表示されないため、同じ元記事に紐付いた他のトピックの投稿に気づかない場合があります。
 オリジナル版では、元記事にジャンプして初めてその存在に気づくことになっていて、最大表示記事数を超えている場合は元記事側でも他のトピの投稿が流れてしまって表示されない場合もあります。 こういう時は、仕方なく「トピック表示」にしたりしますが、訪問者から見るとコメントし辛い感じ。

 色々な案を考えてやってみたのですが、一番しっくりきたのはd3forum側で「このトピックの投稿一覧へ」を表示したときに、他のトピも含めてツリーを表示するというものです。 当該トピだけでしたら、テンプレート編集だけで行けますが、全トピのツリー表示は対策が必要です。

仕様 anchor.png

  • ツリーに表示されたリンクをクリックすると、表示中のトピック内の記事にはそのまま記事部分にジャンプし、それ以外のトピにはページ遷移してその記事部分にジャンプします。
  • プラグインの呼び出し例
    Everything is expanded.Everything is shortened.
     
    
    <{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id order="ASC" postorder=$postorder item="tree"}>
  • プラグインの呼び出しの際のオプションは、以下です。 「order」以外は上記の呼び出し例どおりで問題ないはずです。
    1. forum_dirname: d3forumのディレクトリ名。d3forumテンプレート内では$mydirnameでOK。
    2. forum_id: コメント統合したd3forumのforum番号。d3forumテンプレート内では$forum.idでOK。
    3. topic_id: コメント統合記事以外の時に表示トピックを限定するための、topic番号。d3forumテンプレート内では$topic.idでOK。
    4. external_link_id: コメント統合記事の外部リンク番号。d3forumテンプレート内では$topic.external_link_idでOK。
    5. order: 表示の昇順/降順指定。 「ASC」=「降順」、「DESC」=「昇順」。 「d3forum_main_listposts.html 」内の記述では、ツリー構造順表示が標準ですので、ここでは何も指定しないでください。
    6. limit: ツリーに表示する最大タイトル数。 指定しなければ100件までを最大として表示します。(記事自体の表示件数ではありません。)
    7. postorder: 「投稿の新しいものから」「投稿の古いものから」をクリックした時の、表示順変更のための変数。 d3forumテンプレート内では$postorderでOK。
    8. item: テンプレート内で参照する変数名。

 

コード anchor.png

sumartyプラグインを1つ作って、テンプレートから呼び出してテンプレート変数にアサインし、テンプレート内で表示します。

function.d3comment_tree.php anchor.png

 以下のコードを「function.d3comment_tree.php」 として新規作成し、「(xoops_root_path)/class/smarty/plugins/」ディレクトリ内にアップします。
 (2009/3/31:90行目でERRORが出ていたので修正しました。
  2009/4/13:コメント統合記事かつトピックが2つ以上の場合のみ、「表示中トピック」インジケータが出るように変更しました。)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     function
 * Name:     d3comment_tree
 * Version:  0.1.2
 * Date:     April 13, 2009
 * Author:   naao
 * Purpose:  Shows comment trees in a external link id
 * Input:    
 * 
 * Examples: <{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id order="ASC" postorder=$postorder item="tree"}>
 *
 */
function smarty_function_d3comment_tree($params, &$smarty)
{
    // transitional from 'dirname' -> 'forum_dirname'
    $params['forum_dirname'] = @$params['forum_dirname'] . @$params['dirname'] ;
    $forum_dirname = ! empty( $params['forum_dirname'] ) ? $params['forum_dirname'] : 'd3forum' ;
    $forum_id = ! empty( $params['forum_id'] ) ? intval( $params['forum_id'] ) : 1 ;
    $topic_id = ! empty( $params['topic_id'] ) ? intval( $params['topic_id'] ) : 0 ;
    $external_link_id = ! empty( $params['external_link_id'] ) ? intval( $params['external_link_id'] ) : 1 ;
    $limit = ! empty( $params['limit'] ) ? intval( $params['limit'] ) : 100 ;
    $_order = strtolower(@$params['order']) == 'asc' ? 'ASC' : (strtolower(@$params['order']) == 'desc' ? 'DESC' : '') ;
    $postorder = ! empty( $params['postorder'] ) ? intval( $params['postorder'] ) : 0 ;
    $item = ! empty( $params['item'] ) ? $params['item'] : 'tree' ;
 
    if ( $_order != '') {
            $disp_order = $_order ;
            $whr_order = "post_time DESC";
    } else {
        switch ($postorder) {
            case 0:
                $whr_order = "t.topic_id ASC,p.order_in_tree,p.post_id";
                break;
            case 2:
                $disp_order = 'ASC' ;
                $whr_order = "post_time DESC";
                break;        
            case 3:
                $whr_order = "post_time DESC";
                break;
            default:
        }
    }
    
    if( ! preg_match( '/^[0-9a-zA-Z_-]+$/' , $forum_dirname ) || $forum_id <= 0 || $external_link_id <= 0 ) {
        echo "<p>d3comment_tree function does not set properly.</p>" ;
    } else {
 
        $db =& Database::getInstance() ;
        $myts =& MyTextSanitizer::getInstance() ;
 
        // main query
        $sql = "SELECT p.*,t.topic_locked,t.topic_id,t.forum_id FROM ".$db->prefix($forum_dirname."_posts")." p LEFT JOIN ".$db->prefix($forum_dirname."_topics")." t ON p.topic_id=t.topic_id WHERE t.forum_id='".$forum_id."' AND (topic_external_link_id='".addslashes($external_link_id)."' OR t.topic_id='".addslashes($topic_id)."') ORDER BY ".$whr_order." LIMIT ".$limit ;
 
        if( ! $trs = $db->query( $sql ) ) die( _MD_D3FORUM_ERR_SQL.__LINE__ ) ;
        $user_handler =& xoops_gethandler( 'user' ) ;
        
        $topics_count = 0;
        $topic_last_id = 0;
        while( $post_row = $db->fetchArray( $trs ) ) {
 
            // get this poster's object
            $poster_obj =& $user_handler->get( intval( $post_row['uid'] ) ) ;
            if( is_object( $poster_obj ) ) {
                $poster_uname4disp = $poster_obj->getVar( 'uname' ) ;
            } else {
                $poster_uname4disp = "" ;
            }
 
            $poster_uname4disp = $poster_uname4disp ? $poster_uname4disp : $myts->makeTboxData4Show( $post_row['guest_name'] ) ;
            // posts array
            $posts[] = array(
                'id' => intval( $post_row['post_id'] ) ,
                'subject' => $myts->makeTboxData4Show( $post_row['subject'] , $post_row['number_entity'] , $post_row['special_entity'] ) ,
                'post_time_formatted' => formatTimestamp( $post_row['post_time'] , 'm' ) ,
                'poster_uid' => intval( $post_row['uid'] ) ,
                'poster_uname' => $poster_uname4disp ,
                'icon' => intval( $post_row['icon'] ) ,
                'depth_in_tree' => intval( $post_row['depth_in_tree'] ) ,
                'order_in_tree' => intval( $post_row['order_in_tree'] ) ,
                'topic_id' => intval( $post_row['topic_id'] ) ,
                'ul_in' => '<ul><li>' ,
                'ul_out' => '</li></ul>' ,
            ) ;
            if (intval( $post_row['topic_id'] ) != $topic_last_id) {
                $topics_count ++ ;
                $topic_last_id = intval( $post_row['topic_id'] );
            }
        }
        
        // reverse array if order is "ASC"
        if (($disp_order == 'ASC') && ($posts)) {$posts = array_reverse($posts);}
        
        $assign_name = @$params['item'] . @$params['assign'] ;
        $smarty->assign( $assign_name , $posts ) ;
        $smarty->assign( $assign_name."_tp_count" , $topics_count ) ;
    }
}
?>

d3forum_main_listposts.html anchor.png

テンプレート「(d3forum)_main_listposts.html」を編集します。
(A案)全投稿をツリー表示するか、(B案)当該ツリー以外はトピックリストを表示するか、テンプレートの編集で選択できます。
tree_alltree.jpg tree_topicslist.jpg

A案:全topicの全postsツリー表示 anchor.png

 当該元記事にぶらさがる、全トピックの全投稿を、ツリー表示します。

Everything is expanded.Everything is shortened.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<!-- start module contents -->
<div class="d3f_breadcrumbs">
    <{if $mod_config.show_breadcrumbs}>
    <a href="<{$mod_url}>/index.php"><{$smarty.const._MD_D3FORUM_TOP}></a>
    &nbsp;&gt;&nbsp;
    <{foreach from=$category.paths_raw key=parent_id item=parent_title_raw}>
        <a href="<{$mod_url}>/index.php?cat_id=<{$parent_id}>"><{$parent_title_raw|escape}></a>
        &nbsp;&gt;&nbsp;
    <{/foreach}>
    <a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>"><{$forum.title}></a>
    <{/if}>
    <{if $prev_topic.id || $next_topic.id}>
        (<{if $prev_topic.id}>
            <a href="<{$mod_url}>/index.php?topic_id=<{$prev_topic.id}>" title="<{$prev_topic.title}>"><{$smarty.const._MD_D3FORUM_LINK_PREVTOPIC}></a>
        <{/if}>
        <{if $prev_topic.id && $next_topic.id}>
         | 
        <{/if}>
        <{if $next_topic.id}>
            <a href="<{$mod_url}>/index.php?topic_id=<{$next_topic.id}>" title="<{$next_topic.title}>"><{$smarty.const._MD_D3FORUM_LINK_NEXTTOPIC}></a>
        <{/if}>)
    <{/if}>
</div>
 
<h1 class="d3f_title" style="clear:both"><{$topic.title}></h1>
 
<{include file="db:`$mydirname`_inc_topicbar.html"}>
 
<{include file="db:`$mydirname`_inc_d3comment_summary.html"}>
 
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id  postorder=$postorder item="tree"}>
 
<!-- start post tree  -->
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_POSTSTREE}></h2>
 
<{foreach from=$tree item=eachpost}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'><span style='padding-left:`$eachpost.depth_in_tree`0px;'>"}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}>
    <{if $topic.external_link_id && ($tree_tp_count > 1) && ($eachpost.topic_id==$topic.id) && ($eachpost.depth_in_tree==0)}><font color="red">★表示中トピック</font><{/if}></span>
<{$eachpost.ul_out}>
<{/foreach}>
<!-- end post tree  -->
 
<{include file="db:`$mydirname`_inc_postorder_links.html"}>
<br />
 
<!-- quick reply form -->
<{if $first_post.can_reply && ($postorder==3)}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" uname=$xoops_uname h2_title=$smarty.const._MD_D3FORUM_POSTASSAMETOPIC quick_form_mode="sametopic" subject_raw=$first_post.subject_raw}>
<{/if}>
 
<div class="d3f_link">
<{$posts|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTDISPLAYSINFO}>
(<{$tree|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTHITSINFO}>)
<a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>&amp;external_link_id=<{$topic.external_link_id|escape:"url"}>"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></a></div>
 
<!-- top of posts -->
<div class="d3f_wrap">
<{foreach item=post from=$posts}>
    <{include file="db:`$mydirname`_inc_eachpost.html" post=$post caller="listposts" inner_link_format="#post_id%s"}>
<{/foreach}>
</div>
<!-- bottom of posts -->
 
<{include file="db:`$mydirname`_inc_postorder_links.html"}>
 
<!-- quick reply form -->
<{if $first_post.can_reply && ($postorder!=3)}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" uname=$xoops_uname h2_title=$smarty.const._MD_D3FORUM_POSTASSAMETOPIC quick_form_mode="sametopic" subject_raw=$first_post.subject_raw}>
<{/if}>
 
<!-- forum jump -->
<form name="forum_jump_box" action="<{$mod_url}>/index.php" method="get" style="clear:both;" class="d3f_form">
    <p>
        <select name="forum_id"><{$forum_jumpbox_options}></select>
        <input type="submit" value="<{$smarty.const._MD_D3FORUM_BTN_JUMPTOFORUM}>" />
        &nbsp;
        <a href="<{$mod_url}>/index.php?page=search"><{$smarty.const._MD_D3FORUM_LINK_ADVSEARCH}></a>
    </p>
</form>
 
<hr class="notification" />
<{include file='db:system_notification_select.html'}>
<!-- end module contents -->
B案:当該topic内postsツリー + 全topicsリスト表示 anchor.png

 当該元記事にぶらさがる、全トピックのうち当該トピックの投稿をツリー表示し、他のトピックはトピックの最初の投稿のみリスト表示します。

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<!-- start module contents -->
<div class="d3f_breadcrumbs">
    <{if $mod_config.show_breadcrumbs}>
    <a href="<{$mod_url}>/index.php"><{$smarty.const._MD_D3FORUM_TOP}></a>
    &nbsp;&gt;&nbsp;
    <{foreach from=$category.paths_raw key=parent_id item=parent_title_raw}>
        <a href="<{$mod_url}>/index.php?cat_id=<{$parent_id}>"><{$parent_title_raw|escape}></a>
        &nbsp;&gt;&nbsp;
    <{/foreach}>
    <a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>"><{$forum.title}></a>
    <{/if}>
    <{if $prev_topic.id || $next_topic.id}>
        (<{if $prev_topic.id}>
            <a href="<{$mod_url}>/index.php?topic_id=<{$prev_topic.id}>" title="<{$prev_topic.title}>"><{$smarty.const._MD_D3FORUM_LINK_PREVTOPIC}></a>
        <{/if}>
        <{if $prev_topic.id && $next_topic.id}>
         | 
        <{/if}>
        <{if $next_topic.id}>
            <a href="<{$mod_url}>/index.php?topic_id=<{$next_topic.id}>" title="<{$next_topic.title}>"><{$smarty.const._MD_D3FORUM_LINK_NEXTTOPIC}></a>
        <{/if}>)
    <{/if}>
</div>
 
<h1 class="d3f_title" style="clear:both"><{$topic.title}></h1>
 
<{include file="db:`$mydirname`_inc_topicbar.html"}>
 
<{include file="db:`$mydirname`_inc_d3comment_summary.html"}>
 
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id postorder=$postorder item="tree"}>
 
<!-- start post tree  -->
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_POSTSTREE}></h2>
<{foreach from=$tree item=eachpost}>
  <{if ($eachpost.topic_id==$topic.id)}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'><span style='padding-left:`$eachpost.depth_in_tree`0px;'>"}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}></span>
  <{/if}>
<{$eachpost.ul_out}>
<{/foreach}>
<!-- end topic list  -->
 
<!-- start topic list  -->
<{if $topic.external_link_id && ($tree_tp_count>1)}>
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></h2>
<{foreach from=$tree item=eachpost}>
  <{if ($eachpost.depth_in_tree==0)}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'>"}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}>
    <{if ($eachpost.topic_id==$topic.id) && ($eachpost.depth_in_tree==0)}><font color="red">★表示中トピック</font><{/if}>
  <{/if}>
<{$eachpost.ul_out}>
<{/foreach}>
<{/if}>
<!-- end post tree  -->
<br />
 
<{include file="db:`$mydirname`_inc_postorder_links.html"}>
<br />
 
<!-- quick reply form -->
<{if $first_post.can_reply && ($postorder==3)}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" uname=$xoops_uname h2_title=$smarty.const._MD_D3FORUM_POSTASSAMETOPIC quick_form_mode="sametopic" subject_raw=$first_post.subject_raw}>
<{/if}>
 
<div class="d3f_link">
<{$posts|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTDISPLAYSINFO}>
(<{$tree|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTHITSINFO}>)
<a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>&amp;external_link_id=<{$topic.external_link_id|escape:"url"}>"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></a></div>
 
<!-- top of posts -->
<div class="d3f_wrap">
<{foreach item=post from=$posts}>
    <{include file="db:`$mydirname`_inc_eachpost.html" post=$post caller="listposts" inner_link_format="#post_id%s"}>
<{/foreach}>
</div>
<!-- bottom of posts -->
 
<{include file="db:`$mydirname`_inc_postorder_links.html"}>
 
<!-- quick reply form -->
<{if $first_post.can_reply && ($postorder!=3)}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" uname=$xoops_uname h2_title=$smarty.const._MD_D3FORUM_POSTASSAMETOPIC quick_form_mode="sametopic" subject_raw=$first_post.subject_raw}>
<{/if}>
 
<!-- forum jump -->
<form name="forum_jump_box" action="<{$mod_url}>/index.php" method="get" style="clear:both;" class="d3f_form">
    <p>
        <select name="forum_id"><{$forum_jumpbox_options}></select>
        <input type="submit" value="<{$smarty.const._MD_D3FORUM_BTN_JUMPTOFORUM}>" />
        &nbsp;
        <a href="<{$mod_url}>/index.php?page=search"><{$smarty.const._MD_D3FORUM_LINK_ADVSEARCH}></a>
    </p>
</form>
 
<hr class="notification" />
<{include file='db:system_notification_select.html'}>
<!-- end module contents -->
<!-- start module contents -->
<!-- breadcrumbs -->
<{if $mod_config.show_breadcrumbs}>
<div class="d3f_breadcrumbs">
    <{strip}>
        <a href="<{$mod_url}>/index.php"><{$smarty.const._MD_D3FORUM_TOP}></a>
        &nbsp;&gt;&nbsp;
        <{foreach from=$category.paths_raw key=parent_id item=parent_title_raw}>
            <a href="<{$mod_url}>/index.php?cat_id=<{$parent_id}>"><{$parent_title_raw|escape}></a>
        &nbsp;&gt;
        <{/foreach}>
        <a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>"><{$forum.title}></a>
        &nbsp;&gt;
        <a href="<{$mod_url}>/index.php?topic_id=<{$topic.id}>"><{$topic.title}></a>
    <{/strip}>
</div>
<{/if}>
 
<h1 class="d3f_title"><{$post.subject}></h1>
 
<{include file="db:`$mydirname`_inc_d3comment_summary.html"}>
 
<div class="d3f_link">
<{$posts|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTDISPLAYSINFO}>
<a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>&amp;external_link_id=<{$topic.external_link_id|escape:"url"}>"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></a></div>
 
<!-- start post tree -->
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_POSTSTREE}></h2>
 
<{foreach from=$posts item=eachpost}>
<{if $eachpost.id == $post.id}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem d3f_currenttopic'><span style='padding-left:`$eachpost.depth_in_tree`0px;'>"}>
<{else}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'><span style='padding-left:`$eachpost.depth_in_tree`0px;'>"}>
<{/if}>
    <a href="<{$mod_url}>/index.php?post_id=<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}></span>
<{$eachpost.ul_out}>
<{/foreach}>
<!-- end post tree -->
 
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id postorder=$postorder item="tree"}>
<!-- start topic list  -->
<{if $topic.external_link_id && ($tree_tp_count>1)}>
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></h2>
<{foreach from=$tree item=eachpost}>
  <{if ($eachpost.depth_in_tree==0)}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'>"}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}>
    <{if ($eachpost.topic_id==$topic.id) && ($eachpost.depth_in_tree==0)}><font color="red">★表示中トピック</font><{/if}>
  <{/if}>
<{$eachpost.ul_out}>
<{/foreach}>
<{/if}>
<!-- end post tree  -->
<br />
<p class="d3f_topicinfo"><a href="<{$mod_url}>/index.php?topic_id=<{$topic.id}>"><{$smarty.const._MD_D3FORUM_LINK_LISTPOSTS}></a></p>
 
<div class="d3f_wrap">
<{include file="db:`$mydirname`_inc_eachpost.html" caller="viewpost" inner_link_format="`$mod_url`/index.php?post_id=%s"}>
</div>
 
<!-- quick reply form -->
<{if $post.can_reply}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" uname=$xoops_uname h2_title=$smarty.const._MD_D3FORUM_REPLYTHISPOST quick_form_mode="reply" subject_raw=$post.subject_raw}>
<{/if}>
 
<!-- forum jump -->
<form name="forum_jump_box" action="<{$mod_url}>/index.php" method="get" style="clear:both;">
    <p>
        <select name="forum_id"><{$forum_jumpbox_options}></select>
        <input type="submit" value="<{$smarty.const._MD_D3FORUM_BTN_JUMPTOFORUM}>" />
        &nbsp;
        <a href="<{$mod_url}>/index.php?page=search"><{$smarty.const._MD_D3FORUM_LINK_ADVSEARCH}></a>
    </p>
</form>
 
<hr class="notification" />
 
<{include file='db:system_notification_select.html'}>
<!-- end module contents -->

d3forum_main_viewpost.html anchor.png

1ポスト表示においても、上記のB案に準じたtopicsリスト表示が希望の場合には、テンプレート「(d3forum)_main_viewpost.html」を編集します。
tree_viewpost.jpg

Everything is expanded.Everything is shortened.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<!-- start module contents -->
<!-- breadcrumbs -->
<{if $mod_config.show_breadcrumbs}>
<div class="d3f_breadcrumbs">
    <{strip}>
        <a href="<{$mod_url}>/index.php"><{$smarty.const._MD_D3FORUM_TOP}></a>
        &nbsp;&gt;&nbsp;
        <{foreach from=$category.paths_raw key=parent_id item=parent_title_raw}>
            <a href="<{$mod_url}>/index.php?cat_id=<{$parent_id}>"><{$parent_title_raw|escape}></a>
        &nbsp;&gt;
        <{/foreach}>
        <a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>"><{$forum.title}></a>
        &nbsp;&gt;
        <a href="<{$mod_url}>/index.php?topic_id=<{$topic.id}>"><{$topic.title}></a>
    <{/strip}>
</div>
<{/if}>
 
<h1 class="d3f_title"><{$post.subject}></h1>
 
<{include file="db:`$mydirname`_inc_d3comment_summary.html"}>
 
<div class="d3f_link">
<{$posts|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTDISPLAYSINFO}>
<a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>&amp;external_link_id=<{$topic.external_link_id|escape:"url"}>"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></a></div>
 
<!-- start post tree -->
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_POSTSTREE}></h2>
 
<{foreach from=$posts item=eachpost}>
<{if $eachpost.id == $post.id}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem d3f_currenttopic'><span style='padding-left:`$eachpost.depth_in_tree`0px;'>"}>
<{else}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'><span style='padding-left:`$eachpost.depth_in_tree`0px;'>"}>
<{/if}>
    <a href="<{$mod_url}>/index.php?post_id=<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}></span>
<{$eachpost.ul_out}>
<{/foreach}>
<!-- end post tree -->
 
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id postorder=$postorder item="tree"}>
<!-- start topic list  -->
<{if $topic.external_link_id && ($tree_tp_count>1)}>
<h2 class="head d3f_tree d3f_head"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></h2>
<{foreach from=$tree item=eachpost}>
  <{if ($eachpost.depth_in_tree==0)}>
    <{$eachpost.ul_in|replace:"<ul>":"<ul class='d3f_eachbranch'>\n\t"|replace:"<li>":"<li class='d3f_eachbranchitem'>"}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}>
    <{if ($eachpost.topic_id==$topic.id) && ($eachpost.depth_in_tree==0)}><font color="red">★表示中トピック</font><{/if}>
  <{/if}>
<{$eachpost.ul_out}>
<{/foreach}>
<{/if}>
<!-- end post tree  -->
<br />
<p class="d3f_topicinfo"><a href="<{$mod_url}>/index.php?topic_id=<{$topic.id}>"><{$smarty.const._MD_D3FORUM_LINK_LISTPOSTS}></a></p>
 
<div class="d3f_wrap">
<{include file="db:`$mydirname`_inc_eachpost.html" caller="viewpost" inner_link_format="`$mod_url`/index.php?post_id=%s"}>
</div>
 
<!-- quick reply form -->
<{if $post.can_reply}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" uname=$xoops_uname h2_title=$smarty.const._MD_D3FORUM_REPLYTHISPOST quick_form_mode="reply" subject_raw=$post.subject_raw}>
<{/if}>
 
<!-- forum jump -->
<form name="forum_jump_box" action="<{$mod_url}>/index.php" method="get" style="clear:both;">
    <p>
        <select name="forum_id"><{$forum_jumpbox_options}></select>
        <input type="submit" value="<{$smarty.const._MD_D3FORUM_BTN_JUMPTOFORUM}>" />
        &nbsp;
        <a href="<{$mod_url}>/index.php?page=search"><{$smarty.const._MD_D3FORUM_LINK_ADVSEARCH}></a>
    </p>
</form>
 
<hr class="notification" />
 
<{include file='db:system_notification_select.html'}>
<!-- end module contents -->

おまけ d3forum_comment_listposts_flat.html anchor.png

おまけ-1(A案) anchor.png

 テンプレート「(d3forum)_comment_listposts_flat.html」の一番頭に以下を追記することで、コメント元表示でもツリー表示できます。 これも、topicへのジャンプでなくpost1記事へのジャンプでよければ、プラグインの呼び出しは不要で、テンプレート編集のみでいけますが、折角なのでプラグインでお試しください。

但し、コメント元のモジュール単位でパラメータ変更ができませんので、同一サイト内の全モジュールのコメント統合表示が同じ設定になります。 → モジュール側のコメント統合設定で「コメントの昇順/降順」「最大コメント数」の設定ができる場合、それを反映するようにしました。

Everything is expanded.Everything is shortened.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
 
 
 
 
 
 
 
 
 
 
 
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id external_link_id=$external_link_id order=$plugin_params.order limit=$plugin_params.limit item="tree"}>
 
<!-- start post tree  -->
<h2 class="head d3f_tree d3f_head"><a name="comment"><{$smarty.const._MD_D3FORUM_POSTSTREE}></a></h2>
<{foreach from=$tree item=eachpost}>
    <ul class='d3f_eachbranch'><{"<span style='padding-left:`$eachpost.depth_in_tree`0px; padding-top: 0;'>"}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}></span>
<{$eachpost.ul_out}>
<{/foreach}>
<!-- end post tree  -->
おまけ-2(B案) anchor.png

上記「おまけ」の記述だと、ツリーをクリックするとd3forumのトピ表示にページ遷移しますが、やはりコメント元ページでは そのページ内の各コメントにジャンプすべきかと思います。 ただ、それだけでは「他にどんなトピがあるのか」が判らないので、トピ一覧も表示するようにテンプレートのみ編集してみました。

表示例 (当サイト内)

ちょっと「くどい」気もしますが、サイト管理上の使い勝手は中々ではないでしょうか。 よろしければ、下記のコードでどうぞ。
なお、ALTSYSでフォーラムの言語定数設定にて、「_MD_D3FORUM_LINK_LISTALLCOMMENTS」を「すべてのコメント一覧へ」→「この記事へのトピック一覧」に変更すると、随所で判りやすくなると思います。

Everything is expanded.Everything is shortened.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<h2 class="head d3f_tree d3f_head"><a name="comment"><{$smarty.const._MD_D3FORUM_POSTSTREE}></a></h2>
<!-- start post tree  -->
<{foreach from=$posts item=eachpost}>
    <ul class='d3f_eachbranch'><{"<span style='padding-left:`$eachpost.depth_in_tree`0px; padding-top: 0;'>"}>
    <a href="#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>)
    <{if $forum.isadminormod}><a href="<{$mod_url}>/index.php?page=cutpasteposts&amp;post_id=<{$eachpost.id}>"><img src="<{$mod_imageurl}>/adminicon_cutpaste.gif" alt="<{$smarty.const._MD_D3FORUM_CUTPASTEPOSTS}>" /></a><{/if}></span>
</ul>
<{/foreach}>
<!-- end post tree  -->
 
<br />
<div class="d3f_link">
<{$posts|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTDISPLAYSINFO}>
(<{$post_hits|string_format:$smarty.const._MD_D3FORUM_FMT_POSTHITSINFO}>)
<a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>&amp;external_link_id=<{$external_link_id|escape:"url"}>"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></a></div>
 
<br />
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id external_link_id=$external_link_id order=$plugin_params.order item="tree"}>
<{if $tree_tp_count > 1}>
    <{foreach from=$tree item=eachpost}>
    <{if $eachpost.depth_in_tree == 0}>
    <a href="<{$mod_url}>/index.php?topic_id=<{$eachpost.topic_id}>#post_id<{$eachpost.id}>" id="post_path<{$eachpost.unique_path}>" name="post_path<{$eachpost.unique_path}>"><img src="<{$mod_imageurl}>/posticon<{$eachpost.icon}>.gif" alt="<{$icon_meanings[$eachpost.icon]}>" /> <{$eachpost.subject}></a>
    (<{$eachpost.poster_uname}>, <{$eachpost.post_time_formatted}>) <br />
    <{/if}>
    <{/foreach}>
<{/if}>
 
<{if $plugin_params.order != 'asc'}>
<!-- begin simple comment form -->
<{if $forum.can_post && ! $plugin_params.no_form}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" h2_title=$smarty.const._MD_D3FORUM_POSTASCOMMENTTOP quick_form_mode="sametopic"}>
<{/if}>
<!-- end simple comment form -->
<{/if}>
 
<h2 class="head"><{if $plugin_params.h2_comments}><{$plugin_params.h2_comments}><{else}><{$smarty.const._MD_D3FORUM_COMMENTSLIST}><{/if}></h2>
 
<{if $pagenav}><div class="d3f_pagenav"><{$pagenav}></div><{/if}>
 
<{if $forum.can_post && $plugin_params.no_form}>
 
    <!-- link to comment input form -->
    <div><a href="<{$mod_url}>/index.php?page=newtopic&amp;forum_id=<{$forum.id}>&amp;external_link_id=<{$external_link_id|escape:"url"}>&amp;subject=<{$subject|escape:"url"}>"><{if $plugin_params.link_to_form}><{$plugin_params.link_to_form}><{else}><{$smarty.const._MD_D3FORUM_POSTASCOMMENTTOP}><{/if}></a></div>
 
<{/if}>
 
 
<!-- top of posts -->
<div class="d3f_wrap" id="d3comment_listposts_flat">
<{foreach item=post from=$posts}>
 
<div class="head d3f_head">
    <a href="<{$mod_url}>/index.php?post_id=<{$post.id}>" id="post_path<{$post.unique_path}>" name="post_id<{$post.id}>"><{$post.subject}></a>
</div>
<div class="d3f_info_ctrl" style="float:right;">
    <{if $post.can_edit}>
    <a href="<{$mod_url}>/index.php?page=edit&amp;post_id=<{$post.id}>"><{$smarty.const._MD_D3FORUM_POSTEDIT}></a> |
    <{/if}>
    
    <{if $post.can_delete}>
    <a href="<{$mod_url}>/index.php?page=delete&amp;post_id=<{$post.id}>"><{$smarty.const._MD_D3FORUM_POSTDELETE}></a> |
    <{/if}>
    
    <{if $post.can_reply}>
    <a href="<{$mod_url}>/index.php?page=reply&amp;post_id=<{$post.id}>"><{$smarty.const._MD_D3FORUM_POSTREPLY}></a>
    <{/if}>
</div>
<div class="d3f_info even">
    <{if $post.poster_uid != 0}><a href="<{$xoops_url}>/userinfo.php?uid=<{$post.poster_uid}>"><{$post.poster_uname}></a><{else}><{$post.poster_uname}> <span class="d3f_trip"><{$post.guest_trip}></trip><{/if}>&nbsp;
 
    <{$smarty.const._MD_D3FORUM_ON}> <{$post.post_time_formatted}> <{if $post.post_time < $post.modified_time}> | <span title="<{$post.modified_time_formatted}>"><{$smarty.const._MD_D3FORUM_LASTMODIFIED}></span><{/if}>
</div>
<div class="d3f_body" style="padding: 2px 2px 16px 16px; clear: both;">
    <{$post.post_text}>
</div>
 
 
<{/foreach}>
</div>
<!-- bottom of posts -->
 
<div class="d3f_link">
<{$posts|@count|string_format:$smarty.const._MD_D3FORUM_FMT_POSTDISPLAYSINFO}>
(<{$post_hits|string_format:$smarty.const._MD_D3FORUM_FMT_POSTHITSINFO}>)
<a href="<{$mod_url}>/index.php?forum_id=<{$forum.id}>&amp;external_link_id=<{$external_link_id|escape:"url"}>"><{$smarty.const._MD_D3FORUM_LINK_LISTALLCOMMENTS}></a></div>
 
<{if $pagenav}><div class="d3f_pagenav"><{$pagenav}></div><{/if}>
 
<{if $plugin_params.order == 'asc'}>
<!-- begin simple comment form -->
<{if $forum.can_post && ! $plugin_params.no_form}>
    <{include file="db:`$mydirname`_inc_post_form_quick.html" h2_title=$smarty.const._MD_D3FORUM_POSTASCOMMENTTOP quick_form_mode="sametopic"}>
<{/if}>
<!-- end simple comment form -->
<{/if}>

実体ページ:inc/d3forum/d3com_tree
関連ページ:コメント統合でブロックから元記事へリンク

プリンタ用画面
投票数:48 平均点:5.42
前
inquirySPフォームに元記事ページ情報埋込み
カテゴリートップ
XOOPSサイト構築
次
コメント統合でブロックから元記事へリンク

コメント一覧

投稿ツリー

トピック


なーお  投稿日時 2009/3/26 21:51

nonn50さん

主題の件、少しバージョンアップして機能拡張と表示調整、プラグイン内容の整理を行いました。 :-)

 こちら を参照ください。

では。

nonn50  投稿日時 2009/3/27 9:15

おまけも含めて、新バージョンを設定いたしました。

使いやすくなりましたね :-D

なーお  投稿日時 2009/3/27 10:12

nonn50さん

早速のご使用ありがとうございます。

実は、自分的にまだ不満があって、「おまけ」部分のコメント元ツリー表示のほう、別案を追記しました。  :-D

 こちらです

コメントが多くなるとこちらが使いやすいのではないかと思います。よろしければどうぞ。

nonn50  投稿日時 2009/3/27 17:08 | 最終変更

毎度、お世話になります。

小生サイトでは、おまけ?2(別案)d3forum_comment_listposts_flat.html を設定させていただきました。

ありがとうございました。

追伸:他に書くところが無いので、こちらにて失礼します。
PMにて「•新着メッセージが1通来ています。」とのことですが、ログインしていめらも係らず、資格無しとのことでした ;(

なーお  投稿日時 2009/3/27 22:36
引用:
追伸:他に書くところが無いので、こちらにて失礼します。
PMにて「•新着メッセージが1通来ています。」とのことですが、ログインしていめらも係らず、資格無しとのことでした

調べてみたら、登録ユーザーへのmessageモジュールアクセス権付与を忘れていました。 :p

メール転送設定をしたつもりでしたが、このせいで転送されていなかったのですね。ごめんなさい。

今ならアクセスできると思います。 :-D

なーお  投稿日時 2009/4/13 13:59 | 最終変更

こんにちは。

主題のプラグインツールをバージョンアップしました。

  1. コメント元ページのトピックリスト。トピックが2つ以上表示されている時だけ出るようにしました。
  2. d3forum側のフラット表示で、「★表示中トピック」インジケータは、コメント統合されていてスレッドが2つ以上存在する場合だけ出るようにしました。

若干うるさい感じだったのですが、これで少し静かになったかな。

変更箇所は、下記3つです。

  1. html/class/smarty/plugins/function.d3comment_tree.php
  2. テンプレート d3forum_main_listposts.html
  3. テンプレート d3forum_comment_listposts_flat.html
nonn50  投稿日時 2009/4/27 21:09
引用:

1.「投稿の新しいものから」「投稿の古いものから」をクリックした時の、ツリー表示の降順/昇順切り替え。

は、「?プラグインの呼び出し例」にあるように

1
<{d3comment_tree forum_dirname=$mydirname forum_id=$forum.id topic_id=$topic.id external_link_id=$topic.external_link_id order="ASC" postorder=$postorder item="tree"}>

をテンプレートに書くのだと思いますが、どれに書くのか判りません。

d3blog
weblinks
pico
xpwiki
piCal

で、教えていただきたいと思うのですが...

よろしくお願いできればと思います。

nonn50  投稿日時 2009/4/27 21:18

続投ですみません。

d3forum側で統合コメントしたコメントを、d3blogの「最新のコメント」ブロックに表示するには、どのように改造すればよいのでしょうか?

なーお  投稿日時 2009/4/27 22:57

nonn50さん、こんばんは。

わかりにくくてすみません。

今回のプラグインは、d3forum側に記載することで、各モジュールのテンプレートやモジュール一般設定で設定された内容が反映されるようになっています。

モジュールに一般設定に連動するもの

お問い合わせがあった物の中で

  • pico
  • xpwiki
  • piCal (+コメント統合ハック版)

 以上のモジュールについては、モジュール一般設定のコメント統合の項目に「昇順/降順」切り替えがありますので、それに連動します。  このほか、やmyalbum、xwords 、minidiaryの各+コメント統合ハック版、bulletinなども同様です。

モジュールのコメント統合呼び出し記述に追記が必要なもの

  • weblinks
  • d3blog

 など、コメント統合はしていても最新の機能を実装していないものは、昇順表示とするにはプラグイン呼び出し部分に

 order="ASC"

と追記する必要があります。 例えばd3blogでは、「(d3blog)_main_details.html」の

<{d3comment id=$entry.bid subject=$entry.title mydirname=$mydirname class="d3blogD3commentEntry"}>

 を、

<{d3comment id=$entry.bid subject=$entry.title mydirname=$mydirname class="d3blogD3commentEntry" order="ASC"}>

とすればOKです。

d3forumのトピック表示での切替え

 これについては設定は不要で、表示されているリンクで切り替えができるようになっていると思います。 :-)

なーお  投稿日時 2009/4/27 23:03 | 最終変更
引用:
d3forum側で統合コメントしたコメントを、d3blogの「最新のコメント」ブロックに表示するには、どのように改造すればよいのでしょうか?

こちらは改造は不要です。

Altsysか、d3forumのブロック管理で、「トピック一覧 」ブロックを複製し、そのブロックの「編集」で「フォーラムを指定する : 」にコメント統合したフォーラム番号を指定すれば、そのブロックにはそのフォーラムのトピックのみ表示されます。

もし、トピックではなくてコメント一つずつ表示したい場合は、「投稿一覧 」ブロックを複製して、同様にオプション指定します。 :-)



新しくコメントをつける

題名
ゲスト名
投稿本文
より詳細なコメント入力フォームへ

ブックマーク