Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 232)
@@ -1,4 +1,4 @@
 <?php
-function xpress_the_title($show = false)
+function xpress_the_title($show = true)
 {
 	$output = '<div class ="xpress-post-header">' . "\n";
@@ -35,4 +35,10 @@
 }
 
+function xpress_is_wpmu() {
+	global $xoops_config;
+	
+	return $xoops_config->is_wpmu;
+}
+
 function xpress_selected_author($show=true ) {
 	$output = '';
@@ -80,17 +86,23 @@
 }
 	
-function xpress_credit($show = false)
+function xpress_credit($show = true)
 {
 	global $wp_version , $xoops_config;
+	if ($xoops_config->is_wpmu) {
+		global $wpmu_version;
+	}
 	
 	$xpress_version = $xoops_config->module_version;
 	$xpress_codename = $xoops_config->module_codename;
-	$ret = '<a href="http://www.toemon.com"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>';
-	if (strstr($wp_version,'ME')){
-		$ret .= '(included <a href="http://wpme.sourceforge.jp/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)';
-	} else {
-		$ret .= '(included <a href="http://ja.wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)';
-	}
-
+	$ret = '<a href="http://ja.xpressme.info"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>';
+	if ($xoops_config->is_wpmu) {
+		$ret .= '(included <a href="http://mu.wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress MU ' . $wpmu_version . '</a>)';
+	} else {
+		if (strstr($wp_version,'ME')){
+			$ret .= '(included <a href="http://wpme.sourceforge.jp/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)';
+		} else {
+			$ret .= '(included <a href="http://wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)';
+		}
+	}
 	if (empty($show))
 		return $ret;
@@ -99,5 +111,5 @@
 }
 
-function xpress_convert_time($show = false)
+function xpress_convert_time($show = true)
 {
 	$ret =  timer_stop(0) .'sec. ';
@@ -114,5 +126,5 @@
 }	
 
-function xpress_left_arrow_post_link($show = false)
+function xpress_left_arrow_post_link($show = true)
 {
 	global $xpress_config;
@@ -139,5 +151,5 @@
 			next_post_link('&laquo; %link');
 		else
-		$GLOBALS['left_arrow_post_link'] = 
+			next_post_link('&laquo; %link',$link_title);
 		$ret = ob_get_contents();
 		ob_end_clean();
@@ -175,5 +187,5 @@
 }
 
-function xpress_right_arrow_post_link($show = false)
+function xpress_right_arrow_post_link($show = true)
 {
 	global $xpress_config;
@@ -236,5 +248,5 @@
 }
 // page link
-function xpress_left_arrow_posts_link($show = false)
+function xpress_left_arrow_posts_link($show = true)
 {
 	global $xpress_config;
@@ -261,5 +273,5 @@
 }
 
-function xpress_right_arrow_posts_link($show = false)
+function xpress_right_arrow_posts_link($show = true)
 {
 	global $xpress_config;
@@ -486,5 +498,5 @@
 }
 
