diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php index 0de46b08..8dde76d4 100644 --- a/plugins/af_psql_trgm/init.php +++ b/plugins/af_psql_trgm/init.php @@ -119,90 +119,91 @@ class Af_Psql_Trgm extends Plugin { if (DB_TYPE != "pgsql") { print_error("Database type not supported."); - } + } else { - $result = db_query("select 'similarity'::regproc"); + $result = db_query("select 'similarity'::regproc"); - if (db_num_rows($result) == 0) { - print_error("pg_trgm extension not found."); - } - - $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 ""; - print ""; - print ""; - print ""; + $similarity = $this->host->get($this, "similarity"); + $min_title_length = $this->host->get($this, "min_title_length"); + $enable_globally = $this->host->get($this, "enable_globally"); - print "

" . __("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.") . "

"; - print_notice("Enable the plugin for specific feeds in the feed editor."); + if (!$similarity) $similarity = '0.75'; + if (!$min_title_length) $min_title_length = '32'; - print "

" . __("Global settings") . "

"; + $enable_globally_checked = $enable_globally ? "checked" : ""; - print ""; + print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; + print ""; - print "
".__("Minimum similarity:")." -
".__("Minimum title length:")." -
".__("Enable for all feeds:")." -
"; + print ""; + print ""; + print ""; - print "

"; + print "

" . __("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.") . "

"; + print_notice("Enable the plugin for specific feeds in the feed editor."); - print "
"; + print "

" . __("Global settings") . "

"; - $enabled_feeds = $this->host->get($this, "enabled_feeds"); - if (!array($enabled_feeds)) $enabled_feeds = array(); + print ""; - $enabled_feeds = $this->filter_unknown_feeds($enabled_feeds); - $this->host->set($this, "enabled_feeds", $enabled_feeds); + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; - if (count($enabled_feeds) > 0) { - print "

" . __("Currently enabled for (click to edit):") . "

"; + print "
" . __("Minimum similarity:") . " +
" . __("Minimum title length:") . " +
" . __("Enable for all feeds:") . " +
"; - print ""; } print "";