summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-07-10 16:41:48 +0400
committerAndrew Dolgov <[email protected]>2013-07-10 16:41:48 +0400
commitf48d89fd58aa25a171f3c4f6ab5c7fdaaae35f02 (patch)
tree8ba1a6e8f683ceb8342ab9c81dc5e487ea50966e /classes/api.php
parentbaf3fcf93a7d911a8b85ec54eb3435d91bddf6b7 (diff)
parent425a6edc6b3e84d0cc0ed144ab66421adac33fa5 (diff)
Merge branch 'hookhead' of git://github.com/justauserx/Tiny-Tiny-RSS into justauserx-hookhead
Diffstat (limited to 'classes/api.php')
-rw-r--r--classes/api.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/classes/api.php b/classes/api.php
index 334f5fdc9..b3f4ebc2a 100644
--- a/classes/api.php
+++ b/classes/api.php
@@ -636,8 +636,13 @@ class API extends Handler {
$feed_title = $qfh_ret[1];
$headlines = array();
-
+
while ($line = db_fetch_assoc($result)) {
+ $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100);
+ foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
+ $line = $p->hook_query_headlines($line, 100, true);
+ }
+
$is_updated = ($line["last_read"] == "" &&
($line["unread"] != "t" && $line["unread"] != "1"));
@@ -664,24 +669,22 @@ class API extends Handler {
$headline_row['attachments'] = get_article_enclosures(
$line['id']);
- if ($show_excerpt) {
- $excerpt = truncate_string(strip_tags($line["content_preview"]), 100);
- $headline_row["excerpt"] = $excerpt;
- }
+ if (!$show_excerpt )
+ $headline_row["excerpt"] = $ine["content_preview"];
if ($show_content) {
if ($line["cached_content"] != "") {
- $line["content_preview"] =& $line["cached_content"];
+ $line["content"] =& $line["cached_content"];
}
if ($sanitize_content) {
$headline_row["content"] = sanitize(
- $line["content_preview"],
+ $line["content"],
sql_bool_to_bool($line['hide_images']),
false, $line["site_url"]);
} else {
- $headline_row["content"] = $line["content_preview"];
+ $headline_row["content"] = $line["content"];
}
}
@@ -699,6 +702,7 @@ class API extends Handler {
$headline_row["always_display_attachments"] = sql_bool_to_bool($line["always_display_enclosures"]);
$headline_row["author"] = $line["author"];
+
$headline_row["score"] = (int)$line["score"];
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) {