]> git.wh0rd.org - tt-rss.git/blob - mobile/classic/index.php
bump copyright year
[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
93 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
94 <?php if ($user_css_url) { ?>
95 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
96 <?php } ?>
97 </head>
98 <body id="ttrssMobile">
99
100 <div id="content">
101 <?php
102 if (!$go) {
103 render_feeds_list($link);
104 } else if ($go == "vf") {
105 render_headlines($link);
106 } else if ($go == "view") {
107 render_article($link);
108 } else if ($go == "sform") {
109 render_search_form($link, $_GET["aid"], $_GET["ic"]);
110 } else {
111 print __("Internal error: Function not implemented");
112 }
113
114 ?>
115 </div>
116
117 </body>
118 </html>