Index: trunk/extras/xpress_i18n/portuguese-br/xpressme_modules_root/language/pt-br_utf8/modinfo.php
===================================================================
--- trunk/extras/xpress_i18n/portuguese-br/xpressme_modules_root/language/pt-br_utf8/modinfo.php	(revision 542)
+++ trunk/extras/xpress_i18n/portuguese-br/xpressme_modules_root/language/pt-br_utf8/modinfo.php	(revision 543)
@@ -51,5 +51,6 @@
 	define("_MI_XP2_BLOCK_BLOG_LIST","Blogs Lista");
 	define("_MI_XP2_BLOCK_GLOBAL_POSTS","Posts recentes(Todo o blog)");
-	
+	define("_MI_XP2_BLOCK_GLOBAL_COMM","Comentários recentes(Todo o blog)");
+
 	// Notify Categories
 	define('_MI_XP2_NOTCAT_GLOBAL', 'TUDO');
Index: trunk/extras/xpress_i18n/template/xpressme_modules_root/language/english/modinfo.php
===================================================================
--- trunk/extras/xpress_i18n/template/xpressme_modules_root/language/english/modinfo.php	(revision 542)
+++ trunk/extras/xpress_i18n/template/xpressme_modules_root/language/english/modinfo.php	(revision 543)
@@ -51,4 +51,5 @@
 	define("_MI_XP2_BLOCK_BLOG_LIST","Blogs List");
 	define("_MI_XP2_BLOCK_GLOBAL_POSTS","Recent Posts(All blogs)");
+	define("_MI_XP2_BLOCK_GLOBAL_COMM","Recent Comments(All blogs)");
 
 	// Notify Categories
Index: trunk/xpressme_integration_kit/blocks/global_recent_comments_block.php
===================================================================
--- trunk/xpressme_integration_kit/blocks/global_recent_comments_block.php	(revision 543)
+++ trunk/xpressme_integration_kit/blocks/global_recent_comments_block.php	(revision 543)
@@ -0,0 +1,56 @@
+<?php
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+eval( '
+function b_'.$mydirname.'_global_comments_show($options){
+	return _b_global_comments_show($options) ;
+}
+function b_'.$mydirname.'_global_comments_edit($options){
+	return _b_global_comments_edit($options) ;
+}
+' ) ;
+
+
+if( ! defined( 'XPRESS_GLOBAL_COMMENTS_BLOCK_INCLUDED' ) ) {
+	define( 'XPRESS_GLOBAL_COMMENTS_BLOCK_INCLUDED' , 1 ) ;
+	function _b_global_comments_edit($options)
+	{
+		$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
+		$this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_comments_block.html' : trim( $options[1] );
+		$disp_count = empty( $options[2] ) ? '10' : $options[2] ;
+		$disp_length = empty( $options[3] ) ? '30' : $options[3] ;
+		$date_format = empty( $options[4] ) ? '' : $options[4] ;
+		$time_format = empty( $options[5] ) ? '' : $options[5] ;
+		$com_select = empty( $options[6] ) ? '0' : $options[6] ;
+
+		$mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
+
+		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
+		
+		$form  = javascript_check();
+		$form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
+		$form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
+		$form .= "<br />";
+		$form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
+		$form .= _MB_XP2_LENGTH .": <input type='text' size='3' name='options[3]' value='" . $disp_length . "' /><br />\n";
+		$form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
+		$form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
+	    $form .= "<br />\n";
+	    $form .= comment_type_select('options[6]' , $com_select);
+
+
+		return $form;
+	}
+	
+	function _b_global_comments_show($options)
+	{
+		$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
+		$mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
+		$block_function_name = basename( __FILE__ );
+		
+		require_once $mydirpath.'/include/xpress_block_render.php';
+		return xpress_block_render($mydirname,$block_function_name,$options);
+	}
+}
+?>
Index: trunk/xpressme_integration_kit/include/xpress_templates_make.php
===================================================================
--- trunk/xpressme_integration_kit/include/xpress_templates_make.php	(revision 542)
+++ trunk/xpressme_integration_kit/include/xpress_templates_make.php	(revision 543)
@@ -109,4 +109,5 @@
 		'blog_list_block.html' ,
 		'global_recent_posts_list_block.html' ,
+		'global_recent_comments_block.html',
 		'index.html',
 	);