-function xpress_pings_list($show = false){
+function xpress_pings_list($show = true){
 	
 	$trackbacks = xpress_get_pings();
@@ -535,9 +547,9 @@
 	/** @todo Use API instead of SELECTs. */
 	if ( $user_ID) {
-		$trackbacks = $wpdb->get_results(sprintf("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) ) AND ( comment_type = 'trackback' OR comment_type = 'pingback' ) ORDER BY comment_date", $post->ID, $user_ID));
+		$trackbacks = $wpdb->get_results(sprintf("SELECT * , UNIX_TIMESTAMP(comment_date) AS comment_timestamp ,UNIX_TIMESTAMP(comment_date_gmt) AS comment_timestamp_gmt FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) ) AND ( comment_type = 'trackback' OR comment_type = 'pingback' ) ORDER BY comment_date", $post->ID, $user_ID));
 	} else if ( empty($trackback_author) ) {
-		$trackbacks = $wpdb->get_results(sprintf("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND ( comment_type = 'trackback' OR comment_type = 'pingback' ) ORDER BY comment_date", $post->ID));
-	} else {
-		$trackbacks = $wpdb->get_results(sprintf("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) AND ( comment_type = 'trackback' OR comment_type = 'pingback' ) ORDER BY comment_date", $post->ID, $trackback_author, $trackback_author_email));
+		$trackbacks = $wpdb->get_results(sprintf("SELECT * , UNIX_TIMESTAMP(comment_date) AS comment_timestamp ,UNIX_TIMESTAMP(comment_date_gmt) AS comment_timestamp_gmt FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND ( comment_type = 'trackback' OR comment_type = 'pingback' ) ORDER BY comment_date", $post->ID));
+	} else {
+		$trackbacks = $wpdb->get_results(sprintf("SELECT * , UNIX_TIMESTAMP(comment_date) AS comment_timestamp ,UNIX_TIMESTAMP(comment_date_gmt) AS comment_timestamp_gmt FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) AND ( comment_type = 'trackback' OR comment_type = 'pingback' ) ORDER BY comment_date", $post->ID, $trackback_author, $trackback_author_email));
 	}
 
@@ -561,6 +573,6 @@
 				'title' => $title ,
 				'content' => $content ,
-				'date'		=> $trackback->comment_date ,
-				'date_gmt'		=> $trackback->comment_date_gmt ,
+				'date'		=> $trackback->comment_timestamp ,
+				'date_gmt'		=> $trackback->comment_timestamp_gmt ,
 				'agent'		=> $trackback->comment_agent ,
 				'type'		=> $trackback->comment_type ,
@@ -573,3 +585,198 @@
 			return false;
 }
+
+function get_xpress_calendar($sun_color = '#DB0000' ,$sat_color = '#004D99' ,$initial = true) {
+	global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
+
+
+
+	ob_start();
+	// Quick check. If we have no posts at all, abort!
+	if ( !$posts ) {
+		$gotsome = $wpdb->get_var("SELECT ID from $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1");
+		if ( !$gotsome )
+			return;
+	}
+
+	if ( isset($_GET['w']) )
+		$w = ''.intval($_GET['w']);
+
+	// week_begins = 0 stands for Sunday
+	$week_begins = intval(get_option('start_of_week'));
+
+	// Let's figure out when we are
+	if ( !empty($monthnum) && !empty($year) ) {
+		$thismonth = ''.zeroise(intval($monthnum), 2);
+		$thisyear = ''.intval($year);
+	} elseif ( !empty($w) ) {
+		// We need to get the month from MySQL
+		$thisyear = ''.intval(substr($m, 0, 4));
+		$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
+		$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
+	} elseif ( !empty($m) ) {
+		$thisyear = ''.intval(substr($m, 0, 4));
+		if ( strlen($m) < 6 )
+				$thismonth = '01';
+		else
+				$thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2);
+	} else {
+		$thisyear = gmdate('Y', current_time('timestamp'));
+		$thismonth = gmdate('m', current_time('timestamp'));
+	}
+
+	$unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);
+
+	// Get the next and previous month and year with at least one post
+	$previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
+		FROM $wpdb->posts
+		WHERE post_date < '$thisyear-$thismonth-01'
+		AND post_type = 'post' AND post_status = 'publish'
+			ORDER BY post_date DESC
+			LIMIT 1");
+	$next = $wpdb->get_row("SELECT	DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
+		FROM $wpdb->posts
+		WHERE post_date >	'$thisyear-$thismonth-01'
+		AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
+		AND post_type = 'post' AND post_status = 'publish'
+			ORDER	BY post_date ASC
+			LIMIT 1");
+
+	echo '<table  summary="' . __('Calendar') . '">
+	<caption>' . sprintf(_c('%1$s %2$s|Used as a calendar caption'), $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>
+	<thead>
+	<tr>';
+
+	$myweek = array();
+
+	for ( $wdcount=0; $wdcount<=6; $wdcount++ ) {
+		$myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7);
+	}
+
+	foreach ( $myweek as $wd ) {
+
+		for($week_num=0;$week_num<=6;$week_num++){
+			$week_name = $wp_locale->get_weekday($week_num);
+			if ($week_name === $wd) break;
+		}
+		
+		$day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
+		if ($week_num ==0) $day_name = '<span style="color: ' . $sun_color . '">' . $day_name . '</span>';
+		if ($week_num ==6) $day_name = '<span style="color: ' . $sat_color . '">' . $day_name . '</span>';
+		echo "\n\t\t<th align=\"center\" abbr=\"$wd\" scope=\"col\" title=\"$wd\">$day_name</th>";
+	}
+
+	echo '
+	</tr>
+	</thead>
+
+	<tfoot>
+	<tr>';
+
+	if ( $previous ) {
+		echo "\n\t\t".'<td abbr="' . $wp_locale->get_month($previous->month) . '" colspan="3" id="prev"><a href="' .
+		get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month),
+			date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
+	} else {
+		echo "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
+	}
+
+	echo "\n\t\t".'<td class="pad">&nbsp;</td>';
+
+	if ( $next ) {
+		echo "\n\t\t".'<td abbr="' . $wp_locale->get_month($next->month) . '" colspan="3" id="next"><a href="' .
+		get_month_link($next->year, $next->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($next->month),
+			date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' &raquo;</a></td>';
+	} else {
+		echo "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
+	}
+
+	echo '
+	</tr>
+	</tfoot>
+
+	<tbody>
+	<tr>';
+
+	// Get days with posts
+	$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
+		FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
+		AND YEAR(post_date) = '$thisyear'
+		AND post_type = 'post' AND post_status = 'publish'
+		AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
+	if ( $dayswithposts ) {
+		foreach ( (array) $dayswithposts as $daywith ) {
+			$daywithpost[] = $daywith[0];
+		}
+	} else {
+		$daywithpost = array();
+	}
+
+	if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false)
+		$ak_title_separator = "\n";
+	else
+		$ak_title_separator = ', ';
+
+	$ak_titles_for_day = array();
+	$ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom "
+		."FROM $wpdb->posts "
+		."WHERE YEAR(post_date) = '$thisyear' "
+		."AND MONTH(post_date) = '$thismonth' "
+		."AND post_date < '".current_time('mysql')."' "
+		."AND post_type = 'post' AND post_status = 'publish'"
+	);
+	if ( $ak_post_titles ) {
+		foreach ( (array) $ak_post_titles as $ak_post_title ) {
+
+				$post_title = apply_filters( "the_title", $ak_post_title->post_title );
+				$post_title = str_replace('"', '&quot;', wptexturize( $post_title ));
+
+				if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
+					$ak_titles_for_day['day_'.$ak_post_title->dom] = '';
+				if ( empty($ak_titles_for_day["$ak_post_title->dom"]) ) // first one
+					$ak_titles_for_day["$ak_post_title->dom"] = $post_title;
+				else
+					$ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . $post_title;
+		}
+	}
+
+
+	// See how much we should pad in the beginning
+	$pad = calendar_week_mod(date('w', $unixmonth)-$week_begins);
+	if ( 0 != $pad )
+		echo "\n\t\t".'<td colspan="'.$pad.'" class="pad">&nbsp;</td>';
+
+	$daysinmonth = intval(date('t', $unixmonth));
+	for ( $day = 1; $day <= $daysinmonth; ++$day ) {
+		if ( isset($newrow) && $newrow )
+			echo "\n\t</tr>\n\t<tr>\n\t\t";
+		$newrow = false;
+
+		if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) )
+			echo '<td id="today" align="center">';
+		else
+			echo '<td align="center">';
+
+		if ( in_array($day, $daywithpost) ) // any posts today?
+				echo '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"$ak_titles_for_day[$day]\">$day</a>";
+		else
+			echo $day;
+		echo '</td>';
+
+		if ( 6 == calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins) )
+			$newrow = true;
+	}
+
+	$pad = 7 - calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins);
+	if ( $pad != 0 && $pad != 7 )
+		echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
+
+	echo "\n\t</tr>\n\t</tbody>\n\t</table>";
+
+	$output = ob_get_contents();
+	ob_end_clean();
+//	echo $output;
+//	$cache[ $key ] = $output;
+//	wp_cache_set( 'get_calendar', $cache, 'calendar' );
+	return $output;
+}
 ?>
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/pluggable-override.php	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/pluggable-override.php	(revision 232)
@@ -24,5 +24,7 @@
 		if (!is_object($xoopsUser)){
 				wp_set_current_user(0);
-				wp_logout();
+				wp_clearcookie();
+
+//				wp_logout();		 // When IE is used, it becomes page error by the guest if the wp_logout() is executed here. 
 			 	return false;
 		}
