]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
update translations
[tt-rss.git] / functions.php
index 6e386c508082dbbc2d7b6859542f6dbd89c2c9a5..648ab3438657dc4a4ef36c60846a3c6810469ec4 100644 (file)
                        }
 
                        if (!$_SESSION["uid"] || !validate_session($link)) {
-                               //render_login_form($link, $mobile);
-                               header("Location: login.php");
+                               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");
 
                                }