- Timestamp:
- Aug 22, 2010, 10:45:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
r630 r638 311 311 $output = str_replace('">','" title="'.$on_mouse_show . '">' , $ret); 312 312 313 if ( !empty($xpress_config->post_left_arrow_image_link) && ($fp = fopen($xpress_config->post_left_arrow_image_link, "r"))){313 if (icon_exists($xpress_config->post_left_arrow_image_link)){ 314 314 $img_link = str_replace($link_title,"<img src=\"$xpress_config->post_left_arrow_image_link\" align=\"absmiddle\"/>",$GLOBALS['left_arrow_post_link']); 315 315 $img_link = str_replace('rel=','title="'.$on_mouse_show.'" rel=',$img_link); … … 387 387 $output = str_replace('">','" title="'.$on_mouse_show . '">' , $ret); 388 388 389 390 if (!empty($xpress_config->post_right_arrow_image_link) && ($fp = fopen($xpress_config->post_right_arrow_image_link, "r"))){ 389 if (icon_exists($xpress_config->post_right_arrow_image_link)){ 391 390 $img_link = str_replace($link_title,"<img src=\"$xpress_config->post_right_arrow_image_link\" align=\"absmiddle\"/>",$GLOBALS['right_arrow_post_link']); 392 391 $img_link = str_replace('rel=','title="'.$on_mouse_show.'" rel=',$img_link); … … 426 425 } 427 426 428 if ( !empty($xpress_config->page_left_arrow_image_link) && ($fp = fopen($xpress_config->page_left_arrow_image_link, "r"))){427 if (icon_exists($xpress_config->page_left_arrow_image_link)){ 429 428 $output = $img_link . str_replace('«','' , $output); 430 429 $img_link = str_replace($link_title,"<img src=\"$xpress_config->page_left_arrow_image_link\" align=\"absmiddle\"/>",$output); … … 438 437 } 439 438 439 440 440 function xpress_right_arrow_posts_link($args ='') 441 441 { … … 464 464 } 465 465 466 if ( !empty($xpress_config->page_right_arrow_image_link) && ($fp = fopen($xpress_config->page_right_arrow_image_link, "r"))){466 if (icon_exists($xpress_config->page_right_arrow_image_link)){ 467 467 $output = $img_link . str_replace('»','' , $output); 468 468 $img_link = str_replace($link_title,"<img src=\"$xpress_config->page_right_arrow_image_link\" align=\"absmiddle\"/>",$output); … … 483 483 return ( strlen($str) - $start <= $length ) ? substr( $str, $start, $length ) : substr( $str, $start, $length - strlen($trimmarker) ) . $trimmarker; 484 484 } 485 } 486 487 function icon_exists($str = '') 488 { 489 global $xpress_config; 490 $root_path = $_SERVER['DOCUMENT_ROOT']; 491 $root_pattern = str_replace(".","\.",$root_path); 492 $root_pattern = '/'. str_replace("/","\/",$root_pattern) . '/'; 493 $host = str_replace(".","\.",$_SERVER['SERVER_NAME']); 494 $pattern = "/https?:\/\/{$host}/"; 495 if (preg_match($pattern,$str)){ 496 $str = preg_replace($pattern,$root_path,$str); 497 } else if (!preg_match($root_pattern,$str)){ 498 $str = $root_path.$str; 499 } 500 return file_exists($str); 485 501 } 486 502
Note: See TracChangeset
for help on using the changeset viewer.