blob: d850f02334ba8285709938ec31e6f562e9376e72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
<?
header("Content-Type: application/xml");
include "config.php";
$link = pg_connect(DB_CONN);
$op = $_GET["op"];
if ($op == "feeds") {
$result = pg_query("SELECT * FROM ttrss_feeds ORDER BY title");
print "<ul>";
$lnum = 0;
while ($line = pg_fetch_assoc($result)) {
$feed = $line["title"];
$feed_id = $line["id"];
$class = ($lnum % 2) ? "even" : "odd";
// if ($lnum == 2 || $lnum == 0) $feed = "<b>$feed</b>";
$feed = "<a href=\"javascript:viewfeed($feed_id);\">$feed</a>";
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>";
}
?>
|