Index: /trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php
===================================================================
--- /trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 98)
+++ /trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 99)
@@ -1,3 +1,9 @@
 <?php
+global $xoops_config;
+if (!is_object($xoops_config)){ // is call other modules
+	require_once dirname( __FILE__ ) .'/config_from_xoops.class.php' ;
+	$xoops_config = new ConfigFromXoops;
+}
+
 // xoops db
 function get_xpress_dir_path()
@@ -27,4 +33,12 @@
 	return $ret;
 }
+
+function get_xoops_root_path()
+{
+	global $xoops_config;
+	$ret =$xoops_config->xoops_root_path;
+	return $ret;
+}
+
 function get_wp_prefix()
 {
@@ -118,5 +132,5 @@
 		$blockID = $block->bid;
 		$options = explode("|", $block->options);
-					
+
 		$block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name);
 		require_once $block_theme_file;
Index: /trunk/wp-content/plugins/xpressme/language/xpressme-ja.po
===================================================================
--- /trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 98)
+++ /trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 99)
@@ -3,5 +3,5 @@
 "Project-Id-Version: XPressME Plugin\n"
 "POT-Creation-Date: \n"
-"PO-Revision-Date: 2009-02-04 16:00+0900\n"
+"PO-Revision-Date: 2009-03-07 16:29+0900\n"
 "Last-Translator: toemon <toychee@toemon.com>\n"
 "Language-Team: \n"
@@ -12,5 +12,5 @@
 "X-Poedit-Country: JAPAN\n"
 "X-Poedit-KeywordsList: _e;__\n"
-"X-Poedit-Basepath: C:\\xampp\\htdocs\\cube\\modules\\xpress2X\\wp-content\\plugins\\xpressme\n"
+"X-Poedit-Basepath: C:\\XPressME_Ver2_SVN\\trunk\\wp-content\\plugins\\xpressme\n"
 "X-Poedit-SearchPath-0: .\n"
 
@@ -30,16 +30,16 @@
 
 #: xpressme_class.php:170
-#: xpressme_class.php:283
-#: xpressme_class.php:288
-#: xpressme_class.php:309
-#: xpressme_class.php:314
+#: xpressme_class.php:337
+#: xpressme_class.php:342
+#: xpressme_class.php:363
+#: xpressme_class.php:368
 msgid "YES"
 msgstr "はい"
 
 #: xpressme_class.php:171
-#: xpressme_class.php:284
-#: xpressme_class.php:289
-#: xpressme_class.php:310
-#: xpressme_class.php:315
+#: xpressme_class.php:338
+#: xpressme_class.php:343
+#: xpressme_class.php:364
+#: xpressme_class.php:369
 msgid "NO"
 msgstr "いいえ"
@@ -73,77 +73,89 @@
 msgstr "ユーザ登録しない"
 
-#: xpressme_class.php:273
+#: xpressme_class.php:266
+msgid "Do Not Comment Integration."
+msgstr "コメント統合しません。"
+
+#: xpressme_class.php:302
+msgid "Comment integration with D3Forum"
+msgstr "D3Forumとのコメント統合"
+
+#: xpressme_class.php:304
+msgid "Select the forum of D3Forum that does the comment integration from the following lists."
+msgstr "以下のリストからコメント統合をするD3Forumのフォーラムを選択してください。"
+
+#: xpressme_class.php:327
 msgid "XPressME Configuration Page"
 msgstr "XPressMEの設定ページ"
 
-#: xpressme_class.php:277
+#: xpressme_class.php:331
 msgid "Media Upload Base Path"
 msgstr "メディアアップロードのベースパス設定"
 
-#: xpressme_class.php:278
+#: xpressme_class.php:332
 msgid "Use XOOPS UPLOAD PATH"
 msgstr "XOOPSのアップロードパスを使用する。"
 
-#: xpressme_class.php:279
+#: xpressme_class.php:333
 msgid "USE WordPress BASE_PATH"
 msgstr "WordPressのベースパスを使用する。"
 
-#: xpressme_class.php:282
+#: xpressme_class.php:336
 msgid "Thema Sidebar Display"
 msgstr "テーマ表示時にサイドバー表示する。"
 
-#: xpressme_class.php:287
+#: xpressme_class.php:341
 msgid "The change tracking of the post is preserved"
 msgstr "投稿の変更履歴を有効にする。"
 
-#: xpressme_class.php:292
+#: xpressme_class.php:346
 msgid "Display Navi Title of Old Post Link"
 msgstr "古い記事へのナビタイトルを設定"
 
-#: xpressme_class.php:295
+#: xpressme_class.php:349
 msgid "Display Navi Title of Newer Post Link"
 msgstr "新しい記事へのナビタイトルを設定"
 
-#: xpressme_class.php:298
+#: xpressme_class.php:352
 msgid "Select Display name of PostNavi Link"
 msgstr "投稿記事リンクナビのタイトル設定"
 
-#: xpressme_class.php:299
+#: xpressme_class.php:353
 msgid "Title of post"
 msgstr "投稿記事のタイトルを表示"
 
-#: xpressme_class.php:300
+#: xpressme_class.php:354
 msgid "Title of Navi"
 msgstr "ナビタイトルを表示"
 
-#: xpressme_class.php:303
+#: xpressme_class.php:357
 msgid "Adjustment of Navi link display position"
 msgstr "投稿記事ナビリンクの表示位置設定"
 
-#: xpressme_class.php:304
+#: xpressme_class.php:358
 msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right"
 msgstr "古い記事へのリンクを左に、より新しい記事へのリンクを右に表示"
 
-#: xpressme_class.php:305
+#: xpressme_class.php:359
 msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right"
 msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示"
 
