トップ  >  趣味の部屋  >  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サイト構築
次
コメント統合でブロックから元記事へリンク

コメント一覧

投稿ツリー

トピック


nonn50  投稿日時 2009/4/28 8:03 | 最終変更

ご親切に、丁寧に御説明いただきまして、ありがとうございました。

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

理解いたしました。

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

これも理解しました。

追記:後でこの書き込みを読む人のために

引用:

例えば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です。

との御指導ですが、小生が利用している「d3blog-1.03.2 2009-2-13」版の「(d3blog)_main_details.html」では64行目からはじまる

引用:

<!-- D3comment goes here -->

<{d3comment mydirname=$mydirname class="d3blogD3commentEntry"}>

において

引用:

<{d3comment mydirname=$mydirname class="d3blogD3commentEntry" order="ASC"}>

と加筆しました。

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

理解しておりました。

  • 本質問につき、当方では全て解決です。
    改めて、ありがとうございました
nonn50  投稿日時 2009/4/28 8:22

なるほどです :-(

脳軟化症の爺には思いつきませんでした。

こうなると発想力の問題ですね?

初歩的な内容にまで、ご親切に教授いただき、大変ありがとうございました。
誠にもって勉強になりました。

なーお  投稿日時 2009/5/5 22:01 | 最終変更

以下のテンプレート2つを編集し、当該トピ以外の投稿は表示せず、トピックリストとしてみました。 元記事を修正してありますので、参照ください。

1記事へのコメント数が多いサイトには有効だと思います。
なお、今回はsmartyプラグイン側に変更はありません。

mon   投稿日時 2010/3/8 22:18 | 最終変更

はじめまして、お世話になります。
order="ASC"で悩んだ末に、ここに辿りつきました。

weblinks に適用する場合は、どこにすればよろしいのでしょう。
templates → parts → weblinks_d3forum_comment.html 内で書き加えてみましたがダメでした。

ご教授いただけましたら幸いです。

なーお  投稿日時 2010/3/8 23:59 | 最終変更

monさん、こんにちは。

引用:
order="ASC"で悩んだ末に、ここに辿りつきました。

weblinks に適用する場合は、どこにすればよろしいのでしょう。
templates → parts → weblinks_d3forum_comment.html 内で書き加えてみましたがダメでした。

コアや、各モジュールのバージョンくらいは最低でも教えてください。

また、何をしたくて、どこまで作業して、どこを悩んだのかが良くわかりません。 d3forumコメント統合はできているのか、これからなのか。 統合後のコメントの全ツリー表示をしたいのか、そうではないのか・・
コメント統合って、以外に話が深いので、きちんと書かないと伝わってきませんからご注意を。

また、weblinksは1.9以上まで上がってますが、私の使っているのはかなり古いバージョンで、あまりアドバイスができないかもです。

mon   投稿日時 2010/3/9 8:15

大変失礼いたしました。申し訳ございません。

統合後のコメントの全ツリー表示についても興味がございますが、そのレベルまで至っておりませんので、今回はサイト内の元記事コメント欄を全て昇順表示で統一することを目標にしております。

以下、こちらの環境でございます。

コアは Legacy 2.1.7、PHP5 でd3forum導入済みです。
本サイトを含め関連のサイトを参考に、
myalbum-p 2.88(なーおさんのハック導入)
pical 0.93(なーおさんのハック導入)
bulletinHD 2.22(一般設定にて)
d3blog 1.05(ソースにorderを記入)
以上の様にして、元記事コメント欄を昇順表示にすることができました。

昇順表示ができないのは
weblinls 1.95
x-movie 2.51
で、どちらもコメント統合後の元記事コメント欄にて降順表示まではできています。

どうぞよろしくお願いいたします。

なーお  投稿日時 2010/3/9 22:40 | 最終変更

monさん、こんにちは。

私もweblinks1.95をテスト環境にインストールして、試してみました。 2年ほどの間に相当高機能になって、ビックリです。 :-o

結論から言えば、昇順表示にできました。(念のため、d3forumのバージョンは0.85で試しました。)
但し、 order="ASC" ではだめで、order="asc" と小文字で指定する必要があります。 どうやら、d3forum側では小文字がデフォルトのようですね。 :hammer:

templates - parts - weblinks_d3forum_comment.html のソースを貼っておきます。

Everything is expanded.Everything is shortened.
 
 <{d3forum_comment dirname=$d3forum_dirname forum_id=$d3forum_forum_id id=$d3forum_id subject=$d3forum_subject view=$d3forum_view order="asc" class="weblinksD3commentContent"}>
weblinks_com_asc.gif
mon   投稿日時 2010/3/9 23:07 | 最終変更

なーおさん、こんばんは。

只今、こちらでも昇順表示を確認しました。

引用:
但し、 order="ASC" ではだめで、order="asc" と小文字で指定する必要があります。 どうやら、d3forum側では小文字がデフォルトのようですね。

小文字がデフォルト。。 コメント統合って、本当に、ふ、深い。。
まったく予想外でした。 勉強になりました。

心より感謝申し上げます。ありがとうございました。



新しくコメントをつける

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

ブックマーク