Index: /trunk/xpressme_integration_kit/include/oninstall.php
===================================================================
--- /trunk/xpressme_integration_kit/include/oninstall.php	(revision 351)
+++ /trunk/xpressme_integration_kit/include/oninstall.php	(revision 352)
@@ -111,4 +111,20 @@
 	dbDelta($views_queries);
 	$ret[] = "$group_role table of XPressME was made.";
+	
+	$notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ;
+	$queries ="CREATE TABLE $notify_reserve (
+  		notify_reserve_id bigint(20) NOT NULL AUTO_INCREMENT ,
+  		notify_reserve_status varchar(20)  NOT NULL default '' ,
+  		category text  NOT NULL default '',
+  		item_id bigint(20) unsigned NOT NULL default '0',
+		event varchar(20) NOT NULL default '',
+		extra_tags_arry longtext NOT NULL default '' ,
+		user_list_arry longtext NOT NULL default '' ,
+  		module_id smallint(5) unsigned NOT NULL default '0' ,
+  		omit_user_id varchar(20) NOT NULL default '' ,
+  		KEY notify_reserve_id (notify_reserve_id)
+		)TYPE=MyISAM";
+	dbDelta($queries);
+	$ret[] = "$notify_reserve table of XPressME was made.";
 
 	$sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')";
Index: /trunk/xpressme_integration_kit/include/onupdate.php
===================================================================
--- /trunk/xpressme_integration_kit/include/onupdate.php	(revision 351)
+++ /trunk/xpressme_integration_kit/include/onupdate.php	(revision 352)
@@ -205,4 +205,21 @@
 	}
 	
+	if (! enhanced_table_check($mydirname,'notify_reserve')){
+		$notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ;
+		$queries ="CREATE TABLE $notify_reserve (
+	  		notify_reserve_id bigint(20) NOT NULL AUTO_INCREMENT ,
+	  		notify_reserve_status varchar(20)  NOT NULL default '' ,
+	  		category text  NOT NULL default '',
+	  		item_id bigint(20) unsigned NOT NULL default '0',
+			event varchar(20) NOT NULL default '',
+			extra_tags_arry longtext NOT NULL default '' ,
+			user_list_arry longtext NOT NULL default '' ,
+	  		module_id smallint(5) unsigned NOT NULL default '0' ,
+	  		omit_user_id varchar(20) NOT NULL default '' ,
+	  		KEY notify_reserve_id (notify_reserve_id)
+			)TYPE=MyISAM";
+		$db->queryF( $queries ) ;
+		$msgs[] = "$notify_reserve table of XPressME was made.";
+	}
 	return $msgs;
 }
Index: /trunk/xpressme_integration_kit/include/xpress_debug_log.php
===================================================================
--- /trunk/xpressme_integration_kit/include/xpress_debug_log.php	(revision 351)
+++ /trunk/xpressme_integration_kit/include/xpress_debug_log.php	(revision 352)
@@ -1,3 +1,6 @@
 <?php
+
+// define('XPRESS_EVENT_DEBUG',1);
+
 if (!function_exists('xpress_debug')) {
 	function xpress_debug($title = '',$ditail_show = false)
Index: /trunk/xpressme_integration_kit/wp-config.php
===================================================================
--- /trunk/xpressme_integration_kit/wp-config.php	(revision 351)
+++ /trunk/xpressme_integration_kit/wp-config.php	(revision 352)
@@ -95,5 +95,10 @@
 require_once( ABSPATH .'/include/request_url.php');
 if (is_xpress_index_page_call()){
+	//When notifying by a private message, 
+	//it is evaded that the data base becomes read-only as a result of the check on the referrer and the method. 
+	$_SERVER['REQUEST_METHOD'] = 'POST';
+
 	require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php. 
+	
 	require_once(ABSPATH.'wp-settings.php');
 	if (!is_object($xoopsUser)){	// before login auth cookie clear
@@ -110,8 +115,9 @@
 		$err_str = "The activation of the XPressME plugin was executed.<br />\n";
 		$err_str .= "Because the XPressME plugin was invalid.<br />\n";
-		$err_str .= "Please do the rereading seeing on the page.\n";			
+		$err_str .= "Please do the rereading seeing on the page.\n";
 		die($err_str);
 	}
-
+	
+	Notification_reserve_send();
 	ob_start();	
 		if($xoops_config->is_wp20 )
Index: /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php
===================================================================
--- /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php	(revision 351)
+++ /trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php	(revision 352)
@@ -40,7 +40,9 @@
 	//When notifying by a private message, 
 	//it is evaded that the data base becomes read-only as a result of the check on the referrer and the method. 
+	if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent');
 	if (is_wp_cron_page_call() ){
 		$_SERVER['HTTP_REFERER'] = 'http://'. $_SERVER[HTTP_HOST]  . $_SERVER['PHP_SELF'];
 		$_SERVER['REQUEST_METHOD'] = 'POST';
+		if (function_exists('xpress_debug')) xpress_debug($title = 'wp_cron_page_call',true);
 	}
 	if (is_xmlrpc_call() ){
@@ -49,13 +51,18 @@
 	}
 //	set_error_handler("xpress_error_handler");
-	if ($xoops_config->is_impress != true){  // impress cms is error
-		if ( !defined("XOOPS_MAINFILE_INCLUDED")) {
-			require_once $xoops_config->xoops_mainfile_path;	// load XOOPS System
-		}
-	}
+//	if ($xoops_config->is_impress != true){  // impress cms is error
+//		if ( !defined("XOOPS_MAINFILE_INCLUDED")) {
+//			require_once $xoops_config->xoops_mainfile_path;	// load XOOPS System
+//		}
+//	}
 	if ( defined("XOOPS_MAINFILE_INCLUDED")) {
+		if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent');
 		$module_id = get_xpress_modid() ;
 		$notification_handler =& xoops_gethandler( 'notification' ) ;
 		$notification_handler->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id);
+	} else {
+		if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'not call $notification_handler->triggerEvent');
+		$module_id = get_xpress_modid() ;
+		Notification_reserve($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id);
 	}
 }
