Index: trunk/blocks/recent_posts_content_block.php
===================================================================
--- trunk/blocks/recent_posts_content_block.php	(revision 54)
+++ trunk/blocks/recent_posts_content_block.php	(revision 54)
@@ -0,0 +1,65 @@
+<?php
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+eval( '
+function b_'.$mydirname.'_content_show($options){
+	return _b_content_show($options) ;
+}
+function b_'.$mydirname.'_content_edit($options){
+	return _b_content_edit($options) ;
+}
+' ) ;
+
+if( ! defined( 'XPRESS_CONTENT_BLOCK_INCLUDED' ) ) {
+	define( 'XPRESS_CONTENT_BLOCK_INCLUDED' , 1 ) ;
+	
+	function _b_content_edit($options)
+	{
+		$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
+		$disp_count =  ($options[1])?intval($options[1]):10;
+		$except = empty( $options[2] ) ? false : true ;
+		$except_size =  ($options[3])?intval($options[3]):100;
+		$tag_select = $options[4] ;
+	    $selected = array_slice($options,5); // get allowed cats
+		$this_template = empty( $options[6] ) ? 'db:'.$mydirname.'_block_content.html' : trim( $options[5] );
+
+		$mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
+
+		require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
+		
+		$form  = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
+		$form .= _MB_XPRESS_COUNT .": <input type='text' name='options[1]' value='" . $disp_count . "' />";
+		$form .= "<br />" . yes_no_radio_option('options[2]', _MB_XPRESS_P_EXCEPT , $except);
+		$form .= "<br />" . _MB_XPRESS_P_EXCEPT_SIZE .": <input type='text' name='options[3]' value='" . $except_size . "' />";
+	    $form .= "<br /><br />" . _MB_XPRESS_CATS_SELECT ;
+	    $isAll = (count($selected)==0||empty($selected[0]))?true:false;
+	    $form .= "<br />&nbsp;&nbsp;<select name=\"options[]\" multiple=\"multiple\">";
+	    $form .= "<option value=\"0\" ";
+	    if ($isAll) $form .= " selected=\"selected\"";
+	    $form .= ">"._MB_XPRESS_ALL ."</option>";
+		ob_start();
+		dropdown_cats_options('ID','asc',$selected);
+		$list_str = ob_get_contents();
+		ob_end_clean();
+	    $form .= $list_str. "</select><br />";
+		$form .= "<br />" . _MB_XPRESS_TAGS_SELECT .": <input type='text' name='options[4]' value='" . $tag_select . "' />";
+	    
+//	    $form .="<br /><input type='text' size='60' name='options[11]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
+
+		return $form;
+	}
+
+	
+	function _b_content_show($options)
+	{
+		global $wpdb;
+		$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/language/ja_utf8/blocks.php
===================================================================
--- trunk/language/ja_utf8/blocks.php	(revision 53)
+++ trunk/language/ja_utf8/blocks.php	(revision 54)
@@ -11,4 +11,10 @@
 	define("_MB_XPRESS_PINGBACK","ピンバック");
 	define("_MB_XPRESS_ALL","すべて");
+// recent posts content
+	define("_MB_XPRESS_P_EXCEPT","記事を概要で表示する");
+	define("_MB_XPRESS_P_EXCEPT_SIZE","記事の概要文字数");
+	define("_MB_XPRESS_CATS_SELECT","カテゴリー選択");
+	define("_MB_XPRESS_TAGS_SELECT","タグ選択(複数ある場合はカンマ区切りで入力");
+
 }
 ?>
Index: trunk/language/ja_utf8/modinfo.php
===================================================================
--- trunk/language/ja_utf8/modinfo.php	(revision 53)
+++ trunk/language/ja_utf8/modinfo.php	(revision 54)
@@ -15,4 +15,5 @@
 	// Block Name
 	define("_MI_XPRESS_BLOCK_COMMENTS","最近のコメント");
+	define("_MI_XPRESS_BLOCK_CONTENT","最近の記事内容");
 }
 ?>
Index: trunk/templates/blocks/recent_posts_content_block.html
===================================================================
--- trunk/templates/blocks/recent_posts_content_block.html	(revision 54)
+++ trunk/templates/blocks/recent_posts_content_block.html	(revision 54)
@@ -0,0 +1,43 @@
+<{* **************************  usage ****************************
+ 	The template tag of the following list can be used. 
+ 		<{$block.data_count}>
+		<{$content.post_id}>
+		<{$content.post_title}>
+		<{$content.post_content}>
+		<{$content.post_date}>
+		<{$content.post_time}>
+		<{$content.post_date_time}>
+		<{$content.post_modified_date}>
+		<{$content.post_modified_time}>
+		<{$content.post_modified_date_time}>
+		<{$content.post_author}>
+		<{$content.post_category}>
+		<{$content.post_tags}>
+		<{$content.post_views}>
+		<{$content.comment_link}>
+		<{$content.trackback_url}>
+************************* End of usage ************************ *}>
+<{* Start Template *}>
+
+<ul class="xpress_recent_comments">
+	<{$block.data_count}>
+	<{foreach from=$block.contents item=content}>
+		<li>
+		<{$content.post_id}><br />
+		<{$content.post_title}><br />
+		<{$content.post_content}><br />
+		<{$content.post_date}><br />
+		<{$content.post_time}><br />
+		<{$content.post_date_time}><br />
+		<{$content.post_modified_date}><br />
+		<{$content.post_modified_time}><br />
+		<{$content.post_modified_date_time}><br />
+		<{$content.post_author}><br />
+		<{$content.post_category}><br />
+		<{$content.post_tags}><br />
+		<{$content.post_views}><br />
+		<{$content.comment_link}><br />
+		<{$content.trackback_url}>
+		</li>
+	<{/foreach}>
+</ul>
Index: trunk/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 53)
+++ trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 54)
@@ -218,5 +218,5 @@
 // Retrieves post views given a post ID or post object. 
 function xpress_post_views_count($post_id=0,$format= '',$show = true) {
-	global $table_prefix;
+	global $xoops_db;
 
 	static $post_cache_views;
@@ -230,10 +230,10 @@
 	if($post_id==0) return null;
 	if(!isset($post_cache_views[$post_id])){
-        $sql = "SELECT post_views FROM " . $table_prefix . "views" . " WHERE post_id=$post_id";
-        if (!$result = $GLOBALS["xoopsDB"]->query($sql)) {
+        $sql = "SELECT post_views FROM " . get_xoops_prefix() . "views" . " WHERE post_id=$post_id";
+        $post_views = $xoops_db->get_var($sql);
+        if (!$post_views) {
 	        $post_cache_views[$post_id] = 0;
         }else{
-	        $row = $GLOBALS["xoopsDB"]->fetchArray($result);
-	        $post_cache_views[$post_id] = $row["post_views"];
+	        $post_cache_views[$post_id] = $post_views;
         }
 	}
Index: trunk/wp-content/plugins/xpressme/language/xpressme-ja.po
===================================================================
--- trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 53)
+++ trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 54)
@@ -3,5 +3,5 @@
 "Project-Id-Version: fckeditor for xpress\n"
 "POT-Creation-Date: \n"
