Index: trunk/xpressme_integration_kit/include/xpress_block_render.php
===================================================================
--- trunk/xpressme_integration_kit/include/xpress_block_render.php	(revision 432)
+++ trunk/xpressme_integration_kit/include/xpress_block_render.php	(revision 448)
@@ -137,15 +137,4 @@
 	}
 	
-	function get_block_file_path($mydirname,$file_name)
-	{
-		global $xoops_config;
-		$mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname;
-		$select_theme = get_xpress_theme_name($mydirname);
-		$block_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/' . $file_name;
-
-		if (!file_exists($block_file))
-			$block_file =  $xoops_config->xoops_root_path . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/' . $file_name;
-		return $block_file;
-	}
 	
     function xpress_block_cache_found($mydirname,$block_name)
@@ -184,6 +173,8 @@
 		if (strstr($call_url,$this_url)){			
 			$block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name);
-			require_once $block_theme_file;
+			require_once $block_theme_file['file_path'];
 			$block = $call_theme_function_name($options);		//The block name and the called function name should be assumed to be the same name. 
+			if (!empty($block_theme_file['error']))
+				$block['err_message'] = $block_theme_file['error'];
 		} else {
 			if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){
@@ -227,8 +218,10 @@
 
 			$block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name);
-			require_once $block_theme_file;
+			require_once $block_theme_file['file_path'];
 			$render = $call_theme_function_name($options);		//The block name and the called function name should be assumed to be the same name. 			
 			$render_array['block'] = $render;
 			$render_array['block']['options'] = $block->options;
+			if (!empty($block_theme_file['error']))
+				$render_array['block']['err_message'] = $block_theme_file['error'];
 			if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){	
 				$render_serialize = xpress_XML_serialize($render_array);
@@ -295,5 +288,5 @@
 		}
 	}
-
+	
 }	
 ?>
