From e8b79d16e367f29789e08fe76aaf54e06ffb64e4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 Aug 2006 15:18:02 +0100 Subject: [PATCH] use ttrss_filters.enabled --- backend.php | 34 ++++++++++++++++++++++++++++++++-- functions.php | 3 ++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/backend.php b/backend.php index fc36d2e0..51653b65 100644 --- a/backend.php +++ b/backend.php @@ -1965,7 +1965,9 @@ $filter_type = db_fetch_result($result, 0, "filter_type"); $feed_id = db_fetch_result($result, 0, "feed_id"); $action_id = db_fetch_result($result, 0, "action_id"); - + + $enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled")); + print "
Filter editor
"; print "
"; @@ -2019,6 +2021,18 @@ print ""; + print ""; + + if ($enabled) { + $checked = "checked"; + } else { + $checked = ""; + } + + print "Options: + + "; + print ""; print ""; @@ -2047,6 +2061,7 @@ $filter_id = db_escape_string($_GET["id"]); $feed_id = db_escape_string($_GET["feed_id"]); $action_id = db_escape_string($_GET["action_id"]); + $enabled = checkbox_to_sql_bool(db_escape_string($_GET["enabled"])); if (!$feed_id) { $feed_id = 'NULL'; @@ -2058,7 +2073,8 @@ reg_exp = '$reg_exp', feed_id = $feed_id, action_id = '$action_id', - filter_type = '$filter_type' + filter_type = '$filter_type', + enabled = $enabled WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); } @@ -2129,6 +2145,7 @@ ttrss_filters.id AS id,reg_exp, ttrss_filter_types.name AS filter_type_name, ttrss_filter_types.description AS filter_type_descr, + enabled, feed_id, ttrss_filter_actions.description AS action_description, ttrss_feeds.title AS feed_title @@ -2169,6 +2186,8 @@ $filter_id = $line["id"]; $edit_filter_id = $_GET["id"]; + + $enabled = sql_bool_to_bool($line["enabled"]); if ($subop == "edit" && $filter_id != $edit_filter_id) { $class .= "Grayed"; @@ -2187,6 +2206,17 @@ print ""; + + if (!$enabled) { + $line["reg_exp"] = "" . + $line["reg_exp"] . " (Disabled)"; + $line["feed_title"] = "" . + $line["feed_title"] . ""; + $line["filter_type_descr"] = "" . + $line["filter_type_descr"] . ""; + $line["action_description"] = "" . + $line["action_description"] . ""; + } print "" . $line["reg_exp"] . ""; diff --git a/functions.php b/functions.php index 7e6a134f..d775abb1 100644 --- a/functions.php +++ b/functions.php @@ -380,8 +380,9 @@ $result = db_query($link, "SELECT reg_exp, ttrss_filter_types.name AS name, - ttrss_filter_actions.name AS action + ttrss_filter_actions.name AS action, FROM ttrss_filters,ttrss_filter_types,ttrss_filter_actions WHERE + enabled = true AND owner_uid = $owner_uid AND ttrss_filter_types.id = filter_type AND ttrss_filter_actions.id = action_id AND -- 2.39.5