@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | $align = $xml_obj->attrs->align; |
| 50 | 50 | $alt = $xml_obj->attrs->alt; |
| 51 | 51 | $title = $xml_obj->attrs->title; |
| 52 | - $border = (int)$xml_obj->attrs->border; |
|
| 52 | + $border = (int) $xml_obj->attrs->border; |
|
| 53 | 53 | $link_url = $xml_obj->attrs->link_url; |
| 54 | 54 | $open_window = $xml_obj->attrs->open_window; |
| 55 | 55 | $style = $xml_obj->attrs->style; |
| 56 | - $margin = (int)$xml_obj->attrs->margin; |
|
| 56 | + $margin = (int) $xml_obj->attrs->margin; |
|
| 57 | 57 | |
| 58 | - $src = str_replace(array('&','"'), array('&','&qout;'), $src); |
|
| 58 | + $src = str_replace(array('&', '"'), array('&', '&qout;'), $src); |
|
| 59 | 59 | $src = str_replace('&', '&', $src); |
| 60 | 60 | |
| 61 | 61 | $sslPort = Context::get('_https_port'); |
@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Image containing the address to the address conversion request uri (rss output, etc. purposes) |
| 65 | 65 | $temp_src = explode('/', $src); |
| 66 | - if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); |
|
| 67 | - else if(substr($src , 0, 1)=='/') |
|
| 66 | + if (substr($src, 0, 2) == './') $src = Context::getRequestUri().substr($src, 2); |
|
| 67 | + else if (substr($src, 0, 1) == '/') |
|
| 68 | 68 | { |
| 69 | - if($_SERVER['HTTPS']=='on') { |
|
| 69 | + if ($_SERVER['HTTPS'] == 'on') { |
|
| 70 | 70 | $http_src = 'https://'; |
| 71 | 71 | $src = $http_src.$_SERVER['HTTP_HOST'].$sslPort.$src; |
| 72 | 72 | } else { |
@@ -75,39 +75,39 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | } |
| 78 | - else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; |
|
| 78 | + else if (!strpos($temp_src[0], ':') && $src) $src = Context::getRequestUri().$src; |
|
| 79 | 79 | |
| 80 | 80 | $attr_output = array(); |
| 81 | 81 | $attr_output = array("src=\"".$src."\""); |
| 82 | 82 | $attr_output[] = "alt=\"".$alt."\""; |
| 83 | 83 | |
| 84 | - if($title) |
|
| 84 | + if ($title) |
|
| 85 | 85 | { |
| 86 | 86 | $attr_output[] = "title=\"".$title."\""; |
| 87 | 87 | } |
| 88 | - if($margin) |
|
| 88 | + if ($margin) |
|
| 89 | 89 | { |
| 90 | - $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
|
| 91 | - $style = str_replace(';;',';',$style); |
|
| 92 | - if($style == ';') $style = ''; |
|
| 90 | + $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i', '', $style)).';'; |
|
| 91 | + $style = str_replace(';;', ';', $style); |
|
| 92 | + if ($style == ';') $style = ''; |
|
| 93 | 93 | $style .= ' margin:'.$margin.'px;'; |
| 94 | 94 | } |
| 95 | - if($align) $attr_output[] = "align=\"".$align."\""; |
|
| 96 | - if($width) $attr_output[] = 'width="'.$width.'"'; |
|
| 97 | - if($height) $attr_output[] = 'height="'.$height.'"'; |
|
| 98 | - if($border) |
|
| 95 | + if ($align) $attr_output[] = "align=\"".$align."\""; |
|
| 96 | + if ($width) $attr_output[] = 'width="'.$width.'"'; |
|
| 97 | + if ($height) $attr_output[] = 'height="'.$height.'"'; |
|
| 98 | + if ($border) |
|
| 99 | 99 | { |
| 100 | - $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
|
| 101 | - $style = str_replace(';;',';',$style); |
|
| 102 | - if($style == ';') $style = ''; |
|
| 100 | + $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i', '', $style)).';'; |
|
| 101 | + $style = str_replace(';;', ';', $style); |
|
| 102 | + if ($style == ';') $style = ''; |
|
| 103 | 103 | $style .= ' border-style: solid; border-width:'.$border.'px;'; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - $code = sprintf("<img %s style=\"%s\" />", implode(' ',$attr_output), $style); |
|
| 106 | + $code = sprintf("<img %s style=\"%s\" />", implode(' ', $attr_output), $style); |
|
| 107 | 107 | |
| 108 | - if($link_url) |
|
| 108 | + if ($link_url) |
|
| 109 | 109 | { |
| 110 | - if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
| 110 | + if ($open_window == 'Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
| 111 | 111 | else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code); |
| 112 | 112 | } |
| 113 | 113 | return $code; |
@@ -63,8 +63,9 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Image containing the address to the address conversion request uri (rss output, etc. purposes) |
| 65 | 65 | $temp_src = explode('/', $src); |
| 66 | - if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); |
|
| 67 | - else if(substr($src , 0, 1)=='/') |
|
| 66 | + if(substr($src, 0,2)=='./') { |
|
| 67 | + $src = Context::getRequestUri().substr($src, 2); |
|
| 68 | + } else if(substr($src , 0, 1)=='/') |
|
| 68 | 69 | { |
| 69 | 70 | if($_SERVER['HTTPS']=='on') { |
| 70 | 71 | $http_src = 'https://'; |
@@ -74,8 +75,9 @@ discard block |
||
| 74 | 75 | $src = $http_src.$_SERVER['HTTP_HOST'].$src; |
| 75 | 76 | } |
| 76 | 77 | |
| 78 | + } else if(!strpos($temp_src[0],':') && $src) { |
|
| 79 | + $src = Context::getRequestUri().$src; |
|
| 77 | 80 | } |
| 78 | - else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; |
|
| 79 | 81 | |
| 80 | 82 | $attr_output = array(); |
| 81 | 83 | $attr_output = array("src=\"".$src."\""); |
@@ -89,17 +91,27 @@ discard block |
||
| 89 | 91 | { |
| 90 | 92 | $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
| 91 | 93 | $style = str_replace(';;',';',$style); |
| 92 | - if($style == ';') $style = ''; |
|
| 94 | + if($style == ';') { |
|
| 95 | + $style = ''; |
|
| 96 | + } |
|
| 93 | 97 | $style .= ' margin:'.$margin.'px;'; |
| 94 | 98 | } |
| 95 | - if($align) $attr_output[] = "align=\"".$align."\""; |
|
| 96 | - if($width) $attr_output[] = 'width="'.$width.'"'; |
|
| 97 | - if($height) $attr_output[] = 'height="'.$height.'"'; |
|
| 99 | + if($align) { |
|
| 100 | + $attr_output[] = "align=\"".$align."\""; |
|
| 101 | + } |
|
| 102 | + if($width) { |
|
| 103 | + $attr_output[] = 'width="'.$width.'"'; |
|
| 104 | + } |
|
| 105 | + if($height) { |
|
| 106 | + $attr_output[] = 'height="'.$height.'"'; |
|
| 107 | + } |
|
| 98 | 108 | if($border) |
| 99 | 109 | { |
| 100 | 110 | $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; |
| 101 | 111 | $style = str_replace(';;',';',$style); |
| 102 | - if($style == ';') $style = ''; |
|
| 112 | + if($style == ';') { |
|
| 113 | + $style = ''; |
|
| 114 | + } |
|
| 103 | 115 | $style .= ' border-style: solid; border-width:'.$border.'px;'; |
| 104 | 116 | } |
| 105 | 117 | |
@@ -107,8 +119,11 @@ discard block |
||
| 107 | 119 | |
| 108 | 120 | if($link_url) |
| 109 | 121 | { |
| 110 | - if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
| 111 | - else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code); |
|
| 122 | + if($open_window =='Y') { |
|
| 123 | + $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code); |
|
| 124 | + } else { |
|
| 125 | + $code = sprintf('<a href="%s" >%s</a>', $link_url, $code); |
|
| 126 | + } |
|
| 112 | 127 | } |
| 113 | 128 | return $code; |
| 114 | 129 | } |