diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 170c1a52..6e8f4630 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -54,6 +54,7 @@ class Pref_Filters extends Handler_Protected { checkbox_to_sql_bool($this->dbh->escape_string($_REQUEST["inverse"]))); $filter["rules"] = array(); + $filter["actions"] = array("dummy-action"); $result = $this->dbh->query("SELECT id,name FROM ttrss_filter_types"); @@ -62,6 +63,8 @@ class Pref_Filters extends Handler_Protected { $filter_types[$line["id"]] = $line["name"]; } + $scope_qparts = array(); + $rctr = 0; foreach ($_REQUEST["rule"] AS $r) { $rule = json_decode($r, true); @@ -75,6 +78,14 @@ class Pref_Filters extends Handler_Protected { unset($rule["feed_id"]); } + if (isset($rule["feed_id"])) { + array_push($scope_qparts, "feed_id = " . $rule["feed_id"]); + } + + if (isset($rule["cat_id"])) { + array_push($scope_qparts, "cat_id = " . $rule["feed_id"]); + } + array_push($filter["rules"], $rule); ++$rctr; @@ -83,59 +94,94 @@ class Pref_Filters extends Handler_Protected { } } - $qfh_ret = queryFeedHeadlines(-4, 30, "", false, false, false, - "date_entered DESC", 0, $_SESSION["uid"], $filter); - - $result = $qfh_ret[0]; - $found = 0; + $offset = 0; + $limit = 30; + $started = time(); print __("Articles matching this filter:"); + require_once "include/rssfuncs.php"; + print "
"; + print " | "; + + foreach ($filter['rules'] as $rule) { + $reg_exp = $rule['reg_exp']; + $reg_exp = str_replace('/', '\/', $rule["reg_exp"]); + + $line["title"] = preg_replace("/($reg_exp)/i", + "$1", $line["title"]); + + $content_preview = preg_replace("/($reg_exp)/i", + "$1", $content_preview); + } + + print $line["title"]; + print " ("; + print "" . $feed_title . ""; + print "): "; + print "" . $content_preview . ""; + print " " . mb_substr($line["date_entered"], 0, 16); + + print " |
"; - print " | "; - - print $line["title"]; - print " ("; - print "" . $feed_title . ""; - print "): "; - print "" . $content_preview . ""; - print " " . mb_substr($line["date_entered"], 0, 16); - - print " |
" . __("No recent articles matching this filter have been found."); - - print " | |
"; - - print __("Complex expressions might not give results while testing due to issues with database server regexp implementation."); - - print " |