-"PO-Revision-Date: 2008-12-27 17:37+0900\n"
+"PO-Revision-Date: 2008-12-17 09:50+0900\n"
 "Last-Translator: toemon <toychee@toemon.com>\n"
 "Language-Team: \n"
@@ -12,106 +12,95 @@
 "X-Poedit-Country: JAPAN\n"
 "X-Poedit-KeywordsList: _e;__\n"
-"X-Poedit-Basepath: C:\\xampp\\htdocs\\cube\\modules\\xpress2x\\wp-content\\plugins\\xpressme\n"
+"X-Poedit-Basepath: C:\\xampp\\htdocs\\cube\\modules\\xpress2\\wp-content\\plugins\\xpressme\n"
 "X-Poedit-SearchPath-0: .\n"
 
-#: xpressme_class.php:26
+#: xpressme_class.php:25
 msgid "XPressME Settings"
 msgstr "XPressME設定"
 
-#: xpressme_class.php:43
-#: xpressme_class.php:89
+#: xpressme_class.php:42
+#: xpressme_class.php:81
 msgid "to Old Post"
 msgstr "前の投稿へ"
 
-#: xpressme_class.php:44
-#: xpressme_class.php:91
+#: xpressme_class.php:43
+#: xpressme_class.php:83
 msgid "to Newer Post"
 msgstr "次の投稿へ"
 
