Index: /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
===================================================================
--- /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 590)
+++ /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 591)
@@ -293,4 +293,31 @@
 	}
 	
+	function D3Forum_old_Link_clear($value = null){
+		global $xpress_config,$xoops_db;
+		if ($this->is_use_d3forum){
+			$d3forum_forum_tbl = get_xoops_prefix() . $this->d3forum_module_dir ."_forums";
+			$d3forum_external_link_format = '';
+			$d3f_forum_id = $this->d3forum_forum_id;
+			
+			if ($value === 'none'){
+				$xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='' WHERE forum_id= $d3f_forum_id" ) ;
+			} else {
+				$d3f_set = explode('|', $value);
+				if ($this->d3forum_module_dir !== $d3f_set[1] || $this->d3forum_forum_id !== $d3f_set[2]){
+					$xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='' WHERE forum_id= $d3f_forum_id" ) ;
+				}
+			}
+		}
+	}
+	function D3Forum_link_set(){
+		global $xoops_db;
+
+		if (empty($this->is_use_d3forum)) return;
+		$d3forum_forum_tbl = get_xoops_prefix() . $this->d3forum_module_dir ."_forums";
+		$d3f_forum_id = $this->d3forum_forum_id;
+		$forum_external_link_format = addslashes($this->d3forum_external_link_format);
+		$xoops_db->query( "UPDATE ".$d3forum_forum_tbl ." SET forum_external_link_format='".$forum_external_link_format."' WHERE forum_id= $d3f_forum_id" ) ;
+	}
+	
 	function ReadPostData($post_data = null)
 	{
@@ -310,4 +337,5 @@
 				// post d3forum
 				if ($indedx === 'd3forum') {
+					$this->D3Forum_old_Link_clear($value);
 					if ($value == 'none'){
 						$this->is_use_d3forum = false;
@@ -321,4 +349,5 @@
 						$this->d3forum_forum_id = $d3f_set[2];
 						$this->d3forum_external_link_format = get_xpress_dir_name() . '::xpressD3commentContent';
+						$this->D3Forum_link_set();
 					}
 				} else { //post other
@@ -656,5 +685,5 @@
 			$selected = '';
 		
-		if (xpress_is_multiblog() && $multi_blog_use_d3forum) {
+		if (xpress_is_multiblog() && !$multi_blog_use_d3forum) {
 			$forum_list .= '<option value="none"' . $selected . '>' . __('WordPress MultiBlog cannot integrate the comments.', 'xpressme') . "</option>\n";
 		} else {	
@@ -677,11 +706,15 @@
 						$forums = $xoops_db->get_results($sql);
 						foreach ($forums as $forum) {
-							if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id))
+							if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id)){
 								$selected = ' selected="selected"';
-							else
+								$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";
+							} else if (empty($forum->forum_external_link_format)){
 								$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";
+								$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;
