]> git.wh0rd.org - tt-rss.git/commitdiff
db schema updated, psql feed fetch
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 21 Aug 2005 10:56:27 +0000 (11:56 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 21 Aug 2005 10:56:27 +0000 (11:56 +0100)
backend.php
ttrss_schema.sql

index b4ec48c11326a79c2c089a6233c5fc499fc2a60c..7d072fc8647aa48fbaa5a8e07aa0ce67dea1076f 100644 (file)
@@ -1,19 +1,24 @@
 <?
        header("Content-Type: application/xml");
 
-       $op = $_GET["op"];
+       include "config.php";
 
+       $link = pg_connect(DB_CONN);
+       
+       $op = $_GET["op"];
+       
        if ($op == "feeds") {
 
-               $feeds = array("Art.Gnome.Org Releases", "Footnotes", "Freedesktop.org",        
-                               "Planet Debian", "Planet Gnome");
-
+               $result = pg_query("SELECT * FROM ttrss_feeds ORDER BY title");                 
 
                print "<ul>";
 
                $lnum = 0;
 
-               foreach ($feeds as $feed) {
+               while ($line = pg_fetch_assoc($result)) {
+
+                       $feed = $line["title"];
+                                 
                        $class = ($lnum % 2) ? "even" : "odd";
                        
 //                     if ($lnum == 2 || $lnum == 0) $feed = "<b>$feed</b>";
index 589f9393e0daff403524902b48cca683fdfd564d..58d4e5bb8b1cd36426618facee4bc6bd8c43d9a1 100644 (file)
@@ -14,10 +14,11 @@ insert into ttrss_feeds (id,title,feed_url) values (4, 'Planet Ubuntu', 'http://
 insert into ttrss_feeds (id,title,feed_url) values (5, 'Planet GNOME', 'http://planet.gnome.org/rss20.xml');
 insert into ttrss_feeds (id,title,feed_url) values (6, 'Monologue', 'http://www.go-mono.com/monologue/index.rss');
 
-
 create table ttrss_entries (id serial not null primary key, 
        feed_id int references ttrss_feeds(id), 
        entry_time timestamp not null, 
        headline varchar(250) not null, 
        guid varchar(300) not null unique, 
-       content text not null);
+       content text not null
+       unread boolean default true);
+