1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 05:25:56 +00:00

Changed the implementation of HOOK_QUERY_HEADLINES to deal with issue Fox raised

This commit is contained in:
justauser
2013-06-28 10:46:45 -04:00
parent 2e18843845
commit 6763143835
4 changed files with 15 additions and 34 deletions

View File

@@ -85,7 +85,7 @@ class Handler_Public extends Handler {
}
$tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
$line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...');
while ($line = $this->dbh->fetch_assoc($result)) {
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
$line = $p->hook_query_headlines($line);
@@ -94,11 +94,7 @@ class Handler_Public extends Handler {
$tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true);
$tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
$tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
if(isset($line["modified_preview"]))
$tpl->setVariable('ARTICLE_EXCERPT', strip_tags($line["content_preview"]), true);
else
$tpl->setVariable('ARTICLE_EXCERPT',
truncate_string(strip_tags($line["content_preview"]), 100, '...'), true);
$tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true);
$content = sanitize($line["content"], false, $owner_uid);
@@ -170,6 +166,7 @@ class Handler_Public extends Handler {
$feed['articles'] = array();
while ($line = $this->dbh->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);
}
@@ -178,10 +175,7 @@ class Handler_Public extends Handler {
$article['id'] = $line['link'];
$article['link'] = $line['link'];
$article['title'] = $line['title'];
if(isset($line["modified_preview"]))
$article['excerpt'] = strip_tags($line["content_preview"]);
else
$article['excerpt'] = truncate_string(strip_tags($line["content_preview"]), 100, '...');
$article['excerpt'] = $line["content_preview"];
$article['content'] = sanitize($line["content"], false, $owner_uid);
$article['updated'] = date('c', strtotime($line["updated"]));