summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-02-23 16:01:51 +0400
committerAndrew Dolgov <[email protected]>2013-02-23 16:01:51 +0400
commit84d952f141584c5788aba4d0119a66c8a043721c (patch)
tree496407e90719b8330264b10bc64f4b22b40233db /include
parente02555c1b8efad4fdc918e8245624e0b641ac6df (diff)
implement article render hooks
Diffstat (limited to 'include')
-rw-r--r--include/functions.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/include/functions.php b/include/functions.php
index b0ccba313..a2b2c1c9a 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2871,7 +2871,18 @@
$line = db_fetch_assoc($result);
- $feed_site_url = $line['site_url'];
+ $tag_cache = $line["tag_cache"];
+
+ $line["tags"] = get_article_tags($link, $id, $owner_uid, $line["tag_cache"]);
+ unset($line["tag_cache"]);
+
+ $line["content"] = sanitize($link, $line["content"], false, $owner_uid, $line["site_url"]);
+
+ global $pluginhost;
+
+ foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE) as $p) {
+ $line = $p->hook_render_article($line);
+ }
$num_comments = $line["num_comments"];
$entry_comments = "";
@@ -2929,15 +2940,8 @@
$rv['content'] .= "<div class='postTitle'>" . $line["title"] . "$entry_author</div>";
}
- $tag_cache = $line["tag_cache"];
-
- if (!$tag_cache)
- $tags = get_article_tags($link, $id, $owner_uid);
- else
- $tags = explode(",", $tag_cache);
-
- $tags_str = format_tags_string($tags, $id);
- $tags_str_full = join(", ", $tags);
+ $tags_str = format_tags_string($line["tags"], $id);
+ $tags_str_full = join(", ", $line["tags"]);
if (!$tags_str_full) $tags_str_full = __("no tags");
@@ -3036,13 +3040,10 @@
$line["content"] =& $line["cached_content"];
}
- $article_content = sanitize($link, $line["content"], false, $owner_uid,
- $feed_site_url);
-
- $rv['content'] .= $article_content;
+ $rv['content'] .= $line["content"];
$rv['content'] .= format_article_enclosures($link, $id,
- $always_display_enclosures, $article_content);
+ $always_display_enclosures, $line["content"]);
$rv['content'] .= "</div>";