]> git.wh0rd.org - tt-rss.git/blobdiff - mobile/tt-rss.php
mobile: allow marking articles as unread (clses #240)
[tt-rss.git] / mobile / tt-rss.php
index 4722b98c822edcaf8a1b8d5e7bf2fb151cdf9c1a..b291f46dd3686a7fb40b7ef29d129eb8650c732a 100644 (file)
@@ -1,6 +1,8 @@
 <?php
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
 
+       define('MOBILE_VERSION', true);
+
        require_once "../config.php";
        require_once "functions.php";
        require_once "../functions.php"; 
        require_once "../sessions.php";
 
        require_once "../version.php"; 
-       require_once "../config.php";
        require_once "../db-prefs.php";
 
-       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
+       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 
-       if (DB_TYPE == "pgsql") {
-               pg_query("set client_encoding = 'UTF-8'");
-               pg_set_client_encoding("UNICODE");
-       } else {
-               if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) {
-                       db_query($link, "SET NAMES " . MYSQL_CHARSET);
-//                     db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET);
-               }
-       }
+       init_connection($link);
 
        login_sequence($link, true);
 
 
        $sop = db_escape_string($_GET["sop"]);
 
-       if ($sop && $go == "view") {
-               $a_id = db_escape_string($_GET["id"]);
+       if ($sop) {
+               if ($go == "view") {
+                       $a_id = db_escape_string($_GET["id"]);
+               } elseif ($go == "vf") {
+                       $a_id = db_escape_string($_GET["aid"]);
+               }
 
                if ($a_id) {
 
                                toggleMarked($link, $a_id);
                        }
 
-                       $query_string = preg_replace("/&sop=t[sp]/", "", $_SERVER["QUERY_STRING"]);
+                       if ($sop == "mu") {
+                               markUnread($link, $a_id);
+                       }
+
+                       $query_string = str_replace("&sop=$sop", "", $_SERVER["QUERY_STRING"]);
                        header("Location: tt-rss.php?$query_string");
                }
        }
 <?php if (!$go) { ?>
 
 <div id="footer">
-       <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2007 Andrew Dolgov
+       <a href="http://tt-rss.org/">Tiny-Tiny RSS</a>
+       <?php if (!defined('HIDE_VERSION')) { ?>
+                v<?php echo VERSION ?> 
+       <?php } ?>
+       &copy; 2005-2009 Andrew Dolgov
 </div>
 
 <?php } ?>