You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tt-rss/backend.php

83 lines
1.4 KiB
PHTML

19 years ago
<?
header("Content-Type: application/xml");
include "config.php";
19 years ago
$link = pg_connect(DB_CONN);
$op = $_GET["op"];
19 years ago
if ($op == "feeds") {
$result = pg_query("SELECT * FROM ttrss_feeds ORDER BY title");
19 years ago
print "<ul>";
$lnum = 0;
while ($line = pg_fetch_assoc($result)) {
$feed = $line["title"];
19 years ago
$feed_id = $line["id"];
19 years ago
$class = ($lnum % 2) ? "even" : "odd";
// if ($lnum == 2 || $lnum == 0) $feed = "<b>$feed</b>";
19 years ago
$feed = "<a href=\"javascript:viewfeed($feed_id);\">$feed</a>";
19 years ago
print "<li class=\"$class\">$feed</li>";
++$lnum;
}
print "</ul>";
}
if ($op == "view") {
$post = $_GET["post"];
$feed = $_GET["feed"];
print "<h1>$post</h1>";
print "<h2>$feed</h2>";
print "<p>Blah blah blah blah blah</p>";
}
if ($op == "viewfeed") {
$feed = $_GET["feed"];
$headlines = array("Linus Torvalds flies to the Moon",
"SCO bankrupt at last",
"OMG WTF ANOTHER HEADLINE",
"Another clever headline from $feed",
"I'm really not feeling creative today",
"No, seriously");
$headlines = array_merge($headlines, $headlines);
print "<ul>";
$lnum = 0;
foreach ($headlines as $hl) {
$class = ($lnum % 2) ? "even" : "odd";
// if ($lnum == 2 || $lnum == 0) $feed = "<b>$feed</b>";
$hl = "<a href=\"javascript:view('$feed','$hl')\">$hl</a>";
print "<li class=\"$class\">$hl</li>";
++$lnum;
}
print "</ul>";
}
?>