@@ -38,4 +40,8 @@
 		if (check_xpress_auth_cookie()){	//The cookie is login user's or it checks it
 			if ( $user = wp_validate_auth_cookie() ) {
+				if (!check_user_meta_prefix($user)){
+					repair_user_meta_prefix();
+				}
+
 				wp_set_current_user($user);
 				return ;
@@ -85,8 +91,9 @@
 					return  true;
 				}
-			}
+			}			
 		}
 	}
 	wp_set_current_user(0);
+	wp_clearcookie();
 	return 0;	
 }
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/user_sync_xoops.php	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php	(revision 232)
@@ -100,4 +100,5 @@
 
 	$xoops_users = $xoops_db->get_results($xu_sql);
+	
 	if (empty($xoops_users)){
 		$message .= '...ERR ('. $xu_sql . ')';
@@ -109,71 +110,88 @@
 		$capabillities_name = $role['capabillities'];
 		$allway_update = $role['allway_update'];
+		
+		$wp_user_id = get_wp_user_id($xoops_user->uname) ;
+		
 		if (empty($capabillities_name)){
+			if ($sync_uid != 0){
+				if ($wp_user_id) {
+					if ($allway_update){
+						$message .= '...NOT XPRESS USER ' . $xoops_user->uname;
+						return false;
+					}
+				} else {
+					$message .= '...NOT XPRESS USER ' . $xoops_user->uname;
+					return false;
+				}
+			} else {
 				$message .= "...PASS '" . $xoops_user->uname ."'[uid=".$xoops_user->uid ."](not xpress user)";
-			if ($sync_uid != 0){
-				$message .= '...NOT XPRESS USER ' . $xoops_user->uname;
-				return false;
-			}
-		} else {
-			$user_regist_time = date('Y-m-d H:i:s' , $xoops_user->user_regdate);
-			$user_status = 0;
-			$user_display_name =empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ;
-
-			$is_update = false;
-			
-			$wp_user_id = get_wp_user_id($xoops_user->uname) ;
-			if ($wp_user_id){
-				$wu_sql  = 	"UPDATE $db_xpress_users ";
-				$wu_sql .= 	'SET ';
-				$wu_sql .=		"user_pass  = '$xoops_user->pass', ";
-				$wu_sql .=		"user_email = '$xoops_user->email', ";
-				$wu_sql .=		"user_url = '$xoops_user->url', ";
-				$wu_sql .=		"user_nicename = '$xoops_user->uname', ";
-				$wu_sql .=		"user_registered = '$user_regist_time', ";
-				$wu_sql .=		"user_status = 0 ";
-				$wu_sql .=	"WHERE (user_login = '$xoops_user->uname' )";
-
-				$xoops_db->query($wu_sql);
-				if ($allway_update){
-					$sycc_user = new WP_User($wp_user_id);
-					$sycc_user->set_role($capabillities_name);
-					$message .= '...UPDATE ' . $xoops_user->uname . '(' . $capabillities_name . ')';
-
-				} else {
-					$message .= '...UPDATE ' . $xoops_user->uname . '(Level Not Change)';
-				}
-			}else{
-				$wu_sql  =	"INSERT INTO $db_xpress_users ";
-				$wu_sql .=  	"(user_login , user_pass ,user_email , user_url , user_nicename " ;
-				$wu_sql .=		" , user_registered , user_status , display_name) ";
-				$wu_sql .=	"VALUES ";
-				$wu_sql .=		"('$xoops_user->uname', '$xoops_user->pass', '$xoops_user->email', '$xoops_user->url', '$xoops_user->uname' ";
-				$wu_sql .=		" , '$user_regist_time', $user_status, '$user_display_name')";
-				$xoops_db->query($wu_sql);
+				continue;
+			}
+		}
+
+		$user_regist_time = date('Y-m-d H:i:s' , $xoops_user->user_regdate);
+		$user_status = 0;
+		$user_display_name =empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ;
+
+		$is_update = false;
+		
+		if ($wp_user_id){
+			$wu_sql  = 	"UPDATE $db_xpress_users ";
+			$wu_sql .= 	'SET ';
+			$wu_sql .=		"user_pass  = '$xoops_user->pass', ";
+			$wu_sql .=		"user_email = '$xoops_user->email', ";
+			$wu_sql .=		"user_url = '$xoops_user->url', ";
+			$wu_sql .=		"user_nicename = '$xoops_user->uname', ";
+			$wu_sql .=		"user_registered = '$user_regist_time', ";
+			$wu_sql .=		"user_status = 0 ";
+			$wu_sql .=	"WHERE (user_login = '$xoops_user->uname' )";
+
+			$xoops_db->query($wu_sql);
+			if ($allway_update){
+				$sycc_user = new WP_User($wp_user_id);
+				$sycc_user->set_role($capabillities_name);
+				$message .= '...UPDATE ' . $xoops_user->uname . '(' . $capabillities_name . ')';
+
+			} else {
+				$message .= '...UPDATE ' . $xoops_user->uname . '(Level Not Change)';
+			}
+			if (!check_user_meta_prefix($wp_user_id)){
+				repair_user_meta_prefix();
+			}
+
+			$is_update = true;
+		}else{
+			$wu_sql  =	"INSERT INTO $db_xpress_users ";
+			$wu_sql .=  	"(user_login , user_pass ,user_email , user_url , user_nicename " ;
+			$wu_sql .=		" , user_registered , user_status , display_name) ";
+			$wu_sql .=	"VALUES ";
+			$wu_sql .=		"('$xoops_user->uname', '$xoops_user->pass', '$xoops_user->email', '$xoops_user->url', '$xoops_user->uname' ";
+			$wu_sql .=		" , '$user_regist_time', $user_status, '$user_display_name')";
+			$xoops_db->query($wu_sql);
 //					$wp_user_id = get_wp_user_id($user_login_name) ;					
-				$wp_user_id = mysql_insert_id();
-				$sycc_user = new WP_User($wp_user_id);
-				$sycc_user->set_role($capabillities_name);						
-				$message .= '...INSERT ' . $user_login_name . '(' . $capabillities_name . ')';
-			}
-			
-			$user_nickname =	empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ;
-			$user_rich_editing = 'true';
-			$user_first_name = 	$xoops_user->uname;
-			$user_last_name = 	'';
-			$user_description = '';
-			$user_jabber = 		'';
-
-			update_usermeta( $wp_user_id,'nickname',$user_nickname);
-			update_usermeta( $wp_user_id,'first_name',$user_first_name);
-			update_usermeta( $wp_user_id,'last_name',$user_last_name);
-			update_usermeta( $wp_user_id,'description',$user_description);
-			update_usermeta( $wp_user_id,'jabber',$user_jabber);
-			update_usermeta( $wp_user_id,'aim',$xoops_user->user_aim);
-			update_usermeta( $wp_user_id,'yim',$xoops_user->user_yim);
-			if ($is_update === false ) {
-				update_usermeta( $wp_user_id,'rich_editing',$user_rich_editing);
-			}			
-		}
+			$wp_user_id = mysql_insert_id();
+			$sycc_user = new WP_User($wp_user_id);
+			$sycc_user->set_role($capabillities_name);						
+			$message .= '...INSERT ' . $user_login_name . '(' . $capabillities_name . ')';
+		}
+		
+		$user_nickname =	empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ;
+		$user_rich_editing = 'true';
+		$user_first_name = 	$xoops_user->uname;
+		$user_last_name = 	'';
+		$user_description = '';
+		$user_jabber = 		'';
+
+		update_usermeta( $wp_user_id,'nickname',$user_nickname);
+		update_usermeta( $wp_user_id,'first_name',$user_first_name);
+		update_usermeta( $wp_user_id,'last_name',$user_last_name);
+		update_usermeta( $wp_user_id,'description',$user_description);
+		update_usermeta( $wp_user_id,'jabber',$user_jabber);
+		update_usermeta( $wp_user_id,'aim',$xoops_user->user_aim);
+		update_usermeta( $wp_user_id,'yim',$xoops_user->user_yim);
+		if ($is_update === false ) {
+			update_usermeta( $wp_user_id,'rich_editing',$user_rich_editing);
+		} 
+					
 	}
 	$message .= "...END";
