From 79f3553b8b82e9b62b82456bdcdf74a4abe162fe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 20 May 2006 12:39:22 +0100 Subject: create filter dialog uses prototype --- backend.php | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index 8c4dbcfe3..24b738204 100644 --- a/backend.php +++ b/backend.php @@ -2146,10 +2146,10 @@ if (!WEB_DEMO_MODE) { - $regexp = db_escape_string(trim($_GET["regexp"])); - $match = db_escape_string(trim($_GET["match"])); - $feed_id = db_escape_string($_GET["fid"]); - $action_id = db_escape_string($_GET["aid"]); + $regexp = db_escape_string(trim($_GET["reg_exp"])); + $match_id = db_escape_string(trim($_GET["match_id"])); + $feed_id = db_escape_string($_GET["feed_id"]); + $action_id = db_escape_string($_GET["action_id"]); if (!$feed_id) { $feed_id = 'NULL'; @@ -2161,8 +2161,7 @@ "INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id, action_id) VALUES - ('$regexp', (SELECT id FROM ttrss_filter_types WHERE - description = '$match'),'".$_SESSION["uid"]."', + ('$regexp', '$match_id','".$_SESSION["uid"]."', $feed_id, '$action_id')"); } } @@ -2742,41 +2741,48 @@ print "
Create filter
"; print "
"; + print "
"; + + print ""; + print ""; + print ""; + // print "
Note: filter will only apply to new articles.
"; - $result = db_query($link, "SELECT description + $result = db_query($link, "SELECT id,description FROM ttrss_filter_types ORDER BY description"); $filter_types = array(); while ($line = db_fetch_assoc($result)) { - array_push($filter_types, $line["description"]); + //array_push($filter_types, $line["description"]); + $filter_types[$line["id"]] = $line["description"]; } print ""; print ""; print ""; print ""; - print "
Match:  "; + name=\"reg_exp\" size=\"30\"> "; - print_select("fadd_match", "Title", $filter_types); + print_select_hash("match_id", 1, $filter_types); print "
Feed:"; - print_feed_select($link, "fadd_feed"); + print_feed_select($link, "feed_id"); print "
Action:"; @@ -2794,6 +2800,8 @@ print "
"; + print "
"; + } print "
"; -- cgit v1.2.3-54-g00ecf