summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-07-25 06:02:42 +0100
committerAndrew Dolgov <[email protected]>2006-07-25 06:02:42 +0100
commit831ff047dde75862c01d8e4ebfe8b9f20bcb6925 (patch)
tree4638dbf223dbf6ddcadae18b1ec70812033c0607 /functions.php
parentf295c368703ef93b9e55d8c6dbc220b40db1e566 (diff)
fix adaptive behaviour for linked feeds
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index 9bd505d5b..ea1cb7110 100644
--- a/functions.php
+++ b/functions.php
@@ -1430,11 +1430,24 @@
$n_feed = sprintf("%d", $feed);
if ($is_cat) {
- return getCategoryUnread($link, $feed);
+ return getCategoryUnread($link, $n_feed);
} else if ($n_feed == -1) {
$match_part = "marked = true";
} else if ($feed > 0) {
- $match_part = "feed_id = '$n_feed'";
+
+ $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE parent_feed = '$n_feed'");
+
+ if (db_num_rows($result) > 0) {
+ $linked_feeds = array();
+ while ($line = db_fetch_assoc($result)) {
+ array_push($linked_feeds, "feed_id = " . $line["id"]);
+ }
+
+ $match_part = implode(" OR ", $linked_feeds);
+
+ } else {
+ $match_part = "feed_id = '$n_feed'";
+ }
} else if ($feed < -10) {
$label_id = -$feed - 11;