0: - no date -  |
現: 2026-08-13 (木) 08:56:06 なーお  |
| | + | *picalモジュールで、d3コメント統合の簡単化 [#e8fb7eb0] |
| | + | **概要 [#e535222e] |
| | + | 以前より、[[piCalモジュール:http://xoops.peak.ne.jp/md/mydownloads/singlefile.php?lid=89&cid=1]] をコメント統合で使ってはいましたが、携帯用テンプレートの共有化を行う際に、テンプレートにサイト毎に異なるd3forum_dirnameとforum_idを記述する部分で支障があり、何とかしたいと考え、piCal-ver0.91hをベースに手を入れてみました。 |
| | | | |
| | + | + D3コメントクラスは、[[photositeさん配布のもの:http://www.photositelinks.com/modules/mydownloads/index.php?page=singlefile&cid=1&lid=5]](ver0.6)をベースにして手を入れています。 |
| | + | &br; |
| | + | + コメント統合先のd3forumディレクトリ名・フォーラムid値は、%%d3blog%% d3pipes のコメント統合を参考に、piCalの管理画面でmodule_configに保存する方式としました。 そして、コメント統合のクラスはd3forum-0.83a以降で実装された新方式(「d3comment」で呼ぶほう)を採用しています。 また、D3commentクラス内でforum_idまで認識するため、テンプレート内に記述する必要がありません。 |
| | + | こうすることで、複数サイトを共有化している場合でも、携帯用のテンプレートを共通化できますし、テンプレート配布の際にも神経を使わずに済みます。&br;&br; |
| | + | |
| | + | **手順と方法 [#gd0f42ee] |
| | + | テンプレートだけでなく、ソースの変更も必要ですので、細かく記しておきます。 |
| | + | |
| | + | なお、個別のアップロードも編集も面倒、という人のために、piCal本体との差分ファイルパックを、ここに置いておきます。 解凍後、夫々のフォルダに上書きアップロードして使えます。 |
| | + | |CENTER:ファイル|対応本体バージョン|対応d3forumバージョン| |
| | + | |&ref(piCal093_1_diff.zip); 最新|0.93|d3forum-0.85~| |
| | + | |&ref(piCal092_1_diff.zip);|0.92|d3forum-0.85~| |
| | + | |&ref(piCal091h3_2a_diff.zip);|0.91|d3forum-0.84| |
| | + | |
| | + | ***D3commentクラス [#mf5b4e4a] |
| | + | D3commentクラスは、下記ファイルをダウンロード後、「(piCal)/class」内にアップロードして使用します。 |
| | + | |&ref(piCalD3commentContent.class_1.php);| |
| | + | |&font(Red){08/10/13 参照元のphotositeさんの不具合対応盤に差し替えました。&br;お手数ですが、最新版に差し替え願います。};| |
| | + | |
| | + | 当然ながら、d3forumの方にコメント統合用に掲示板を追加し、(必要があれば)過去のxoopsコメントをインポート後、「コメント統合時の参照方法」に |
| | + | piCal::piCalD3commentContent:: |
| | + | と記載します。(最初の「piCal」の部分は、インストールディレクトリ名に合わせて変更します。) |
| | + | なお、&font(Red){d3forumは0.83a以降のバージョンが必須};で、D3commentの最新のAPIクラス群を忘れずにアップして下さい。 |
| | + | |
| | + | ***piCalソースの変更 [#p17e7e51] |
| | + | (以下、&font(Red){ver-091h3_2aまでの情報};です。 ver-092-1以降の情報は、追って編集します。) |
| | + | 3つのソースファイルに手を入れます。 こんな方法で良いのか自信はありませんが、間違いではないと思うのでご勘弁。 :-D &br; |
| | + | (&font(Red){08/09/01:config変数名を、d3pipesなどと同様の標準的なものに変更しました};) |
| | + | |
| | + | ****xoops_version.php [#r237c429] |
| | + | 「xoops_version.php」を編集し、管理画面にmodule_config項目を追加します。 |
| | + | 下記の447~463行目を追記します。 |
| | + | #code(php,437-){{ |
| | + | $modversion['config'][27] = array( |
| | + | 'name' => 'pical_proxysettings' , |
| | + | 'title' => '_MI_PROXYSETTINGS' , |
| | + | 'description' => '' , |
| | + | 'formtype' => 'textbox' , |
| | + | 'valuetype' => 'text' , |
| | + | 'default' => '' , |
| | + | 'options' => array() , |
| | + | ) ; |
| | + | |
| | + | $modversion['config'][28] = array( |
| | + | 'name' => 'comment_dirname' , |
| | + | 'title' => '_MI_COM_AGENT' , |
| | + | 'description' => '_MI_COM_AGENTDSC' , |
| | + | 'formtype' => 'textbox', |
| | + | 'valuetype' => 'text', |
| | + | 'default' => '' |
| | + | ); |
| | + | |
| | + | $modversion['config'][29]= array( |
| | + | 'name' => 'comment_forum_id', |
| | + | 'title' => '_MI_COM_AGENTID', |
| | + | 'description' => '_MI_COM_AGENTIDDSC', |
| | + | 'formtype' => 'textbox', |
| | + | 'valuetype' => 'int', |
| | + | 'default' => '0' |
| | + | ); |
| | + | |
| | + | }} |
| | + | |
| | + | ****languages/japanese/modinfo.php [#xeaef993] |
| | + | 「modinfo.php」を編集し、上の作業で追加した管理画面の項目に日本語テキストを追加します。 |
| | + | 以下の110~行目を追記します。 |
| | + | |
| | + | #code(php,108-){{ |
| | + | define('_MI_PICAL_ADMENU_MYBLOCKSADMIN','ブロック・グループ管理'); |
| | + | |
| | + | //d3comment integration |
| | + | define("_MI_COM_AGENT","コメント統合するd3forumのdirname"); |
| | + | define("_MI_COM_AGENTDSC","d3forumのコメント統合機能を使用する場合は<br/>フォーラムのhtml側ディレクトリ名を指定します。<br/>xoopsコメントを使用する場合やコメント機能を無効にする場合は空欄です。"); |
| | + | define("_MI_COM_AGENTID","コメント統合するフォーラムの番号"); |
| | + | define("_MI_COM_AGENTIDDSC","コメント統合を選択した場合、forum_idを必ず指定してください。"); |
| | + | define("_MI_COM_VIEW","コメント統合の表示方法"); |
| | + | define("_MI_COM_VIEWDSC","フラット表示かスレッド表示化かを選択します。"); |
| | + | } |
| | + | |
| | + | ?> |
| | + | }} |
| | + | |
| | + | ****index.php [#l5659961] |
| | + | 「index.php」に、下記のように117~125行目を追記します。 |
| | + | module_config設定項目を、smarty変数でテンプレートに渡すために必要です。 |
| | + | #code(php,113-){{ |
| | + | // クローラーにリンクをへつらせない follow -> nofollow |
| | + | $meta_robots = str_replace( ',follow' , ',nofollow' , $xoopsTpl->get_template_vars( "xoops_meta_robots" ) ) ; |
| | + | $xoopsTpl->assign( "xoops_meta_robots" , $meta_robots ) ; |
| | + | |
| | + | // モジュールID // added by naao |
| | + | $module_handler =& xoops_gethandler('module'); |
| | + | $this_module =& $module_handler->getByDirname($mydirname); |
| | + | $mid = $this_module->getVar('mid'); |
| | + | |
| | + | // モジュールconfig // added by naao |
| | + | $config_handler =& xoops_gethandler("config"); |
| | + | $mod_config = $config_handler->getConfigsByCat(0, $mid); |
| | + | $xoopsTpl->assign("moduleConfig", $mod_config); |
| | + | |
| | + | // 実行時間計測スタート |
| | + | }} |
| | + | |
| | + | ***テンプレートの編集 [#pcd8502e] |
| | + | 続いて、テンプレートを1つ、Altsysなどで編集します。 |
| | + | |
| | + | ****pical_event_detail.html [#f0dbe181] |
| | + | 「pical_event_detail.html」の、7行目以降 を以下のように編集します。 |
| | + | &font(Red){(08/11/01 X2で表示されない不具合のため、Legacyなクラス指定に変更)}; |
| | + | #code(html,1-){{ |
| | + | <{$detail_body}> |
| | + | |
| | + | <div style="text-align: right; padding: 0px; margin: 0px;"> |
| | + | <a href="<{$print_link}>" target="_blank"><img src="<{$skinpath}>/print.gif" alt="<{$lang_print}>" title="<{$lang_print}>" border="0" /></a> |
| | + | </div> |
| | + | |
| | + | <{if $moduleConfig.comment_dirname}> |
| | + | <{d3forum_comment dirname=$moduleConfig.comment_dirname forum_id=$moduleConfig.comment_forum_id itemname="event_id" subject=$xoops_pagetitle}> |
| | + | |
| | + | <{else}> |
| | + | <div style="text-align: center; padding: 3px; margin: 3px;"> |
| | + | <{$commentsnav}> |
| | + | <{$lang_notice}> |
| | + | </div> |
| | + | |
| | + | <div style="margin: 3px; padding: 3px;"> |
| | + | <!-- start comments loop --> |
| | + | <{if $comment_mode == "flat"}> |
| | + | <{include file="db:system_comments_flat.html"}> |
| | + | <{elseif $comment_mode == "thread"}> |
| | + | <{include file="db:system_comments_thread.html"}> |
| | + | |
| | + | <{elseif $comment_mode == "nest"}> |
| | + | <{include file="db:system_comments_nest.html"}> |
| | + | <{/if}> |
| | + | <!-- end comments loop --> |
| | + | </div> |
| | + | <{/if}> |
| | + | |
| | + | <{include file='db:system_notification_select.html'}> |
| | + | |
| | + | }} |
| | + | |
| | + | ***モバイル用テンプレート [#i1f4ece4] |
| | + | モバイルテンプハウスで、[[作成・公開中:http://www.mc8.jp/HD/modules/xpwiki?Templates/pical]]。 |
| | + | |
| | + | **インストールと設定 [#s4d2f108] |
| | + | xoops管理画面の「モジュールの管理」で、''&font(Maroon){「piCal」をモジュールアップデート};''します。 これで、「piCal」の管理画面に、2つの項目が追加されます。 |
| | + | |
| | + | &ref(inc/myalbum_d3com/myalbum_config.gif,mw:200,mh:200); |
| | + | |
| | + | ここで、 |
| | + | +コメントシステムの設定 : d3forumのコメント統合機能を使用する場合はd3forumのhtml側ディレクトリ名を指定します。xoopsコメントを使用する場合やコメント機能を無効にする場合は空欄です。 |
| | + | +コメントのforum_id : コメント統合を選択した場合、統合先のforum_id値を必ず指定してください。 |
| | + | |
| | + | これらを設定すれば完了です。(この編集を行うまでは、xoopsコメントシステムが有効です。) |
| | + | |
| | + | **その他 [#kdecd574] |
| | + | ***関連情報 [#c2eb89db] |
| | + | - [[minidiary+D3コメント統合へのお知恵を:http://www.xugj.org/modules/d3forum/index.php?topic_id=757#post_id4643]] (XUGJ) |
| | + | - [[D3comment統合と、コメント元のイベント通知:http://www.xugj.org/modules/QandA/index.php?post_id=4875]] (XUGJ) |
| | + | |
| | + | - [[元ソース(D3commentクラス):http://www.mc8.jp/X//modules/mydownloads/viewcat.php?cid=2]](モーションクリエイト) |
| | + | |
| | + | ***ライセンス [#kae2250d] |
| | + | -piCalソース、d3forumソース、xugj_blockソース:GPL |