Index: /trunk/include/config_from_xoops.class.php
===================================================================
--- /trunk/include/config_from_xoops.class.php	(revision 112)
+++ /trunk/include/config_from_xoops.class.php	(revision 113)
@@ -27,4 +27,6 @@
 	var $module_url;
 	var $module_db_prefix;
+	var $module_version;
+	var $module_codename;	
 	var $xoops_upload_path;
 	var $xoops_upload_url;
@@ -148,4 +150,6 @@
 			$this->module_db_prefix =  $this->xoops_db_prefix  . '_' . $this->module_name . '_';
 		
+		$this->set_module_version();
+		
     }
     
@@ -153,5 +157,28 @@
     	return dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
     }
-
+    
+    // set XPressME module virsion and codename from xoops_versions.php
+    function set_module_version(){
+    	$xoops_version_file = dirname(dirname(__FILE__)) . '/xoops_version.php';
+		if(file_exists($xoops_version_file)){
+			$version_file = file($xoops_version_file);
+			$version_pattern = '(\$modversion\[\s*\'version\'\s*\])\s*=\s*[\'"]([^\'"]*)[\'"]';
+			$codename_pattern = '(\$modversion\[\s*\'codename\'\s*\])\s*=\s*[\'"]([^\'"]*)[\'"]';
+			$version_found = false;
+			$codename_found = false;
+			for ($i = 0 ; $i <count($version_file) ; $i++){
+				if (preg_match( "/$version_pattern/", $version_file[$i] ,$v_matches )){
+					$this->module_version = $v_matches[2];
+					$version_found = true;
+				}
+				if (preg_match( "/$codename_pattern/", $version_file[$i] ,$c_matches )){
+					$this->module_codename = $c_matches[2];
+					$codename_found = true;
+				}
+				if ( $version_found && $codename_found ) break;
+			}
+		}
+    }
+    
 }
 ?>
Index: /trunk/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- /trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 112)
+++ /trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 113)
@@ -3,8 +3,8 @@
 function xpress_credit($show = false)
 {
-	global $wp_version , $modversion;
-	
-	$xpress_version = $modversion['version'];
-	$xpress_codename = $modversion['codename'];
+	global $wp_version , $xoops_config;
+	
+	$xpress_version = $xoops_config->module_version;
+	$xpress_codename = $xoops_config->module_codename;
 	$ret = '<a href="http://www.toemon.com"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>';
 	if (strstr($wp_version,'ME')){
