]> git.wh0rd.org - tt-rss.git/blob - mobile/tt-rss.php
mobile: add some translations
[tt-rss.git] / mobile / tt-rss.php
1 <?php
2 error_reporting(E_ERROR | E_WARNING | E_PARSE);
3
4 require_once "../config.php";
5 require_once "functions.php";
6 require_once "../functions.php";
7
8 require_once "../sessions.php";
9
10 require_once "../version.php";
11 require_once "../db-prefs.php";
12
13 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
14
15 init_connection($link);
16
17 login_sequence($link, true);
18
19 /* perform various redirect-needing subops */
20
21 $subop = db_escape_string($_GET["subop"]);
22 $go = $_GET["go"];
23
24 if ($subop == "tc" && !$go) {
25
26 $cat_id = db_escape_string($_GET["id"]);
27
28 if ($cat_id != 0) {
29 db_query($link, "UPDATE ttrss_feed_categories SET
30 collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " .
31 $_SESSION["uid"]);
32 } else {
33 if ($_COOKIE["ttrss_vf_uclps"] != 1) {
34 setcookie("ttrss_vf_uclps", 1);
35 } else {
36 setcookie("ttrss_vf_uclps", 0);
37 }
38 }
39
40 header("Location: tt-rss.php");
41 return;
42 }
43
44 $ts_id = db_escape_string($_GET["ts"]);
45
46 if ($go == "vf" && $ts_id) {
47
48 toggleMarked($link, $ts_id);
49
50 $query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
51 header("Location: tt-rss.php?$query_string");
52 return;
53 }
54
55 $tp_id = db_escape_string($_GET["tp"]);
56
57 if ($go == "vf" && $tp_id) {
58
59 togglePublished($link, $tp_id);
60
61 $query_string = preg_replace("/&tp=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
62 header("Location: tt-rss.php?$query_string");
63 return;
64 }
65
66 $sop = db_escape_string($_GET["sop"]);
67
68 if ($sop && $go == "view") {
69 $a_id = db_escape_string($_GET["id"]);
70
71 if ($a_id) {
72
73 if ($sop == "tp") {
74 togglePublished($link, $a_id);
75 }
76
77 if ($sop == "ts") {
78 toggleMarked($link, $a_id);
79 }
80
81 $query_string = preg_replace("/&sop=t[sp]/", "", $_SERVER["QUERY_STRING"]);
82 header("Location: tt-rss.php?$query_string");
83 }
84 }
85
86 ?>
87 <html>
88 <head>
89 <title>Tiny Tiny RSS - Mobile</title>
90 <link rel="stylesheet" type="text/css" href="mobile.css">
91 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
92 <script type="text/javascript" src="tt-rss.js"></script>
93
94 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
95 <?php if ($user_css_url) { ?>
96 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
97 <?php } ?>
98 </head>
99 <body id="ttrssMobile">
100
101 <div id="content">
102 <?php
103 if (!$go) {
104 render_feeds_list($link);
105 } else if ($go == "vf") {
106 render_headlines($link);
107 } else if ($go == "view") {
108 render_article($link);
109 } else if ($go == "sform") {
110 render_search_form($link, $_GET["aid"], $_GET["ic"]);
111 } else {
112 print __("Internal error: Function not implemented");
113 }
114
115 ?>
116 </div>
117
118 <?php if (!$go) { ?>
119
120 <div id="footer">
121 <a href="http://tt-rss.org/">Tiny-Tiny RSS</a>
122 <?php if (!defined('HIDE_VERSION')) { ?>
123 v<?php echo VERSION ?>
124 <?php } ?>
125 &copy; 2005-2008 Andrew Dolgov
126 </div>
127
128 <?php } ?>
129
130 </body>
131 </html>