]> git.wh0rd.org - tt-rss.git/blob - mobile/tt-rss.php
mobile: add search
[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 "../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, true);
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 if ($go == "sform") {
70 render_search_form($link, $_GET["aid"], $_GET["ic"]);
71 } else {
72 print __("Internal error: Function not implemented");
73 }
74
75 ?>
76 </div>
77
78 <div id="footer">
79 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2006 Andrew Dolgov
80 </div>
81
82 </body>
83 </html>