@@ -242,4 +260,21 @@
  * and  user_roles option_name pre-fix of the option table of WordPress is not changed.
 */
+function check_user_meta_prefix($uid){
+	global $xoops_db;
+	$db_xpress_usermeta = get_wp_prefix() . 'usermeta';
+	$user_meta_prefix = get_wp_prefix();
+
+	$sql = "SELECT * FROM $db_xpress_usermeta WHERE user_id = $uid AND meta_key = '" . $user_meta_prefix ."user_level'" ;
+
+	$user_level = $xoops_db->get_results($sql);
+	if (empty($user_level)) return false ;
+
+	$sql = "SELECT * FROM $db_xpress_usermeta WHERE user_id = $uid AND meta_key = '" . $user_meta_prefix ."capabilities'" ;
+	$capabilities = $xoops_db->get_results($sql);
+	if (empty($capabilities)) return false ;
+	
+	return true;	
+}
+
 function repair_user_meta_prefix(){
 	global $xoops_db;
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 232)
@@ -294,3 +294,12 @@
 	return $query;
 }
+
+function safe_site_url_filter($site_url){
+	global $xoops_config;
+	if (!$xoops_config->is_wpmu){
+		if ($site_url != get_xpress_url()) $site_url = get_xpress_url();
+	}
+	return $site_url;
+}
+
 ?>
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po
===================================================================
--- trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 232)
@@ -3,5 +3,5 @@
 "Project-Id-Version: XPressME Plugin\n"
 "POT-Creation-Date: \n"
-"PO-Revision-Date: 2009-04-04 18:30+0900\n"
+"PO-Revision-Date: 2009-05-20 16:34+0900\n"
 "Last-Translator: toemon <toychee@toemon.com>\n"
 "Language-Team: \n"
@@ -15,359 +15,427 @@
 "X-Poedit-SearchPath-0: .\n"
 
-#: xpressme_class.php:43
+#: xpressme_class.php:46
 msgid "XPressME Settings"
 msgstr "XPressME設定"
 
-#: xpressme_class.php:60
-#: xpressme_class.php:206
+#: xpressme_class.php:63
+#: xpressme_class.php:214
 msgid "Older Post"
 msgstr "前の投稿へ"
 
-#: xpressme_class.php:61
-#: xpressme_class.php:208
+#: xpressme_class.php:64
+#: xpressme_class.php:216
 msgid "Newer Post"
 msgstr "次の投稿へ"
 
-#: xpressme_class.php:63
-#: xpressme_class.php:211
+#: xpressme_class.php:66
+#: xpressme_class.php:219
 msgid "Older Entries"
 msgstr "前ページへ"
 
-#: xpressme_class.php:64
-#: xpressme_class.php:213
+#: xpressme_class.php:67
+#: xpressme_class.php:221
 msgid "Newer Entries"
 msgstr "次ページへ"
 
-#: xpressme_class.php:78
+#: xpressme_class.php:81
 msgid "more"
 msgstr "続きを読む"
 
-#: xpressme_class.php:264
-#: xpressme_class.php:280
-#: xpressme_class.php:648
-#: xpressme_class.php:653
-#: xpressme_class.php:659
-#: xpressme_class.php:670
-#: xpressme_class.php:675
+#: xpressme_class.php:276
+#: xpressme_class.php:292
+#: xpressme_class.php:726
+#: xpressme_class.php:731
+#: xpressme_class.php:737
+#: xpressme_class.php:748
+#: xpressme_class.php:754
 msgid "YES"
 msgstr "はい"
 
-#: xpressme_class.php:265
-#: xpressme_class.php:281
-#: xpressme_class.php:649
-#: xpressme_class.php:654
-#: xpressme_class.php:660
-#: xpressme_class.php:671
-#: xpressme_class.php:676
+#: xpressme_class.php:277
+#: xpressme_class.php:293
+#: xpressme_class.php:727
+#: xpressme_class.php:732
+#: xpressme_class.php:738
+#: xpressme_class.php:749
+#: xpressme_class.php:755
 msgid "NO"
 msgstr "いいえ"
 
-#: xpressme_class.php:323
+#: xpressme_class.php:335
 msgid "Single Post Navi Setting"
 msgstr "シングルポストナビの設定"
 
