Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 262)
@@ -16,12 +16,18 @@
 		$output .= ob_get_contents();
 	ob_end_clean();
+	
+	if(function_exists('the_title_attribute')){
+		$title = the_title_attribute('echo=0');	
+	} else {
+		ob_start();
+			the_title();
+			$title = ob_get_contents();
+		ob_end_clean();
+	}
 						
 	$output .= '" rel="bookmark" title="';
-	$output .= sprintf(__('Permanent Link to %s', 'xpress'), the_title_attribute('echo=0'));
+	$output .= sprintf(__('Permanent Link to %s', 'xpress'), $title);
 	$output .= '">';
-	ob_start();
-		the_title();
-		$output .= ob_get_contents();
-	ob_end_clean();
+	$output .= $title;
 	$output .= '</a></h2>' . "\n";
 	$output .= '</div>' . "\n";
Index: trunk/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 261)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp20.php	(revision 262)
@@ -248,4 +248,19 @@
 }
 
+// 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
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/category_block_theme.php	(revision 262)
@@ -60,6 +60,8 @@
 			'recurse' => 1,
 		);
-		$block['categories'] = wp_list_cats($param);
-		
+		ob_start();
+			wp_list_cats($param);
+			$block['categories'] = ob_get_contents();
+		ob_end_clean();	
 	}
 	return $block ;	
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/page_block_theme.php	(revision 262)
@@ -22,22 +22,30 @@
 	if ($show_date == 'none' ) $show_date = '';
 	
-	$parm = array(
-    	'sort_column'	=> $sort_column, 
-    	'sort_order'	=> $sort_order, 
-    	'exclude'		=> $exclude,
-    	'exclude_tree'	=> $exclude_tree,
-    	'include'		=> $includes,
-    	'depth'			=> $depth, 
-    	'child_of'		=> $child_of,
-    	'show_date'		=> $show_date,
-    	'date_format'	=> $date_format,
-    	'title_li'		=> '',
-    	'echo'			=> 0,
-    	'hierarchical'	=> $hierarchical,
-    	'meta_key'		=> $meta_key,
-    	'meta_value'	=> $meta_value
-    );
-	
-	$output = "<ul>\n" . wp_list_pages($parm) . "\n</ul>\n";
+	if (!xpress_is_wp20()){
+		$parm = array(
+	    	'sort_column'	=> $sort_column, 
+	    	'sort_order'	=> $sort_order, 
+	    	'exclude'		=> $exclude,
+	    	'exclude_tree'	=> $exclude_tree,
+	    	'include'		=> $includes,
+	    	'depth'			=> $depth, 
+	    	'child_of'		=> $child_of,
+	    	'show_date'		=> $show_date,
+	    	'date_format'	=> $date_format,
+	    	'title_li'		=> '',
+	    	'echo'			=> 0,
+	    	'hierarchical'	=> $hierarchical,
+	    	'meta_key'		=> $meta_key,
+	    	'meta_value'	=> $meta_value
+	    );
+		$output = "<ul>\n" . wp_list_pages($parm) . "\n</ul>\n";
+	} else {
+		$output = "<ul>\n";
+		ob_start();
+			wp_list_pages($parm);
+			$output .= ob_get_contents();
+		ob_end_clean();
+		$output .="\n</ul>\n";
+	}
 	$block['list_pages'] = $output;
 	return $block ;	
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/popular_posts_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/popular_posts_block_theme.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/popular_posts_block_theme.php	(revision 262)
@@ -44,5 +44,5 @@
 		
 	$select = "SELECT $view_tb.post_views, $post_tb.ID, $post_tb.post_title, $post_tb.post_date";				
-
+	if ($wp_db_version >= 6124){
  		$from  = " FROM (((";
  		$from .= " $post_tb LEFT JOIN $view_tb ON $post_tb.ID = $view_tb.post_id)";
@@ -66,4 +66,16 @@
 				$where .= " AND ($term_taxonomy.term_id IN ($tag_id_list))";
 		}
+	} else {
+		$from  = " FROM ((";
+		$from .= " $post_tb LEFT JOIN $view_tb ON $post_tb.ID = $view_tb.post_id)";
+		$from .= " LEFT JOIN $post2cat_tb ON $post_tb.ID = $post2cat_tb.post_id)";
+		$from .= " INNER JOIN $user_tb ON $post_tb.post_author = $user_tb.ID";
+		
+		$where = " WHERE ($post_tb.post_status = 'publish') AND  (UNIX_TIMESTAMP($post_tb.post_date) <= UNIX_TIMESTAMP())" ;
+		
+	 	if ($cat_select) {
+	 		$where .= " AND ($post2cat_tb.category_id IN ($cat_id))";
+		}
+	}
 		
 
@@ -106,8 +118,12 @@
 			ob_end_clean();	
 			
-			ob_start();
-				the_tags(__('Tags:', 'kubrick') . ' ',' &bull; ','');
-				$tags = ob_get_contents();
-			ob_end_clean();
+			if (function_exists('the_tags')){
+				ob_start();
+					the_tags(__('Tags:', 'xpress') . ' ',' &bull; ','');
+					$tags = ob_get_contents();
+				ob_end_clean();	
+			} else {
+				$tags = '';
+			}
 			
 			ob_start();