-#: xpressme_class.php:97
-#: xpressme_class.php:157
-#: xpressme_class.php:162
-#: xpressme_class.php:183
+#: xpressme_class.php:88
+#: xpressme_class.php:148
+#: xpressme_class.php:153
 msgid "YES"
 msgstr "はい"
 
-#: xpressme_class.php:98
-#: xpressme_class.php:158
-#: xpressme_class.php:163
-#: xpressme_class.php:184
+#: xpressme_class.php:89
+#: xpressme_class.php:149
+#: xpressme_class.php:154
 msgid "NO"
 msgstr "いいえ"
 
-#: xpressme_class.php:147
+#: xpressme_class.php:138
 msgid "XPressME Configuration Page"
 msgstr "XPressMEの設定ページ"
 
-#: xpressme_class.php:151
+#: xpressme_class.php:142
 msgid "Media Upload Base Path"
 msgstr "メディアアップロードのベースパス設定"
 
-#: xpressme_class.php:152
+#: xpressme_class.php:143
 msgid "Use XOOPS UPLOAD PATH"
 msgstr "XOOPSのアップロードパスを使用する。"
 
-#: xpressme_class.php:153
+#: xpressme_class.php:144
 msgid "USE WordPress BASE_PATH"
 msgstr "WordPressのベースパスを使用する。"
 
-#: xpressme_class.php:156
+#: xpressme_class.php:147
 msgid "Thema Sidebar Display"
 msgstr "テーマ表示時にサイドバー表示する。"
 
-#: xpressme_class.php:161
+#: xpressme_class.php:152
 msgid "The change tracking of the post is preserved"
 msgstr "投稿の変更履歴を有効にする。"
 
-#: xpressme_class.php:166
+#: xpressme_class.php:157
 msgid "Select Display name of PostNavi Link"
 msgstr "投稿記事リンクナビのタイトル設定"
 
-#: xpressme_class.php:167
+#: xpressme_class.php:158
 msgid "Title of post"
 msgstr "投稿記事のタイトルを表示"
 
-#: xpressme_class.php:168
+#: xpressme_class.php:159
 msgid "Next and Previous"
 msgstr "[次の投稿へ]、[前の投稿]へを表示"
 
-#: xpressme_class.php:171
+#: xpressme_class.php:162
 msgid "Adjustment of Navi link display position"
 msgstr "投稿記事ナビリンクの表示位置設定"
 
-#: xpressme_class.php:172
+#: xpressme_class.php:163
 msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right"
 msgstr "古い記事へのリンクを左に、より新しい記事へのリンクを右に表示"
 
-#: xpressme_class.php:173
+#: xpressme_class.php:164
 msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right"
 msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示"
 
-#: xpressme_class.php:176
+#: xpressme_class.php:167
 msgid "Display Title of Old Post Link"
 msgstr "古い記事へのリンクタイトルを設定"
 
-#: xpressme_class.php:179
+#: xpressme_class.php:170
 msgid "Display Title of Newer Post Link"
 msgstr "より新しい記事へのリンクタイトルを設定"
 
-#: xpressme_class.php:182
-msgid "Is the posts author views counted?"
-msgstr "投稿者自身の閲覧をカウントしますか？"
-
-#: xpressme_class.php:190
+#: xpressme_class.php:178
 msgid "Update Config"
 msgstr "更新"
 
-#: xpressme_class.php:191
+#: xpressme_class.php:179
 msgid "Preset Config"
 msgstr "プリセット"
 