@@ -177,5 +184,71 @@
 		default :
 	}
-}		
+}
+
+//When the event cannot notify because the XOOPS system is not loaded, the event is stacked. 
+function Notification_reserve($category, $item_id=0, $event, $extra_tags=array(), $user_list=array(), $module_id=0, $omit_user_id=null)
+{
+	global $xpress_config,$xoops_db;
+	
+	$xpress_prefix = get_wp_prefix();
+	$notfiy_reserve = $xpress_prefix . 'notify_reserve';
+
+	$extra_tags_arry = addslashes(serialize($extra_tags));
+	$user_list_arry = addslashes(serialize($user_list));
+//	$extra_tags_arry = mysql_real_escape_string(serialize($extra_tags));
+//	$user_list_arry = mysql_real_escape_string(serialize($user_list));
+	
+	$notify_reserve_status = 'reserve';
+
+	$sql  = "INSERT INTO $notfiy_reserve ";
+	$sql .=    "(notify_reserve_status , category , item_id , event , extra_tags_arry , user_list_arry , module_id , omit_user_id)";
+	$sql .=  "VALUES ";
+	$sql .=    "('$notify_reserve_status' , '$category' , $item_id , '$event' , '$extra_tags_arry' , '$user_list_arry' , $module_id , '$omit_user_id')";
+	if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = $sql);
+
+	$xoops_db->query($sql);
+}
+
+//It calls when the XOOPS system is loaded, and the stacked event notification processing is done. 
+function Notification_reserve_send()
+{
+	global $xpress_config,$xoops_db;
+	if ( ! defined("XOOPS_MAINFILE_INCLUDED")) return;
+	
+	$notification_handler =& xoops_gethandler( 'notification' ) ;
+	
+	$xpress_prefix = get_wp_prefix();
+	$notfiy_reserve_db = $xpress_prefix . 'notify_reserve';
+
+	$extra_tags_arry = addslashes(serialize($extra_tags));
+	$user_list_arry = addslashes(serialize($user_list));
+	
+	$sql  = "SELECT * ";
+	$sql .= "FROM $notfiy_reserve_db ";
+	$sql .= "WHERE  notify_reserve_status = 'reserve'";
+
+	$notify_reserves = $xoops_db->get_results($sql);
+
+	//So as not to process it by other sessions while processing it, status is changed. 
+	foreach($notify_reserves as $notify){
+		$notify_reserve_id = $notify->notify_reserve_id;
+		$sql  = "UPDATE $notfiy_reserve_db SET  notify_reserve_status = 'sending' WHERE notify_reserve_id = $notify_reserve_id";
+		$xoops_db->query($sql);
+	}
+
+	foreach($notify_reserves as $notify){
+		$notify_reserve_id = $notify->notify_reserve_id;
+		$category = $notify->category;
+		$item_id = $notify->item_id;
+		$event = $notify->event;
+		$extra_tags = unserialize($notify->extra_tags_arry);
+		$user_list = unserialize($notify->user_list_arry);
+		$module_id = $notify->module_id;
+		$omit_user_id = $notify->omit_user_id;
+		$notification_handler->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id);
+		$sql  = "DELETE FROM  $notfiy_reserve_db WHERE notify_reserve_id = $notify_reserve_id";
+		$xoops_db->query($sql);
+	}
+}
 
 ?>
