1: 2008-08-30 (土) 08:16:30 なーお ![バックアップ No.1 を復元して編集](http://motioncafe.naaon.com/modules/xpwiki/skin/loader.php?src=page_white_edit.png) |
2: 2008-09-01 (月) 09:20:45 なーお ![バックアップ No.2 を復元して編集](http://motioncafe.naaon.com/modules/xpwiki/skin/loader.php?src=page_white_edit.png) |
| *picalモジュールで、d3コメント統合の簡単化 [#e8fb7eb0] | | *picalモジュールで、d3コメント統合の簡単化 [#e8fb7eb0] |
| **概要 [#e535222e] | | **概要 [#e535222e] |
- | 以前より、[[piCalモジュール:http://xoops.peak.ne.jp/md/mydownloads/singlefile.php?lid=89&cid=1]] をコメント統合で使ってはいましたが、携帯用テンプレートの共有化を行う際に、テンプレートにサイト毎に異なるd3forum_dirnameとforum_idを記述する部分で支障があり、何とかしたいと考え、Xwords-ver0.91をベースに手を入れてみました。 | + | 以前より、[[piCalモジュール:http://xoops.peak.ne.jp/md/mydownloads/singlefile.php?lid=89&cid=1]] をコメント統合で使ってはいましたが、携帯用テンプレートの共有化を行う際に、テンプレートにサイト毎に異なるd3forum_dirnameとforum_idを記述する部分で支障があり、何とかしたいと考え、piCal-ver0.91hをベースに手を入れてみました。 |
| | | |
| + D3コメントクラスは、モジュール同梱のものがベースです。 | | + D3コメントクラスは、モジュール同梱のものがベースです。 |
| | | |
| なお、個別のアップロードも編集も面倒、という人のために、piCal-ver0.91との差分ファイルパックを、ここに置いておきます。 解凍後、夫々のフォルダに上書きアップロードして使えます。 | | なお、個別のアップロードも編集も面倒、という人のために、piCal-ver0.91との差分ファイルパックを、ここに置いておきます。 解凍後、夫々のフォルダに上書きアップロードして使えます。 |
- | |&ref(ID$k35fd101);| | + | |&ref(piCal091h3_diff.zip);| |
| | | |
| ***xugj_blockの準備 [#s1d2208f] | | ***xugj_blockの準備 [#s1d2208f] |
| ***D3commentクラス [#mf5b4e4a] | | ***D3commentクラス [#mf5b4e4a] |
| D3commentクラスは、下記ファイルをダウンロード後、「(piCal)/class」内にアップロードして使用します。 | | D3commentクラスは、下記ファイルをダウンロード後、「(piCal)/class」内にアップロードして使用します。 |
- | |&ref(piCalD3commentContent.class.php);| | + | |&ref(piCalD3commentContent.class_0.php);| |
| | | |
| 当然ながら、d3forumの方にコメント統合用に掲示板を追加し、(必要があれば)過去のxoopsコメントをインポート後、「コメント統合時の参照方法」に | | 当然ながら、d3forumの方にコメント統合用に掲示板を追加し、(必要があれば)過去のxoopsコメントをインポート後、「コメント統合時の参照方法」に |
- | piCal::piCalD3commentContent | + | piCal::piCalD3commentContent:: |
| と記載します。(最初の「piCal」の部分は、インストールディレクトリ名に合わせて変更します。) | | と記載します。(最初の「piCal」の部分は、インストールディレクトリ名に合わせて変更します。) |
| なお、&font(Red){d3forumは0.83a以降のバージョンが必須};で、D3commentの最新のAPIクラス群を忘れずにアップして下さい。 | | なお、&font(Red){d3forumは0.83a以降のバージョンが必須};で、D3commentの最新のAPIクラス群を忘れずにアップして下さい。 |
| | | |
- | ***Xwordsソースの変更 [#p17e7e51] | + | ***piCalソースの変更 [#p17e7e51] |
| 3つのソースファイルに手を入れます。 こんな方法で良いのか自信はありませんが、間違いではないと思うのでご勘弁。 :-D &br; | | 3つのソースファイルに手を入れます。 こんな方法で良いのか自信はありませんが、間違いではないと思うのでご勘弁。 :-D &br; |
| | | |
| ****xoops_version.php [#r237c429] | | ****xoops_version.php [#r237c429] |
| 「xoops_version.php」を編集し、管理画面にmodule_config項目を追加します。 | | 「xoops_version.php」を編集し、管理画面にmodule_config項目を追加します。 |
- | 下記の388~402行目を追記します。 | + | 下記の447~463行目を追記します。 |
- | #code(php,379-){{ | + | #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' => 'com_agent' , |
| + | 'title' => '_MI_COM_AGENT' , |
| + | 'description' => '_MI_COM_AGENTDSC' , |
| + | 'formtype' => 'textbox', |
| + | 'valuetype' => 'text', |
| + | 'default' => '' |
| + | ); |
| + | |
| + | $modversion['config'][29]= array( |
| + | 'name' => 'com_agent_forumid', |
| + | 'title' => '_MI_COM_AGENTID', |
| + | 'description' => '_MI_COM_AGENTIDDSC', |
| + | 'formtype' => 'textbox', |
| + | 'valuetype' => 'int', |
| + | 'default' => '0' |
| + | ) |
| }} | | }} |
| | | |
| ****languages/japanese/modinfo.php [#xeaef993] | | ****languages/japanese/modinfo.php [#xeaef993] |
| 「modinfo.php」を編集し、上の作業で追加した管理画面の項目に日本語テキストを追加します。 | | 「modinfo.php」を編集し、上の作業で追加した管理画面の項目に日本語テキストを追加します。 |
- | 以下の158~162行目を追記します。 | + | 以下の110~113行目を追記します。 |
| + | |
| + | #code(php,109-){{ |
| + | define('_MI_PICAL_ADMENU_MYBLOCKSADMIN','ブロック・グループ管理'); |
| + | define("_MI_COM_AGENT","コメントシステムの設定"); |
| + | define("_MI_COM_AGENTDSC","d3forumのコメント統合機能を使用する場合は<br/>フォーラムのhtml側ディレクトリ名を指定します。<br/>xoopsコメントを使用する場合やコメント機能を無効にする場合は空欄です。"); |
| + | define("_MI_COM_AGENTID","コメントのforum_id"); |
| + | define("_MI_COM_AGENTIDDSC","コメント統合を選択した場合、forum_idを必ず指定してください。"); |
| | | |
- | #code(php,150-){{ | |
| }} | | }} |
| | | |
- | ****header.php [#l5659961] | + | ****index.php [#l5659961] |
- | 「header.php」に、下記のように56~65行目を追記します。 | + | 「index.php」に、下記のように117~125行目を追記します。 |
| module_config設定項目を、smarty変数でテンプレートに渡すために必要です。 | | module_config設定項目を、smarty変数でテンプレートに渡すために必要です。 |
- | #code(php,54-){{ | + | #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); |
| + | |
| + | // 実行時間計測スタート |
| }} | | }} |
| | | |
| 続いて、テンプレートを1つ、Altsysなどで編集します。 | | 続いて、テンプレートを1つ、Altsysなどで編集します。 |
| | | |
- | ****xwords_entry.html [#f0dbe181] | + | ****pical_event_detail.html [#f0dbe181] |
- | 「xwords_entry.html」の、105~125行目 を以下のように編集します。 | + | 「pical_event_detail.html」の、7行目以降 を以下のように編集します。 |
| + | |
| + | #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.com_agent}> |
| + | <{d3comment mydirname=$xoops_dirname id=$com_itemid subject=$xoops_default_comment_title class="piCalD3commentContent"}> |
| + | |
| + | <{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}> |
| | | |
- | #code(html,105-){{ | + | <{include file='db:system_notification_select.html'}> |
| | | |
| }} | | }} |
| | | |
| **インストールと設定 [#s4d2f108] | | **インストールと設定 [#s4d2f108] |
- | xoops管理画面の「モジュールの管理」で、''&font(Maroon){「xwords」をモジュールアップデート};''します。 これで、「xwords」の管理画面に、2つの項目が追加されます。 | + | xoops管理画面の「モジュールの管理」で、''&font(Maroon){「piCal」をモジュールアップデート};''します。 これで、「piCal」の管理画面に、2つの項目が追加されます。 |
| | | |
- | &ref(ID$j7c23a6b); | + | &ref(pical_config.gif,mw:200,mh:200); |
| | | |
| ここで、 | | ここで、 |
| | | |
| ***ライセンス [#kae2250d] | | ***ライセンス [#kae2250d] |
- | -xwordsソース、d3forumソース、xugj_blockソース:GPL | + | -piCalソース、d3forumソース、xugj_blockソース:GPL |