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 633)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 638)
@@ -311,5 +311,5 @@
 	$output = str_replace('">','" title="'.$on_mouse_show . '">' , $ret);
 
-	if (!empty($xpress_config->post_left_arrow_image_link) && ($fp = fopen($xpress_config->post_left_arrow_image_link, "r"))){
+	if (icon_exists($xpress_config->post_left_arrow_image_link)){
 		$img_link = str_replace($link_title,"<img src=\"$xpress_config->post_left_arrow_image_link\" align=\"absmiddle\"/>",$GLOBALS['left_arrow_post_link']);
 		$img_link = str_replace('rel=','title="'.$on_mouse_show.'" rel=',$img_link);
@@ -387,6 +387,5 @@
 	$output = str_replace('">','" title="'.$on_mouse_show . '">' , $ret);
 
-
-	if (!empty($xpress_config->post_right_arrow_image_link) && ($fp = fopen($xpress_config->post_right_arrow_image_link, "r"))){
+	if (icon_exists($xpress_config->post_right_arrow_image_link)){
 		$img_link = str_replace($link_title,"<img src=\"$xpress_config->post_right_arrow_image_link\" align=\"absmiddle\"/>",$GLOBALS['right_arrow_post_link']);
 		$img_link = str_replace('rel=','title="'.$on_mouse_show.'" rel=',$img_link);
@@ -426,5 +425,5 @@
 	}
 	
-	if (!empty($xpress_config->page_left_arrow_image_link) && ($fp = fopen($xpress_config->page_left_arrow_image_link, "r"))){
+	if (icon_exists($xpress_config->page_left_arrow_image_link)){
 		$output = $img_link . str_replace('&laquo;','' , $output);
 		$img_link = str_replace($link_title,"<img src=\"$xpress_config->page_left_arrow_image_link\" align=\"absmiddle\"/>",$output);
@@ -438,4 +437,5 @@
 }
 
+
 function xpress_right_arrow_posts_link($args ='')
 {
@@ -464,5 +464,5 @@
 	}
 	
-	if (!empty($xpress_config->page_right_arrow_image_link) && ($fp = fopen($xpress_config->page_right_arrow_image_link, "r"))){
+	if (icon_exists($xpress_config->page_right_arrow_image_link)){
 		$output = $img_link . str_replace('&raquo;','' , $output);
 		$img_link = str_replace($link_title,"<img src=\"$xpress_config->page_right_arrow_image_link\" align=\"absmiddle\"/>",$output);
@@ -483,4 +483,20 @@
         return ( strlen($str) - $start <= $length ) ? substr( $str, $start, $length ) : substr( $str, $start, $length - strlen($trimmarker) ) . $trimmarker;
     }
+}
+
+function icon_exists($str = '')
+{
+	global $xpress_config;
+	$root_path = $_SERVER['DOCUMENT_ROOT'];
+	$root_pattern = str_replace(".","\.",$root_path);
+	$root_pattern = '/'. str_replace("/","\/",$root_pattern) . '/';
+	$host = str_replace(".","\.",$_SERVER['SERVER_NAME']);
+	$pattern = "/https?:\/\/{$host}/";
+	if (preg_match($pattern,$str)){
+		$str = preg_replace($pattern,$root_path,$str);
+	} else if (!preg_match($root_pattern,$str)){
+		$str = $root_path.$str;
+	}
+	return file_exists($str);
 }
 
