diff options
author | Andrew Dolgov <[email protected]> | 2011-12-27 12:52:33 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-27 12:57:38 +0400 |
commit | ba975b2ec7d20d1e841b1f9fdc1a571317aca3eb (patch) | |
tree | 4c80af67216087197bc077b4564ada5b327626c4 /include/functions.php | |
parent | b69a09ea07041c23e7a7add2fed6c03cb989174b (diff) |
implement filtering by category (closes #386)
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php index ed28fd257..5cbe80c81 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3488,15 +3488,23 @@ inverse, action_param, filter_param - FROM ttrss_filters,ttrss_filter_types,ttrss_filter_actions WHERE + FROM ttrss_filters + LEFT JOIN ttrss_feeds ON (ttrss_feeds.id = '$feed'), + ttrss_filter_types,ttrss_filter_actions + WHERE enabled = true AND $ftype_query_part - owner_uid = $owner_uid AND + ttrss_filters.owner_uid = $owner_uid AND ttrss_filter_types.id = filter_type AND ttrss_filter_actions.id = action_id AND - (feed_id IS NULL OR feed_id = '$feed') ORDER BY reg_exp"); + ((cat_filter = true AND ttrss_feeds.cat_id = ttrss_filters.cat_id) OR + (cat_filter = true AND ttrss_feeds.cat_id IS NULL AND + ttrss_filters.cat_id IS NULL) OR + (cat_filter = false AND (feed_id IS NULL OR feed_id = '$feed'))) + ORDER BY reg_exp"); while ($line = db_fetch_assoc($result)) { + if (!$filters[$line["name"]]) $filters[$line["name"]] = array(); $filter["reg_exp"] = $line["reg_exp"]; $filter["action"] = $line["action"]; |