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 ;
+}
+?>
