From: Andrew Dolgov Date: Wed, 16 Aug 2006 13:19:24 +0000 (+0100) Subject: use getCategoryUnread in outputFeedList, misc fixes X-Git-Tag: schema_freeze_for_1.2.2~2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=26eb0119a591db451551bb11afe214b23725c8fc;p=tt-rss.git use getCategoryUnread in outputFeedList, misc fixes --- diff --git a/backend.php b/backend.php index 428939fe..583ab658 100644 --- a/backend.php +++ b/backend.php @@ -364,21 +364,9 @@ $ellipsis = ""; } - if ($cat_id) { - $cat_id_qpart = "cat_id = '$cat_id'"; - } else { - $cat_id_qpart = "cat_id IS NULL"; - } - - $tmp_result = db_query($link, "SELECT count(int_id) AS unread - FROM ttrss_user_entries,ttrss_feeds WHERE - unread = true AND - feed_id = ttrss_feeds.id AND $cat_id_qpart AND - ttrss_user_entries.owner_uid = " . $_SESSION["uid"]); - - $cat_unread = db_fetch_result($tmp_result, 0, "unread"); - $cat_id = sprintf("%d", $cat_id); + + $cat_unread = getCategoryUnread($link, $cat_id); print "
  • $tmp_category diff --git a/mobile/functions.php b/mobile/functions.php index d35e6e23..398a12a5 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -204,16 +204,9 @@ $cat_id_qpart = "cat_id IS NULL"; } - $tmp_result = db_query($link, "SELECT count(int_id) AS unread - FROM ttrss_user_entries,ttrss_feeds WHERE - unread = true AND - feed_id = ttrss_feeds.id AND $cat_id_qpart AND - ttrss_user_entries.owner_uid = " . $_SESSION["uid"]); - - $cat_unread = db_fetch_result($tmp_result, 0, "unread"); - $cat_id = sprintf("%d", $cat_id); - + $cat_unread = getCategoryUnread($link, $cat_id); + print "
  • $tmp_category