]> git.wh0rd.org Git - tt-rss.git/commitdiff
create filter: save filter_param to DB
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 13 Dec 2008 12:22:16 +0000 (13:22 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 13 Dec 2008 12:22:16 +0000 (13:22 +0100)
modules/popup-dialog.php
modules/pref-filters.php

index ea74eb583e76ccdb7fc002671313207b86994469..10074b1798e6b20c5a4619b5fcda0dbf505296d2 100644 (file)
 
                        print "<span id=\"filter_dlg_date_mod_box\" style=\"display : none\">";
                        print "<select name=\"filter_date_modifier\">";
-                       print "<option name=\"before\">".__('Before')."</option>";
-                       print "<option name=\"after\">".__('After')."</option>";
+                       print "<option value=\"before\">".__('Before')."</option>";
+                       print "<option value=\"after\">".__('After')."</option>";
                        print "</select>&nbsp;</span>";
 
                        print "<input onkeypress=\"return filterCR(event, createFilter)\"
index fa47bdca85aea5ac3544bf508429c43c925809fd..a63b8513da6b4fd5f6e13ddc9ec9719af9efa4ac 100644 (file)
                                $feed_id = sprintf("'%s'", db_escape_string($feed_id));
                        }
 
+                       # for the time being, no other filters use params anyway...
+                       $filter_param = db_escape_string($_GET["filter_date_modifier"]);
+
                        $result = db_query($link,
                                "INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id,
-                                       action_id, action_param, inverse) 
+                                       action_id, action_param, inverse, filter_param
                                VALUES 
                                        ('$regexp', '$filter_type','".$_SESSION["uid"]."', 
-                                               $feed_id, '$action_id', '$action_param', $inverse)");
+                                               $feed_id, '$action_id', '$action_param', $inverse, '$filter_param')");
 
                        if (db_affected_rows($link, $result) != 0) {
                                print T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp));