]> git.wh0rd.org - tt-rss.git/blob - mobile/tt-rss.php
rework login process, drop http auth
[tt-rss.git] / mobile / tt-rss.php
1 <?php
2 require_once "../config.php";
3 require_once "functions.php";
4 require_once "../functions.php";
5
6 require_once "../sessions.php";
7
8 require_once "../version.php";
9 require_once "../config.php";
10 require_once "../db-prefs.php";
11
12 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
13
14 login_sequence($link);
15
16 /* perform various redirect-needing subops */
17
18 $subop = db_escape_string($_GET["subop"]);
19 $go = $_GET["go"];
20
21 if ($subop == "tc" && !$go) {
22
23 $cat_id = db_escape_string($_GET["id"]);
24
25 if ($cat_id != 0) {
26 db_query($link, "UPDATE ttrss_feed_categories SET
27 collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " .
28 $_SESSION["uid"]);
29 } else {
30 if ($_COOKIE["ttrss_vf_uclps"] != 1) {
31 setcookie("ttrss_vf_uclps", 1);
32 } else {
33 setcookie("ttrss_vf_uclps", 0);
34 }
35 }
36
37 header("Location: tt-rss.php");
38 return;
39 }
40
41 $ts_id = db_escape_string($_GET["ts"]);
42
43 if ($go == "vf" && $ts_id) {
44 $result = db_query($link, "UPDATE ttrss_user_entries SET marked = NOT marked
45 WHERE ref_id = '$ts_id' AND owner_uid = " . $_SESSION["uid"]);
46 $query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
47 header("Location: tt-rss.php?$query_string");
48 return;
49 }
50 ?>
51 <html>
52 <head>
53 <title>Tiny Tiny RSS - Mobile</title>
54 <link rel="stylesheet" type="text/css" href="mobile.css">
55 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
56 </head>
57 <body>
58
59 <div id="content">
60 <?php
61 if (!$go) {
62 render_feeds_list($link);
63 } else if ($go == "vf") {
64 render_headlines($link);
65 } else if ($go == "view") {
66 render_article($link);
67 } else {
68 print "Function not implemented";
69 }
70
71 ?>
72 </div>
73
74 <div id="footer">
75 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2006 Andrew Dolgov
76 </div>
77
78 </body>
79 </html>