From: Andrew Dolgov Date: Thu, 8 Sep 2005 02:49:20 +0000 (+0100) Subject: response size optimizations for viewfeed/view X-Git-Tag: 1.0.4~37 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8d7008c7b0c47899d105216065158a004a4cf009;p=tt-rss.git response size optimizations for viewfeed/view --- diff --git a/backend.php b/backend.php index 10169f7a..ae35ee12 100644 --- a/backend.php +++ b/backend.php @@ -265,6 +265,11 @@ $addheader = $_GET["addheader"]; $limit = $_GET["limit"]; + if (!$feed) { + print "Error: no feed to display."; + return; + } + if (!$skip) $skip = 0; if ($subop == "undefined") $subop = ""; @@ -279,17 +284,10 @@ "; } - if (DB_TYPE == "pgsql") { - $result = db_query($link, - "SELECT *,SUBSTRING(last_updated,1,16) as last_updated_s, - EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) as update_timeout - FROM ttrss_feeds WHERE id = '$feed'"); - } else { - $result = db_query($link, - "SELECT *,SUBSTRING(last_updated,1,16) as last_updated_s - FROM ttrss_feeds WHERE id = '$feed'"); - } - + $result = db_query($link, + "SELECT *,SUBSTRING(last_updated,1,16) as last_updated_s + FROM ttrss_feeds WHERE id = '$feed'"); + if ($result) { $line = db_fetch_assoc($result); @@ -341,7 +339,7 @@ $unread_entries = db_fetch_result($result, 0, "unread_entries"); */ - if ($limit != "All") { + if ($limit && $limit != "All") { $limit_query_part = "LIMIT " . $limit; } @@ -403,15 +401,12 @@ print " - print "$update_pic"; - - print "$marked_pic"; + print "$update_pic"; + print "$marked_pic"; - print " + print " ".$line["updated"].""; - print "$content_link"; + print "$content_link"; print "";