Index: branches/Ver2.1/xpressme_integration_kit/include/add_xpress_config.php
===================================================================
--- branches/Ver2.1/xpressme_integration_kit/include/add_xpress_config.php	(revision 374)
+++ branches/Ver2.1/xpressme_integration_kit/include/add_xpress_config.php	(revision 374)
@@ -0,0 +1,6 @@
+<?php
+require_once dirname( __FILE__ ).'/xpress_debug_log.php' ;
+require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
+$xoops_config = new ConfigFromXoops;
+require_once dirname( __FILE__ ).'/set_cash_cookie_path.php' ;
+?>
Index: branches/Ver2.1/xpressme_integration_kit/include/add_xpress_process.php
===================================================================
--- branches/Ver2.1/xpressme_integration_kit/include/add_xpress_process.php	(revision 374)
+++ branches/Ver2.1/xpressme_integration_kit/include/add_xpress_process.php	(revision 374)
@@ -0,0 +1,53 @@
+<?php
+require_once( dirname( __FILE__ ).'/request_url.php');
+if (is_xpress_index_page_call()){
+	//When notifying by a private message, Notification_reserve_send();
+	//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
+		wp_logout();
+	}
+	wp();
+	
+	if (!function_exists('is_wordpress_style')){	// When the XPressME plug-in is invalid
+		require_once dirname( __FILE__ ).'/xpress_active_plugin.php' ;
+		xpress_pulugin_activation('xpressme/xpressme.php');
+		// reloaded 
+		header('Location: ' . $xoops_config->module_url . '/');
+		
+		$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";			
+		die($err_str);
+	}
+	
+	Notification_reserve_send();
+	ob_start();	
+		if (version_compare($xoops_config->wp_version,'2.2', '<'))
+			require_once dirname( __FILE__ ).'/old_template-loader.php' ;
+		else
+			require_once( ABSPATH . WPINC . '/template-loader.php' );
+		$wp_output = ob_get_contents();
+	ob_end_clean();
+	// It judges it here because it does in is_index_page() through feed to which the permalink is set. 
+	if (is_wordpress_style() || is_feed()) {
+		echo $wp_output;
+	} else {
+		require_once( dirname( __FILE__ ).'/xpress_render.php' );
+		xpress_render($wp_output);
+	}
+
+	//When there is no block cache, and an optional block is different, cache is refreshed. 
+	//When adding, and changing and deleting Post & Comment, block cache is refreshed by add_action at any time. 
+	// This Function in xpressme plugin
+	require_once( dirname( __FILE__ ).'/xpress_block_render.php' );	
+	xpress_unnecessary_block_cache_delete($xoops_config->module_name);
+	if (is_home()) xpress_block_cache_refresh($xoops_config->module_name);
+	exit();		// The return to wp-blog-header.php is stolen here
+}
+if (is_admin_post_call()) require_once $xoops_config->xoops_mainfile_path;		// for Notification_triggerEvent
+if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path;	// for Notification_triggerEvent
+?>
Index: branches/Ver2.1/xpressme_integration_kit/include/oninstall.php
===================================================================
--- trunk/xpressme_integration_kit/include/oninstall.php	(revision 317)
+++ branches/Ver2.1/xpressme_integration_kit/include/oninstall.php	(revision 374)
@@ -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')";
@@ -162,5 +178,13 @@
 		
 		// Rewrite Option for Xpress
-		//	update_option("blog_charset", wp_blog_charset());
+			if (WPLANG == 'ja_EUC') {
+				$setup_charset = 'EUC-JP';
+			} elseif(WPLANG == 'ja_SJIS') {
+				$setup_charset = 'Shift_JIS';
+			} else {
+				$setup_charset = 'UTF-8';
+			}
+			update_option("blog_charset", $setup_charset);
+
 			update_option('blogname', $site_name );	
 			update_option('blogdescription', 'WordPress for XOOPS');
Index: branches/Ver2.1/xpressme_integration_kit/include/onupdate.php
===================================================================
--- trunk/xpressme_integration_kit/include/onupdate.php	(revision 317)
+++ branches/Ver2.1/xpressme_integration_kit/include/onupdate.php	(revision 374)
@@ -53,5 +53,4 @@
 //	}
 	
-//	update_option("blog_charset", wp_blog_charset());
 	return true ;
 }
@@ -206,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: branches/Ver2.1/xpressme_integration_kit/include/xml.php
===================================================================
--- trunk/xpressme_integration_kit/include/xml.php	(revision 317)
+++ branches/Ver2.1/xpressme_integration_kit/include/xml.php	(revision 374)
@@ -85,4 +85,21 @@
 		$this->stack    = array();
 		$this->parent   = &$this->document;
