diff --git a/functions.php b/functions.php index d7342e2cd..8e60ad80f 100644 --- a/functions.php +++ b/functions.php @@ -1936,9 +1936,6 @@ } } -// print session_id(); -// print_r($_SESSION); - if (!$_SESSION["uid"] || !validate_session($link)) { render_login_form($link, $mobile); exit; @@ -2278,30 +2275,18 @@ function getAllCounters($link, $omode = "flc", $active_feed = false) { - /* getting all counters is a resource intensive operation, so we - * rate limit it a little bit */ - - - -// if (get_pref($link, "SYNC_COUNTERS") || -// time() - $_SESSION["get_all_counters_stamp"] > 5) { - - if (!$omode) $omode = "flc"; + if (!$omode) $omode = "flc"; - getGlobalCounters($link); + getGlobalCounters($link); - if (strchr($omode, "l")) getLabelCounters($link); - if (strchr($omode, "f")) getFeedCounters($link, SMART_RPC_COUNTERS, $active_feed); - if (strchr($omode, "t")) getTagCounters($link); - if (strchr($omode, "c")) { - if (get_pref($link, 'ENABLE_FEED_CATS')) { - getCategoryCounters($link); - } + if (strchr($omode, "l")) getLabelCounters($link); + if (strchr($omode, "f")) getFeedCounters($link, SMART_RPC_COUNTERS, $active_feed); + if (strchr($omode, "t")) getTagCounters($link); + if (strchr($omode, "c")) { + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); } - - $_SESSION["get_all_counters_stamp"] = time(); -// } - + } } function getCategoryCounters($link) { @@ -2573,15 +2558,6 @@ $tctrs_modified = false; -/* $result = db_query($link, "SELECT tag_name,count(ttrss_entries.id) AS count - FROM ttrss_tags,ttrss_entries,ttrss_user_entries WHERE - ttrss_user_entries.ref_id = ttrss_entries.id AND - ttrss_tags.owner_uid = ".$_SESSION["uid"]." AND - post_int_id = ttrss_user_entries.int_id AND unread = true GROUP BY tag_name - UNION - select tag_name,0 as count FROM ttrss_tags - WHERE ttrss_tags.owner_uid = ".$_SESSION["uid"]); */ - $age_qpart = getMaxAgeSubquery(); $result = db_query($link, "SELECT tag_name,SUM((SELECT COUNT(int_id) @@ -2712,21 +2688,6 @@ $old_counters = $_SESSION["fctr_last_value"]; -/* $query = "SELECT ttrss_feeds.id, - ttrss_feeds.title, - ".SUBSTRING_FOR_DATE."(ttrss_feeds.last_updated,1,19) AS last_updated, - last_error, - COUNT(ttrss_entries.id) AS count - FROM ttrss_feeds - LEFT JOIN ttrss_user_entries ON (ttrss_user_entries.feed_id = ttrss_feeds.id - AND ttrss_user_entries.owner_uid = ttrss_feeds.owner_uid - AND ttrss_user_entries.unread = true) - LEFT JOIN ttrss_entries ON (ttrss_user_entries.ref_id = ttrss_entries.id AND - $age_qpart) - WHERE ttrss_feeds.owner_uid = ".$_SESSION["uid"]." - AND parent_feed IS NULL - GROUP BY ttrss_feeds.id, ttrss_feeds.title, ttrss_feeds.last_updated, last_error"; */ - $query = "SELECT ttrss_feeds.id, ttrss_feeds.title, ".SUBSTRING_FOR_DATE."(ttrss_feeds.last_updated,1,19) AS last_updated, @@ -2757,13 +2718,6 @@ $has_img = feed_has_icon($id); -/* $tmp_result = db_query($link, - "SELECT ttrss_feeds.id,COUNT(unread) AS unread - FROM ttrss_feeds LEFT JOIN ttrss_user_entries - ON (ttrss_feeds.id = ttrss_user_entries.feed_id) - LEFT JOIN ttrss_entries ON (ttrss_user_entries.ref_id = ttrss_entries.id) - WHERE parent_feed = '$id' AND $age_qpart AND unread = true GROUP BY ttrss_feeds.id"); */ - $tmp_result = db_query($link, "SELECT SUM(value) AS unread FROM ttrss_feeds, ttrss_counters_cache WHERE parent_feed = '$id' AND feed_id = id"); @@ -4635,12 +4589,6 @@ $feed_icon = " "; } -/* if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "(Comments)"; - } else { - $entry_comments = ""; - } */ - $num_comments = $line["num_comments"]; $entry_comments = ""; @@ -4690,10 +4638,6 @@ print "