Index: trunk/include/onupdate.php
===================================================================
--- trunk/include/onupdate.php	(revision 207)
+++ trunk/include/onupdate.php	(revision 208)
@@ -23,5 +23,28 @@
 	$mid = $module->getVar('mid') ;
 
-// XPressME orignal table updayte
+
+
+//XPressME Update
+	global $wpdb,$wp_rewrite, $wp_queries, $table_prefix, $wp_db_version, $wp_roles,$wp_query;
+	define('WP_INSTALLING', true);
+	$mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
+	$path = $mydirpath . '/';
+	
+/* 
+ * xpress_put_siteurl($mydirname,''); 
+ * Call to a member function register() The on a non-object error is evaded.
+ * It happens by register_widget() that exists in wp-includes/widgets.php. 
+ * The blog is not installed. It is cheating to function wp_maybe_load_widgets(). 
+ * As a result, default-widgets.php is not loaded.
+ */
+	xpress_put_siteurl($mydirname,''); 				// Site_url is temporarily deleted. 
+	
+	if (file_exists($path . 'wp-load.php')) {
+		require_once $path . 'wp-load.php';
+	} else {
+		require_once $path . 'wp-config.php';
+	}
+
+// XPressME orignal table update
 	if (! enhanced_table_check($mydirname,'views')){
 		$xp_prefix = $mydirname;
@@ -114,25 +137,5 @@
 	$msgs = array_merge($msgs,$t_mess);
 
-
-//Wordpress TABLE UPGRADE
-	global $wpdb,$wp_rewrite, $wp_queries, $table_prefix, $wp_db_version, $wp_roles,$wp_query;
-	define('WP_INSTALLING', true);
-	$mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
-	$path = $mydirpath . '/';
-	
-/* 
- * xpress_put_siteurl($mydirname,''); 
- * Call to a member function register() The on a non-object error is evaded.
- * It happens by register_widget() that exists in wp-includes/widgets.php. 
- * The blog is not installed. It is cheating to function wp_maybe_load_widgets(). 
- * As a result, default-widgets.php is not loaded.
- */
-	xpress_put_siteurl($mydirname,''); 				// Site_url is temporarily deleted. 
-	
-	if (file_exists($path . 'wp-load.php')) {
-		require_once $path . 'wp-load.php';
-	} else {
-		require_once $path . 'wp-config.php';
-	}
+// upgrade WordPress
 	
 	$site_url= XOOPS_URL."/modules/".$mydirname;		