+		
+		//libxml2 ver.2.7.0 -2.7.2 stripping leading angle brackets bug patch
+		if ( 
+			LIBXML_DOTTED_VERSION == '2.7.0' 
+			|| LIBXML_DOTTED_VERSION == '2.7.1' 
+			|| LIBXML_DOTTED_VERSION == '2.7.2' 
+			|| (
+				LIBXML_DOTTED_VERSION == '2.7.3'
+				&& version_compare( PHP_VERSION, '5.2.9', '<' )
+			)
+		) {
+			$data =str_replace('&lt;','&#60;',$data );
+			$data =str_replace('&gt;','&#62;',$data );
+			$data =str_replace('&amp;','&#38;',$data );
+		}
+		//end Fix
+		
 		// return xml_parse(&$this->parser, &$data, true) ? $this->document : NULL; // GIJ
 		$ret = @xml_parse($this->parser, $data, true) ? $this->document : NULL;
Index: branches/Ver2.1/xpressme_integration_kit/include/xpress_block_render.php
===================================================================
--- trunk/xpressme_integration_kit/include/xpress_block_render.php	(revision 317)
+++ branches/Ver2.1/xpressme_integration_kit/include/xpress_block_render.php	(revision 374)
@@ -15,4 +15,7 @@
 			$xml = xpress_XML_serialize($block);
 			$xml_name = $block_name . '.xml';
+			if (WPLANG == 'ja_EUC'){
+				$xml = str_replace('<?xml version="1.0" ?>', '<?xml version="1.0" encoding="EUC-JP" ?>' , $xml);
+			}
 			xpress_cache_write($mydirname,$xml_name,$xml);
 	}
@@ -21,5 +24,10 @@
 			$xml_name = $block_name . '.xml';
 			$xml_data = xpress_cache_read($mydirname,$xml_name);
-			return @xpress_XML_unserialize($xml_data);
+
+			$ret = @xpress_XML_unserialize($xml_data);
+			if (strstr($xml_data, '<?xml version="1.0" encoding="EUC-JP" ?>') !== false){
+				$ans = mb_convert_variables('EUC-JP' , 'UTF-8', &$ret);
+			}
+			return $ret;
 	}
 	
Index: branches/Ver2.1/xpressme_integration_kit/include/xpress_debug_log.php
===================================================================
--- trunk/xpressme_integration_kit/include/xpress_debug_log.php	(revision 317)
+++ branches/Ver2.1/xpressme_integration_kit/include/xpress_debug_log.php	(revision 374)
@@ -1,3 +1,6 @@
 <?php
+
+// define('XPRESS_EVENT_DEBUG',1);
+
 if (!function_exists('xpress_debug')) {
 	function xpress_debug($title = '',$ditail_show = false)
Index: branches/Ver2.1/xpressme_integration_kit/include/xpress_render.php
===================================================================
--- trunk/xpressme_integration_kit/include/xpress_render.php	(revision 317)
+++ branches/Ver2.1/xpressme_integration_kit/include/xpress_render.php	(revision 374)
@@ -36,5 +36,5 @@
 
 	$head_str = preg_replace("/^(\s)*(\r|\n|\r\n)/m", "", $head_str);	
-	$head_str = $head_str . "\n<!-- " . xpress_credit('echo=0&no_link=1') . " -->\n";
+	$head_str = $head_str . "\n<!-- credit " . xpress_credit('echo=0&no_link=1') . " -->\n";
 	return $head_str;
 }
@@ -147,5 +147,7 @@
 //rendering for the module header and the body
 function xpress_render($contents){
-	global $xoops_config , $xoopsTpl,$xpress_config;
+	global $xoops_config;
+	global $xoopsUser , $xoopsTpl,$xpress_config , $xoopsModule , $xoopsLogger, $xoopsConfig ; //for XOOPS
+
 	xpress_remake_global_for_permlink();
 	$mydirname = basename(dirname(dirname(__FILE__)));
@@ -218,4 +220,9 @@
 	$xpress_data['now_user_level'] = xpress_now_user_level('echo=0');
 
+	//If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed. 
+	if (is_object($xoopsModule) && $xoopsModule->getVar('hasnotification') == 1 && is_object($xoopsUser)) {
+		require_once $xoops_config->xoops_root_path . '/include/notification_select.php';
+	}
+	
 	$xoopsTpl->assign('xpress', $xpress_data);
 	$templates_file = 'db:'.$mydirname. '_index.html';
