]> git.wh0rd.org Git - tt-rss.git/blob - mobile/tt-rss.php
mobile: interface tweaks
[tt-rss.git] / mobile / tt-rss.php
1 <?
2         require_once "../functions.php"; 
3         require_once "functions.php";
4
5         basic_nosid_redirect_check();
6
7         require_once "../sessions.php";
8
9         require_once "../version.php"; 
10         require_once "../config.php";
11         require_once "../db-prefs.php";
12
13         $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
14
15         login_sequence($link);
16
17         /* perform various redirect-needing subops */
18
19         $subop = db_escape_string($_GET["subop"]);
20         $go = $_GET["go"];
21
22         if ($subop == "tc" && !$go) {
23                 
24                 $cat_id = db_escape_string($_GET["id"]);
25                         
26                 if ($cat_id != 0) {                     
27                         db_query($link, "UPDATE ttrss_feed_categories SET
28                                 collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " . 
29                                 $_SESSION["uid"]);
30                 } else {
31                         if ($_COOKIE["ttrss_vf_uclps"] != 1) {
32                                 setcookie("ttrss_vf_uclps", 1);
33                         } else {
34                                 setcookie("ttrss_vf_uclps", 0);
35                         }
36                 }
37                 
38                 header("Location: tt-rss.php");
39                 return;
40         }
41
42         $ts_id = db_escape_string($_GET["ts"]);
43
44         if ($go == "vf" && $ts_id) {
45                 $result = db_query($link, "UPDATE ttrss_user_entries SET marked = NOT marked
46                         WHERE ref_id = '$ts_id' AND owner_uid = " . $_SESSION["uid"]);
47                 $query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
48                 header("Location: tt-rss.php?$query_string");
49                 return;
50         }
51 ?>
52 <html>
53 <head>
54         <title>Tiny Tiny RSS - Mobile</title>
55         <link rel="stylesheet" type="text/css" href="mobile.css">
56         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
57 </head>
58 <body>
59
60 <div id="content">
61 <?
62         if (!$go) {
63                 render_feeds_list($link);
64         } else if ($go == "vf") {
65                 render_headlines($link);        
66         } else if ($go == "view") {
67                 render_article($link);
68         } else {
69                 print "Function not implemented";
70         }
71
72 ?>
73 </div>
74
75 <div id="footer">
76         <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
77 </div>
78
79 </body>
80 </html>