diff options
author | Andrew Dolgov <[email protected]> | 2015-01-19 14:59:33 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-01-19 14:59:33 +0300 |
commit | 167fb03f3e94d8a86c986e262952a6e124c12470 (patch) | |
tree | b299687d0b4a508a9450340d69c34eab32d285bf | |
parent | 9a121298e15856638be6f3e44593ab06a172bc17 (diff) |
trgm: add disabled for now button part
-rw-r--r-- | plugins/af_psql_trgm/init.php | 47 |
1 files changed, 47 insertions, 0 deletions
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 "<h2>$title</h2>"; + + $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 "<ul class=\"browseFeedList\" style=\"border-width : 1px\">"; + + while ($line = db_fetch_assoc($result)) { + print "<li>"; + print "<div style='float : right'>" . smart_date_time($line["updated"]) + . "</div>"; + print $line["title"]; + print "</li>"; + } + + print "</ul>"; + + } */ + + /* function hook_article_button($line) { + return "<img src=\"plugins/af_psql_trgm/button.png\" + style=\"cursor : pointer\" style=\"cursor : pointer\" + onclick=\"showTrgmRelated(".$line["id"].")\" + class='tagsPic' title='".__('Show related articles')."'>"; + } */ + function hook_prefs_tab($args) { if ($args != "prefFeeds") return; |