From 452a329b97694da92bb011ec176f03787e40c42b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Apr 2011 08:24:24 +0400 Subject: [PATCH] filter_test: fix per-feed filter testing; misc tweaks --- modules/pref-filters.php | 60 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/modules/pref-filters.php b/modules/pref-filters.php index a270ba8e..bba4ff71 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -19,22 +19,27 @@ $filters[$type_name] = array($filter); - if ($feed_id != "NULL") + if ($feed_id) $feed = $feed_id; else $feed = -4; - $feed_title = getFeedTitle($line, $feed); + $feed_title = getFeedTitle($link, $feed); $qfh_ret = queryFeedHeadlines($link, $feed, 300, "", false, false, false, - false, "updated DESC", 0, $_SESSION["uid"]); + false, "date_entered DESC", 0, $_SESSION["uid"]); $result = $qfh_ret[0]; $articles = array(); $found = 0; + print __("Articles matching this filter:"); + + print "
"; + print ""; + while ($line = db_fetch_assoc($result)) { $entry_timestamp = strtotime($line["updated"]); @@ -52,45 +57,36 @@ if ($line["feed_title"]) $feed_title = $line["feed_title"]; - array_push($articles, array("title" => $line["title"], - "content" => $content_preview, "feed" => $feed_title)); - - $found++; - } - - if ($found >= 30) - break; - } - - if ($found == 0) { - print __("No recent articles matching this filter has been found."); - } else { - - print __("Recent articles matching this filter:"); - - print "
"; - print "
"; - - foreach ($articles as $article) { print ""; print ""; + disabled=\"1\" type=\"checkbox\">"; print ""; + + $found++; } - print "
"; - print $article["title"]; + print $line["title"]; print " ("; - print "" . $article["feed"] . ""; + print "" . $feed_title . ""; print "): "; - print "" . $article["content"] . ""; + print "" . $content_preview . ""; print "
"; - print "
"; + + if ($found >= 30) + break; + } + + if ($found == 0) { + print "" . + __("No recent articles matching this filter has been found.") . ""; } + + print ""; + print ""; + } function module_pref_filters($link) { @@ -410,7 +406,7 @@ filter_test($link, $filter_type, $reg_exp, $action_id, $action_param, $filter_param, sql_bool_to_bool($inverse), - $feed_id); + (int) $_REQUEST["feed_id"]); print "
"; print "