Index: branches/Ver2.1/xpressme_integration_kit/admin/index.php
===================================================================
--- trunk/xpressme_integration_kit/admin/index.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/admin/index.php	(revision 374)
@@ -169,4 +169,5 @@
 		echo "SERVER:  ". $_SERVER['SERVER_SOFTWARE']. "<br />\n";
 		echo "PHP Version:   " . phpversion() . "<br />\n";
+		echo 'libxml Version:  ' . LIBXML_DOTTED_VERSION . "<br />\n";
 		echo "MySQL Version:   " . mysql_get_server_info() . "</text><br />";
 		echo "XOOPS Version:   " . XOOPS_VERSION . "</text><br />";
@@ -232,4 +233,5 @@
 		echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />";
 		echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />";
+		echo "<label>" . "<strong>libxml Version:</strong>" . ":</label><text>" . LIBXML_DOTTED_VERSION . "</text><br />";
 		echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />";
 		echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />";
Index: branches/Ver2.1/xpressme_integration_kit/blocks/popular_posts_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/popular_posts_block.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/blocks/popular_posts_block.php	(revision 374)
@@ -36,6 +36,12 @@
 		$form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
 		$form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
-		$form .= "<br />\n";
-		$form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[6]' value='" . $tag_select . "' /><br />\n";	
+		include $mydirpath .'/wp-includes/version.php' ;
+		if (wp_version_compare($wp_version, '>=','2.3')){
+			$form .= "<br />\n";
+			$form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[6]' value='" . $tag_select . "' /><br />\n";
+		} else {
+			$form .= "<input type='hidden' name='options[6]' value='' /><br />\n";
+		}
+
 	    $form .= _MB_XP2_CATS_SELECT ."<br />\n";
 	    $isAll = (count($selected)==0||empty($selected[0]))?true:false;
Index: branches/Ver2.1/xpressme_integration_kit/blocks/recent_posts_content_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/recent_posts_content_block.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/blocks/recent_posts_content_block.php	(revision 374)
@@ -40,6 +40,12 @@
 		$form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n";
 		
-		$form .= "<br />\n";
-		$form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
+		include $mydirpath .'/wp-includes/version.php' ;
+		if (wp_version_compare($wp_version, '>=','2.3')){
+			$form .= "<br />\n";
+			$form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
+		} else {
+			$form .= "<input type='hidden' name='options[7]' value='' /><br />\n";
+		}
+		
 	    $form .= _MB_XP2_CATS_SELECT ."<br />\n";
 	    $isAll = (count($selected)==0||empty($selected[0]))?true:false;
Index: branches/Ver2.1/xpressme_integration_kit/blocks/recent_posts_list_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/recent_posts_list_block.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/blocks/recent_posts_list_block.php	(revision 374)
@@ -39,6 +39,12 @@
 		$form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n";
 		
-	    $form .= "<br />\n";
-		$form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
+		include $mydirpath .'/wp-includes/version.php' ;
+		if (wp_version_compare($wp_version, '>=','2.3')){
+			$form .= "<br />\n";
+			$form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
+		} else {
+			$form .= "<input type='hidden' name='options[7]' value='' /><br />\n";
+		}
+
 	    $form .= _MB_XP2_CATS_SELECT ."<br />\n";
 	    $isAll = (count($selected)==0||empty($selected[0]))?true:false;
Index: branches/Ver2.1/xpressme_integration_kit/class/config_from_xoops.class.php
===================================================================
--- trunk/xpressme_integration_kit/class/config_from_xoops.class.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/class/config_from_xoops.class.php	(revision 374)
@@ -41,5 +41,6 @@
 	var $mu_path_current_site;
 	var $wp_db_version;
-	var $is_wp20;
+	var $wp_version;
+	var $is_wp_me;
 	
 	function __constructor()	//for PHP5
@@ -62,7 +63,16 @@
     	$this->xp_config_file_path = $this->module_path . '/xp-config.php';
     	
+    	// start /admin/index.php page detect
+    	$php_script_name = $_SERVER['SCRIPT_NAME'];
+		$php_query_string = $_SERVER['QUERY_STRING'];
+		$admin_page = 	basename(dirname(dirname(__FILE__))) . '/admin/index.php';
+		$is_xoops_module_admin = false;
+		if (strstr($php_script_name,$admin_page) !== false) $is_xoops_module_admin = true;
+		if (strstr($php_query_string,$admin_page) !== false) $is_xoops_module_admin = true;
+    	// end of /admin/index.php page detect
+    	
     	if (file_exists($this->xp_config_file_path)){	// file exists xp-config.php
     		$this->_get_value_by_xp_config_file();
-    	} else if (defined('XOOPS_MAINFILE_INCLUDED')){ // loaded XOOPS mainfile.php
+    	}else if (defined('XOOPS_MAINFILE_INCLUDED') && !$is_xoops_module_admin){ // loaded XOOPS mainfile.php
     		$this->_get_value_by_xoops_define();
     	} else {  // A set value is acquired from mainfile.php by the pattern match.
@@ -282,9 +292,13 @@
     	
     	$this->wp_db_version = $wp_db_version;
-    	if ($wp_db_version == 3441)
-			$this->is_wp20 = true;
-		else
-			$this->is_wp20 = false;
-		
+		
+		$this->wp_version = str_replace("ME", "", $wp_version);
+		
+		$pattern = 'ME.*';
+    	if (preg_match('/' . $pattern . '/' ,$wp_version)){
+			$this->is_wp_me = true;
+		} else {
+			$this->is_wp_me = true;
+		}
     }
     
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 339)
+++ 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 339)
+++ 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 339)
+++ 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 339)
+++ 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 339)
+++ 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 339)
+++ 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';
Index: branches/Ver2.1/xpressme_integration_kit/wp-config.php
===================================================================
--- trunk/xpressme_integration_kit/wp-config.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-config.php	(revision 374)
@@ -1,7 +1,5 @@
 <?php
-require_once dirname( __FILE__ ).'/include/xpress_debug_log.php' ;
-require_once dirname( __FILE__ ).'/class/config_from_xoops.class.php' ;
-$xoops_config = new ConfigFromXoops;
-require_once dirname( __FILE__ ).'/include/set_cash_cookie_path.php' ;
+/** It is an additional loading for XPressME. */
+require_once dirname( __FILE__ ).'/include/add_xpress_config.php' ;
 
 /**
@@ -93,50 +91,7 @@
 	define('ABSPATH', dirname(__FILE__).'/');
 
-require_once( ABSPATH .'/include/request_url.php');
-if (is_xpress_index_page_call()){
-	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__ ).'/include/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);
-	}
+/** Processing for XPressME is done.*/
+require_once( ABSPATH .'/include/add_xpress_process.php');
 
-	ob_start();	
-		if($xoops_config->is_wp20 )
-			require_once dirname( __FILE__ ).'/include/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( ABSPATH .'/include/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( ABSPATH .'/include/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;
-if (is_xpress_comments_post_call()) require_once $xoops_config->xoops_mainfile_path;
 require_once(ABSPATH.'wp-settings.php');
 ?>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 374)
@@ -16,8 +16,7 @@
 }
 
