Index: trunk/xpressme_integration_kit/include/data.inc.php
===================================================================
--- trunk/xpressme_integration_kit/include/data.inc.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/data.inc.php	(revision 583)
@@ -31,9 +31,5 @@
 	global $xoopsDB;
 
-	if ($mydirname == 'wordpress'){
-		$wp_prefix = 'wp';
-	} else {
-		$wp_prefix = $mydirname;
-	}
+	$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 	require_once (XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/include/general_functions.php');
 	include(XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/wp-includes/version.php');
@@ -163,10 +159,5 @@
 
 	global $xoopsDB;
-
-	if ($mydirname == 'wordpress'){
-		$wp_prefix = 'wp';
-	} else {
-		$wp_prefix = $mydirname;
-	}
+	$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 	require_once (XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/include/general_functions.php');
 	$prefix = $xoopsDB->prefix($wp_prefix);
@@ -208,10 +199,5 @@
 
 	global $xoopsDB;
-
-	if ($mydirname == 'wordpress'){
-		$wp_prefix = 'wp';
-	} else {
-		$wp_prefix = $mydirname;
-	}
+	$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 	
 	require_once (XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/include/general_functions.php');
Index: trunk/xpressme_integration_kit/include/general_functions.php
===================================================================
--- trunk/xpressme_integration_kit/include/general_functions.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/general_functions.php	(revision 583)
@@ -13,10 +13,6 @@
 		if (empty($mydirname))
 			$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
-
-		if ($mydirname == 'wordpress'){
-			$wp_prefix = 'wp';
-		} else {
-			$wp_prefix = $mydirname;
-		}
+		
+		$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 
 		if (empty($xoops_db)) { // not load XPressME
@@ -56,9 +52,5 @@
 			$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
 
-		if ($mydirname == 'wordpress'){
-			$wp_prefix = 'wp';
-		} else {
-			$wp_prefix = $mydirname;
-		}
+		$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 
 		if (empty($xoops_db)) { // not load XPressME
Index: trunk/xpressme_integration_kit/include/oninstall.php
===================================================================
--- trunk/xpressme_integration_kit/include/oninstall.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/oninstall.php	(revision 583)
@@ -86,8 +86,5 @@
 	
 // create XPressME table
-	$xp_prefix = $mydirname;
-	if ($xp_prefix == 'wordpress'){
- 		$xp_prefix = 'wp';
-	}
+	$xp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 	$views_table = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_views' ;
 
Index: trunk/xpressme_integration_kit/include/onuninstall.php
===================================================================
--- trunk/xpressme_integration_kit/include/onuninstall.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/onuninstall.php	(revision 583)
@@ -25,8 +25,5 @@
 	$mid = $module->getVar('mid') ;
 	
-	$xp_prefix = $mydirname;
-	if ($xp_prefix == 'wordpress'){
-	 	$xp_prefix = 'wp';
-	}
+	$xp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 	
 	$xoops_prefix = $db->prefix();
Index: trunk/xpressme_integration_kit/include/onupdate.php
===================================================================
--- trunk/xpressme_integration_kit/include/onupdate.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/onupdate.php	(revision 583)
@@ -81,8 +81,5 @@
 function xpress_put_siteurl($mydirname,$url){
 		global $xoopsModule;
-		$wp_prefix = $mydirname;
-		if ($wp_prefix == 'wordpress'){
-			$wp_prefix = 'wp';
-		}
+		$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 		$xoopsDB =& Database::getInstance();
 		$db_xpress_option = $xoopsDB->prefix($wp_prefix . '_options');
@@ -96,8 +93,5 @@
 function xpress_put_home($mydirname,$url){
 		global $xoopsModule;
-		$wp_prefix = $mydirname;
-		if ($wp_prefix == 'wordpress'){
-			$wp_prefix = 'wp';
-		}
+		$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 		$xoopsDB =& Database::getInstance();
 		$db_xpress_option = $xoopsDB->prefix($wp_prefix . '_options');
@@ -111,8 +105,5 @@
 	function get_xpress_option($mydirname,$option_name){
 		global $xoopsModule;
-		$wp_prefix = $mydirname;
-		if ($wp_prefix == 'wordpress'){
-			$wp_prefix = 'wp';
-		}
+		$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 		$xoopsDB =& Database::getInstance();
 		$option_table = $xoopsDB->prefix($wp_prefix . '_options');
@@ -145,8 +136,5 @@
 function get_db_version($mydirname){
 		global $xoopsModule;
-		$wp_prefix = $mydirname;
-		if ($wp_prefix == 'wordpress'){
-			$wp_prefix = 'wp';
-		}
+		$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 		$xoopsDB =& Database::getInstance();
 		$db_xpress_option = $xoopsDB->prefix($wp_prefix . '_options');
@@ -192,16 +180,9 @@
 function xpress_table_make($module, $mydirname)
 {
-	$xp_prefix = $mydirname;
-	if ($xp_prefix == 'wordpress'){
-	 	$xp_prefix = 'wp';
-	}
 	$db =& Database::getInstance() ;
 	$mid = $module->getVar('mid') ;
 
 // XPressME orignal table update
-	$xp_prefix = $mydirname;
-	if ($xp_prefix == 'wordpress'){
-	 	$xp_prefix = 'wp';
-	}
+	$xp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 	$msgs = array();
 
@@ -307,9 +288,5 @@
 		
 		$xoopsDB =& Database::getInstance();
-		if ($mydirname == 'wordpress'){
-			$xpress_prefix=  $xoopsDB->prefix('wp_');
-		} else {
-			$xpress_prefix=  $xoopsDB->prefix($mydirname . '_');
-		}
+		$xpress_prefix = $xoopsDB->prefix(preg_replace('/wordpress/','wp',$mydirname) . '_');
 		$db_enhanced = $xpress_prefix . $table_name;
 
Index: trunk/xpressme_integration_kit/include/search.php
===================================================================
--- trunk/xpressme_integration_kit/include/search.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/search.php	(revision 583)
@@ -20,8 +20,5 @@
 		$myts =& MyTextSanitizer::getInstance();
 		
-		$xp_prefix = $mydirname;
-		if ($xp_prefix == 'wordpress'){
-	 		$xp_prefix = 'wp';
-		}
+		$xp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 		if ($userid) {
 			$wp_uid = xoops_uid_to_wp_uid(intval($userid),$mydirname);
Index: trunk/xpressme_integration_kit/include/sitemap.plugin.php
===================================================================
--- trunk/xpressme_integration_kit/include/sitemap.plugin.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/sitemap.plugin.php	(revision 583)
@@ -30,6 +30,5 @@
 		$disp_sub =@$sitemap_configs["show_subcategoris"];
 		
-		$prefix = $mydirname;
-		if ($prefix == 'wordpress') $prefix ='wp';
+		$prefix = preg_replace('/wordpress/','wp',$mydirname);
 		$prefix = $xoopsDB->prefix($prefix);
 		require_once (XOOPS_ROOT_PATH . '/modules/'.$mydirname . '/include/general_functions.php');
Index: trunk/xpressme_integration_kit/include/xpress_block_render.php
===================================================================
--- trunk/xpressme_integration_kit/include/xpress_block_render.php	(revision 580)
+++ trunk/xpressme_integration_kit/include/xpress_block_render.php	(revision 583)
@@ -84,6 +84,5 @@
 		if (is_null($wpdb)){
 			$xoopsDB =& Database::getInstance();
-			$wp_prefix = $mydirname;
-			if ($wp_prefix == 'wordpress') $wp_prefix = 'wp';
+			$wp_prefix = preg_replace('/wordpress/','wp',$mydirname);
 
 			$module_tbl = $xoopsDB->prefix($wp_prefix).'_options';	
