Index: trunk/xpressme_integration_kit/include/general_functions.php
===================================================================
--- trunk/xpressme_integration_kit/include/general_functions.php	(revision 263)
+++ trunk/xpressme_integration_kit/include/general_functions.php	(revision 264)
@@ -91,3 +91,31 @@
 	}
 }
+
+// XOOPS user ID is get from the name and the mail address of the contributor of the comment that is not user_id. 
+if (!function_exists('wp_comment_author_to_xoops_uid')){
+	function wp_comment_author_to_xoops_uid($name = '',$email = ''){
+		global $xoopsDB,$xoops_db;
+		if (empty($name) || empty($email)) return 0;
+		
+		if (empty($xoops_db)) { // not load XPressME
+			$xoops_user_tbl = $xoopsDB->prefix('users');
+			$wp_user_tbl = $xoopsDB->prefix($wp_prefix . "_users");
+
+			$xoops_uid = 0;
+			$xoops_user_SQL ="SELECT uid FROM $xoops_user_tbl WHERE uname = '$name' AND email = '$email'";
+			$xoops_user_Res = $xoopsDB->query($xoops_user_SQL, 0, 0);
+			if ($xoopsDB->getRowsNum($xoops_user_Res)  > 0){
+				$xoops_user_Row = $xoopsDB->fetchArray($xoops_user_Res);
+				$xoops_uid = $xoops_user_Row['uid'];
+			}	
+			return $xoops_uid;
+		} else { // load XPressME or not Load XOOPS
+			$xoops_user_tbl = get_xoops_prefix() . 'users';
+			$xoops_uid = $xoops_db->get_var("SELECT uid FROM $xoops_user_tbl WHERE uname = '$name' AND email = '$email'");
+			if (empty($xoops_uid)) return 0;
+			return $xoops_uid;
+		}			
+	}
+}
+
 ?>
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php	(revision 263)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php	(revision 264)
@@ -495,5 +495,9 @@
 	$modified_time = strtotime($row->comment_date);	// or	$row2['comment_date_gmt']
 	require_once (get_xpress_dir_path() . 'include/general_functions.php');
-	$uid =  wp_uid_to_xoops_uid($row->user_id,$mydirname);
+	if (empty($row->user_id)){
+		$uid = wp_comment_author_to_xoops_uid($row->comment_author,$row->comment_author_email);
+	} else {
+		$uid = wp_uid_to_xoops_uid($row->user_id,$mydirname);
+	}
 	$poster_ip = "'" . addslashes($row->comment_author_IP ). "'";
 	$modifier_ip = "'" . addslashes($row->comment_author_IP) . "'";
Index: trunk/xpressme_integration_kit/xoops_version.php
===================================================================
--- trunk/xpressme_integration_kit/xoops_version.php	(revision 263)
+++ trunk/xpressme_integration_kit/xoops_version.php	(revision 264)
@@ -40,5 +40,5 @@
 
 // status
-$modversion['codename'] = "Bata-1";
+$modversion['codename'] = "Bata-2";
 
 // onInstall, onUpdate, onUninstall
