- if($debug) _debug("Feed: " . $line["feed_url"] . ", " . $line["last_updated"]);
-
- update_rss_feed($link, $line["id"], true);
- sleep(1); // prevent flood (FIXME make this an option?)
+ // For each feed, we call the feed update function.
+ foreach ($feeds_to_update as $feed) {
+ if($debug) _debug("Base feed: $feed");
+
+ //update_rss_feed( $line["id"], true);
+
+ // since we have the data cached, we can deal with other feeds with the same url
+
+ $tmp_result = db_query( "SELECT DISTINCT ttrss_feeds.id,last_updated
+ FROM ttrss_feeds, ttrss_users, ttrss_user_prefs WHERE
+ ttrss_user_prefs.owner_uid = ttrss_feeds.owner_uid AND
+ ttrss_users.id = ttrss_user_prefs.owner_uid AND
+ ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL' AND
+ feed_url = '".db_escape_string( $feed)."' AND
+ (ttrss_feeds.update_interval > 0 OR
+ ttrss_user_prefs.value != '-1')
+ $login_thresh_qpart
+ ORDER BY ttrss_feeds.id $query_limit");
+
+ if (db_num_rows($tmp_result) > 0) {
+ while ($tline = db_fetch_assoc($tmp_result)) {
+ if($debug) _debug(" => " . $tline["last_updated"] . ", " . $tline["id"]);
+ update_rss_feed( $tline["id"], true);
+ ++$nf;
+ }
+ }