-#: xpressme_class.php:328
-#: xpressme_class.php:373
+#: xpressme_class.php:340
+#: xpressme_class.php:385
 msgid "Adjustment of Navi link display position"
 msgstr "リンクの表示位置設定"
 
-#: xpressme_class.php:331
+#: xpressme_class.php:343
 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:344
 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:350
 msgid "Select Display name of PostNavi Link"
 msgstr "表示するリンクテキストを選択"
 
-#: xpressme_class.php:341
+#: xpressme_class.php:353
 msgid "Title of post"
 msgstr "投稿記事のタイトルを表示"
 
-#: xpressme_class.php:342
+#: xpressme_class.php:354
 msgid "Title of Navi"
 msgstr "ナビタイトルを表示"
 
-#: xpressme_class.php:348
+#: xpressme_class.php:360
 msgid "Display Navi Title of Old Post Link"
 msgstr "古い記事へのナビタイトルを設定"
 
-#: xpressme_class.php:355
+#: xpressme_class.php:367
 msgid "Display Navi Title of Newer Post Link"
 msgstr "より新しい記事へのナビタイトルを設定"
 
-#: xpressme_class.php:368
+#: xpressme_class.php:380
 msgid "Posts List Page Navi Setting"
 msgstr "ポストリストページナビの設定"
 
-#: xpressme_class.php:376
+#: xpressme_class.php:388
 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:389
 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:395
 msgid "Display Navi Title of Old Page Link"
 msgstr "古いページへのナビタイトルを設定"
 
-#: xpressme_class.php:390
+#: xpressme_class.php:402
 msgid "Display Navi Title of Newer Page Link"
 msgstr "より新しいページへのナビタイトルを設定"
 
-#: xpressme_class.php:405
+#: xpressme_class.php:417
 msgid "Role Setting at Login"
 msgstr "ログイン時の権限設定"
 
-#: xpressme_class.php:408
+#: xpressme_class.php:420
 msgid "XOOPS Groupe"
 msgstr "XOOPSグループ名"
 
-#: xpressme_class.php:408
+#: xpressme_class.php:420
 msgid "WordPress Role"
 msgstr "WordPressでの権限"
 
-#: xpressme_class.php:408
+#: xpressme_class.php:420
 msgid "Role is set at each login"
 msgstr "ログイン時、常に権限を更新する"
 
-#: xpressme_class.php:434
-#: xpressme_class.php:438
-#: xpressme_class.php:441
+#: xpressme_class.php:446
+#: xpressme_class.php:450
+#: xpressme_class.php:453
 msgid "Default Role of WordPress"
 msgstr "WordPressのデフォルト権限"
 
-#: xpressme_class.php:435
-#: xpressme_class.php:439
-#: xpressme_class.php:442
+#: xpressme_class.php:447
+#: xpressme_class.php:451
+#: xpressme_class.php:454
 msgid "Group User Doesn't Register"
 msgstr "ユーザ登録しない"
 
-#: xpressme_class.php:471
+#: xpressme_class.php:485
+msgid "WordPress MU cannot integrate the comments."
+msgstr "WordPress MUはコメント統合できません。"
+
+#: xpressme_class.php:487
 msgid "Do Not Comment Integration."
 msgstr "コメント統合しません。"
 
-#: xpressme_class.php:505
+#: xpressme_class.php:522
 msgid "Comment integration with D3Forum"
 msgstr "D3Forumとのコメント統合"
 
-#: xpressme_class.php:507
+#: xpressme_class.php:524
 msgid "Select the forum of D3Forum that does the comment integration from the following lists."
 msgstr "以下のリストからコメント統合をするD3Forumのフォーラムを選択してください。"
 
-#: xpressme_class.php:511
+#: xpressme_class.php:528
 msgid "Select the Type of display of D3Forum comment."
 msgstr "D3Forumの表示タイプを選択"
 
-#: xpressme_class.php:513
-#: xpressme_class.php:516
+#: xpressme_class.php:530
+#: xpressme_class.php:533
 msgid "Flat"
 msgstr "フラット"
 
-#: xpressme_class.php:514
-#: xpressme_class.php:517
+#: xpressme_class.php:531
+#: xpressme_class.php:534
 msgid "Threaded"
 msgstr "スレッド"
 
-#: xpressme_class.php:520
+#: xpressme_class.php:537
 msgid "Select the order of display of D3Forum comment."
 msgstr "D3Forumコメントの表示順を選択"
 
-#: xpressme_class.php:522
-#: xpressme_class.php:525
+#: xpressme_class.php:539
+#: xpressme_class.php:542
 msgid "DESC"
 msgstr "降順"
 
-#: xpressme_class.php:523
-#: xpressme_class.php:526
+#: xpressme_class.php:540
+#: xpressme_class.php:543
 msgid "ASC"
 msgstr "昇順"
 
-#: xpressme_class.php:529
+#: xpressme_class.php:546
 msgid "Number of displays of D3Forum comments."
 msgstr "D3Forumのコメント表示数"
 
-#: xpressme_class.php:533
+#: xpressme_class.php:550
 msgid "The import and the export between Wordpress Comments and the D3Forum Posts can be done. "
 msgstr "WordPressコメントとD3Forumポスト間の一括転送（エクスポート・インポート）"
 
-#: xpressme_class.php:534
+#: xpressme_class.php:551
 msgid "Export to D3Forum"
 msgstr "D3Forumへ一括エクスポート"
 
-#: xpressme_class.php:535
+#: xpressme_class.php:552
 msgid "Import from D3Forum"
 msgstr "D3Forumから一括インポート"
 
-#: xpressme_class.php:547
+#: xpressme_class.php:564
 msgid "Contents Excerpt Setting"
 msgstr "記事抜粋の設定"
 
-#: xpressme_class.php:552
+#: xpressme_class.php:569
 msgid "Is the excerpt display done with the archive of contents?"
 msgstr "記事のアーカイブで抜粋表示を行いますか？"
 
-#: xpressme_class.php:559
+#: xpressme_class.php:576
 msgid "When ASCII character more than the set ratio is included, it is judged ASCII contents. "
 msgstr "ASCII文字が含まれる比率が設定された値より大きい場合、ASCII文字コンテンツと判断します。"
 
-#: xpressme_class.php:566
+#: xpressme_class.php:583
 msgid "Excerpt length of word for ASCII contents"
 msgstr "ASCIIコンテンツの抜粋単語数"
 
