diff options
author | Andrew Dolgov <[email protected]> | 2011-04-18 08:24:24 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-04-18 08:24:24 +0400 |
commit | 452a329b97694da92bb011ec176f03787e40c42b (patch) | |
tree | 39760bf243fefab478a9fdec164b28ca0fab8c6d | |
parent | 5593784a2c64a910425d2064575ee575721dad53 (diff) |
filter_test: fix per-feed filter testing; misc tweaks
-rw-r--r-- | modules/pref-filters.php | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/modules/pref-filters.php b/modules/pref-filters.php index a270ba8e6..bba4ff71e 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 "<div class=\"inactiveFeedHolder\">"; + print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">"; + 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 "<div class=\"inactiveFeedHolder\">"; - print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">"; - - foreach ($articles as $article) { print "<tr>"; print "<td width='5%' align='center'><input dojoType=\"dijit.form.CheckBox\" checked=\"1\" - disabled=\"1\" - type=\"checkbox\"></td>"; + disabled=\"1\" type=\"checkbox\"></td>"; print "<td>"; - print $article["title"]; + print $line["title"]; print " ("; - print "<b>" . $article["feed"] . "</b>"; + print "<b>" . $feed_title . "</b>"; print "): "; - print "<span class=\"insensitive\">" . $article["content"] . "</span>"; + print "<span class=\"insensitive\">" . $content_preview . "</span>"; print "</td></tr>"; + + $found++; } - print "</table>"; - print "</div>"; + + if ($found >= 30) + break; + } + + if ($found == 0) { + print "<tr><td align='center'>" . + __("No recent articles matching this filter has been found.") . "</td></tr>"; } + + print "</table>"; + print "</div>"; + } 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 "<div align='center'>"; print "<button dojoType=\"dijit.form.Button\" @@ -487,7 +483,7 @@ filter_test($link, $filter_type, $regexp, $action_id, $action_param, $filter_param, sql_bool_to_bool($inverse), - $feed_id); + (int) $_REQUEST["feed_id"]); print "<div align='center'>"; print "<button dojoType=\"dijit.form.Button\" |