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