Index: trunk/xpressme_integration_kit/language/english/modinfo.php
===================================================================
--- trunk/xpressme_integration_kit/language/english/modinfo.php	(revision 542)
+++ trunk/xpressme_integration_kit/language/english/modinfo.php	(revision 543)
@@ -51,4 +51,5 @@
 	define("_MI_XP2_BLOCK_BLOG_LIST","Blogs List");
 	define("_MI_XP2_BLOCK_GLOBAL_POSTS","Recent Posts(All blogs)");
+	define("_MI_XP2_BLOCK_GLOBAL_COMM","Recent Comments(All blogs)");
 
 	// Notify Categories
Index: trunk/xpressme_integration_kit/language/ja_utf8/modinfo.php
===================================================================
--- trunk/xpressme_integration_kit/language/ja_utf8/modinfo.php	(revision 542)
+++ trunk/xpressme_integration_kit/language/ja_utf8/modinfo.php	(revision 543)
@@ -51,5 +51,6 @@
 	define("_MI_XP2_BLOCK_BLOG_LIST","ブログリスト");
 	define("_MI_XP2_BLOCK_GLOBAL_POSTS","最近の記事(全ブログ)");
-	
+	define("_MI_XP2_BLOCK_GLOBAL_COMM","最近のコメント(全ブログ)");
+
 	// Notify Categories
 	define('_MI_XP2_NOTCAT_GLOBAL', 'ブログ全体');
Index: trunk/xpressme_integration_kit/language/japanese/modinfo.php
===================================================================
--- trunk/xpressme_integration_kit/language/japanese/modinfo.php	(revision 542)
+++ trunk/xpressme_integration_kit/language/japanese/modinfo.php	(revision 543)
@@ -51,5 +51,6 @@
 	define("_MI_XP2_BLOCK_BLOG_LIST","¥Ö¥í¥°¥ê¥¹¥È");
 	define("_MI_XP2_BLOCK_GLOBAL_POSTS","ºÇ¶á¤Îµ­»ö(Á´¥Ö¥í¥°)");
-	
+	define("_MI_XP2_BLOCK_GLOBAL_COMM","ºÇ¶á¤Î¥³¥á¥ó¥È(Á´¥Ö¥í¥°)");
+
 	// Notify Categories
 	define('_MI_XP2_NOTCAT_GLOBAL', '¥Ö¥í¥°Á´ÂÎ');
Index: trunk/xpressme_integration_kit/templates/source/global_recent_comments_block.html
===================================================================
--- trunk/xpressme_integration_kit/templates/source/global_recent_comments_block.html	(revision 543)
+++ trunk/xpressme_integration_kit/templates/source/global_recent_comments_block.html	(revision 543)
@@ -0,0 +1,44 @@
+<{* **************************  usage ****************************
+ 	The template tag of the following list can be used. 
+ 		<{$block.err_message}> 					// When the block cannot be displayed, this outputs the reason. Please do not delete it.
+		<{$block.data_count}>					// The number of contents is displayed. 
+		<{$block.contents}>						// Data array of contents. 
+		// Examples of <{$block.contents}>
+		<{foreach from=$block.contents item=content}>	// Loop
+		<{$content.from_auther_to_post}>		// It is displayed by "Author of the comment on the post" format. Each link is included in it. 
+		<{$content.comment_ID}>					// Displays the numeric ID of a comment.
+		<{$content.comment_post_ID}>			// Displays the numeric ID of the target post for the comment is displayed. 
+		<{$content.comment_date}>				// Displays the published date of a comment. Format at date set by general setting of Wordpress.
+		<{$content.comment_date_time}>			// Displays the published date-time of a comment. Format at date-time set by general setting of Wordpress.
+		<{$content.comment_content}>			// Displays the contents of a comment.
+		<{$content.comment_excerpt}>			// Displays the excerpt contents of a comment.
+		<{$content.comment_link}>				// Displays the comment link.
+		<{$content.comment_title}>				// Displays the title of a comment.
+		<{$content.comment_title_link}>			// Displays the comment link, where the link text value is the comment's title name.
+		<{$content.post_link}>					// Displays a link to the post a comment belongs to.
+		<{$content.post_title}>					// Displays a title to the post a comment belongs to.
+		<{$content.post_title_link}>			// Displays the post's permalink, where the link text value is the posts title name.
+		<{$content.author_link}>				// Displays the link of comment author's web homepages.
+		<{$content.author_name}>				// Displays the comment author's name.
+		<{$content.author_name_link}>			// Displays the link of comment author's web homepages, where the link text value is the author's name.
+		<{$content.comment_type}>				// Displays the comment type. (type is comment,truckback or pingback)
+		<{$content.blog_link}>					// Displays a permalink to the blog a comment belongs to.
+		<{$content.blog_title}>					// Displays a title to the blog a comment belongs to.
+		<{$content.blog_title_link}>			// Displays the blog's permalink, where the link text value is the posts title name.
+		<{/foreach}>							// End of Loop
+   ************************* End of usage ************************ *}>
+<{* Start Template *}>
+
+<div class="xpress_block">
+	<{$block.err_message}>
+	<div class="xpress_recent_comments_block">
+		<ul>
+		<{foreach from=$block.contents item=content}>
+			<li>
+				<{$content.from_auther_to_post}><br />
+				<{$content.comment_date_time}>
+			</li>
+		<{/foreach}>
+		</ul>
+	</div>
+</div>
Index: trunk/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 542)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 543)
@@ -141,5 +141,5 @@
 		
 		// Avoid the failure of the operation when switch_to_blog() and other plugin code is called on the admin page.
