diff options
Diffstat (limited to 'include/functions2.php')
-rw-r--r-- | include/functions2.php | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/include/functions2.php b/include/functions2.php index a73f9a7a7..27b1933d0 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -1940,28 +1940,37 @@ foreach ($entries as $entry) { - if (preg_match("/image/", $entry["type"]) || - preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) { - - if (!$hide_images) { - $encsize = ''; - if ($entry['height'] > 0) - $encsize .= ' height="' . intval($entry['width']) . '"'; - if ($entry['width'] > 0) - $encsize .= ' width="' . intval($entry['height']) . '"'; - $rv .= "<p><img - alt=\"".htmlspecialchars($entry["filename"])."\" - src=\"" .htmlspecialchars($entry["url"]) . "\" - " . $encsize . " /></p>"; - } else { - $rv .= "<p><a target=\"_blank\" - href=\"".htmlspecialchars($entry["url"])."\" - >" .htmlspecialchars($entry["url"]) . "</a></p>"; - } + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ENCLOSURE) as $plugin) + $retval = $plugin->hook_render_enclosure($entry, $hide_images); - if ($entry['title']) { - $rv.= "<div class=\"enclosure_title\">${entry['title']}</div>"; - } + + if ($retval) { + $rv .= $retval; + } else { + + if (preg_match("/image/", $entry["type"]) || + preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) { + + if (!$hide_images) { + $encsize = ''; + if ($entry['height'] > 0) + $encsize .= ' height="' . intval($entry['width']) . '"'; + if ($entry['width'] > 0) + $encsize .= ' width="' . intval($entry['height']) . '"'; + $rv .= "<p><img + alt=\"".htmlspecialchars($entry["filename"])."\" + src=\"" .htmlspecialchars($entry["url"]) . "\" + " . $encsize . " /></p>"; + } else { + $rv .= "<p><a target=\"_blank\" + href=\"".htmlspecialchars($entry["url"])."\" + >" .htmlspecialchars($entry["url"]) . "</a></p>"; + } + + if ($entry['title']) { + $rv.= "<div class=\"enclosure_title\">${entry['title']}</div>"; + } + } } } } |