From: Andrew Dolgov Date: Tue, 23 Jun 2015 04:36:25 +0000 (-0700) Subject: af_psql_trgm: add option to match all feeds X-Git-Tag: 16.3~270 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f46fe8399870e338b99feb5c77e28e46c548b630;p=tt-rss.git af_psql_trgm: add option to match all feeds --- diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php index f41455f8..26385114 100644 --- a/plugins/af_psql_trgm/init.php +++ b/plugins/af_psql_trgm/init.php @@ -12,6 +12,7 @@ class Af_Psql_Trgm extends Plugin { function save() { $similarity = (float) db_escape_string($_POST["similarity"]); $min_title_length = (int) db_escape_string($_POST["min_title_length"]); + $enable_globally = checkbox_to_sql_bool($_POST["enable_globally"]) == "true"; if ($similarity < 0) $similarity = 0; if ($similarity > 1) $similarity = 1; @@ -22,8 +23,9 @@ class Af_Psql_Trgm extends Plugin { $this->host->set($this, "similarity", $similarity); $this->host->set($this, "min_title_length", $min_title_length); + $this->host->set($this, "enable_globally", $enable_globally); - echo T_sprintf("Data saved (%s)", $similarity); + echo T_sprintf("Data saved (%s, %d)", $similarity, $enable_globally); } function init($host) { @@ -127,10 +129,13 @@ class Af_Psql_Trgm extends Plugin { $similarity = $this->host->get($this, "similarity"); $min_title_length = $this->host->get($this, "min_title_length"); + $enable_globally = $this->host->get($this, "enable_globally"); if (!$similarity) $similarity = '0.75'; if (!$min_title_length) $min_title_length = '32'; + $enable_globally_checked = $enable_globally ? "checked" : ""; + print "
"; print "