-		$excludes = '|global_recent_posts_list_block.php|my_.*_block.php|';
+		$excludes = '|global_recent_posts_list_block.php|my_.*_block.php|global_recent_comments_block.php|';
 		if (preg_match('/' . $excludes . '/' , $func_file)) continue;
 		
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_comments_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_comments_block_theme.php	(revision 543)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_comments_block_theme.php	(revision 543)
@@ -0,0 +1,138 @@
+<?php
+// Block Version: 1.0
+function global_recent_comments_block($options)
+{
+	$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
+	$this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_comments_block.html' : trim( $options[1] );
+	$disp_count = empty( $options[2] ) ? '10' : $options[2] ;
+	$disp_length = empty( $options[3] ) ? '30' : $options[3] ;
+	$date_format = empty( $options[4] ) ? '' : $options[4] ;
+	$time_format = empty( $options[5] ) ? '' : $options[5] ;
+	$com_select = empty( $options[6] ) ? '0' : $options[6] ;
+
+	$selected = explode(',' , $com_select);
+
+	$mydirpath = get_xpress_dir_path();
+	
+	if (empty($date_format)) $date_format = get_settings('date_format');
+	if (empty($time_format)) $time_format = get_settings('time_format');
+	
+	$disp_all = in_array('0',$selected);
+	$disp_comment = in_array('1',$selected);
+	$disp_trackback = in_array('2',$selected);
+	$disp_pingback = in_array('3',$selected);
+	
+	$type_select = '';
+	if (!$disp_all){			
+		if ($disp_comment){
+			$in_where =  "''";
+		}
+		if ($disp_trackback){
+			if (empty($in_where)) $in_where =  "'trackback' "; else $in_where .=  ",'trackback'";
+		}
+				
+		if ($disp_pingback){
+			if (empty($in_where)) $in_where =  "'pingback' "; else $in_where .=  ",'pingback'";
+		}
+		
+		if (! empty($in_where)){
+			$type_select = " AND comment_type IN($in_where) ";				
+		}
+	}
+	
+	global $wpdb, $wp_rewrite , $switched , $blog_id;
+	$block = array();
+	$comment_array = array();
+	if (xpress_is_multiblog()){
+		$blogs = get_blog_list(0,'all');
+		foreach ($blogs AS $blog) {
+			switch_to_blog($blog['blog_id']);
+			$wp_rewrite->init();
+			if (!is_null($wpdb)){
+				$comment_sql  = "SELECT comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_content, comment_type,UNIX_TIMESTAMP(comment_date) as comment_unix_time ";
+				$comment_sql .= "FROM $wpdb->comments LEFT JOIN $wpdb->posts ON  $wpdb->posts.ID = $wpdb->comments.comment_post_ID ";
+				if (xpress_is_wp_version('<','2.1')){
+					$comment_sql .= "WHERE comment_approved = '1' AND post_status = 'publish' $type_select ";
+				} else {
+					$comment_sql .= "WHERE comment_approved = '1' AND post_type = 'post'  AND post_status = 'publish' $type_select ";
+				}
+				$comment_sql .= "ORDER BY comment_date_gmt DESC LIMIT $disp_count";
+				$comments = $wpdb->get_results($comment_sql);
+				
+				if ( $comments ) {
+						$blog_title = get_bloginfo('name');
+						$blog_link = get_bloginfo('url');
+						$blog_title_link = '<a href="' . $blog_link . '">' . $blog_title . '</a>' ;
+					foreach ($comments as $comment){
+						$comment_content = $comment->comment_content;
+						$comment_unix_time = $comment->comment_unix_time;
+						$comment_excerpt = ($disp_length>0 ? xpress_substr($comment_content, 0, $disp_length): $comment->comment_content);
+						$comment_link = get_comment_link($comment->comment_ID);
+						$comment_title = $comment_excerpt;
+						$comment_title_link = "<a href='$comment_link' rel='external nofollow' class='url'>$comment_title</a>";
+
+						$post_link = get_permalink($comment->comment_post_ID);
+						$post_title = get_the_title($comment->comment_post_ID);
+						$post_title_link = '<a href="'. $post_link . '">' . $post_title . '</a>';
+						
+						$author_link = $comment->comment_author_url;
+						$author_name = $comment->comment_author;
+						$author_name_link = (( empty( $author_link ) || 'http://' == $author_link ) ? $author_name : "<a href='$author_link' rel='external nofollow' class='url'>$author_name</a>");
+
+						$comment_type = (empty($comment->comment_type) ? 'comment': $comment->comment_type);
+						
+						$post_title_comment_link = '<a href="'. $comment_link . '">' . $post_title . '</a>';
+						$from_auther_to_post = sprintf(__('%1$s on %2$s','xpress'), $author_name_link , $post_title_comment_link );
+
+						$row_data = array(
+							'blog_title' => $blog_title ,
+							'blog_link' => $blog_link ,
+							'blog_title_link' => $blog_title_link ,
+							'comment_ID' 		=> $comment->comment_ID ,
+							'comment_post_ID'	=> $comment->comment_post_ID ,
+							'comment_unix_time' => $comment_unix_time ,
+							'comment_date' 		=> date($date_format,$comment->comment_unix_time) ,
+							'comment_date_time' => date($date_format . ' ' . $time_format,$comment->comment_unix_time) ,
+							'comment_content' 	=> $comment_content ,
+							'comment_excerpt' 	=> $comment_excerpt ,
+							'comment_link' 		=> $comment_link,
+							'comment_title' 	=> $comment_title ,
+							'comment_title_link' => $comment_title_link ,
+							'post_link' 		=> $post_link,
+							'post_title' 		=> $post_title,
+							'post_title_link' 	=> $post_title_link,
+							'author_link' 		=> $author_link,
+							'author_name' 		=> $author_name,
+							'author_name_link' 	=> $author_name_link,
+							'comment_type' 		=> $comment_type,
+							'from_auther_to_post' => $from_auther_to_post
+						);
+						$comment_array[] = $row_data;
+					}
+					$block['data_count'] = $item_no;
+				}
+			}
+			restore_current_blog();
+			$wp_rewrite->init();
+		} // end of foreach
+	}
+	usort($comment_array, "the_comment_time_cmp");
+	if (!empty($disp_count)){
+		$comment_array = array_slice($comment_array,0,$disp_count);
+	}
+
+	$item_no = 0;
+	foreach ($comment_array AS $comment) {
+		$block['contents']['item'.$item_no] = $comment;
+		$item_no++;
+	}
+	$block['data_count'] = $item_no;
+
+	return $block ;
+}
+function the_comment_time_cmp($a, $b)
+{
+    return - strcasecmp($a['comment_unix_time'], $b['comment_unix_time']);
+}
+
+?>
Index: trunk/xpressme_integration_kit/xoops_version.php
===================================================================
--- trunk/xpressme_integration_kit/xoops_version.php	(revision 542)
+++ trunk/xpressme_integration_kit/xoops_version.php	(revision 543)
@@ -375,4 +375,16 @@
 		'func_num'		=> $b_no,	
 	);
+	$b_no++;
+	$modversion['blocks'][$b_no] = array(
+		'file' 			=> 'global_recent_comments_block.php' ,
+		'name' 			=> constant('_MI_XP2_BLOCK_GLOBAL_COMM') ,
+		'description'	=> '' ,
+		'show_func' 	=> "b_". $mydirname . "_global_comments_show" ,
+		'edit_func' 	=> "b_". $mydirname . "_global_comments_edit" ,
+		'template'		=> '' ,
+		'options'		=> $mydirname. '||10|30|||0' ,
+		'can_clone'		=> true ,
+		'func_num'		=> $b_no,	
+	);
 
 }
