Index: branches/Ver2.1/xpressme_integration_kit/class/config_from_xoops.class.php
===================================================================
--- trunk/xpressme_integration_kit/class/config_from_xoops.class.php	(revision 331)
+++ branches/Ver2.1/xpressme_integration_kit/class/config_from_xoops.class.php	(revision 374)
@@ -41,5 +41,6 @@
 	var $mu_path_current_site;
 	var $wp_db_version;
-	var $is_wp20;
+	var $wp_version;
+	var $is_wp_me;
 	
 	function __constructor()	//for PHP5
@@ -62,7 +63,16 @@
     	$this->xp_config_file_path = $this->module_path . '/xp-config.php';
     	
+    	// start /admin/index.php page detect
+    	$php_script_name = $_SERVER['SCRIPT_NAME'];
+		$php_query_string = $_SERVER['QUERY_STRING'];
+		$admin_page = 	basename(dirname(dirname(__FILE__))) . '/admin/index.php';
+		$is_xoops_module_admin = false;
+		if (strstr($php_script_name,$admin_page) !== false) $is_xoops_module_admin = true;
+		if (strstr($php_query_string,$admin_page) !== false) $is_xoops_module_admin = true;
+    	// end of /admin/index.php page detect
+    	
     	if (file_exists($this->xp_config_file_path)){	// file exists xp-config.php
     		$this->_get_value_by_xp_config_file();
-    	} else if (defined('XOOPS_MAINFILE_INCLUDED')){ // loaded XOOPS mainfile.php
+    	}else if (defined('XOOPS_MAINFILE_INCLUDED') && !$is_xoops_module_admin){ // loaded XOOPS mainfile.php
     		$this->_get_value_by_xoops_define();
     	} else {  // A set value is acquired from mainfile.php by the pattern match.
@@ -282,9 +292,13 @@
     	
     	$this->wp_db_version = $wp_db_version;
-    	if ($wp_db_version == 3441)
-			$this->is_wp20 = true;
-		else
-			$this->is_wp20 = false;
-		
+		
+		$this->wp_version = str_replace("ME", "", $wp_version);
+		
+		$pattern = 'ME.*';
+    	if (preg_match('/' . $pattern . '/' ,$wp_version)){
+			$this->is_wp_me = true;
+		} else {
+			$this->is_wp_me = true;
+		}
     }
     
