$op = $_REQUEST["op"];
- define('SCHEMA_VERSION', 12);
+ define('SCHEMA_VERSION', 13);
require_once "sanity_check.php";
require_once "config.php";
print "<td><input disabled class='iedit' name='action_param'></td></tr>";
+ print "<tr><td valign='top'>Options:</td><td>";
+
+ print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\">
+ <label for=\"inverse\">Inverse match</label></td></tr>";
+
print "</table>";
print "</form>";
$action_param = db_fetch_result($result, 0, "action_param");
$enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled"));
+ $inverse = sql_bool_to_bool(db_fetch_result($result, 0, "inverse"));
print "<div id=\"infoBoxTitle\">Filter editor</div>";
print "<div class=\"infoBoxContents\">";
$checked = "";
}
- print "<tr><td>Options:</td><td>
+ print "<tr><td valign='top'>Options:</td><td>
<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" $checked>
- <label for=\"enabled\">Enabled</label>";
+ <label for=\"enabled\">Enabled</label><br/>";
+
+ if ($inverse) {
+ $checked = "checked";
+ } else {
+ $checked = "";
+ }
+
+ print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\" $checked>
+ <label for=\"inverse\">Inverse match</label>";
print "</td></tr></table>";
$action_id = db_escape_string($_GET["action_id"]);
$action_param = db_escape_string($_GET["action_param"]);
$enabled = checkbox_to_sql_bool(db_escape_string($_GET["enabled"]));
+ $inverse = checkbox_to_sql_bool(db_escape_string($_GET["inverse"]));
if (!$feed_id) {
$feed_id = 'NULL';
action_id = '$action_id',
filter_type = '$filter_type',
enabled = $enabled,
+ inverse = $inverse,
action_param = '$action_param'
WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]);
}
$action_id = db_escape_string($_GET["action_id"]);
$action_param = db_escape_string($_GET["action_param"]);
+ $inverse = checkbox_to_sql_bool(db_escape_string($_GET["inverse"]));
+
if (!$regexp) return;
if (!$feed_id) {
$result = db_query($link,
"INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id,
- action_id, action_param)
+ action_id, action_param, inverse)
VALUES
('$regexp', '$filter_type','".$_SESSION["uid"]."',
- $feed_id, '$action_id', '$action_param')");
+ $feed_id, '$action_id', '$action_param', $inverse)");
}
}
ttrss_filter_types.name AS filter_type_name,
ttrss_filter_types.description AS filter_type_descr,
enabled,
+ inverse,
feed_id,
ttrss_filter_actions.description AS action_description,
ttrss_feeds.title AS feed_title
$edit_filter_id = $_GET["id"];
$enabled = sql_bool_to_bool($line["enabled"]);
-
+ $inverse = sql_bool_to_bool($line["inverse"]);
+
if ($subop == "edit" && $filter_id != $edit_filter_id) {
$class .= "Grayed";
$this_row_id = "";
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
$line["feed_title"] . "</td>";
+
+ $inverse_label = "";
+
+ if ($inverse) {
+ $inverse_label = " <span class='insensitive'>(Inverse)</span>";
+ }
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
- $line["filter_type_descr"] . "</td>";
+ $line["filter_type_descr"] . "$inverse_label</td>";
print "<td><a href=\"javascript:editFilter($filter_id);\">" .
$line["action_description"] . "</td>";
--- /dev/null
+alter table ttrss_filters add column action_param varchar(200);
+
+update ttrss_filters set action_param = '';
+
+alter table ttrss_filters change action_param action_param varchar(200) not null;
+alter table ttrss_filters alter column action_param set default '';
+
+insert into ttrss_filter_actions (id,name,description) values (4, 'tag',
+ 'Assign tags');
+
+update ttrss_version set schema_version = 12;
+
--- /dev/null
+begin;
+
+alter table ttrss_filters add column action_param varchar(200);
+
+update ttrss_filters set action_param = '';
+
+alter table ttrss_filters alter column action_param set not null;
+alter table ttrss_filters alter column action_param set default '';
+
+insert into ttrss_filter_actions (id,name,description) values (4, 'tag',
+ 'Assign tags');
+
+update ttrss_version set schema_version = 12;
+
+commit;
feed_id integer default null,
filter_type integer not null,
reg_exp varchar(250) not null,
+ inverse bool not null default false,
enabled bool not null default true,
action_id integer not null default 1,
action_param varchar(200) not null default '',
create table ttrss_version (schema_version int not null) TYPE=InnoDB;
-insert into ttrss_version values (12);
+insert into ttrss_version values (13);
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null) TYPE=InnoDB;
filter_type integer not null references ttrss_filter_types(id),
reg_exp varchar(250) not null,
enabled boolean not null default true,
+ inverse boolean not null default false,
action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade,
action_param varchar(200) not null default '');
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (12);
+insert into ttrss_version values (13);
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null);
+++ /dev/null
-alter table ttrss_filters add column action_param varchar(200);
-
-update ttrss_filters set action_param = '';
-
-alter table ttrss_filters change action_param action_param varchar(200) not null;
-alter table ttrss_filters alter column action_param set default '';
-
-insert into ttrss_filter_actions (id,name,description) values (4, 'tag',
- 'Assign tags');
-
-update ttrss_version set schema_version = 12;
-
+++ /dev/null
-begin;
-
-alter table ttrss_filters add column action_param varchar(200);
-
-update ttrss_filters set action_param = '';
-
-alter table ttrss_filters alter column action_param set not null;
-alter table ttrss_filters alter column action_param set default '';
-
-insert into ttrss_filter_actions (id,name,description) values (4, 'tag',
- 'Assign tags');
-
-update ttrss_version set schema_version = 12;
-
-commit;
--- /dev/null
+alter table ttrss_filters add column inverse bool;
+update ttrss_filters set inverse = false;
+alter table ttrss_filters change inverse inverse bool not null;
+alter table ttrss_filters alter column inverse set default false;
+
+update ttrss_version set schema_version = 13;
--- /dev/null
+begin;
+
+alter table ttrss_filters add column inverse boolean;
+update ttrss_filters set inverse = false;
+alter table ttrss_filters alter column inverse set not null;
+alter table ttrss_filters alter column inverse set default false;
+
+update ttrss_version set schema_version = 13;
+
+commit;