-#: xpressme_class.php:573
+#: xpressme_class.php:590
 msgid "Excerpt length of character for multibyte contents"
 msgstr "マルチバイトコンテンツの抜粋文字数"
 
-#: xpressme_class.php:580
+#: xpressme_class.php:597
 msgid "More Link Text (Is not displayed for the blank.)"
 msgstr "Moreリンクテキスト（ブランクの場合リンクを表示しません。）"
 
-#: xpressme_class.php:592
+#: xpressme_class.php:609
 msgid "Display Mode Setting"
 msgstr "表示モード設定"
 
-#: xpressme_class.php:595
+#: xpressme_class.php:612
 msgid "Select the XPressME Display Mode."
 msgstr "XPressMEの表示モードの選択"
 
-#: xpressme_class.php:600
+#: xpressme_class.php:617
 msgid "Xoops Mode"
 msgstr "XOOPSモード"
 
-#: xpressme_class.php:604
+#: xpressme_class.php:621
 msgid "WordPress Mode"
 msgstr "WordPressモード"
 
-#: xpressme_class.php:608
+#: xpressme_class.php:625
 msgid "User select"
 msgstr "ユーザによる選択"
 
-#: xpressme_class.php:637
+#: xpressme_class.php:635
+msgid "Header Meta Option"
+msgstr "ヘッダメタ　オプション"
+
+#: xpressme_class.php:640
+msgid "Select the Header keyword."
+msgstr "ヘッダで使用するキーワードの選択"
+
+#: xpressme_class.php:645
+msgid "Xoops KeyWord"
+msgstr "XOOPSのキーワード"
+
+#: xpressme_class.php:648
+msgid "WordPress KeyWord"
+msgstr "WordPressのキーワード"
+
+#: xpressme_class.php:651
+msgid "WordPress & Xoops KeyWord"
+msgstr "WordPressｊとXOOPSのキーワード"
+
+#: xpressme_class.php:657
+msgid "Select the Header Description."
+msgstr "ヘッダで使用するディスクリプション（説明）の選択"
+
+#: xpressme_class.php:662
+msgid "Xoops Description"
+msgstr "XOOPSのディスクリプション"
+
+#: xpressme_class.php:665
+msgid "WordPress Description"
+msgstr "WordPressのディスクリプション"
+
+#: xpressme_class.php:668
+msgid "WordPress & Xoops Description"
+msgstr "WordPressとXOOPSのディスクリプション"
+
+#: xpressme_class.php:674
+msgid "Select the Header Robots Index."
+msgstr "ヘッダで使用するロボットインデックスの選択"
+
+#: xpressme_class.php:679
+msgid "Xoops Robots Index"
+msgstr "XOOPSのロボットインデックス"
+
+#: xpressme_class.php:682
+msgid "WordPress Robots Index"
+msgstr "WordPressのロボットインデックス"
+
+#: xpressme_class.php:715
 msgid "XPressME Configuration Page"
 msgstr "XPressMEの設定ページ"
 
-#: xpressme_class.php:642
+#: xpressme_class.php:720
 msgid "Media Upload Base Path"
 msgstr "メディアアップロードのベースパス設定"
 
-#: xpressme_class.php:643
+#: xpressme_class.php:721
 msgid "Use XOOPS UPLOAD PATH"
 msgstr "XOOPSのアップロードパスを使用する。"
 
-#: xpressme_class.php:644
+#: xpressme_class.php:722
 msgid "USE WordPress BASE_PATH"
 msgstr "WordPressのベースパスを使用する。"
 
-#: xpressme_class.php:647
+#: xpressme_class.php:725
 msgid "Thema Sidebar Display"
 msgstr "テーマ表示時にサイドバー表示する。"
 
-#: xpressme_class.php:652
+#: xpressme_class.php:730
 msgid "The change tracking of the post is preserved"
 msgstr "投稿の変更履歴を有効にする。"
 
-#: xpressme_class.php:658
+#: xpressme_class.php:736
 msgid "Select Multi user mode"
 msgstr "マルチユーザーモードを選択"
 
-#: xpressme_class.php:669
+#: xpressme_class.php:747
 msgid "Is the posts author views counted?"
 msgstr "投稿者の閲覧をカウントしますか？"
 
-#: xpressme_class.php:674
+#: xpressme_class.php:753
 msgid "Is SQL debugging window displayed?"
 msgstr "SQLデバッグウィンドを表示しますか？"
 
-#: xpressme_class.php:686
+#: xpressme_class.php:765
 msgid "Update Config"
 msgstr "更新"
 
-#: xpressme_class.php:687
+#: xpressme_class.php:766
 msgid "Preset Config"
 msgstr "プリセット"
 
-#: include/custom_functions.php:258
+#: include/custom_functions.php:20
+#, php-format
+msgid "Permanent Link to %s"
+msgstr "%sのパーマリンク"
+
+#: include/custom_functions.php:343
 #, php-format
 msgid "views :%d"
 msgstr "閲覧数 :%d"
 
-#: include/custom_functions.php:376
+#: include/custom_functions.php:461
 msgid "Main"
 msgstr "メイン"
 
-#: include/custom_functions.php:378
+#: include/custom_functions.php:464
 #, php-format
 msgid "Archive for the &#8216;%s&#8217; Category"
 msgstr "カテゴリー &#8216;%s&#8217; のアーカイブ"
 
-#: include/custom_functions.php:380
+#: include/custom_functions.php:466
 #, php-format
 msgid "Posts Tagged &#8216;%s&#8217;"
 msgstr "&#8216;%s&#8217; タグのついている投稿"
 
-#: include/custom_functions.php:382
+#: include/custom_functions.php:468
 #, php-format
 msgid "Archive for %s|Daily archive page"
 msgstr "%sの日別アーカイブ"
 
-#: include/custom_functions.php:382
+#: include/custom_functions.php:468
 msgid "F jS, Y"
 msgstr "Y年n月j日"
 
-#: include/custom_functions.php:384
+#: include/custom_functions.php:470
 #, php-format
 msgid "Archive for %s|Monthly archive page"
 msgstr "%sの月別アーカイブ"
 
-#: include/custom_functions.php:384
+#: include/custom_functions.php:470
 msgid "F, Y"
 msgstr "Y年n月"
 
