diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php index f55aa1156..a451dce23 100644 --- a/plugins/af_psql_trgm/init.php +++ b/plugins/af_psql_trgm/init.php @@ -33,9 +33,56 @@ class Af_Psql_Trgm extends Plugin { $host->add_hook($host::HOOK_PREFS_TAB, $this); $host->add_hook($host::HOOK_PREFS_EDIT_FEED, $this); $host->add_hook($host::HOOK_PREFS_SAVE_FEED, $this); + //$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); } + /* function get_js() { + return file_get_contents(__DIR__ . "/init.js"); + } + + function showrelated() { + $id = (int) db_escape_string($_REQUEST['param']); + $owner_uid = $_SESSION["uid"]; + + $result = db_query("SELECT title FROM ttrss_entries, ttrss_user_entries + WHERE ref_id = id AND id = $id AND owner_uid = $owner_uid"); + + $title = db_fetch_result($result, 0, "title"); + + print "

$title

"; + + $title = db_escape_string($title); + $result = db_query("SELECT id,title,updated + FROM ttrss_entries, ttrss_user_entries + WHERE owner_uid = $owner_uid AND + id = ref_id AND + id != $id AND + date_entered >= NOW() - INTERVAL '1 day' AND + SIMILARITY(title, '$title') >= 0.5 + LIMIT 30"); + + print ""; + + } */ + + /* function hook_article_button($line) { + return ""; + } */ + function hook_prefs_tab($args) { if ($args != "prefFeeds") return;