summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-04-21 14:07:20 +0300
committerAndrew Dolgov <[email protected]>2015-04-21 14:07:20 +0300
commit945346cbffe266beb48e930af859879821fb8ad6 (patch)
treee68a23907881c47b0abc76397fbbe8aced04bb77 /include
parente55a5ec601eb1e5df52d9299327ad63a621889ba (diff)
add HOOK_RENDER_ENCLOSURE & af_youtube_embed plugin
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php51
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>";
+ }
+ }
}
}
}