]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
update translations
[tt-rss.git] / functions.php
index 08e71b9d9de36ce027af729ddafd1ecddb17e948..648ab3438657dc4a4ef36c60846a3c6810469ec4 100644 (file)
 
                        if (!$_SESSION["uid"] || !validate_session($link)) {
                                render_login_form($link, $mobile);
+                               //header("Location: login.php");
                                exit;
                        } else {
                                /* bump login timestamp */
                                                }
                                        } else if ($feed == -2) {
 
-                                               /* FIXME catchup for all labels vfeed */
+
+                                               db_query($link, "UPDATE ttrss_user_entries 
+                                                       SET unread = false,last_read = NOW() WHERE (SELECT COUNT(*) 
+                                                               FROM ttrss_user_labels2 WHERE article_id = ref_id) > 0 
+                                                       AND unread = true AND owner_uid = " . $_SESSION["uid"]);
                                        }
 
                                } else if ($feed > 0) {
                                        $label_id = -$feed - 11;
 
                                        db_query($link, "UPDATE ttrss_user_entries, ttrss_user_labels2 
-                                               SET unread = false WHERE label_id = '$label_id' AND unread = true
+                                               SET unread = false, last_read = NOW() 
+                                                       WHERE label_id = '$label_id' AND unread = true
                                                        AND owner_uid = '".$_SESSION["uid"]."' AND ref_id = article_id");
 
                                }
 
                print "<param key=\"sync_counters\" value=\"1\"/>";
 
+               print "<param key=\"offline_enabled\" value=\"".
+                       (int) get_pref($link, "ENABLE_OFFLINE_READING") . "\"/>";
+
                $result = db_query($link, "SELECT COUNT(*) AS cf FROM
                        ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);