]> git.wh0rd.org - tt-rss.git/blob - mobile/classic/index.php
db2215b24a5e0b5ad924ec0d39ef4f1baa860479
[tt-rss.git] / mobile / classic / index.php
1 <?php
2 error_reporting(E_ERROR | E_WARNING | E_PARSE);
3
4 define('MOBILE_VERSION', true);
5
6 require_once "../../config.php";
7 require_once "functions.php";
8 require_once "../../functions.php";
9
10 require_once "../../sessions.php";
11
12 require_once "../../version.php";
13 require_once "../../db-prefs.php";
14
15 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
16
17 init_connection($link);
18
19 login_sequence($link, 2);
20
21 /* perform various redirect-needing subops */
22
23 $subop = db_escape_string($_GET["subop"]);
24 $go = $_GET["go"];
25
26 if ($subop == "tc" && !$go) {
27
28 $cat_id = db_escape_string($_GET["id"]);
29 toggle_collapse_cat($link, $cat_id);
30
31 header("Location: index.php");
32 return;
33 }
34
35 $ts_id = db_escape_string($_GET["ts"]);
36
37 if ($go == "vf" && $ts_id) {
38
39 toggleMarked($link, $ts_id);
40
41 $query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
42 header("Location: index.php?$query_string");
43 return;
44 }
45
46 $tp_id = db_escape_string($_GET["tp"]);
47
48 if ($go == "vf" && $tp_id) {
49
50 togglePublished($link, $tp_id);
51
52 $query_string = preg_replace("/&tp=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
53 header("Location: index.php?$query_string");
54 return;
55 }
56
57 $sop = db_escape_string($_GET["sop"]);
58
59 if ($sop) {
60 if ($go == "view") {
61 $a_id = db_escape_string($_GET["id"]);
62 } elseif ($go == "vf") {
63 $a_id = db_escape_string($_GET["aid"]);
64 }
65
66 if ($a_id) {
67
68 if ($sop == "tp") {
69 togglePublished($link, $a_id);
70 }
71
72 if ($sop == "ts") {
73 toggleMarked($link, $a_id);
74 }
75
76 if ($sop == "mu") {
77 markUnread($link, $a_id);
78 }
79
80 $query_string = str_replace("&sop=$sop", "", $_SERVER["QUERY_STRING"]);
81 header("Location: index.php?$query_string");
82 }
83 }
84
85 ?>
86 <html>
87 <head>
88 <title>Tiny Tiny RSS</title>
89 <link rel="stylesheet" type="text/css" href="mobile.css">
90 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
91 <script type="text/javascript" src="mobile.js"></script>
92 <?php print_user_stylesheet($link) ?>
93 </head>
94 <body id="ttrssMobile">
95
96 <div id="content">
97 <?php
98 if (!$go) {
99 render_feeds_list($link);
100 } else if ($go == "vf") {
101 render_headlines($link);
102 } else if ($go == "view") {
103 render_article($link);
104 } else if ($go == "sform") {
105 render_search_form($link, $_GET["aid"], $_GET["ic"]);
106 } else {
107 print __("Internal error: Function not implemented");
108 }
109
110 ?>
111 </div>
112
113 </body>
114 </html>