summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-09-07 04:53:29 +0100
committerAndrew Dolgov <[email protected]>2005-09-07 04:53:29 +0100
commit1a66d16e4689d827268455c28aa3aee8d46b9cb1 (patch)
tree59b9f883f00afe9948b0d28808d7677917d4dd05 /backend.php
parent6de17d52514965b083a3659fb7708faad4922662 (diff)
scrollable feedlist (iframe)
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/backend.php b/backend.php
index 8ed16ee58..bb8f86534 100644
--- a/backend.php
+++ b/backend.php
@@ -23,6 +23,14 @@
function outputFeedList($link) {
+ print "<html><head>
+ <title>Tiny Tiny RSS : Feedlist</title>
+ <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
+ <script type=\"text/javascript\" src=\"functions.js\"></script>
+ <script type=\"text/javascript\" src=\"feedlist.js\"></script>
+ <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
+ </head><body>";
+
$result = pg_query($link, "SELECT *,
(SELECT count(id) FROM ttrss_entries
WHERE feed_id = ttrss_feeds.id) AS total,
@@ -30,7 +38,9 @@
WHERE feed_id = ttrss_feeds.id AND unread = true) as unread
FROM ttrss_feeds ORDER BY title");
- print "<table width=\"100%\" class=\"feeds\" id=\"feedsList\">";
+ $actid = $_GET["actid"];
+
+ print "<table width=\"100%\" class=\"feedsList\" id=\"feedsList\">";
$lnum = 0;
@@ -50,6 +60,10 @@
if ($unread > 0) $class .= "Unread";
+ if ($actid == $feed_id) {
+ $class .= "Selected";
+ }
+
$total_unread += $unread;
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
@@ -92,6 +106,7 @@
print "</table>";
print "<div class=\"invisible\" id=\"FEEDTU\">$total_unread</div>";
+ print "<div class=\"invisible\" id=\"ACTFEEDID\">$actid</div>";
/*
print "<p align=\"center\">All feeds:
@@ -104,6 +119,7 @@
print "<div class=\"invisible\" id=\"FEEDTU\">$total_unread</div>";
*/
+
}
@@ -144,12 +160,10 @@
if ($subop == "forceUpdateAllFeeds") {
update_all_feeds($link, true);
- outputFeedList($link);
}
if ($subop == "updateAllFeeds") {
update_all_feeds($link, false);
- outputFeedList($link);
}
if ($subop == "catchupPage") {
@@ -264,7 +278,7 @@
// FIXME: check for null value here
- $result = pg_query("SELECT *,SUBSTRING(last_updated,1,16) as last_updated,
+ $result = pg_query("SELECT *,SUBSTRING(last_updated,1,16) as last_updated_s,
EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) as update_timeout
FROM ttrss_feeds WHERE id = '$feed'");
@@ -273,7 +287,8 @@
$line = pg_fetch_assoc($result);
if ($subop == "ForceUpdate" ||
- (!$subop && $line["update_timeout"] > MIN_UPDATE_TIME)) {
+ $line["last_updated"] == "" ||
+ $line["update_timeout"] > MIN_UPDATE_TIME) {
update_rss_feed($link, $line["feed_url"], $feed);
@@ -422,9 +437,11 @@
print "<script type=\"text/javascript\">
document.onkeydown = hotkey_handler;
- var feedr = parent.document.getElementById(\"FEEDR-\" + $feed);
- var feedt = parent.document.getElementById(\"FEEDT-\" + $feed);
- var feedu = parent.document.getElementById(\"FEEDU-\" + $feed);
+ var p_document = parent.frames['feeds-frame'].document;
+
+ var feedr = p_document.getElementById(\"FEEDR-\" + $feed);
+ var feedt = p_document.getElementById(\"FEEDT-\" + $feed);
+ var feedu = p_document.getElementById(\"FEEDU-\" + $feed);
feedt.innerHTML = \"$total\";
feedu.innerHTML = \"$unread\";