Index: trunk/xpressme_integration_kit/include/general_functions.php
===================================================================
--- trunk/xpressme_integration_kit/include/general_functions.php	(revision 261)
+++ 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;
+		}			
+	}
+}
+
 ?>
