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 338)
+++ 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 338)
+++ 	(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 338)
+++ 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 338)
+++ 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 338)
+++ 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 338)
+++ 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 338)
+++ 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 338)
+++ 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');
