From: Andrew Dolgov Date: Sun, 21 Aug 2005 13:46:43 +0000 (+0100) Subject: basic functionality pass 1 X-Git-Tag: 0.1~22 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d76a3b036c8863ae023686f08e36b11dc9e8ce2e;p=tt-rss.git basic functionality pass 1 --- diff --git a/backend.php b/backend.php index d850f023..5eb64d10 100644 --- a/backend.php +++ b/backend.php @@ -3,13 +3,22 @@ include "config.php"; - $link = pg_connect(DB_CONN); - + require_once('magpierss/rss_fetch.inc'); + + $link = pg_connect(DB_CONN); + + pg_query("set client_encoding = 'utf-8'"); + $op = $_GET["op"]; if ($op == "feeds") { - $result = pg_query("SELECT * FROM ttrss_feeds ORDER BY title"); + $result = pg_query("SELECT *, + (SELECT count(id) FROM ttrss_entries + WHERE feed_id = ttrss_feeds.id) AS total, + (SELECT count(id) FROM ttrss_entries + WHERE feed_id = ttrss_feeds.id AND unread = true) as unread + FROM ttrss_feeds ORDER BY title"); print "