-#: include/custom_functions.php:386
+#: include/custom_functions.php:472
 #, php-format
 msgid "Archive for %s|Yearly archive page"
 msgstr "%sの年別アーカイブ "
 
-#: include/custom_functions.php:386
+#: include/custom_functions.php:472
 msgid "Y"
 msgstr "Y年"
 
-#: include/custom_functions.php:389
+#: include/custom_functions.php:475
 #, php-format
 msgid "Archive for the &#8216;%s&#8217; Author"
 msgstr "投稿者 &#8216;%s&#8217; のアーカイブ"
 
-#: include/custom_functions.php:392
+#: include/custom_functions.php:478
 #, php-format
 msgid "Search Results of word &#8216;%s&#8217;"
 msgstr "&#8216;%s&#8217; の検索結果"
 
-#: include/custom_functions.php:395
+#: include/custom_functions.php:484
+#: include/custom_functions.php:486
 #, php-format
 msgid "Article of %s"
 msgstr "%sの記事"
 
-#: include/custom_functions.php:410
+#: include/custom_functions.php:501
 #, php-format
 msgid "From %1$s on site %2$s"
 msgstr "サイト %2$s の %1$s より"
 
-#: include/custom_functions.php:433
+#: include/custom_functions.php:524
 #, fuzzy
 msgid "% TrackBack/Pingback"
 msgstr "トラックバック・ピンバック % 件"
 
-#: include/custom_functions.php:435
+#: include/custom_functions.php:526
 msgid "No Trackback/Pingback"
 msgstr "トラックバック・ピンバックはありません"
 
-#: include/custom_functions.php:437
+#: include/custom_functions.php:528
 msgid "One Trackback/Pingback"
 msgstr "トラックバック・ピンバック 1 件"
+
+#: include/custom_functions.php:638
+msgid "Calendar"
+msgstr "カレンダー"
+
+#: include/custom_functions.php:671
+#: include/custom_functions.php:681
+#, php-format
+msgid "View posts for %1$s %2$s"
+msgstr ""
 
 #: include/xpress_common_functions.php:202
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php
===================================================================
--- trunk/wp-content/plugins/xpressme/xpressme.php	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php	(revision 232)
@@ -2,9 +2,9 @@
 /*
 Plugin Name: Plugin for XPressME
-Plugin URI: http://www.toemon.com
+Plugin URI: http://ja.xpressme.info
 Description: Plugin for XPressME (custom function,filter,action)
 Author: toemon
-Version: 0.001
-Author URI: http://www.toemon.com
+Version: 1.0
+Author URI: http://ja.xpressme.info
 */
 require_once('xpressme_class.php');
@@ -28,4 +28,9 @@
 }
 add_action("wp_meta" , "wp_meta_add_xpress_menu");			// add xpress menu  in wp_meta
+	
+//Site URL check
+add_filter('option_home',			"safe_site_url_filter");
+add_filter('option_siteurl',		"safe_site_url_filter");
+	
 
 //XOOPS Bloack Cache Refresh
@@ -71,5 +76,4 @@
 
 
-
 //The trackback and the pingback are excluded from the count of the comment. 
 add_filter('get_comments_number', 'xpress_comment_count', 0);
Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
===================================================================
--- trunk/wp-content/plugins/xpressme/xpressme_class.php	(revision 165)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 232)
@@ -29,4 +29,7 @@
 	var $viewer_type;
 	var $is_multi_user;
+	var $meta_keyword_type;
+	var $meta_description_type;
+	var $meta_robot_type;
 	//constructor
 	function XPressME_Class()
@@ -79,5 +82,7 @@
 		$this->viewer_type = 'xoops';
 		$this->is_multi_user = false;
-
+		$this->meta_keyword_type = 'xoops';
+		$this->meta_description_type = 'xoops';
+		$this->meta_robot_type = 'xoops';	
 	}
 	
@@ -127,5 +132,8 @@
 			'more_link_text' => $this->more_link_text,
 			'viewer_type' => $this->viewer_type,
