Index: trunk/include/oninstall.php
===================================================================
--- trunk/include/oninstall.php	(revision 89)
+++ trunk/include/oninstall.php	(revision 96)
@@ -51,4 +51,5 @@
 	wp_cache_flush();
 	make_db_current_silent();
+	$ret[] = "The data base of wordpress was made by prefix $table_prefix.";
 	
 	$option_desc = __('WordPress web address');
@@ -67,12 +68,43 @@
 	update_option("home", $site_url);
 	update_option("siteurl", $site_url);
+	update_option("what_to_show", "posts");
+	update_option('default_pingback_flag', 0);
+	$ret[] = 'The initial data was written in the data base of wordpress.';
+	
 	update_option("template", "xpress_default");
 	update_option("stylesheet", "xpress_default");
-	update_option("what_to_show", "posts");
-
+	$ret[] = 'The default theme of wordpress was set to xpress_default.';
 	/* add new option for uploads */
 //	update_option('uploads_use_yearmonth_folders', 1);
 //	update_option('upload_path', $module->getVar("dirname"));
 	
+		
+// Admin User Data write
+	// Change uid field
+	$wpdb->query("ALTER TABLE $wpdb->posts CHANGE `post_author` `post_author` mediumint(8) NOT NULL DEFAULT '0'");
+	$user_name = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("uname"):'admin';
+	$email = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("email"):'foo@exsample.com';
+	$pass_md5 = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("pass"):'';
+	
+	$user_id = username_exists($user_name);
+	if ( !$user_id ) {
+		$random_password = 'admin';
+		$user_id = wp_create_user($user_name, $random_password, $email);
+	} else {
+		$random_password = __('User already exists.  Password inherited.');
+	}
+
+	$user = new WP_User($user_id);
+	$user->set_role('administrator');
+	'User ' . $user_name . ' of the administrator was made.';
+	// over write xoops md5 password 
+	$sql = "UPDATE $wpdb->users SET user_pass ='$pass_md5' WHERE ID = $user_id";
+	$wpdb->query($sql);
+	$ret[] = 'The password of XOOPS was copied.';
+	// Set Default data
+	wp_install_defaults($user_id);
+	$ret[] = 'The first sample post & comment was written.';
+//	    generate_page_uri_index();
+
 	/* activate the XPressME plugin */
 	$plugin_current = "xpressme/xpressme.php";
@@ -80,18 +112,6 @@
 	include_once(dirname(__FILE__) . '/../wp-content/plugins/'.$plugin_current);
 	do_action('activate_'.$plugin_current);
-		
-// Admin User Data write
-	// Change uid field
-	$wpdb->query("ALTER TABLE $wpdb->posts CHANGE `post_author` `post_author` mediumint(8) NOT NULL DEFAULT '0'");
-	$ID = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("uid"):1;
-//   	require_once($mydirpath . '/include/user_sync.php');
-	$sync_messg = '';
-//	user_sync_to_wordpress($ID,$sync_messg);		//this function in XPressME plugin 
-
-	// Set Default data
-		wp_install_defaults($ID);
-//	    generate_page_uri_index();
-
-	        
+	$ret[] = 'The xpressme plug-in was activated.';
+	
 	// create views table
 	$xp_prefix = $mydirname;
@@ -115,4 +135,6 @@
 
 	dbDelta($views_queries);
+	$ret[] = "$views_table table of XPressME was made.";
+
 	
 	$d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ;
@@ -124,4 +146,5 @@
 		)$charset_collate;";
 	dbDelta($views_queries);
+	$ret[] = "$d3forum_link table of XPressME was made.";
 	
 	$group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ;
@@ -136,4 +159,6 @@
 		)$charset_collate;";
 	dbDelta($views_queries);
+	$ret[] = "$group_role table of XPressME was made.";
+
 	$sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')";
 	$wpdb->query($sql);
