From: Andrew Dolgov Date: Mon, 19 Jan 2015 11:59:33 +0000 (+0300) Subject: trgm: add disabled for now button part X-Git-Tag: 16.3~378 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=167fb03f3e94d8a86c986e262952a6e124c12470;p=tt-rss.git trgm: add disabled for now button part --- diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php index f55aa115..a451dce2 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;