]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
update translations
[tt-rss.git] / functions.php
index 80488b09f9b7d3c1294a2f73f457848c4b0f9421..648ab3438657dc4a4ef36c60846a3c6810469ec4 100644 (file)
 
                        if (!$_SESSION["uid"] || !validate_session($link)) {
                                render_login_form($link, $mobile);
+                               //header("Location: login.php");
                                exit;
                        } else {
                                /* bump login timestamp */
                }
        }
        
+       function bool_to_sql_bool($s) {
+               if ($s) {
+                       return "true";
+               } else {
+                       return "false";
+               }
+       }
 
        function toggleEvenOdd($a) {
                if ($a == "even") 
                                                }
                                        } 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");
 
                                }
        }
 
        function get_script_dt_add() {
-               if (strpos(VERSION, ".99") === false) {
+/*             if (strpos(VERSION, ".99") === false) {
                        return VERSION;
                } else {
                        return time();
-               }
+               } */
+               return time();
        }
 
        function get_pgsql_version($link) {
                print "<param key=\"hide_read_feeds\" value=\"" . 
                        (int) get_pref($link, "HIDE_READ_FEEDS") . "\"/>";
 
+               print "<param key=\"enable_feed_cats\" value=\"" . 
+                       (int) get_pref($link, "ENABLE_FEED_CATS") . "\"/>";
+
                print "<param key=\"feeds_sort_by_unread\" value=\"" . 
                        (int) get_pref($link, "FEEDS_SORT_BY_UNREAD") . "\"/>";
 
 
                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"]);