@@ -115,5 +131,5 @@
 				$post_modified_date = ob_get_contents();
 			ob_end_clean();
-			
+				
 			ob_start();
 				the_modified_date($time_format);
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php	(revision 262)
@@ -46,7 +46,10 @@
 		$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 ";
-		$comment_sql .= "WHERE comment_approved = '1' AND post_type = 'post'  AND post_status = 'publish' $type_select ";
+		if (xpress_is_wp20()){
+			$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);
 		
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php	(revision 262)
@@ -62,9 +62,13 @@
 			ob_end_clean();	
 			
-			ob_start();
-				the_tags(__('Tags:', 'kubrick') . ' ',' &bull; ','');
-				$tags = ob_get_contents();
-			ob_end_clean();
-			
+			if (function_exists('the_tags')){
+				ob_start();
+					the_tags(__('Tags:', 'xpress') . ' ',' &bull; ','');
+					$tags = ob_get_contents();
+				ob_end_clean();	
+			} else {
+				$tags = '';
+			}
+
 			if ($excerpt){
 				$excerpt_length_word = $excerpt_size;
@@ -82,5 +86,5 @@
 				$post_modified_date = ob_get_contents();
 			ob_end_clean();
-			
+				
 			ob_start();
 				the_modified_date($time_format);
@@ -111,5 +115,10 @@
 						<?php if (function_exists('hotDates')) { hotDates(); }?>
 						<div class ="xpress-post-title">
-							<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'xpress'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2>
+							<?php if(function_exists('the_title_attribute')) : ?>			
+								<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'xpress'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2>
+							<?php else : ?>
+								<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'xpress'), the_title('','',false)); ?>"><?php the_title(); ?></a></h2>
+							<?php endif; ?>
+
 						</div>
 					</div>
Index: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_list_block_theme.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_list_block_theme.php	(revision 261)
+++ trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_list_block_theme.php	(revision 262)
@@ -64,8 +64,12 @@
 			ob_end_clean();	
 			
-			ob_start();
-				the_tags(__('Tags:', 'kubrick') . ' ',' &bull; ','');
-				$tags = ob_get_contents();
-			ob_end_clean();
+			if (function_exists('the_tags')){
+				ob_start();
+					the_tags(__('Tags:', 'xpress') . ' ',' &bull; ','');
+					$tags = ob_get_contents();
+				ob_end_clean();	
+			} else {
+				$tags = '';
+			}
 			
 			ob_start();
@@ -73,5 +77,5 @@
 				$post_modified_date = ob_get_contents();
 			ob_end_clean();
-			
+
 			ob_start();
 				the_modified_date($time_format);
@@ -141,128 +145,4 @@
 	}
 	return $block ;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-		
-	if (strstr($call_url,$this_url)){
-		$output ='<!-- xpress_recent_entries direct load -->' . "\n";
-	 	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");
-		}	
-		if ($r->have_posts()) {
-			$red_sec = $disp_red *60*60*24;
-			$green_sec = $disp_green *60*60*24;
-			$output .= '<!-- xpress_recent_block -->' . "\n" . '<ul>';
-			while ($r->have_posts()){
-				$r->the_post();
-				ob_start();
-					if ( get_the_title() ) {
-						the_title();
-					} else {
-						the_ID();
-					}
-					$title = ob_get_contents();
-				ob_end_clean();
-				ob_start();
-					the_time('U');
-					$post_time = ob_get_contents();
-				ob_end_clean();
-				$elapse = time() - $post_time;
-				$new_mark = '';
-				if ($elapse < $red_sec ) {
-					$new_mark = '<em style="color: red; font-size: small;">New!</em>';
-
-				} else if ($elapse < $green_sec) {
-					$new_mark = '<em style="color: green; font-size: small;">New!</em>';
-				}
-				ob_start();
-					the_permalink();
-					$permalink = ob_get_contents();
-				ob_end_clean();	
-				ob_start();
-					the_author();
-					$author = ob_get_contents();
-				ob_end_clean();
-				$output .=  '<li><a href="' . $permalink . '">' . $title . '</a> ';
-				if ($show_new) {
-					$output .= $new_mark ;
-				}
- 				if ($show_author){
-					$output .= ' ' . $author;
-				}
-				switch($show_date){
-					case 1 :
-						$format = get_settings('date_format');
-						$output .= '<p class="recentpost_time">(' . date($format,$post_time) . ')</p>';
-						break;
-					case 2 :
-						$format = get_settings('date_format') . ' ' . get_settings('time_format');
-						$output .= '<p class="recentpost_time">(' . date($format,$post_time) . ')</p>';
-						break;
-					default :							
-				}
-				$output .= '</li>'. "\n";				
-			}
-			$output .= '</ul>';
-		}
-		$block['content'] = $output;
-	} else {
-		$para  = '?showposts=' . $disp_count;
-		$para .= '&show_new=' . $show_new;
-		$para .= '&disp_red=' . $disp_red;
-		$para .= '&disp_green=' . $disp_green;
-		$para .= '&show_author=' . $show_author;
-		$para .= '&show_date=' .$show_date;
-		$para .= '&cat_id=' . implode(',',$selected);
-
-		$block['content'] = fetch_block($mydirname,$bid,'recent_entries_block',$para);
-	}
-	return $block ;	
-
 }
-
 ?>
