From d76a3b036c8863ae023686f08e36b11dc9e8ce2e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 21 Aug 2005 14:46:43 +0100 Subject: [PATCH] basic functionality pass 1 --- backend.php | 185 ++++++++++++++++++++++++++++++++++++++++------- tt-rss.css | 52 ++++++++++--- tt-rss.js | 34 ++++++--- tt-rss.php | 5 +- ttrss_schema.sql | 14 ++-- 5 files changed, 234 insertions(+), 56 deletions(-) diff --git a/backend.php b/backend.php index d850f0233..5eb64d102 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 "