fixed viewfeed/MarkAllRead behaviour
This commit is contained in:
parent
77a1bf8b83
commit
deaaa02c50
8
NEWS
8
NEWS
|
@ -7,7 +7,13 @@ v1.0.3 (Sep xx, 2005)
|
||||||
- Added ability to mark posts as "starred". These posts are not expired
|
- Added ability to mark posts as "starred". These posts are not expired
|
||||||
automatically.
|
automatically.
|
||||||
- Rework interface using iframes, fixes a lot of scrolling issues.
|
- Rework interface using iframes, fixes a lot of scrolling issues.
|
||||||
- Rejoice, kids! Support for MySQL (InnoDB and version 4.1 REQUIRED!)
|
|
||||||
|
- Rejoice, kids! Introducing support for MySQL (InnoDB and version 4.1 REQUIRED!)
|
||||||
|
|
||||||
|
Special thanks to Jamie McCarthy who basically shamed me into doing this.
|
||||||
|
|
||||||
|
Note: Database support could have suffered regressions from many changes
|
||||||
|
in the code. I need your bugreports and yes - this means YOU! :-)
|
||||||
|
|
||||||
v1.0.2 (Sep 02, 2005)
|
v1.0.2 (Sep 02, 2005)
|
||||||
|
|
||||||
|
|
23
backend.php
23
backend.php
|
@ -303,21 +303,14 @@
|
||||||
|
|
||||||
$line = db_fetch_assoc($result);
|
$line = db_fetch_assoc($result);
|
||||||
|
|
||||||
if ($subop == "ForceUpdate" ||
|
|
||||||
$line["last_updated"] == "" ||
|
|
||||||
$line["update_timeout"] > MIN_UPDATE_TIME) {
|
|
||||||
|
|
||||||
update_rss_feed($link, $line["feed_url"], $feed);
|
update_rss_feed($link, $line["feed_url"], $feed);
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if ($subop == "MarkAllRead") {
|
if ($subop == "MarkAllRead") {
|
||||||
|
|
||||||
db_query($link, "UPDATE ttrss_entries SET unread = false,last_read = NOW()
|
db_query($link, "UPDATE ttrss_entries SET unread = false,last_read = NOW()
|
||||||
WHERE feed_id = '$feed'");
|
WHERE feed_id = '$feed'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
print "<table class=\"headlinesList\" id=\"headlinesList\" width=\"100%\">";
|
print "<table class=\"headlinesList\" id=\"headlinesList\" width=\"100%\">";
|
||||||
|
|
||||||
|
@ -361,15 +354,8 @@
|
||||||
$limit_query_part = "LIMIT " . $limit;
|
$limit_query_part = "LIMIT " . $limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DB_TYPE == "pgsql") {
|
|
||||||
$extract_epoch_qpart = "
|
|
||||||
,EXTRACT(EPOCH FROM last_read) AS last_read_ts,
|
|
||||||
EXTRACT(EPOCH FROM updated) AS updated_ts";
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = db_query($link, "SELECT
|
$result = db_query($link, "SELECT
|
||||||
id,title,updated,unread,feed_id,marked,link
|
id,title,updated,unread,feed_id,marked,link,last_read
|
||||||
$extract_epoch_qpart
|
|
||||||
FROM
|
FROM
|
||||||
ttrss_entries
|
ttrss_entries
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -389,7 +375,12 @@
|
||||||
$id = $line["id"];
|
$id = $line["id"];
|
||||||
$feed_id = $line["feed_id"];
|
$feed_id = $line["feed_id"];
|
||||||
|
|
||||||
if ($line["last_read_ts"] < $line["updated_ts"] && $line["unread"] == "f") {
|
// printf("%d %s - %d %s<br>", strtotime($line["last_read"]), $line["last_read"],
|
||||||
|
// strtotime($line["updated"]), $line["updated"]);
|
||||||
|
|
||||||
|
if (strtotime($line["last_read"]) < strtotime($line["updated"]) &&
|
||||||
|
($line["unread"] == "f" || $line["unread"] == "0")) {
|
||||||
|
|
||||||
$update_pic = "<img id='FUPDPIC-$id' src=\"images/updated.png\"
|
$update_pic = "<img id='FUPDPIC-$id' src=\"images/updated.png\"
|
||||||
alt=\"Updated\">";
|
alt=\"Updated\">";
|
||||||
++$num_unread;
|
++$num_unread;
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache');
|
define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache');
|
||||||
// Local cache directory for RSS feeds
|
// Local cache directory for RSS feeds
|
||||||
|
|
||||||
define(MIN_UPDATE_TIME, 1800);
|
|
||||||
|
|
||||||
define(WEB_DEMO_MODE, false);
|
define(WEB_DEMO_MODE, false);
|
||||||
|
|
||||||
define(ENABLE_FEED_ICONS, true);
|
define(ENABLE_FEED_ICONS, true);
|
||||||
|
|
|
@ -50,10 +50,9 @@ function viewfeed(feed, skip, subop, doc) {
|
||||||
if (subop == "MarkAllRead") {
|
if (subop == "MarkAllRead") {
|
||||||
|
|
||||||
var feedr = document.getElementById("FEEDR-" + feed);
|
var feedr = document.getElementById("FEEDR-" + feed);
|
||||||
var feedt = document.getElementById("FEEDT-" + feed);
|
var feedctr = document.getElementById("FEEDCTR-" + feed);
|
||||||
var feedu = document.getElementById("FEEDU-" + feed);
|
|
||||||
|
|
||||||
feedu.innerHTML = "0";
|
feedctr.className = "invisible";
|
||||||
|
|
||||||
if (feedr.className.match("Unread")) {
|
if (feedr.className.match("Unread")) {
|
||||||
feedr.className = feedr.className.replace("Unread", "");
|
feedr.className = feedr.className.replace("Unread", "");
|
||||||
|
|
|
@ -17,17 +17,7 @@
|
||||||
|
|
||||||
db_query($link, "BEGIN");
|
db_query($link, "BEGIN");
|
||||||
|
|
||||||
if (!$fetch) {
|
|
||||||
|
|
||||||
$result = db_query($link, "SELECT feed_url,id FROM ttrss_feeds WHERE
|
|
||||||
last_updated is null OR title = '' OR
|
|
||||||
EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) > " .
|
|
||||||
MIN_UPDATE_TIME);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$result = db_query($link, "SELECT feed_url,id FROM ttrss_feeds");
|
$result = db_query($link, "SELECT feed_url,id FROM ttrss_feeds");
|
||||||
}
|
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
while ($line = db_fetch_assoc($result)) {
|
||||||
update_rss_feed($link, $line["feed_url"], $line["id"]);
|
update_rss_feed($link, $line["feed_url"], $line["id"]);
|
||||||
|
|
|
@ -159,7 +159,7 @@ function viewCurrentFeed(skip, subop) {
|
||||||
|
|
||||||
function viewfeed(feed, skip, subop) {
|
function viewfeed(feed, skip, subop) {
|
||||||
|
|
||||||
// notify("Loading headlines...");
|
notify("Loading headlines...");
|
||||||
|
|
||||||
enableHotkeys();
|
enableHotkeys();
|
||||||
|
|
||||||
|
@ -205,10 +205,9 @@ function viewfeed(feed, skip, subop) {
|
||||||
if (subop == "MarkAllRead") {
|
if (subop == "MarkAllRead") {
|
||||||
|
|
||||||
var feedr = f_doc.getElementById("FEEDR-" + feed);
|
var feedr = f_doc.getElementById("FEEDR-" + feed);
|
||||||
var feedt = f_doc.getElementById("FEEDT-" + feed);
|
var feedctr = f_doc.getElementById("FEEDCTR-" + feed);
|
||||||
var feedu = f_doc.getElementById("FEEDU-" + feed);
|
|
||||||
|
|
||||||
feedu.innerHTML = "0";
|
feedctr.className = "invisible";
|
||||||
|
|
||||||
if (feedr.className.match("Unread")) {
|
if (feedr.className.match("Unread")) {
|
||||||
feedr.className = feedr.className.replace("Unread", "");
|
feedr.className = feedr.className.replace("Unread", "");
|
||||||
|
|
Loading…
Reference in New Issue