-#: xpressme_class.php:308
+#: xpressme_class.php:362
 msgid "Is the posts author views counted?"
 msgstr "投稿者の閲覧をカウントしますか？"
 
-#: xpressme_class.php:313
+#: xpressme_class.php:367
 msgid "Is SQL debugging window displayed?"
 msgstr "SQLデバッグウィンドを表示しますか？"
 
-#: xpressme_class.php:323
+#: xpressme_class.php:379
 msgid "Update Config"
 msgstr "更新"
 
-#: xpressme_class.php:324
+#: xpressme_class.php:380
 msgid "Preset Config"
 msgstr "プリセット"
 
-#: include/custom_functions.php:244
+#: include/custom_functions.php:180
 #, php-format
 msgid "views :%d"
Index: /trunk/wp-content/plugins/xpressme/xpressme_class.php
===================================================================
--- /trunk/wp-content/plugins/xpressme/xpressme_class.php	(revision 98)
+++ /trunk/wp-content/plugins/xpressme/xpressme_class.php	(revision 99)
@@ -15,5 +15,8 @@
 	var $is_sql_debug;
 	var $groupe_role;
-
+	var $is_use_d3forum;
+	var $d3forum_module_dir;
+	var $d3forum_forum_id;
+	var $d3forum_external_link_format;
 	//constructor
 	function XPressME_Class()
@@ -49,4 +52,8 @@
 		$this->is_author_view_count = false;
 		$this->is_sql_debug = false;
+		$this->is_use_d3forum = false;
+		$this->d3forum_module_dir = '';
+		$this->d3forum_forum_id = '';
+		$this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
 	}
 	
@@ -79,5 +86,9 @@
 			'newer_post_link_text' => $this->newer_post_link_text,
 			'is_author_view_count' => $this->is_author_view_count,
-			'is_sql_debug' => $this->is_sql_debug
+			'is_sql_debug' => $this->is_sql_debug,
+			'is_use_d3forum' =>	$this->is_use_d3forum,
+			'd3forum_module_dir' => $this->d3forum_module_dir,
+			'd3forum_forum_id' => $this->d3forum_forum_id,
+			'd3forum_external_link_format' => $this->d3forum_external_link_format
 		);
 		if ($mode == 'add_new') {
@@ -144,4 +155,18 @@
 		$this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count']));
 		$this->is_sql_debug = stripslashes(trim($_POST['ch_is_sql_debug']));
+		//d3forum
+		$d3forum_select = stripslashes(trim($_POST['ch_d3forum']));
+		if ($d3forum_select == 'none') {
+			$this->is_use_d3forum = false;
+			$this->d3forum_module_dir = '';
+			$this->d3forum_forum_id = '';
+			$this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
+		} else {
+			$d3f_set = explode('|', $d3forum_select);
+			$this->is_use_d3forum = true;
+			$this->d3forum_module_dir = $d3f_set[1];
+			$this->d3forum_forum_id = $d3f_set[2];
+			$this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
+		}
 		
 		global $xoops_db;
@@ -256,5 +281,61 @@
 
 	}
-		
+	
+	function d3forum_option(){
+		global $xoops_db;
+		
+		$d3frum_list = array();
+		$module_dir_path = get_xoops_root_path();
+		
+		$forum_list  = '<select name="ch_d3forum">' . "\n";
+		
+		if ($this->is_use_d3forum != true)
+			$selected = ' selected="selected"';
+		else
+			$selected = '';
+		$forum_list .= '<option value="none"' . $selected . '>' . __('Do Not Comment Integration.', 'xpressme') . "</option>\n";
+
+		// Form making for forum selection of D3forum
+		$modules_table = get_xoops_prefix() .'modules';
+		$sql = "SELECT mid,name,isactive,dirname FROM $modules_table WHERE isactive = 1";
+		$modules = $xoops_db->get_results($sql);
+		foreach ($modules as $module) {
+			$file_path = $module_dir_path . '/modules/' . $module->dirname . '/mytrustdirname.php';			
+			if (! file_exists($file_path)) continue;
+			$array_files = file($file_path);
+			// It is checked whether there is character string "$mytrustdirname ='d3forum'"in the file.
+			foreach ($array_files as $aeey_file){
+				if( preg_match( "/\s*($mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) {
+					$forums_tb = get_xoops_prefix() . $module->dirname . '_forums';
+					$cat_tb = get_xoops_prefix() . $module->dirname . '_categories';
+					$sql= "SELECT * FROM $forums_tb LEFT JOIN $cat_tb ON $forums_tb.cat_id = $cat_tb.cat_id";
+					$forums = $xoops_db->get_results($sql);
+					foreach ($forums as $forum) {
+						if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id))
+							$selected = ' selected="selected"';
+						else
+							$selected = '';
+						$forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id;
+						$forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)";
+						$forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n";
+					}
+					break;
+				}
+			}
+			$form .= '<br>';			
+		}
+		$forum_list .= '</select>' . "\n";
+
+		$form  = '<tr>' . "\n";
+		$form .= '<th><label for="d3forum">' .__('Comment integration with D3Forum', 'xpressme') . '</label></th>' . "\n";
+		$form .=  "<td>\n";
+		$form .=  __('Select the forum of D3Forum that does the comment integration from the following lists.', 'xpressme') ."<br />\n";
+		$form .=  $forum_list."\n";
+		$form .= '<br /><br /><br /><br /><br /><br /><br />';
+		$form .=  "</td>\n";
+		$form .=  "</tr><tr>\n";
+		return $form;
+	}
+
 	function option_page()
 	{
@@ -316,5 +397,7 @@
 												);
 		
-		echo				$this->groupe_role_option();				
+		echo				$this->groupe_role_option();		
+		
+		echo				$this->d3forum_option();		
 //		$this->is_use_xoops_upload_path_html();
 		echo			"</table>\n";