-function xpress_is_wp20() {
+function xpress_is_wp_version($operator='==',$comp_version){
 	global $xoops_config;
-	
-	return $xoops_config->is_wp20;
+ 	return version_compare($xoops_config->wp_version, $comp_version, $operator);
 }
 
@@ -538,5 +537,5 @@
 	
 	$defaults = array(
-		'more_link_text'=> null,
+		'more_link_text'=> $xpress_config->more_link_text,
 		'stripteaser' => 0,
 		'more_file' => '',
@@ -545,5 +544,5 @@
 		'excerpt_length_word' => $xpress_config->excerpt_length_word ,
 		'excerpt_length_character' => $xpress_config->excerpt_length_character ,
-		'excerpt_more_link_text' => $xpress_config->more_link_text ,
+		'excerpt_more_link_text' => $xpress_config->excerpt_more_link_text ,
 		'echo' => 1
 	);
@@ -585,5 +584,5 @@
 
 	
-	if ($xoops_config->wp_db_version  > 5000){
+	if (xpress_is_wp_version('>=','2.1')){
 		$output = '<a href="'. get_xpress_url() . '/wp-admin/post-new.php' . '">' . $link_title . '</a>';
 	} else {
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp20.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp20.php	(revision 339)
+++ 	(revision )
@@ -1,273 +1,0 @@
-<?php
-// wp_login override for wp2.0
-if ( !function_exists('wp_login') ) :
-function wp_login($username, $password, $already_md5 = false) {
-	global $wpdb, $error;
-
-
-	if(is_object($GLOBALS["xoopsModule"]) && WP_BLOG_DIRNAME == $GLOBALS["xoopsModule"]->getVar("dirname")){
-		if(!is_object($GLOBALS["xoopsUser"])){
-			wp_clearcookie();
-			return false;
-		}
-	}			
-
-	$username = sanitize_user($username);
-
-	if ( '' == $username )
-		return false;
-
-	if ( '' == $password ) {
-		$error = __('<strong>ERROR</strong>: The password field is empty.');
-		return false;
-	}
-
-	$login = get_userdatabylogin($username);
-	//$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
-
-	if (!$login) {
-		$error = __('<strong>ERROR</strong>: Invalid username.');
-		return false;
-	} else {
-		if ($login->user_login == $username) {
-				if ($login->user_pass == $password) return true;
-				if ($login->user_pass == md5($password)) return true;
-		}
-
-		$error = __('<strong>ERROR</strong>: Incorrect password.');
-		$pwd = '';
-		return false;
-	}
-}
-endif;
-
-if ( !function_exists('wp_sanitize_redirect') ) :
-/**
- * Sanitizes a URL for use in a redirect.
- *
- * @since 2.3
- *
- * @return string redirect-sanitized URL
- **/
-function wp_sanitize_redirect($location) {
-	$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
-	$location = wp_kses_no_null($location);
-
-	// remove %0d and %0a from location
-	$strip = array('%0d', '%0a');
-	$found = true;
-	while($found) {
-		$found = false;
-		foreach( (array) $strip as $val ) {
-			while(strpos($location, $val) !== false) {
-				$found = true;
-				$location = str_replace($val, '', $location);
-			}
-		}
-	}
-	return $location;
-}
-endif;
-
-
-// Added WP2.7 separate_comments()
-function &separate_comments(&$comments) {
-	$comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
-	$count = count($comments);
-	for ( $i = 0; $i < $count; $i++ ) {
-		$type = $comments[$i]->comment_type;
-		if ( empty($type) )
-			$type = 'comment';
-		$comments_by_type[$type][] = &$comments[$i];
-		if ( 'trackback' == $type || 'pingback' == $type )
-			$comments_by_type['pings'][] = &$comments[$i];
-	}
-
-	return $comments_by_type;
-}
-
-// Added WP2.7 get_comments()
-function get_comments( $args = '' ) {
-	global $wpdb;
-
-	$defaults = array('status' => '', 'orderby' => 'comment_date_gmt', 'order' => 'DESC', 'number' => '', 'offset' => '', 'post_id' => 0);
-
-	$args = wp_parse_args( $args, $defaults );
-	extract( $args, EXTR_SKIP );
-
-	// $args can be whatever, only use the args defined in defaults to compute the key
-	$key = md5( serialize( compact(array_keys($defaults)) )  );
-	$last_changed = wp_cache_get('last_changed', 'comment');
-	if ( !$last_changed ) {
-		$last_changed = time();
-		wp_cache_set('last_changed', $last_changed, 'comment');
-	}
-	$cache_key = "get_comments:$key:$last_changed";
-
-	if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) {
-		return $cache;
-	}
-
-	$post_id = absint($post_id);
-
-	if ( 'hold' == $status )
-		$approved = "comment_approved = '0'";
-	elseif ( 'approve' == $status )
-		$approved = "comment_approved = '1'";
-	elseif ( 'spam' == $status )
-		$approved = "comment_approved = 'spam'";
-	else
-		$approved = "( comment_approved = '0' OR comment_approved = '1' )";
-
-	$order = ( 'ASC' == $order ) ? 'ASC' : 'DESC';
-
-	$orderby = 'comment_date_gmt';  // Hard code for now
-
-	$number = absint($number);
-	$offset = absint($offset);
-
-	if ( !empty($number) ) {
-		if ( $offset )
-			$number = 'LIMIT ' . $offset . ',' . $number;
-		else
-			$number = 'LIMIT ' . $number;
-
-	} else {
-		$number = '';
-	}
-
-	if ( ! empty($post_id) )
-		$post_where = "comment_post_ID = $post_id AND" ;
-	else
-		$post_where = '';
-
-	$comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE $post_where $approved ORDER BY $orderby $order $number" );
-	wp_cache_add( $cache_key, $comments, 'comment' );
-
-	return $comments;
-}
-
-// Added WP2.2 wp_parse_args()
-function wp_parse_args( $args, $defaults = '' ) {
-	if ( is_object( $args ) )
-		$r = get_object_vars( $args );
-	elseif ( is_array( $args ) )
-		$r =& $args;
-	else
-		wp_parse_str( $args, $r );
-
-	if ( is_array( $defaults ) )
-		return array_merge( $defaults, $r );
-	return $r;
-}
-
-// Added WP2.2.1 wp_parse_str()
-function wp_parse_str( $string, &$array ) {
-	parse_str( $string, $array );
-	if ( get_magic_quotes_gpc() )
-		$array = stripslashes_deep( $array );
-	$array = apply_filters( 'wp_parse_str', $array );
-}
-// Added WP2.5 absint()
-function absint( $maybeint ) {
-	return abs( intval( $maybeint ) );
-}
-
-// Added WP2.7 absint()
-function locate_template($template_names, $load = false) {
-	if (!is_array($template_names))
-		return '';
-
-	$located = '';
-	foreach($template_names as $template_name) {
-		if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
-			$located = STYLESHEETPATH . '/' . $template_name;
-			break;
-		} else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
-			$located = TEMPLATEPATH . '/' . $template_name;
-			break;
-		}
-	}
-
-	if ($load && '' != $located)
-		load_template($located);
-
-	return $located;
-}
-
-// Added WP2.5 translate_with_context()
-function translate_with_context( $text, $domain = 'default' ) {
-	return before_last_bar(translate( $text, $domain ) );
-
-}
-
-// Added WP2.2 translate()
-function translate($text, $domain = 'default') {
-	global $l10n;
-
-	if (isset($l10n[$domain]))
-		return apply_filters('gettext', $l10n[$domain]->translate($text), $text, $domain);
-	else
-		return apply_filters('gettext', $text, $text, $domain);
-}
-
-// Added WP2.2 translate_with_context()
-function before_last_bar( $string ) {
-	$last_bar = strrpos( $string, '|' );
-	if ( false == $last_bar )
-		return $string;
-	else
-		return substr( $string, 0, $last_bar );
-}
-
-// Added WP2.7 post_password_required()
-function post_password_required( $post = null ) {
-	$post = get_post($post);
-
-	if ( empty($post->post_password) )
-		return false;
-
-	if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) )
-		return true;
-
-	if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password )
-		return true;
-
-	return false;
-}
-// Added WP2.7 comment_form_title()
-function comment_form_title( $noreplytext = 'Leave a Reply', $replytext = 'Leave a Reply to %s', $linktoparent = TRUE ) {
-	global $comment;
-
-	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
-
-	if ( 0 == $replytoid )
-		echo $noreplytext;
-	else {
-		$comment = get_comment($replytoid);
-		$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
-		printf( $replytext, $author );
-	}
-}
-
-// ADD WP 2.1.0
-function the_modified_date($d = '') {
-	echo apply_filters('the_modified_date', get_the_modified_date($d), $d);
-}
-
-// ADD WP 2.1.0
-function get_the_modified_date($d = '') {
-	if ( '' == $d )
-		$the_time = get_post_modified_time(get_option('date_format'));
-	else
-		$the_time = get_post_modified_time($d);
-	return apply_filters('get_the_modified_date', $the_time, $d);
-}
-
-/**
- * @ignore
- */
-function _c() {}
-
-
-?>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp_old.php
===================================================================
--- branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp_old.php	(revision 374)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp_old.php	(revision 374)
@@ -0,0 +1,315 @@
+<?php
+// wp_login override for wp2.3 under
+if ( !function_exists('wp_login') && version_compare($xoops_config->wp_version,'2.3', '<')) :
+	function wp_login($username, $password, $already_md5 = false) {
+		global $wpdb, $error;
+
+
+		if(is_object($GLOBALS["xoopsModule"]) && WP_BLOG_DIRNAME == $GLOBALS["xoopsModule"]->getVar("dirname")){
+			if(!is_object($GLOBALS["xoopsUser"])){
+				wp_clearcookie();
+				return false;
+			}
+		}			
+
+		$username = sanitize_user($username);
+
+		if ( '' == $username )
+			return false;
+
+		if ( '' == $password ) {
+			$error = __('<strong>ERROR</strong>: The password field is empty.');
+			return false;
+		}
+
+		$login = get_userdatabylogin($username);
+		//$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
+
+		if (!$login) {
+			$error = __('<strong>ERROR</strong>: Invalid username.');
+			return false;
+		} else {
+			if ($login->user_login == $username) {
+					if ($login->user_pass == $password) return true;
+					if ($login->user_pass == md5($password)) return true;
+			}
+
+			$error = __('<strong>ERROR</strong>: Incorrect password.');
+			$pwd = '';
+			return false;
+		}
+	}
+endif;
+
+// Under WP2.1
+if (version_compare($xoops_config->wp_version,'2.1', '<')) :
+	// ADD WP 2.1.0
+	function the_modified_date($d = '') {
+		echo apply_filters('the_modified_date', get_the_modified_date($d), $d);
+	}
+
+	// ADD WP 2.1.0
+	function get_the_modified_date($d = '') {
+		if ( '' == $d )
+			$the_time = get_post_modified_time(get_option('date_format'));
+		else
+			$the_time = get_post_modified_time($d);
+		return apply_filters('get_the_modified_date', $the_time, $d);
+	}
+endif;	// Under WP2.1
+
+// Under WP2.2
+if (version_compare($xoops_config->wp_version,'2.2', '<')):
+	// Added WP2.2 wp_parse_args()
+	function wp_parse_args( $args, $defaults = '' ) {
+		if ( is_object( $args ) )
+			$r = get_object_vars( $args );
+		elseif ( is_array( $args ) )
+			$r =& $args;
+		else
+			wp_parse_str( $args, $r );
+
+		if ( is_array( $defaults ) )
+			return array_merge( $defaults, $r );
+		return $r;
+	}
+	// Added WP2.2 translate()
+	function translate($text, $domain = 'default') {
+		global $l10n;
+
+		if (isset($l10n[$domain]))
+			return apply_filters('gettext', $l10n[$domain]->translate($text), $text, $domain);
+		else
+			return apply_filters('gettext', $text, $text, $domain);
+	}
+
+	// Added WP2.2 translate_with_context()
+	function before_last_bar( $string ) {
+		$last_bar = strrpos( $string, '|' );
+		if ( false == $last_bar )
+			return $string;
+		else
+			return substr( $string, 0, $last_bar );
+	}
+endif;	// Under WP2.2
+
+// Under WP2.2.1
+if (version_compare($xoops_config->wp_version,'2.2.1', '<')) :
+	// Added WP2.2.1 wp_parse_str()
+	function wp_parse_str( $string, &$array ) {
+		parse_str( $string, $array );
+		if ( get_magic_quotes_gpc() )
+			$array = stripslashes_deep( $array );
+		$array = apply_filters( 'wp_parse_str', $array );
+	}
+
+endif;	// Under WP2.2.1
+
+// Under WP2.3
+if (version_compare($xoops_config->wp_version,'2.3', '<')) :
+	if ( !function_exists('wp_sanitize_redirect') ) :
+	/**
+	 * Sanitizes a URL for use in a redirect.
+	 *
+	 * @since 2.3
+	 *
+	 * @return string redirect-sanitized URL
+	 **/
+	function wp_sanitize_redirect($location) {
+		$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
+		$location = wp_kses_no_null($location);
+
+		// remove %0d and %0a from location
+		$strip = array('%0d', '%0a');
+		$found = true;
+		while($found) {
+			$found = false;
+			foreach( (array) $strip as $val ) {
+				while(strpos($location, $val) !== false) {
+					$found = true;
+					$location = str_replace($val, '', $location);
+				}
+			}
+		}
+		return $location;
+	}
+	endif;
+	
+	if ( !function_exists('wp_sanitize_redirect') ) :
+	/**
+	 * Sanitizes a URL for use in a redirect.
+	 *
+	 * @since 2.3
+	 *
+	 * @return string redirect-sanitized URL
+	 **/
+	function wp_sanitize_redirect($location) {
+		$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
+		$location = wp_kses_no_null($location);
+
+		// remove %0d and %0a from location
+		$strip = array('%0d', '%0a');
+		$found = true;
+		while($found) {
+			$found = false;
+			foreach( (array) $strip as $val ) {
+				while(strpos($location, $val) !== false) {
+					$found = true;
+					$location = str_replace($val, '', $location);
+				}
+			}
+		}
+		return $location;
+	}
+	endif;
+
+endif;	// Under WP2.3
+
+// Under WP2.5
+if (version_compare($xoops_config->wp_version,'2.5', '<')) :
+	// Added WP2.5 absint()
+	function absint( $maybeint ) {
+		return abs( intval( $maybeint ) );
+	}
+	// Added WP2.5 translate_with_context()
+	function translate_with_context( $text, $domain = 'default' ) {
+		return before_last_bar(translate( $text, $domain ) );
+	}
+	/**
+	 * @ignore
+	 */
+	function _c() {}
+
+endif;	// Under WP2.5
+
+// Under WP2.7
+if (version_compare($xoops_config->wp_version,'2.7', '<')) :
+	// Added WP2.7 separate_comments()
+	function &separate_comments(&$comments) {
+		$comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array());
+		$count = count($comments);
+		for ( $i = 0; $i < $count; $i++ ) {
+			$type = $comments[$i]->comment_type;
+			if ( empty($type) )
+				$type = 'comment';
+			$comments_by_type[$type][] = &$comments[$i];
+			if ( 'trackback' == $type || 'pingback' == $type )
+				$comments_by_type['pings'][] = &$comments[$i];
+		}
+
+		return $comments_by_type;
+	}
+
+	// Added WP2.7 get_comments()
+	function get_comments( $args = '' ) {
+		global $wpdb;
+
+		$defaults = array('status' => '', 'orderby' => 'comment_date_gmt', 'order' => 'DESC', 'number' => '', 'offset' => '', 'post_id' => 0);
+
+		$args = wp_parse_args( $args, $defaults );
+		extract( $args, EXTR_SKIP );
+
+		// $args can be whatever, only use the args defined in defaults to compute the key
+		$key = md5( serialize( compact(array_keys($defaults)) )  );
+		$last_changed = wp_cache_get('last_changed', 'comment');
+		if ( !$last_changed ) {
+			$last_changed = time();
+			wp_cache_set('last_changed', $last_changed, 'comment');
+		}
+		$cache_key = "get_comments:$key:$last_changed";
+
+		if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) {
+			return $cache;
+		}
+
+		$post_id = absint($post_id);
+
+		if ( 'hold' == $status )
+			$approved = "comment_approved = '0'";
+		elseif ( 'approve' == $status )
+			$approved = "comment_approved = '1'";
+		elseif ( 'spam' == $status )
+			$approved = "comment_approved = 'spam'";
+		else
+			$approved = "( comment_approved = '0' OR comment_approved = '1' )";
+
+		$order = ( 'ASC' == $order ) ? 'ASC' : 'DESC';
+
+		$orderby = 'comment_date_gmt';  // Hard code for now
+
+		$number = absint($number);
+		$offset = absint($offset);
+
+		if ( !empty($number) ) {
+			if ( $offset )
+				$number = 'LIMIT ' . $offset . ',' . $number;
+			else
+				$number = 'LIMIT ' . $number;
+
+		} else {
+			$number = '';
+		}
+
+		if ( ! empty($post_id) )
+			$post_where = "comment_post_ID = $post_id AND" ;
+		else
+			$post_where = '';
+
+		$comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE $post_where $approved ORDER BY $orderby $order $number" );
+		wp_cache_add( $cache_key, $comments, 'comment' );
+
+		return $comments;
+	}
+
+	// Added WP2.7 absint()
+	function locate_template($template_names, $load = false) {
+		if (!is_array($template_names))
+			return '';
+
+		$located = '';
+		foreach($template_names as $template_name) {
+			if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
+				$located = STYLESHEETPATH . '/' . $template_name;
+				break;
+			} else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
+				$located = TEMPLATEPATH . '/' . $template_name;
+				break;
+			}
+		}
+
+		if ($load && '' != $located)
+			load_template($located);
+
+		return $located;
+	}
+	// Added WP2.7 post_password_required()
+	function post_password_required( $post = null ) {
+		$post = get_post($post);
+
+		if ( empty($post->post_password) )
+			return false;
+
+		if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) )
+			return true;
+
+		if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password )
+			return true;
+
+		return false;
+	}
+	// Added WP2.7 comment_form_title()
+	function comment_form_title( $noreplytext = 'Leave a Reply', $replytext = 'Leave a Reply to %s', $linktoparent = TRUE ) {
+		global $comment;
+
+		$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
+
+		if ( 0 == $replytoid )
+			echo $noreplytext;
+		else {
+			$comment = get_comment($replytoid);
+			$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
+			printf( $replytext, $author );
+		}
+	}
+endif;	// Under WP2.7
+?>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php	(revision 374)
@@ -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,8 +51,19 @@
 	}
 //	set_error_handler("xpress_error_handler");
