Index: trunk/wp-content/themes/xpress_default/blocks/archives_block_theme.php
===================================================================
--- trunk/wp-content/themes/xpress_default/blocks/archives_block_theme.php	(revision 124)
+++ trunk/wp-content/themes/xpress_default/blocks/archives_block_theme.php	(revision 125)
@@ -4,48 +4,68 @@
 	$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
 	$this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_archives_block.html' : trim( $options[1] );
-	$type = empty( $options[2] ) ? false : true ;
-	$limit = empty( $options[3] ) ? '10' : $options[3] ;
+	$type = empty( $options[2] ) ? 'monthly' : $options[2] ;
+	$limit  = !is_numeric( $options[3] ) ? 0 : $options[3] ;
 	$show_post_count = empty( $options[4] ) ? false : true ;		
 	$drop_down = empty( $options[5] ) ? false : true ;	
 	
-	if ($type) {
-		$type_name = 'monthly';
+	switch($type){
+		case 'yearly':
+			$select_str = __('Select Yearly', 'xpress');
+			break;
+		case 'monthly':
+			$select_str = __('Select Monthly', 'xpress');
+			break;
+		case 'weekly':
+			$select_str = __('Select Weekly', 'xpress');
+			break;
+		case 'daily':
+			$select_str = __('Select Daily', 'xpress');
+			break;
+		case 'postbypost':
+			$select_str = __('Select Post', 'xpress');
+			break;
+		default:
+			$select_str = __('Select Monthly', 'xpress');
+	}
+	
+	if ($drop_down) $format = 'option'; else $format = 'html';
+	if ($limit == 0 ) $limit_str = ''; else $limit_str = $limit;
+	
+	$param = array(
+		'type' => $type, 
+		'limit' => $limit_str, 
+		'format' => $format, 
+		'before' => '', 
+		'after' => '',
+		'show_post_count' => $show_post_count
+	);
+	
+	ob_start();
+		wp_get_archives($param);
+		$get_archives_output = ob_get_contents();
+	ob_end_clean();
+	
+
+	if($drop_down){
+		
+
+		$output = '<form id="archiveform" action="">';
+		$output .= '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">';
+		$output .= "<option value=''>" . $select_str . "</option>\n";
+		$output .=  $get_archives_output;
+		$output .= '</select>';
+		$output .= '</form>';
+		
+		$output  = '<select name="archive-dropdown"' . "onChange='document.location.href=this.options[this.selectedIndex].value;'>\n";
+  		$output .= '<option value="">'.attribute_escape($select_str) . "</option>\n";
+  		$output .=	$get_archives_output;
+		$output .=	"</select>\n";
+		
 	} else {
-		$type_name = 'weekly';
-	}			
-
-	$drop_down_list = '<form id="archiveform" action="">';
-	$drop_down_list .= '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">';
-	$drop_down_list .= "<option value=''>";
-	if ($type) {
-		$drop_down_list .= __('Select Monthly', 'xpress');
-	} else {
-		$drop_down_list .= __('Select Weekly', 'xpress');
+		$output  = "<ul>\n";
+		$output .=  $get_archives_output;
+		$output  .= "</ul>\n";
 	}
-	$drop_down_list .=  '</option>';
-	ob_start();
-		get_archives($type_name,$limit,'option','','',$show_post_count);
-		$drop_down_list .= ob_get_contents();
-	ob_end_clean();
-	$drop_down_list .= '</select>';
-	$drop_down_list .= '</form>';				
-
-	ob_start();
-		get_archives($type_name,$limit,'custom','','|',$show_post_count);
-		$output = ob_get_contents();
-	ob_end_clean();
-	$output = preg_replace('/\|$/', '' ,$output); // "|" at the end of line is deleted. 
-	$archives = explode('|',$output);
-	$item_no = 0;
-	foreach ($archives as $archive){
-		$row_data = array(
-			'archive'		=> $archive
-		);
-		$block['contents']['item'.$item_no] = $row_data;
-		$item_no++;
-	}
-	$block['data_count'] = $item_no;
-	$block['config']['is_archive_doropdown'] = $drop_down;
-	$block['archive_dropdown'] = $drop_down_list;
+	$block['archive'] = $output;
 	return $block ;	
 }
Index: trunk/wp-content/themes/xpress_default/blocks/sidebar_block_theme.php
===================================================================
--- trunk/wp-content/themes/xpress_default/blocks/sidebar_block_theme.php	(revision 125)
+++ trunk/wp-content/themes/xpress_default/blocks/sidebar_block_theme.php	(revision 125)
@@ -0,0 +1,16 @@
+<?php
+function sidebar_block($options)
+{
+	$templates = array();
+	$templates[] = "sidebar.php";
+	$sidebar_path = locate_template($templates, false);
+	ob_start();
+		require($sidebar_path);
+		$output = ob_get_contents();
+	ob_end_clean();	
+	$block['sidebar'] = $output;								
+	return $block ;	
+
+}
+
+?>