-#: include/custom_functions.php:242
-#, php-format
-msgid "views :%d"
-msgstr "閲覧数 :%d"
-
Index: trunk/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php
===================================================================
--- trunk/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php	(revision 54)
+++ trunk/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php	(revision 54)
@@ -0,0 +1,127 @@
+<?php
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+function recent_posts_content_block($options)
+{
+	$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
+	$disp_count =  ($options[1])?intval($options[1]):10;
+	$except = empty( $options[2] ) ? false : true ;
+	$except_size =  ($options[3])?intval($options[3]):100;
+	$tag_select = $options[4] ;
+    $selected = array_slice($options,5); // get allowed cats
+	$this_template = empty( $options[6] ) ? 'db:'.$mydirname.'_block_content.html' : trim( $options[6] );
+	$mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
+	
+	$this_url = '/modules/'. $mydirname;
+	$call_url = $_SERVER['REQUEST_URI'];
+	
+	
+	
+	global $wpdb;
+	$block = array();
+	$item_no = 0;	
+	if (!is_null($wpdb)){
+		$wp_query->in_the_loop = true;		//for use the_tags() in multi lopp 
+		if (array_search(0,$selected)===0) {
+			$r = new WP_Query("showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish");
+
+		} else {
+			$cat_id = implode(',',$selected);
+			$r = new WP_Query("cat=$cat_id&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish");
+		}
+		while($r->have_posts()){			
+			$r->the_post();
+			ob_start();
+				the_ID();
+				$post_id = ob_get_contents();
+			ob_end_clean();
+			
+			ob_start();
+				the_title();
+				$title = ob_get_contents();
+			ob_end_clean();
+			
+			ob_start();
+				the_permalink();
+				$permalink = ob_get_contents();
+			ob_end_clean();					
+			
+			ob_start();
+				the_author_posts_link();
+				$author = ob_get_contents();
+			ob_end_clean();
+			
+			ob_start();
+				the_category(' &bull; ');
+				$category = ob_get_contents();
+			ob_end_clean();	
+			
+			ob_start();
+				the_tags(__('Tags').': ',' &bull; ','');
+				$tags = ob_get_contents();
+			ob_end_clean();	
+							
+			ob_start();
+				the_content();
+				$post_content = ob_get_contents();
+			ob_end_clean();	
+						
+			ob_start();
+				the_modified_date(get_settings('date_format'));
+				$post_modified_date = ob_get_contents();
+			ob_end_clean();
+			
+			ob_start();
+				the_modified_date(get_settings('time_format'));
+				$post_modified_time = ob_get_contents();
+			ob_end_clean();
+			
+			ob_start();
+				the_time(get_settings('date_format'));
+				$post_date = ob_get_contents();
+			ob_end_clean();
+			
+			ob_start();
+				the_time(get_settings('time_format'));
+				$post_time = ob_get_contents();
+			ob_end_clean();
+			
+			
+			ob_start();
+				comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
+				$comments_popup_link = ob_get_contents();
+			ob_end_clean();
+			
+			$post_title = '<a href="' . $permalink . '">' . $title . '</a>';
+			$post_date_time = $post_date . ' ' . $post_time ;
+			$post_modified_date_time = $post_modified_date . ' ' . $post_modified_time ;
+			$trackback_url = trackback_url(false);
+			$post_viwes = xpress_post_views_count($post_id,'views: %d' ,false);
+			if (empty($tags)) $tags = __('Not Tag');
+
+			$row_data = array(
+				'post_id'		=> $post_id ,
+				'post_title'	=> $post_title ,
+				'post_content' 		=> $post_content ,
+				'post_date' => $post_date ,
+				'post_time' => $post_time ,
+				'post_date_time' => $post_date_time ,
+				'post_modified_date' => $post_modified_date ,
+				'post_modified_time' => $post_modified_time ,
+				'post_modified_date_time' => $post_modified_date_time ,
+				'post_author' 	=> $author ,
+				'post_category' 	=> $category ,	
+				'post_tags' 		=> $tags,
+				'post_views' 		=> $post_viwes,
+				'comment_link' 	=> $comments_popup_link ,
+				'trackback_url' => $trackback_url
+			);
+			
+			$block['contents']['item'.$item_no] = $row_data;
+			$item_no++;
+		}
+		$block['data_count'] = $item_no;  //xml unserialise error
+	}
+	return $block ;
+}
+?>
Index: trunk/xoops_version.php
===================================================================
--- trunk/xoops_version.php	(revision 53)
+++ trunk/xoops_version.php	(revision 54)
@@ -110,3 +110,14 @@
 	'func_num'		=> 1,	
 );
+$modversion['blocks'][2] = array(
+	'file' 			=> 'recent_posts_content_block.php' ,
+	'name' 			=> constant('_MI_XPRESS_BLOCK_CONTENT') ,
+	'description'	=> '' ,
+	'show_func' 	=> "b_". $mydirname . "_content_show" ,
+	'edit_func' 	=> "b_". $mydirname . "_content_edit" ,
+	'template'		=> 'recent_posts_content_block.html' , 
+	'options'		=> $mydirname. '|10|0|100||0' ,
+	'can_clone'		=> true ,
+	'func_num'		=> 2,
+);
 ?>
