diff options
author | justauser <[email protected]> | 2013-06-27 11:18:23 -0400 |
---|---|---|
committer | justauser <[email protected]> | 2013-06-27 11:18:23 -0400 |
commit | 891e36f57e2e3955a4f13019e8fdc58fce826434 (patch) | |
tree | 2610bb1f22c8807593143dcc634a8bda68be59f4 /classes/feeds.php | |
parent | b584460302b674c8e9c52718d0e6682e427a913a (diff) |
Changes to add a new hook: HOOK_QUERY_HEADLINES. An example is provided.
Diffstat (limited to 'classes/feeds.php')
-rw-r--r-- | classes/feeds.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index 83736925c..fd4c7fe53 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -288,6 +288,9 @@ class Feeds extends Handler_Protected { $expand_cdm = get_pref('CDM_EXPANDED'); while ($line = $this->dbh->fetch_assoc($result)) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { + $line = $p->hook_query_headlines($line, 250); + } $id = $line["id"]; $feed_id = $line["feed_id"]; $label_cache = $line["label_cache"]; @@ -360,9 +363,12 @@ class Feeds extends Handler_Protected { $date_entered_fmt = T_sprintf("Imported at %s", make_local_datetime($line["date_entered"], false)); - if (get_pref('SHOW_CONTENT_PREVIEW')) { - $content_preview = truncate_string(strip_tags($line["content_preview"]), - 250); + if (get_pref('SHOW_CONTENT_PREVIEW') ) { + if(isset($line["modified_preview"])) + $content_preview = strip_tags($line["content_preview"]); + else + $content_preview = truncate_string(strip_tags($line["content_preview"]), + 250); } $score = $line["score"]; @@ -502,7 +508,7 @@ class Feeds extends Handler_Protected { else $tags = false; - $line["content"] = sanitize($line["content_preview"], + $line["content"] = sanitize($line["content"], sql_bool_to_bool($line['hide_images']), false, $entry_site_url); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) { @@ -575,7 +581,7 @@ class Feeds extends Handler_Protected { $excerpt_hidden = "style=\"display : none\""; $reply['content'] .= "<span $excerpt_hidden - id=\"CEXC-$id\" class=\"cdmExcerpt\"> - $content_preview</span>"; + id=\"CEXC-$id\" class=\"cdmExcerpt\"> -" . $content_preview . "</span>"; $reply['content'] .= "</span>"; if (!get_pref('VFEED_GROUP_BY_FEED')) { |