1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-03 10:59:13 +00:00

Changes to add a new hook: HOOK_QUERY_HEADLINES. An example is provided.

This commit is contained in:
justauser
2013-06-27 11:18:23 -04:00
parent b584460302
commit 891e36f57e
8 changed files with 101 additions and 25 deletions

View File

@@ -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')) {