]> git.wh0rd.org - tt-rss.git/blame - mobile/tt-rss.php
mobile: interface tweaks
[tt-rss.git] / mobile / tt-rss.php
CommitLineData
9338b88c
AD
1<?
2 require_once "../functions.php";
ca35939d 3 require_once "functions.php";
9338b88c
AD
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);
ca35939d
AD
14
15 login_sequence($link);
16
42096f52
AD
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"]);
b750d485
AD
30 } else {
31 if ($_COOKIE["ttrss_vf_uclps"] != 1) {
32 setcookie("ttrss_vf_uclps", 1);
33 } else {
34 setcookie("ttrss_vf_uclps", 0);
35 }
42096f52 36 }
b750d485
AD
37
38 header("Location: tt-rss.php");
39 return;
42096f52
AD
40 }
41
24ac6776
AD
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 }
9338b88c
AD
51?>
52<html>
53<head>
54 <title>Tiny Tiny RSS - Mobile</title>
55 <link rel="stylesheet" type="text/css" href="mobile.css">
2f468537 56 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
9338b88c
AD
57</head>
58<body>
59
8e3f7217 60<div id="content">
ca35939d 61<?
42096f52 62 if (!$go) {
ca35939d 63 render_feeds_list($link);
2f468537
AD
64 } else if ($go == "vf") {
65 render_headlines($link);
42096f52
AD
66 } else if ($go == "view") {
67 render_article($link);
8e3f7217
AD
68 } else {
69 print "Function not implemented";
ca35939d
AD
70 }
71
72?>
8e3f7217
AD
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>
ca35939d 78
9338b88c
AD
79</body>
80</html>