-			'is_multi_user' => $this->is_multi_user
+			'is_multi_user' => $this->is_multi_user,
+			'meta_keyword_type' => $this->meta_keyword_type,
+			'meta_description_type' => $this->meta_description_type,
+			'meta_robot_type' => $this->meta_robot_type
 		);
 		if ($mode == 'add_new') {
@@ -239,4 +247,8 @@
 		$this->viewer_type = stripslashes(trim($_POST['ch_viewer_type']));
 		$this->is_multi_user = stripslashes(trim($_POST['ch_is_multi_user']));
+		$this->meta_keyword_type = stripslashes(trim($_POST['ch_meta_keyword_type']));
+		$this->meta_description_type = stripslashes(trim($_POST['ch_meta_description_type']));
+		$this->meta_robot_type = stripslashes(trim($_POST['ch_meta_robot_type']));
+
 		global $xoops_db;
 		$table = get_wp_prefix() . 'group_role';	
@@ -458,5 +470,5 @@
 	
 	function d3forum_option($do_message = ''){
-		global $xoops_db;
+		global $xoops_db,$xoops_config;
 		
 		$d3frum_list = array();
@@ -469,34 +481,39 @@
 		else
 			$selected = '';
-		$forum_list .= '<option value="none"' . $selected . '>' . __('Do Not Comment Integration.', 'xpressme') . "</option>\n";
-
-		// Form making for forum selection of D3forum
-		$modules_table = get_xoops_prefix() .'modules';
-		$sql = "SELECT mid,name,isactive,dirname FROM $modules_table WHERE isactive = 1";
-		$modules = $xoops_db->get_results($sql);
-		foreach ($modules as $module) {
-			$file_path = $module_dir_path . '/modules/' . $module->dirname . '/mytrustdirname.php';			
-			if (! file_exists($file_path)) continue;
-			$array_files = file($file_path);
-			// It is checked whether there is character string "$mytrustdirname ='d3forum'"in the file.
-			foreach ($array_files as $aeey_file){
-				if( preg_match( "/\s*(mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) {
-					$forums_tb = get_xoops_prefix() . $module->dirname . '_forums';
-					$cat_tb = get_xoops_prefix() . $module->dirname . '_categories';
-					$sql= "SELECT * FROM $forums_tb LEFT JOIN $cat_tb ON $forums_tb.cat_id = $cat_tb.cat_id";
-					$forums = $xoops_db->get_results($sql);
-					foreach ($forums as $forum) {
-						if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id))
-							$selected = ' selected="selected"';
-						else
-							$selected = '';
-						$forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id;
-						$forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)";
-						$forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n";
+		
+		if ($xoops_config->is_wpmu) {
+			$forum_list .= '<option value="none"' . $selected . '>' . __('WordPress MU cannot integrate the comments.', 'xpressme') . "</option>\n";
+		} else {	
+			$forum_list .= '<option value="none"' . $selected . '>' . __('Do Not Comment Integration.', 'xpressme') . "</option>\n";
+
+			// Form making for forum selection of D3forum
+			$modules_table = get_xoops_prefix() .'modules';
+			$sql = "SELECT mid,name,isactive,dirname FROM $modules_table WHERE isactive = 1";
+			$modules = $xoops_db->get_results($sql);
+			foreach ($modules as $module) {
+				$file_path = $module_dir_path . '/modules/' . $module->dirname . '/mytrustdirname.php';			
+				if (! file_exists($file_path)) continue;
+				$array_files = file($file_path);
+				// It is checked whether there is character string "$mytrustdirname ='d3forum'"in the file.
+				foreach ($array_files as $aeey_file){
+					if( preg_match( "/\s*(mytrustdirname)\s*(=)\s*([\"'])(d3forum)([\"'])/", $aeey_file ) ) {
+						$forums_tb = get_xoops_prefix() . $module->dirname . '_forums';
+						$cat_tb = get_xoops_prefix() . $module->dirname . '_categories';
+						$sql= "SELECT * FROM $forums_tb LEFT JOIN $cat_tb ON $forums_tb.cat_id = $cat_tb.cat_id";
+						$forums = $xoops_db->get_results($sql);
+						foreach ($forums as $forum) {
+							if (($module->dirname == $this->d3forum_module_dir) &&  ($forum->forum_id == $this->d3forum_forum_id))
+								$selected = ' selected="selected"';
+							else
+								$selected = '';
+							$forum_div = 'forum|' . $module->dirname . '|' .  $forum->forum_id;
+							$forum_select = "$module->name($module->dirname) $forum->cat_title-$forum->forum_title(ID=$forum->forum_id)";
+							$forum_list .= '<option value="' . $forum_div . '" ' . $selected . '>' . $forum_select . "</option>\n";
+						}
+						break;
 					}
-					break;
 				}
+				$forum_list .= '<br>';			
 			}
-			$forum_list .= '<br>';			
 		}
 		$forum_list .= '</select>' . "\n";
@@ -613,4 +630,65 @@
 	    return $form;
 	}
+	
+	function header_meta_option(){
+		$form  = "<tr>\n";
+		$form .= '<th><label for="header_type">' .__('Header Meta Option', 'xpressme') . '</label></th>';
+		$form .= "<td>\n";
+		$form .= "<table>\n";
+		$form .= "<tr>\n";
+		
+		$form .=  "<td>" . __('Select the Header keyword.', 'xpressme')  . "</td>\n";
+		$form .= "<td>\n";
+		$form .= '<select name="ch_meta_keyword_type">' . "\n";		
+		$form .= '<option value="xoops" ';
+		if ($this->meta_keyword_type == 'xoops') $form .= ' selected="selected"';
+		$form .= '>'.__('Xoops KeyWord', 'xpressme') ."</option>\n";
+		$form .= '<option value="wordpress" ';
+		if ($this->meta_keyword_type == 'wordpress') $form .= ' selected="selected"';
+		$form .= '>'.__('WordPress KeyWord', 'xpressme') ."</option>\n";		
+		$form .= '<option value="wordpress_xoops" ';
+		if ($this->meta_keyword_type == 'wordpress_xoops') $form .= ' selected="selected"';
+		$form .= '>'.__('WordPress & Xoops KeyWord', 'xpressme') ."</option>\n";
+		$form .= "</select><br />\n";
+		$form .= "</td>\n";
+		$form .= "</tr>\n";
+		
+		$form .= "<tr>\n";
+		$form .=  "<td>" . __('Select the Header Description.', 'xpressme') . "</td>\n";
+		$form .= "<td>\n";
+		$form .= '<select name="ch_meta_description_type">' . "\n";
+		$form .= '<option value="xoops" ';
+		if ($this->meta_description_type == 'xoops') $form .= ' selected="selected"';
+		$form .= '>'.__('Xoops Description', 'xpressme') ."</option>\n";
+		$form .= '<option value="wordpress" ';
+		if ($this->meta_description_type == 'wordpress') $form .= ' selected="selected"';
+		$form .= '>'.__('WordPress Description', 'xpressme') ."</option>\n";
+		$form .= '<option value="wordpress_xoops" ';
+		if ($this->meta_description_type == 'wordpress_xoops') $form .= ' selected="selected"';
+		$form .= '>'.__('WordPress & Xoops Description', 'xpressme') ."</option>\n";
+		$form .= "</select><br />\n";
+		$form .= "</td>\n";
+		$form .= "</tr>\n";
+
+		$form .= "<tr>\n";
+		$form .=  "<td>" . __('Select the Header Robots Index.', 'xpressme') . "</td>\n";
+		$form .= "<td>\n";
+		$form .= '<select name="ch_meta_robot_type">' . "\n";
+		$form .= '<option value="xoops" ';
+		if ($this->meta_robot_type == 'xoops') $form .= ' selected="selected"';
+		$form .= '>'.__('Xoops Robots Index', 'xpressme') ."</option>\n";
+		$form .= '<option value="wordpress" ';
+		if ($this->meta_robot_type == 'wordpress') $form .= ' selected="selected"';
+		$form .= '>'.__('WordPress Robots Index', 'xpressme') ."</option>\n";
+		$form .= "</select><br />\n";
+		$form .= "</td>\n";
+		$form .= "</tr>\n";
+
+		$form .= "</table>\n";
+		
+		$form .= "</tr>\n";
+	    return $form;
+	}
+
 
 	function option_page()
@@ -671,4 +749,5 @@
 												__('NO','xpressme')		
 												);
+		echo 				$this->header_meta_option();
 		echo				$this->yes_no_radio_option('is_sql_debug',
 												__('Is SQL debugging window displayed?','xpressme'),