-	require_once $xoops_config->xoops_mainfile_path;	// load XOOPS System
-	$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);
+//	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);
+	}
 }
 
@@ -103,5 +116,5 @@
 		$sql2 .= "WHERE ($table_term_relationships.object_id =" . $comment_post_ID.") AND ($table_term_taxonomy.taxonomy='category')";		
 	}
-	$categories = $xoops_db->get_results($sql);
+	$categories = $xoops_db->get_results($sql2);
 	foreach($categories as $categorie){
 		$cat_id = $categorie->cat_ID;
@@ -158,5 +171,5 @@
 				$sql2 .= "WHERE ($table_term_relationships.object_id =" . $post_id.") AND ($table_term_taxonomy.taxonomy='category')";		
 			}
-			$categories = $xoops_db->get_results($sql);
+			$categories = $xoops_db->get_results($sql2);
 			foreach($categories as $categorie){
 				$cat_id = $categorie->cat_ID;
@@ -171,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);
+	}
+}
 
 ?>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php	(revision 374)
@@ -250,10 +250,20 @@
 	$location = wp_sanitize_redirect($location);
 
-	if ( $is_IIS ) {
-		header("Refresh: 0;url=$location");
-	} else {
-		if ( php_sapi_name() != 'cgi-fcgi' )
-			status_header($status); // This causes problems on IIS and some FastCGI setups
-		header("Location: $location");
+	if (!headers_sent()) {
+		ob_end_clean();
+		if ( $is_IIS ) {
+			header("Refresh: 0;url=$location");
+		} else {
+			if ( php_sapi_name() != 'cgi-fcgi' )
+				status_header($status); // This causes problems on IIS and some FastCGI setups
+			header("Location: $location");
+		}
+	} else {  // force redirect 
+		echo ("<HTML>");
+		echo("<META http-equiv=\"Refresh\" content=\"0;url=$location\">");
+		echo ("<BODY onload=\"try {self.location.href='$location' } catch(e) {}\">");
+		printf(__("If the page does not automatically reload, please click <a href='%s'>here</a>","xpressme"),$location);
+		echo ("</BODY>");
+		echo ("</HTML>");
 	}
 }
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 374)
@@ -250,5 +250,5 @@
 			}
 		} else {
-			if(xpress_is_wp20()){
+			if(xpress_is_wp_version('<','2.1')){  // Maybe, I think that it is ver2.1 or less.
 				if (!empty($wp->matched_query) ){
 					if (strpos($wp->matched_query,'author_name') !== false ){
@@ -303,5 +303,5 @@
 	$query = preg_replace('/\s\s+/', ' ', $query);
 	if (!empty($_COOKIE[$author_cookie])){
-		if(xpress_is_wp20()){
+		if(xpress_is_wp_version('<','2.1')){
 			$pattern = "WHERE.*AND\s?\(*post_author\s*=";
 			if ( preg_match ( "/".$pattern."/i", $query, $match ) ){
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 374)
@@ -1,8 +1,13 @@
+# Japanese (UTF-8) translation for XPressME Plugin
+# Copyright (c) 2005-2008 XPressME
+# This file is distributed under the same license as the XPressME package.
+# toemon <info@toemon.com>
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: XPressME Plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-07-09 18:40+0900\n"
-"PO-Revision-Date: 2009-07-09 18:40+0900\n"
+"POT-Creation-Date: 2009-08-24 20:14+0900\n"
+"PO-Revision-Date: 2009-08-24 20:26+0900\n"
 "Last-Translator: toemon <info@toemon.com>\n"
 "Language-Team: toemon <info@toemon.com>\n"
@@ -18,475 +23,515 @@
 "X-Poedit-SearchPath-0: .\n"
 
-#: xpressme.php:34
+#: xpressme.php:33
 msgid "Display Settings"
 msgstr "表示設定"
 
-#: xpressme.php:35
+#: xpressme.php:34
 msgid "Integration Settings"
 msgstr "統合設定"
 
-#: xpressme.php:36
+#: xpressme.php:35
 msgid "Other Settings"
 msgstr "その他の設定"
 
-#: xpressme.php:216
+#: xpressme.php:37
+msgid "Upgrade"
+msgstr "アップグレード"
+
+#: xpressme.php:38
+msgid "to XOOPS Admin"
+msgstr "XOOPS管理へ"
+
+#: xpressme.php:138
 msgid "XPressME Display Setting"
 msgstr "XPressME 表示設定"
 
-#: xpressme.php:217
-#: xpressme.php:266
-#: xpressme.php:307
-msgid "to XOOPS Modules Admin Page"
-msgstr "XOOPSモジュール管理ページへ"
-
-#: xpressme.php:222
+#: xpressme.php:144
 msgid "Thema Sidebar Display"
 msgstr "テーマ表示時にサイドバー表示する。"
 
-#: xpressme.php:223
-#: xpressme.php:312
-#: xpressme.php:318
-#: xpressme.php:323
-#: xpressme.php:329
-#: xpressme_class.php:264
-#: xpressme_class.php:280
+#: xpressme.php:145
+#: xpressme.php:234
+#: xpressme.php:240
+#: xpressme.php:245
+#: xpressme.php:251
+#: xpressme_class.php:271
+#: xpressme_class.php:287
 msgid "YES"
 msgstr "はい"
 
-#: xpressme.php:224
-#: xpressme.php:313
-#: xpressme.php:319
-#: xpressme.php:324
-#: xpressme.php:330
-#: xpressme_class.php:265
-#: xpressme_class.php:281
+#: xpressme.php:146
+#: xpressme.php:235
+#: xpressme.php:241
+#: xpressme.php:246
+#: xpressme.php:252
+#: xpressme_class.php:272
+#: xpressme_class.php:288
 msgid "NO"
 msgstr "いいえ"
 
-#: xpressme.php:232
-#: xpressme.php:281
-#: xpressme.php:335
+#: xpressme.php:154
+#: xpressme.php:203
+#: xpressme.php:257
 msgid "Update Config"
 msgstr "更新"
 
-#: xpressme.php:233
-#: xpressme.php:282
-#: xpressme.php:336
+#: xpressme.php:155
+#: xpressme.php:204
+#: xpressme.php:258
 msgid "Preset Config"
 msgstr "プリセット"
 
-#: xpressme.php:265
+#: xpressme.php:187
 msgid "XPressME Integration Setting"
 msgstr "XPressME 統合設定"
 
-#: xpressme.php:270
+#: xpressme.php:192
 msgid "Media Upload Base Path"
 msgstr "メディアアップロードのベースパス設定"
 
-#: xpressme.php:271
+#: xpressme.php:193
 msgid "Use XOOPS UPLOAD PATH"
 msgstr "XOOPSのアップロードパスを使用する。"
 
-#: xpressme.php:272
+#: xpressme.php:194
 msgid "USE WordPress BASE_PATH"
 msgstr "WordPressのベースパスを使用する。"
 
-#: xpressme.php:306
+#: xpressme.php:228
 msgid "XPressME Other Setting"
 msgstr "XPressME その他の設定"
 
-#: xpressme.php:311
+#: xpressme.php:233
 msgid "The change tracking of the post is preserved"
 msgstr "投稿の変更履歴を有効にする。"
 
-#: xpressme.php:317
+#: xpressme.php:239
 msgid "Select Multi user mode"
 msgstr "マルチユーザーモードを選択"
 
-#: xpressme.php:322
+#: xpressme.php:244
 msgid "Is the posts author views counted?"
 msgstr "投稿者の閲覧をカウントしますか？"
 
-#: xpressme.php:328
+#: xpressme.php:250
 msgid "Is SQL debugging window displayed?"
 msgstr "SQLデバッグウィンドを表示しますか？"
 
-#: xpressme_class.php:51
-#: xpressme_class.php:220
+#: xpressme.php:274
+msgid "XPressME Upgrade"
+msgstr "XPressME アップグレード"
+
+#: xpressme.php:288
+#, php-format
+msgid "You are using a XPressME Integration Kit development version (%1$s). Cool! Please <a href=\"%2$s\">stay updated</a>."
+msgstr "お使いの XPressME Integration Kit は開発版 (%1$s) です。すばらしい ! どうぞ<a href=\"%2$s\">最新版を使い続けてください</a>。"
+
+#: xpressme.php:292
+msgid "There is a new version of XPressME Integration Kit available for upgrade"
+msgstr "新しいバージョンの XPressME Integration Kit にアップグレードが可能です"
+
+#: xpressme.php:295
+#, php-format
+msgid "You can upgrade to version %s download the package and install it manually:"
+msgstr "バージョン %s のパッケージを手動でダウンロードしてインストールすることができます。"
+
+#: xpressme.php:298
+#, php-format
+msgid "Download %s"
+msgstr "%s をダウンロード"
+
+#: xpressme.php:301
+msgid "You have the latest version of XPressME Integration Kit. You do not need to upgrade"
+msgstr "最新バージョンの XPressME Integration Kit をご利用中です。アップグレードの必要はありません。"
+
+#: xpressme.php:305
+#, php-format
+msgid "There is no response from <a href=\"%s\">version check API</a> now. sorry, please confirm it after."
+msgstr "現在、<a href=\"%s\">version check API</a>からのレスポンスがありません。　申し訳ありませんが、しばらく後で確認してください。"
+
+#: xpressme.php:398
+#, php-format
+msgid "XPressME Integration Kit Version %1$s is available! <a href=\"%2$s\">Please update now</a>."
+msgstr "XPressME Integration Kit Version %1$s が利用可能です ! <a href=\"%2$s\">アップデートしてください</a>。"
+
+#: xpressme.php:400
+#, php-format
+msgid "XPressME Integration Kit Version %1$s is available! Please notify the site administrator."
+msgstr "XPressME Integration Kit Version %1$s が利用可能です ! サイト管理者に連絡してください。"
+
+#: xpressme_class.php:52
+#: xpressme_class.php:223
 msgid "Older Post"
 msgstr "前の投稿へ"
 
-#: xpressme_class.php:52
-#: xpressme_class.php:223
+#: xpressme_class.php:53
+#: xpressme_class.php:226
 msgid "Newer Post"
 msgstr "次の投稿へ"
 
-#: xpressme_class.php:54
-#: xpressme_class.php:226
+#: xpressme_class.php:55
+#: xpressme_class.php:229
 msgid "Older Entries"
 msgstr "前ページへ"
 
-#: xpressme_class.php:55
-#: xpressme_class.php:229
+#: xpressme_class.php:56
+#: xpressme_class.php:232
 msgid "Newer Entries"
 msgstr "次ページへ"
 
-#: xpressme_class.php:69
-msgid "more"
-msgstr "続きを読む"
-
-#: xpressme_class.php:323
+#: xpressme_class.php:70
+#: xpressme_class.php:71
+#: xpressme_class.php:235
+msgid "Read the rest of this entry &raquo;"
+msgstr "この投稿の続きを読む &raquo;"
+
+#: xpressme_class.php:330
 msgid "Single Post Navi Setting"
 msgstr "シングルポストナビの設定"
 
-#: xpressme_class.php:328
-#: xpressme_class.php:373
+#: xpressme_class.php:335
+#: xpressme_class.php:380
 msgid "Adjustment of Navi link display position"
 msgstr "リンクの表示位置設定"
 
-#: xpressme_class.php:331
+#: xpressme_class.php:338
 msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right"
 msgstr "以前の記事へのリンクを左に、より新しい記事へのリンクを右に表示"
 
-#: xpressme_class.php:332
+#: xpressme_class.php:339
 msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right"
 msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示"
 
-#: xpressme_class.php:338
+#: xpressme_class.php:345
 msgid "Select Display name of PostNavi Link"
 msgstr "表示するリンクテキストを選択"
 
-#: xpressme_class.php:341
+#: xpressme_class.php:348
 msgid "Title of post"
 msgstr "投稿記事のタイトルを表示"
 
-#: xpressme_class.php:342
+#: xpressme_class.php:349
 msgid "Title of Navi"
 msgstr "ナビタイトルを表示"
 
-#: xpressme_class.php:348
+#: xpressme_class.php:355
 msgid "Display Navi Title of Old Post Link"
 msgstr "古い記事へのナビタイトルを設定"
 
-#: xpressme_class.php:355
+#: xpressme_class.php:362
 msgid "Display Navi Title of Newer Post Link"
 msgstr "より新しい記事へのナビタイトルを設定"
 
-#: xpressme_class.php:368
+#: xpressme_class.php:375
 msgid "Posts List Page Navi Setting"
 msgstr "ポストリストページナビの設定"
 
-#: xpressme_class.php:376
+#: xpressme_class.php:383
 msgid "'Old Page Link' is displayed in the left, and 'Newer Page Link' is displayed in the right"
 msgstr "古いページへのリンクを左に、より新しいページへのリンクを右に表示"
 
-#: xpressme_class.php:377
+#: xpressme_class.php:384
 msgid "'Newer Page Link' is displayed in the left, and 'Old Page Link' is displayed in the right"
 msgstr "より新しいページへのリンクを左に、古いページへのリンクを右に表示"
 
-#: xpressme_class.php:383
+#: xpressme_class.php:390
 msgid "Display Navi Title of Old Page Link"
 msgstr "古いページへのナビタイトルを設定"
 
-#: xpressme_class.php:390
+#: xpressme_class.php:397
 msgid "Display Navi Title of Newer Page Link"
 msgstr "より新しいページへのナビタイトルを設定"
 
-#: xpressme_class.php:405
+#: xpressme_class.php:412
 msgid "Role Setting at Login"
 msgstr "ログイン時の権限設定"
 
-#: xpressme_class.php:408
+#: xpressme_class.php:415
 msgid "XOOPS Groupe"
 msgstr "XOOPSグループ名"
 
-#: xpressme_class.php:408
+#: xpressme_class.php:415
 msgid "WordPress Role"
 msgstr "WordPressでの権限"
 
-#: xpressme_class.php:408
+#: xpressme_class.php:415
 msgid "Role is set at each login"
 msgstr "ログイン時、常に権限を更新する"
 
-#: xpressme_class.php:434
-#: xpressme_class.php:438
 #: xpressme_class.php:441
+#: xpressme_class.php:445
+#: xpressme_class.php:448
 msgid "Default Role of WordPress"
 msgstr "WordPressのデフォルト権限"
 
-#: xpressme_class.php:435
-#: xpressme_class.php:439
 #: xpressme_class.php:442
+#: xpressme_class.php:446
+#: xpressme_class.php:449
 msgid "Group User Doesn't Register"
 msgstr "ユーザ登録しない"
 
-#: xpressme_class.php:473
+#: xpressme_class.php:480
 msgid "WordPress MU cannot integrate the comments."
 msgstr "WordPress MUはコメント統合できません。"
 
-#: xpressme_class.php:475
+#: xpressme_class.php:482
 msgid "Do Not Comment Integration."
 msgstr "コメント統合しません。"
 
-#: xpressme_class.php:510
+#: xpressme_class.php:517
 msgid "Comment integration with D3Forum"
 msgstr "D3Forumとのコメント統合"
 
-#: xpressme_class.php:512
+#: xpressme_class.php:519
 msgid "Select the forum of D3Forum that does the comment integration from the following lists."
 msgstr "以下のリストからコメント統合をするD3Forumのフォーラムを選択してください。"
 
-#: xpressme_class.php:516
+#: xpressme_class.php:524
 msgid "Select the Type of display of D3Forum comment."
 msgstr "D3Forumの表示タイプを選択"
 
-#: xpressme_class.php:518
-#: xpressme_class.php:521
+#: xpressme_class.php:526
+#: xpressme_class.php:529
 msgid "Flat"
 msgstr "フラット"
 
-#: xpressme_class.php:519
-#: xpressme_class.php:522
+#: xpressme_class.php:527
+#: xpressme_class.php:530
 msgid "Threaded"
 msgstr "スレッド"
 
-#: xpressme_class.php:525
+#: xpressme_class.php:533
 msgid "Select the order of display of D3Forum comment."
 msgstr "D3Forumコメントの表示順を選択"
 
-#: xpressme_class.php:527
-#: xpressme_class.php:530
+#: xpressme_class.php:535
+#: xpressme_class.php:538
 msgid "DESC"
 msgstr "降順"
 
-#: xpressme_class.php:528
-#: xpressme_class.php:531
+#: xpressme_class.php:536
+#: xpressme_class.php:539
 msgid "ASC"
 msgstr "昇順"
 
-#: xpressme_class.php:534
+#: xpressme_class.php:542
 msgid "Number of displays of D3Forum comments."
 msgstr "D3Forumのコメント表示数"
 
-#: xpressme_class.php:538
+#: xpressme_class.php:545
 msgid "The import and the export between Wordpress Comments and the D3Forum Posts can be done. "
 msgstr "WordPressコメントとD3Forumポスト間の一括転送（エクスポート・インポート）"
 
-#: xpressme_class.php:539
+#: xpressme_class.php:546
 msgid "Export to D3Forum"
 msgstr "D3Forumへ一括エクスポート"
 
-#: xpressme_class.php:540
+#: xpressme_class.php:547
 msgid "Import from D3Forum"
 msgstr "D3Forumから一括インポート"
 
-#: xpressme_class.php:552
+#: xpressme_class.php:560
 msgid "Contents Excerpt Setting"
 msgstr "記事抜粋の設定"
 
-#: xpressme_class.php:557
+#: xpressme_class.php:565
 msgid "Is the excerpt display done with the archive of contents?"
 msgstr "記事のアーカイブで抜粋表示を行いますか？"
 
-#: xpressme_class.php:564
+#: xpressme_class.php:572
 msgid "When ASCII character more than the set ratio is included, it is judged ASCII contents. "
 msgstr "ASCII文字が含まれる比率が設定された値より大きい場合、ASCII文字コンテンツと判断します。"
 
-#: xpressme_class.php:571
+#: xpressme_class.php:579
 msgid "Excerpt length of word for ASCII contents"
 msgstr "ASCIIコンテンツの抜粋単語数"
 
-#: xpressme_class.php:578
+#: xpressme_class.php:586
 msgid "Excerpt length of character for multibyte contents"
 msgstr "マルチバイトコンテンツの抜粋文字数"
 
-#: xpressme_class.php:585
-msgid "More Link Text (Is not displayed for the blank.)"
-msgstr "Moreリンクテキスト（ブランクの場合リンクを表示しません。）"
-
-#: xpressme_class.php:597
+#: xpressme_class.php:593
+msgid "This text is displayed in the link that reads contents not excerpted.(Is not displayed for the blank.)"
+msgstr "抜粋されていないコンテンツを読むためのリンクに表示されるテキスト(空白の場合リンクを表示しません)"
+
+#: xpressme_class.php:600
+msgid "This text is displayed in the link that more tag (&lt;!--more--&gt;). "
+msgstr "more タグ (&lt;!--more--&gt;)のリンクに表示されるテキスト"
+
+#: xpressme_class.php:612
 msgid "Display Mode Setting"
 msgstr "表示モード設定"
 
-#: xpressme_class.php:600
+#: xpressme_class.php:615
 msgid "Select the XPressME Display Mode."
 msgstr "XPressMEの表示モードの選択"
 
-#: xpressme_class.php:605
+#: xpressme_class.php:620
 msgid "Xoops Mode"
 msgstr "XOOPSモード"
 
-#: xpressme_class.php:609
+#: xpressme_class.php:624
 msgid "WordPress Mode"
 msgstr "WordPressモード"
 
-#: xpressme_class.php:613
+#: xpressme_class.php:628
 msgid "User select"
 msgstr "ユーザによる選択"
 
-#: xpressme_class.php:623
+#: xpressme_class.php:638
 msgid "Header Meta Option"
 msgstr "ヘッダメタ　オプション"
 
-#: xpressme_class.php:628
+#: xpressme_class.php:643
 msgid "Select the Header keyword."
 msgstr "ヘッダで使用するキーワードの選択"
 
-#: xpressme_class.php:633
+#: xpressme_class.php:648
 msgid "Xoops KeyWord"
 msgstr "XOOPSのキーワード"
 
-#: xpressme_class.php:636
+#: xpressme_class.php:651
 msgid "WordPress KeyWord"
 msgstr "WordPressのキーワード"
 
-#: xpressme_class.php:639
+#: xpressme_class.php:654
 msgid "WordPress & Xoops KeyWord"
 msgstr "WordPressｊとXOOPSのキーワード"
 
-#: xpressme_class.php:645
+#: xpressme_class.php:660
 msgid "Select the Header Description."
 msgstr "ヘッダで使用するディスクリプション（説明）の選択"
 
-#: xpressme_class.php:650
+#: xpressme_class.php:665
 msgid "Xoops Description"
 msgstr "XOOPSのディスクリプション"
 
-#: xpressme_class.php:653
+#: xpressme_class.php:668
 msgid "WordPress Description"
 msgstr "WordPressのディスクリプション"
 
-#: xpressme_class.php:656
+#: xpressme_class.php:671
 msgid "WordPress & Xoops Description"
 msgstr "WordPressとXOOPSのディスクリプション"
 
-#: xpressme_class.php:662
+#: xpressme_class.php:677
 msgid "Select the Header Robots Index."
 msgstr "ヘッダで使用するロボットインデックスの選択"
 
-#: xpressme_class.php:667
+#: xpressme_class.php:682
 msgid "Xoops Robots Index"
 msgstr "XOOPSのロボットインデックス"
 
-#: xpressme_class.php:670
+#: xpressme_class.php:685
 msgid "WordPress Robots Index"
 msgstr "WordPressのロボットインデックス"
 
-#: xpressme_class.php:699
+#: xpressme_class.php:714
 #, php-format
 msgid "Unable to create directory %s. Is its parent directory writable by the server?"
 msgstr "%s ディレクトリーが作成できません。サーバーの親ディレクトリー書き込み権限があるか確認くださいr?"
 
-#: include/custom_functions.php:75
+#: include/custom_functions.php:74
 #, php-format
 msgid "Permanent Link to %s"
 msgstr "%sのパーマリンク"
 
-#: include/custom_functions.php:430
-#: include/custom_functions.php:455
+#: include/custom_functions.php:429
+#: include/custom_functions.php:454
 #, php-format
 msgid "views :%d"
 msgstr "閲覧数 :%d"
 
-#: include/custom_functions.php:609
+#: include/custom_functions.php:608
 msgid "Main"
 msgstr "メイン"
 
-#: include/custom_functions.php:612
+#: include/custom_functions.php:611
 #, php-format
 msgid "Archive for the &#8216;%s&#8217; Category"
 msgstr "カテゴリー &#8216;%s&#8217; のアーカイブ"
 
-#: include/custom_functions.php:615
+#: include/custom_functions.php:614
 #, php-format
 msgid "Posts Tagged &#8216;%s&#8217;"
 msgstr "&#8216;%s&#8217; タグのついている投稿"
 
-#: include/custom_functions.php:618
+#: include/custom_functions.php:617
 #, php-format
 msgid "Archive for %s|Daily archive page"
 msgstr "%sの日別アーカイブ"
 
-#: include/custom_functions.php:618
+#: include/custom_functions.php:617
 msgid "F jS, Y"
 msgstr "Y年n月j日"
 
-#: include/custom_functions.php:620
+#: include/custom_functions.php:619
 #, php-format
 msgid "Archive for %s|Monthly archive page"
 msgstr "%sの月別アーカイブ"
 
-#: include/custom_functions.php:620
+#: include/custom_functions.php:619
 msgid "F, Y"
 msgstr "Y年n月"
 
-#: include/custom_functions.php:622
+#: include/custom_functions.php:621
 #, php-format
 msgid "Archive for %s|Yearly archive page"
 msgstr "%sの年別アーカイブ "
 
-#: include/custom_functions.php:622
+#: include/custom_functions.php:621
 msgid "Y"
 msgstr "Y年"
 
-#: include/custom_functions.php:625
+#: include/custom_functions.php:624
 #, php-format
 msgid "Archive for the &#8216;%s&#8217; Author"
 msgstr "投稿者 &#8216;%s&#8217; のアーカイブ"
 
-#: include/custom_functions.php:628
+#: include/custom_functions.php:627
 #, php-format
 msgid "Search Results of word &#8216;%s&#8217;"
 msgstr "&#8216;%s&#8217; の検索結果"
 
-#: include/custom_functions.php:634
-#: include/custom_functions.php:636
+#: include/custom_functions.php:633
+#: include/custom_functions.php:635
 #, php-format
 msgid "Article of %s"
 msgstr "%sの記事"
 
-#: include/custom_functions.php:658
+#: include/custom_functions.php:657
 #, php-format
 msgid "From %1$s on site %2$s"
 msgstr "サイト %2$s の %1$s より"
 
-#: include/custom_functions.php:679
+#: include/custom_functions.php:678
 msgid "No Trackback/Pingback"
 msgstr "トラックバック・ピンバックはありません"
 
-#: include/custom_functions.php:680
+#: include/custom_functions.php:679
 msgid "One Trackback/Pingback"
 msgstr "トラックバック・ピンバック 1 件"
 
-#: include/custom_functions.php:681
+#: include/custom_functions.php:680
 msgid "% TrackBack/Pingback"
 msgstr "トラックバック・ピンバック % 件"
 
-#: include/custom_functions.php:832
-msgid "Calendar"
-msgstr "カレンダー"
-
-#: include/custom_functions.php:833
-#, php-format
-msgid "%1$s %2$s|Used as a calendar caption"
-msgstr "%2$s 年 %1$s|カレンダーのキャプションに使われます"
-
-#: include/custom_functions.php:865
-#: include/custom_functions.php:875
-#, php-format
-msgid "View posts for %1$s %2$s"
-msgstr "%2$s年%1$sの投稿を表示"
-
-#: include/functions_for_wp20.php:21
+#: include/functions_for_wp_old.php:21
 msgid "<strong>ERROR</strong>: The password field is empty."
 msgstr "<strong>エラー</strong>: パスワードが入力されていません."
 
-#: include/functions_for_wp20.php:29
+#: include/functions_for_wp_old.php:29
 msgid "<strong>ERROR</strong>: Invalid username."
 msgstr "<strong>エラー</strong>: ユーザ名が異なっています."
 
-#: include/functions_for_wp20.php:37
+#: include/functions_for_wp_old.php:37
 msgid "<strong>ERROR</strong>: Incorrect password."
 msgstr "<strong>エラー</strong>: パスワードが異なっています."
+
+#: include/pluggable-override.php:265
+#, php-format
+msgid "If the page does not automatically reload, please click <a href='%s'>here</a>"
+msgstr "自動的にページが読み込まれない場合は<a href='%s'>こちら</a>をクリックしてください。"
 
 #: include/xpress_common_functions.php:202
@@ -503,7 +548,15 @@
 msgstr "WordPressモードへ切替"
 
+#~ msgid "more"
+#~ msgstr "続きを読む"
+#~ msgid "More Link Text (Is not displayed for the blank.)"
+#~ msgstr "Moreリンクテキスト（ブランクの場合リンクを表示しません。）"
+#~ msgid "Calendar"
+#~ msgstr "カレンダー"
+#~ msgid "%1$s %2$s|Used as a calendar caption"
+#~ msgstr "%2$s 年 %1$s|カレンダーのキャプションに使われます"
+#~ msgid "View posts for %1$s %2$s"
+#~ msgstr "%2$s年%1$sの投稿を表示"
 #~ msgid "XPressME Configuration Page"
 #~ msgstr "XPressMEの設定ページ"
-#~ msgid "XPressME"
-#~ msgstr "XPressME"
-
+
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php	(revision 374)
@@ -20,6 +20,5 @@
 
 require_once dirname( __FILE__ ).'/include/pluggable-override.php' ;
-if ($xoops_config->is_wp20)
-	require_once dirname( __FILE__ ).'/include/functions_for_wp20.php' ;
+require_once dirname( __FILE__ ).'/include/functions_for_wp_old.php' ;
 
 function my_plugin_menu()
@@ -35,5 +34,7 @@
 	add_submenu_page(__FILE__, __('Integration Settings', 'xpressme'), __('Integration Settings', 'xpressme'), 8, 'integration_option_page', 'integration_option_page');
 	add_submenu_page(__FILE__, __('Other Settings', 'xpressme'), __('Other Settings', 'xpressme'), 8, 'other_option_page', 'other_option_page');
-//	add_submenu_page(__FILE__, __('XPressME Settings', 'xpressme'), __('XPressME Settings', 'xpressme'), 8,  'option_page', 'option_page');
+//	if (function_exists('wp_remote_get'))
+		add_submenu_page(__FILE__, __('Upgrade', 'xpressme'), __('Upgrade', 'xpressme'), 8, 'upgrade_page', 'upgrade_page');
+	add_submenu_page(__FILE__, __('to XOOPS Admin', 'xpressme'), __('to XOOPS Admin', 'xpressme'), 8,  'redirect_xoops_admin', 'redirect_xoops_admin');
 }
 add_action('admin_menu', 'my_plugin_menu');
@@ -98,5 +99,5 @@
 add_filter('query','xpress_query_filter');
 //add_action("init", "xpress_set_author_cookie");
-if(xpress_is_wp20()){
+if(xpress_is_wp_version('<','2.1')){
 	// It is called before parse_request() makes $GET. 
 	add_action("query_vars", "xpress_set_author_cookie");
@@ -111,4 +112,10 @@
 add_action('wp_footer', array(&$xpress_config, 'displayDebugLog'));
 
+function redirect_xoops_admin()
+{
+	global $xoops_config,$xpress_config;
+	$xoops_admin_url = $xoops_config->module_url . '/admin/index.php';
+	wp_redirect($xoops_admin_url);
+}
 
 function display_option_page()
@@ -130,5 +137,5 @@
 		echo		'<div id="icon-options-general" class="icon32"><br /></div>'."\n";
 		echo		'<h2>' . __('XPressME Display Setting', 'xpressme') . "</h2><br>\n";
-		echo 		'<div align="right"><a href="' . $xoops_admin_url . '"><h3>'. __('to XOOPS Modules Admin Page', 'xpressme') . '</h3></a></div>';
+//		echo 		'<div align="right"><a href="' . $xoops_admin_url . '"><h3>'. __('to XOOPS Modules Admin Page', 'xpressme') . '</h3></a></div>';
 		echo		'<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">'."\n" ;
 		echo			'<table class="form-table">'."\n";
@@ -179,5 +186,5 @@
 		echo		'<div id="icon-options-general" class="icon32"><br /></div>'."\n";
 		echo		'<h2>' . __('XPressME Integration Setting', 'xpressme') . "</h2><br>\n";
-		echo 		'<div align="right"><a href="' . $xoops_admin_url . '"><h3>'. __('to XOOPS Modules Admin Page', 'xpressme') . '</h3></a></div>';
+//		echo 		'<div align="right"><a href="' . $xoops_admin_url . '"><h3>'. __('to XOOPS Modules Admin Page', 'xpressme') . '</h3></a></div>';
 		echo		'<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">'."\n" ;
 		echo			'<table class="form-table">'."\n";
@@ -220,5 +227,5 @@
 		echo		'<div id="icon-options-general" class="icon32"><br /></div>'."\n";
 		echo		'<h2>' . __('XPressME Other Setting', 'xpressme') . "</h2><br>\n";
-		echo 		'<div align="right"><a href="' . $xoops_admin_url . '"><h3>'. __('to XOOPS Modules Admin Page', 'xpressme') . '</h3></a></div>';
+//		echo 		'<div align="right"><a href="' . $xoops_admin_url . '"><h3>'. __('to XOOPS Modules Admin Page', 'xpressme') . '</h3></a></div>';
 		echo		'<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">'."\n" ;
 		echo			'<table class="form-table">'."\n";
@@ -256,3 +263,172 @@
 }
 
+function upgrade_page()
+{
+	global $xoops_config,$xpress_config;
+	
+	$xpress_version = $xoops_config->module_version . $xoops_config->module_codename;
+	$check_url = "http://ja1.xpressme.info/version_check/?version=$xpress_version";
+
+	echo	'<div class="wrap">'."\n";
+	echo		'<div id="icon-options-general" class="icon32"><br /></div>'."\n";
+	echo		'<h2>' . __('XPressME Upgrade', 'xpressme') . "</h2><br>\n";
+	
+	if(get_xpress_latest_version()){
+		$latest = get_option('xpressme_latest_version');
+		if ($latest) {
+			$site_url=$latest['url'];
+			$package=$latest['package'];
+			$latest_version=$latest['latest_version'];
+			$check_time=$latest['check_time'];
+		}
+
+
+		if (version_compare($xpress_version, $latest_version, '>')){
+				echo '<h3 class="response">';
+				printf(__('You are using a XPressME Integration Kit development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.', 'xpressme') , $xpress_version , $site_url);
+				echo '</h3>';
+
+		} else if (version_compare($xpress_version, $latest_version, '<')) {
+			echo	'<h3 class="response">'. __('There is a new version of XPressME Integration Kit available for upgrade', 'xpressme') . '</h3>';
+			echo '<p>';
+	//		printf(__('You can upgrade to version %s automatically or download the package and install it manually:'),$latest_version);
+			printf(__('You can upgrade to version %s download the package and install it manually:', 'xpressme'),$latest_version);
+			echo '</p>';
+			echo '<a class="button" href="' . $package . '">';
+			printf(__('Download %s', 'xpressme') , $latest_version);
+			echo '</a>';
+		} else {
+			echo	'<h3 class="response">'. __('You have the latest version of XPressME Integration Kit. You do not need to upgrade', 'xpressme') . '</h3>';
+		}
+	} else {
+		echo '<h3 class="response">';
+		printf(__('There is no response from <a href="%s">version check API</a> now. sorry, please confirm it after.', 'xpressme'),$check_url);
+		echo	"</div>\n";
+	}
+}
+
+function xp_remote_get($url, $headers = ""){
+	global $xoops_config;
+	$xpress_version = $xoops_config->module_version . $xoops_config->module_codename;
+
+	require_once( $xoops_config->module_path . '/wp-includes/class-snoopy.php');
+
+	// Snoopy is an HTTP client in PHP
+	$client = new Snoopy();
+	$client->agent = 'XPressME/' . $xpress_version;
+	$client->read_timeout = 2;
+	if (is_array($headers) ) {
+		$client->rawheaders = $headers;
+	}
+
+	@$client->fetch($url);
+	$response['response']['code'] = $client->status;
+	$response['body'] = $client->results;
+	return $response;
+	return $client;
+
+}
+
+function get_xpress_latest_version(){
+	global $wp_version, $wpdb, $wp_local_package;
+	global $xoops_config;
+	
+	$xpress_version = $xoops_config->module_version . $xoops_config->module_codename;
+
+	$check_url = "http://ja.xpressme.info/version_check/?version=$xpress_version";
+	$request_options = array(
+	'timeout' => 3,
+	'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
+	);
+
+	if (! function_exists('wp_remote_get')) {
+		$response = xp_remote_get($check_url);
+		
+		if (empty($response['body'])) return false;
+	} else {
+	
+		$response = wp_remote_get($check_url, $request_options);
+		
+		if ( is_wp_error( $response ) )
+			return false;
+	}
+	if ( 200 != $response['response']['code'] )
+		return false;
+	$body = trim( $response['body'] );
+	$body = str_replace(array("\r\n", "\r"), "\n", $body);
+	$returns = explode("\n", $body);
+	$response = $returns[0];
+	if ( isset( $returns[1] ) )
+		$url = clean_url( $returns[1] );
+	if ( isset( $returns[2] ) )
+		$package = clean_url( $returns[2] );
+	if ( isset( $returns[3] ) )
+		$latest_version = $returns[3];
+
+	$write_options = array (
+		'url' => $url ,
+		'package' => $package ,
+		'latest_version' => $latest_version ,
+		'check_time' => time()
+	);
+	
+	$latest_version = get_option('xpressme_latest_version');
+	if (!$latest_version) {
+		add_option('xpressme_latest_version', $write_options);
+	} else {
+		update_option('xpressme_latest_version', $write_options);
+	}
+	return true;
+}
+
+function xpress_update_check() {
+	if ( defined('WP_INSTALLING') )
+		return;
+	global $pagenow;
+
+	$php_query_string = $_SERVER['QUERY_STRING'];
+
+	if ( 'admin.php' == $pagenow && 'page=upgrade_page' == $php_query_string)
+		return;
+
+	global $wp_version, $wpdb, $wp_local_package;
+	global $xoops_config;
+
+	$php_query_string = $_SERVER['QUERY_STRING'];
+	$xpress_version = $xoops_config->module_version . $xoops_config->module_codename;
+
+	$latest = get_option('xpressme_latest_version');
+	if (!$latest ) {
+		get_xpress_latest_version();
+		$latest = get_option('xpressme_latest_version');
+	}
+
+	if ($latest) {
+		$next_check = $latest['check_time'] + (60*60*24);
+		$now_time = time();
+		if ($next_check < $now_time ){
+			get_xpress_latest_version();
+			$latest = get_option('xpressme_latest_version');
+		}
+	}
+
+	if ($latest) {
+		$url=$latest['url'];
+		$package=$latest['package'];
+		$latest_version=$latest['latest_version'];
+		$check_time=$latest['check_time'];
+		$upgrade_page = $xoops_config->module_url . "/wp-admin/admin.php?page=upgrade_page";
+
+		if (version_compare($xpress_version, $latest_version, '<')) {
+			if ( current_user_can('manage_options') ){
+				$msg = sprintf( __('XPressME Integration Kit Version %1$s is available! <a href="%2$s">Please update now</a>.', 'xpressme'), $latest_version, $upgrade_page );
+			} else {
+				$msg = sprintf( __('XPressME Integration Kit Version %1$s is available! Please notify the site administrator.', 'xpressme'), $latest_version );
+			}
+			echo "<div id='update-nag'>$msg </div>";
+		}
+	}
+}
+
+add_action( 'admin_notices', 'xpress_update_check', 3 );
 ?>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 374)
@@ -26,4 +26,5 @@
 	var $excerpt_length_word;
 	var $excerpt_length_character;
+	var $excerpt_more_link_text;
 	var $more_link_text;
 	var $viewer_type;
@@ -67,5 +68,6 @@
 		$this->excerpt_length_word = 40;
 		$this->excerpt_length_character = 120;
-		$this->more_link_text = __('more', 'xpressme');
+		$this->excerpt_more_link_text = __('Read the rest of this entry &raquo;', 'xpressme');
+		$this->more_link_text = __('Read the rest of this entry &raquo;', 'xpressme');
 		$this->viewer_type = 'xoops';
 		$this->is_multi_user = false;
@@ -118,4 +120,5 @@
 			'excerpt_length_word' => $this->excerpt_length_word,
 			'excerpt_length_character' => $this->excerpt_length_character,
+			'excerpt_more_link_text' => $this->excerpt_more_link_text,
 			'more_link_text' => $this->more_link_text,
 			'viewer_type' => $this->viewer_type,
@@ -229,4 +232,8 @@
 								$set_value = __('Newer Entries', 'xpressme');
 								break;
+							case 'excerpt_more_link_text':
+								$set_value = __('Read the rest of this entry &raquo;', 'xpressme');
+								break;
+								
 							default:
 						}
@@ -584,5 +591,12 @@
 
 		$form .= "<tr>\n";
-		$form .= "<td>" . __('More Link Text (Is not displayed for the blank.)','xpressme') . "</td>\n";		
+		$form .= "<td>" . __('This text is displayed in the link that reads contents not excerpted.(Is not displayed for the blank.)','xpressme') . "</td>\n";		
+		$form .= "<td>\n";
+		$form .=  $this->text_option_sub('excerpt_more_link_text');
+		$form .= "</td>\n";
+		$form .= "</tr>\n";
+
+		$form .= "<tr>\n";
+		$form .= "<td>" . __('This text is displayed in the link that more tag (&lt;!--more--&gt;). ','xpressme') . "</td>\n";		
 		$form .= "<td>\n";
 		$form .=  $this->text_option_sub('more_link_text');
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/authors_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/authors_block_theme.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/authors_block_theme.php	(revision 374)
@@ -10,5 +10,5 @@
 	$mydirpath = get_xpress_dir_path();
 	
-	if(xpress_is_wp20() ){
+	if(xpress_is_wp_version('<','2.3') ){
 		$param_str = 'optioncount='. $optioncount . '&exclude_admin=' . $exclude_admin .'&show_fullname='. $show_fullname . '&hide_empty=' . $hide_empty;
 		ob_start();
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php	(revision 374)
@@ -38,5 +38,12 @@
 			'depth' => $depth
 		);
-		$block['categories'] = wp_list_categories($param);
+		if ( xpress_is_wp_version('>=','2.3') ) {
+			$block['categories'] = wp_list_categories($param);
+		} else {	// not suport echo flag
+			ob_start();
+			wp_list_categories($param);
+			$block['categories'] = ob_get_contents();
+			ob_end_clean();
+		}
 	} else {
 		if (empty($show_option_all))
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/meta_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/meta_block_theme.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/meta_block_theme.php	(revision 374)
@@ -35,5 +35,5 @@
 		if ($post_new){
 			if($Now_user_level > 0){
-				if (xpress_is_wp20()){
+				if (xpress_is_wp_version('<','2.1') ){
 					$output .=
 					'<li>'.
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php	(revision 374)
@@ -22,5 +22,5 @@
 	if ($show_date == 'none' ) $show_date = '';
 	
-	if (!xpress_is_wp20()){
+	if (xpress_is_wp_version('>=','2.2')){
 		$parm = array(
 	    	'sort_column'	=> $sort_column, 
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php	(revision 374)
@@ -46,5 +46,5 @@
 		$comment_sql  = "SELECT comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_content, comment_type,UNIX_TIMESTAMP(comment_date) as comment_unix_time ";
 		$comment_sql .= "FROM $wpdb->comments LEFT JOIN $wpdb->posts ON  $wpdb->posts.ID = $wpdb->comments.comment_post_ID ";
-		if (xpress_is_wp20()){
+		if (xpress_is_wp_version('<','2.1')){
 			$comment_sql .= "WHERE comment_approved = '1' AND post_status = 'publish' $type_select ";
 		} else {
@@ -60,9 +60,5 @@
 				$comment_content = $comment->comment_content;
 				$comment_excerpt = ($disp_length>0 ? xpress_substr($comment_content, 0, $disp_length): $comment->comment_content);
-				if (xpress_is_wp20()){
-					$comment_link = get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID ;
-				} else {
-					$comment_link = get_comment_link($comment->comment_ID);
-				}
+				$comment_link = get_comment_link($comment->comment_ID);
 				$comment_title = $comment_excerpt;
 				$comment_title_link = "<a href='$comment_link' rel='external nofollow' class='url'>$comment_title</a>";
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/comments.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/comments.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/comments.php	(revision 374)
@@ -12,5 +12,5 @@
 
 <!-- You can start editing here. -->
-<?php if (! xpress_is_wp20() ) : ?>
+<?php if ( xpress_is_wp_version('>=','2.7')) : ?>
 	<?php if ( have_comments() ) : ?>
 		<?php if ( ! empty($comments_by_type['comment']) ) : ?>
@@ -34,5 +34,5 @@
 		<?php endif; ?>
 	<?php endif; ?>
-<?php else : // is WordPress2.0 ?>
+<?php else : // is version 2.7 under?>
 	<?php if ( $comments ) : ?>
 		<h3 id="xpress_comments"><?php comments_number(__('No Responses', 'xpress'), __('One Response', 'xpress'), __('% Responses', 'xpress'));?> <?php printf(__('to &#8220;%s&#8221;', 'xpress'), the_title('', '', false)); ?></h3>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/index.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/index.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/index.php	(revision 374)
@@ -34,5 +34,5 @@
 					</div>
 					<div class="xpress-post-entry">
-						<?php xpress_the_content('more_link_text=' . __('Read the rest of this entry &raquo;', 'xpress') ); ?>
+						<?php xpress_the_content(); ?>
 					</div>
 					<div class="xpress-link-pages"><?php wp_link_pages() ?></div>
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/ja.po
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/ja.po	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/ja.po	(revision 374)
@@ -1,16 +1,8 @@
-# WordPress 用日本語リソース (UTF-8) 
-# Japanese (UTF-8) translation for WordPress
+# Japanese (UTF-8) translation for XPressME Default Themes
+# Copyright (c) 2005-2008 XPressME
+# This file is distributed under the same license as the XPressME package.
+# toemon <info@toemon.com>
 #
-# Copyright (c) 2005-2008
-# このファイルは WordPress 本体と同じライセンスのもと配布されています。
-# This file is distributed under the same license as the WordPress package.
-#
-# WordPress 日本語版作成チーム / WP ja translation team
-# <http://groups.google.com/group/wp-ja-pkg/web/members>
-#
-#  誤字脱字誤訳、あるいはよりよい訳などありましたら以下までぜひお知らせください。
-#  また、翻訳、校正、コミットをお手伝いしていただける方も随時募集中です。
-#  連絡先 / Contact: wpja.team@gmail.com (件名か内容に「日本語リソース」と入れてください)
-#
+#, fuzzy
 msgid ""
 msgstr ""
Index: branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/single.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/single.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/wp-content/themes/xpress_default/single.php	(revision 374)
@@ -66,5 +66,5 @@
 					<div id ="xpress-comments-block">
 						<?php
-							if (xpress_is_wp20() )
+							if ( xpress_is_wp_version('<','2.7') )
 								comments_template();
 							else
Index: branches/Ver2.1/xpressme_integration_kit/xoops_version.php
===================================================================
--- trunk/xpressme_integration_kit/xoops_version.php	(revision 339)
+++ branches/Ver2.1/xpressme_integration_kit/xoops_version.php	(revision 374)
@@ -13,4 +13,11 @@
 if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
 
+if (!function_exists('wp_version_compare')){
+	function wp_version_compare($wp_version , $operator='==',$comp_version){
+		$inc_wp_version = str_replace("ME", "", $wp_version);
+	 	return version_compare($inc_wp_version, $comp_version, $operator);
+	}
+}
+
 $mydirpath = dirname(__FILE__);
 $mydirname = basename($mydirpath);
@@ -40,5 +47,5 @@
 
 // status
-$modversion['codename'] = "Bata-8(r337)";
+$modversion['codename'] = "";
 
 // onInstall, onUpdate, onUninstall
@@ -81,5 +88,5 @@
 	if (@$current_user->user_level > 0) {
 	$modversion['sub'][1]['name'] = constant( '_MI_XP2_MENU_POST_NEW');
-	if ($wp_db_version > 5000)
+	if (wp_version_compare($wp_version, '>=','2.1'))
 		$modversion['sub'][1]['url'] = "wp-admin/post-new.php";
 	else
@@ -237,14 +244,16 @@
 );
 $b_no++;
-$modversion['blocks'][$b_no] = array(
-	'file' 			=> 'tag_cloud_block.php' ,
-	'name' 			=> constant('_MI_XP2_BLOCK_TAG') ,
-	'description'	=> '' ,
-	'show_func' 	=> "b_". $mydirname . "_tag_cloud_show" ,
-	'edit_func' 	=> "b_". $mydirname . "_tag_cloud_edit" ,
-	'options'		=> $mydirname. '||8|22|pt|45|flat|name|ASC||' ,
-	'can_clone'		=> false ,
-	'func_num'		=> $b_no,	
-);
+if (wp_version_compare($wp_version, '>=','2.3')){
+	$modversion['blocks'][$b_no] = array(
+		'file' 			=> 'tag_cloud_block.php' ,
+		'name' 			=> constant('_MI_XP2_BLOCK_TAG') ,
+		'description'	=> '' ,
+		'show_func' 	=> "b_". $mydirname . "_tag_cloud_show" ,
+		'edit_func' 	=> "b_". $mydirname . "_tag_cloud_edit" ,
+		'options'		=> $mydirname. '||8|22|pt|45|flat|name|ASC||' ,
+		'can_clone'		=> false ,
+		'func_num'		=> $b_no,	
+	);
+}
 $b_no++;
 $modversion['blocks'][$b_no] = array(
@@ -270,14 +279,16 @@
 );
 $b_no++;
-$modversion['blocks'][$b_no] = array(
-	'file' 			=> 'widget_block.php' ,
-	'name' 			=> constant('_MI_XP2_BLOCK_WIDGET') ,
-	'description'	=> '' ,
-	'show_func' 	=> "b_". $mydirname . "_widget_show" ,
-	'edit_func' 	=> "b_". $mydirname . "_widget_edit" ,
-	'options'		=> $mydirname. '||1|' ,
-	'can_clone'		=> true ,
-	'func_num'		=> $b_no,	
-);
+if (wp_version_compare($wp_version, '>=','2.7')){
+	$modversion['blocks'][$b_no] = array(
+		'file' 			=> 'widget_block.php' ,
+		'name' 			=> constant('_MI_XP2_BLOCK_WIDGET') ,
+		'description'	=> '' ,
+		'show_func' 	=> "b_". $mydirname . "_widget_show" ,
+		'edit_func' 	=> "b_". $mydirname . "_widget_edit" ,
+		'options'		=> $mydirname. '||1|' ,
+		'can_clone'		=> true ,
+		'func_num'		=> $b_no,	
+	);
+}
 $b_no++;
 $modversion['blocks'][$b_no] = array(
