diff options
Diffstat (limited to 'classes/article.php')
-rwxr-xr-x | classes/article.php | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/classes/article.php b/classes/article.php index ff83143d6..c23a1b820 100755 --- a/classes/article.php +++ b/classes/article.php @@ -100,15 +100,12 @@ class Article extends Handler_Protected { $pluginhost->load_all(PluginHost::KIND_ALL, $owner_uid); $pluginhost->load_data(); - $af_readability = $pluginhost->get_plugin("Af_Readability"); + foreach ($pluginhost->get_hooks(PluginHost::HOOK_GET_FULL_TEXT) as $p) { + $extracted_content = $p->hook_get_full_text($url); - if ($af_readability) { - $enable_share_anything = $pluginhost->get($af_readability, "enable_share_anything"); - - if ($enable_share_anything) { - $extracted_content = $af_readability->extract_content($url); - - if ($extracted_content) $content = $extracted_content; + if ($extracted_content) { + $content = $extracted_content; + break; } } } @@ -151,6 +148,16 @@ class Article extends Handler_Protected { content = ?, content_hash = ? WHERE id = ?"); $sth->execute([$content, $content_hash, $ref_id]); + if (DB_TYPE == "pgsql"){ + $sth = $pdo->prepare("UPDATE ttrss_entries + SET tsvector_combined = to_tsvector( :ts_content) + WHERE id = :id"); + $params = [ + ":ts_content" => mb_substr(strip_tags($content ), 0, 900000), + ":id" => $ref_id]; + $sth->execute($params); + } + $sth = $pdo->prepare("UPDATE ttrss_user_entries SET published = true, last_published = NOW() WHERE int_id = ? AND owner_uid = ?"); @@ -186,7 +193,15 @@ class Article extends Handler_Protected { if ($row = $sth->fetch()) { $ref_id = $row["id"]; - + if (DB_TYPE == "pgsql"){ + $sth = $pdo->prepare("UPDATE ttrss_entries + SET tsvector_combined = to_tsvector( :ts_content) + WHERE id = :id"); + $params = [ + ":ts_content" => mb_substr(strip_tags($content ), 0, 900000), + ":id" => $ref_id]; + $sth->execute($params); + } $sth = $pdo->prepare("INSERT INTO ttrss_user_entries (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, last_read, note, unread, last_published) @@ -516,7 +531,7 @@ class Article extends Handler_Protected { $rv .= "<br clear='both'/>"; } - $rv .= "<div class=\"attachments\" dojoType=\"dijit.form.DropDownButton\">". + $rv .= "<div class=\"attachments\" dojoType=\"fox.form.DropDownButton\">". "<span>" . __('Attachments')."</span>"; $rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">"; |