]> git.wh0rd.org Git - tt-rss.git/commitdiff
fixed viewfeed/MarkAllRead behaviour
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 7 Sep 2005 14:03:30 +0000 (15:03 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 7 Sep 2005 14:03:30 +0000 (15:03 +0100)
NEWS
backend.php
config.php-dist
feedlist.js
functions.php
tt-rss.js

diff --git a/NEWS b/NEWS
index 44f3002a0d184fc4ea7bd60b3291150856e4ec60..129cbf8a0f645522a455f2127882a8047389748f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,9 +5,15 @@ v1.0.3 (Sep xx, 2005)
          checking is case insensitive)
        - Reworked preferences dialog
        - Added ability to mark posts as "starred". These posts are not expired
-         automatically.
+         automatically.          
        - 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)
 
index b4181069fd38bf9408415e99243c0bb6e50ece72..556c9469791f890a691205d10d0212ecad881435 100644 (file)
 
                        $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() 
-                                               WHERE feed_id = '$feed'");
-                               }
+                               db_query($link, "UPDATE ttrss_entries SET unread = false,last_read = NOW() 
+                                       WHERE feed_id = '$feed'");
                        }
                }
 
                        $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 
-                               id,title,updated,unread,feed_id,marked,link
-                               $extract_epoch_qpart
+                               id,title,updated,unread,feed_id,marked,link,last_read
                        FROM
                                ttrss_entries 
                        WHERE
                        $id = $line["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\" 
                                        alt=\"Updated\">";
                                ++$num_unread;
index fd35eeb078849393ccc39ead64690efe086e248c..e604cf89d6977d7bd1b25a1b970fa26794ede9ec 100644 (file)
@@ -11,8 +11,6 @@
 
        define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache');
        // Local cache directory for RSS feeds
-
-       define(MIN_UPDATE_TIME, 1800);
        
        define(WEB_DEMO_MODE, false);
        
index d2b49f41509ce6426f81f02db1cbbf8064bb58d9..b5b34bfccb7389ee5cc5f68b2ff98eeadc139d48 100644 (file)
@@ -50,10 +50,9 @@ function viewfeed(feed, skip, subop, doc) {
        if (subop == "MarkAllRead") {
 
                var feedr = document.getElementById("FEEDR-" + feed);
-               var feedt = document.getElementById("FEEDT-" + feed);
-               var feedu = document.getElementById("FEEDU-" + feed);
-
-               feedu.innerHTML = "0";
+               var feedctr = document.getElementById("FEEDCTR-" + feed);
+       
+               feedctr.className = "invisible";
 
                if (feedr.className.match("Unread")) {
                        feedr.className = feedr.className.replace("Unread", "");
index 742e026f5c54f01c63ef26c02451bc82299deb91..5736c016e7d1413923a50dc455ed30ffbb81ab6a 100644 (file)
 
                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)) {
                        update_rss_feed($link, $line["feed_url"], $line["id"]);
                                                        content, 
                                                        content_hash,
                                                        feed_id, 
-                                                       comments,
+                                                       comments,                                                       
                                                        no_orig_date) 
                                                VALUES
                                                        ('$entry_title', 
index 5f1269a5a2273bd685bc209555e9ebbff61af311..25c608518fecb5ff0d50d4b75f689ac5c42afb56 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -159,7 +159,7 @@ function viewCurrentFeed(skip, subop) {
 
 function viewfeed(feed, skip, subop) {
 
-//     notify("Loading headlines...");
+       notify("Loading headlines...");
 
        enableHotkeys();
 
@@ -201,14 +201,13 @@ function viewfeed(feed, skip, subop) {
        f_doc.getElementById("ACTFEEDID").innerHTML = feed;
 
        setCookie("ttrss_vf_actfeed", feed);
-
+       
        if (subop == "MarkAllRead") {
 
                var feedr = f_doc.getElementById("FEEDR-" + feed);
-               var feedt = f_doc.getElementById("FEEDT-" + feed);
-               var feedu = f_doc.getElementById("FEEDU-" + feed);
+               var feedctr = f_doc.getElementById("FEEDCTR-" + feed);
                
-               feedu.innerHTML = "0";
+               feedctr.className = "invisible";
 
                if (feedr.className.match("Unread")) {
                        feedr.className = feedr.className.replace("Unread", "");