]>
Commit | Line | Data |
---|---|---|
e9e95dae | 1 | <?php |
793185a9 AD |
2 | error_reporting(E_ERROR | E_WARNING | E_PARSE); |
3 | ||
3dd46f19 | 4 | require_once "../config.php"; |
ca35939d | 5 | require_once "functions.php"; |
3dd46f19 | 6 | require_once "../functions.php"; |
9338b88c | 7 | |
9338b88c AD |
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); | |
ca35939d | 15 | |
da3427a0 AD |
16 | if (DB_TYPE == "pgsql") { |
17 | pg_query("set client_encoding = 'UTF-8'"); | |
18 | pg_set_client_encoding("UNICODE"); | |
19 | } else { | |
20 | if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { | |
21 | db_query($link, "SET NAMES " . MYSQL_CHARSET); | |
22 | // db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); | |
23 | } | |
24 | } | |
25 | ||
793185a9 | 26 | login_sequence($link, true); |
ca35939d | 27 | |
42096f52 AD |
28 | /* perform various redirect-needing subops */ |
29 | ||
30 | $subop = db_escape_string($_GET["subop"]); | |
31 | $go = $_GET["go"]; | |
32 | ||
33 | if ($subop == "tc" && !$go) { | |
34 | ||
35 | $cat_id = db_escape_string($_GET["id"]); | |
36 | ||
37 | if ($cat_id != 0) { | |
38 | db_query($link, "UPDATE ttrss_feed_categories SET | |
39 | collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " . | |
40 | $_SESSION["uid"]); | |
b750d485 AD |
41 | } else { |
42 | if ($_COOKIE["ttrss_vf_uclps"] != 1) { | |
43 | setcookie("ttrss_vf_uclps", 1); | |
44 | } else { | |
45 | setcookie("ttrss_vf_uclps", 0); | |
46 | } | |
42096f52 | 47 | } |
b750d485 AD |
48 | |
49 | header("Location: tt-rss.php"); | |
50 | return; | |
42096f52 AD |
51 | } |
52 | ||
24ac6776 AD |
53 | $ts_id = db_escape_string($_GET["ts"]); |
54 | ||
55 | if ($go == "vf" && $ts_id) { | |
f70f7e28 AD |
56 | |
57 | toggleMarked($link, $ts_id); | |
58 | ||
24ac6776 AD |
59 | $query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]); |
60 | header("Location: tt-rss.php?$query_string"); | |
61 | return; | |
62 | } | |
510ac75f AD |
63 | |
64 | $tp_id = db_escape_string($_GET["tp"]); | |
65 | ||
66 | if ($go == "vf" && $tp_id) { | |
f70f7e28 AD |
67 | |
68 | togglePublished($link, $tp_id); | |
69 | ||
510ac75f AD |
70 | $query_string = preg_replace("/&tp=[0-9]*/", "", $_SERVER["QUERY_STRING"]); |
71 | header("Location: tt-rss.php?$query_string"); | |
72 | return; | |
73 | } | |
74 | ||
f70f7e28 AD |
75 | $sop = db_escape_string($_GET["sop"]); |
76 | ||
77 | if ($sop && $go == "view") { | |
78 | $a_id = db_escape_string($_GET["id"]); | |
79 | ||
80 | if ($a_id) { | |
81 | ||
82 | if ($sop == "tp") { | |
83 | togglePublished($link, $a_id); | |
84 | } | |
85 | ||
86 | if ($sop == "ts") { | |
87 | toggleMarked($link, $a_id); | |
88 | } | |
89 | ||
90 | $query_string = preg_replace("/&sop=t[sp]/", "", $_SERVER["QUERY_STRING"]); | |
91 | header("Location: tt-rss.php?$query_string"); | |
92 | } | |
93 | } | |
94 | ||
9338b88c AD |
95 | ?> |
96 | <html> | |
97 | <head> | |
98 | <title>Tiny Tiny RSS - Mobile</title> | |
99 | <link rel="stylesheet" type="text/css" href="mobile.css"> | |
2f468537 | 100 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
fc46ab83 | 101 | <script type="text/javascript" src="tt-rss.js"></script> |
27f5a18f AD |
102 | |
103 | <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?> | |
104 | <?php if ($user_css_url) { ?> | |
105 | <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/> | |
106 | <?php } ?> | |
9338b88c | 107 | </head> |
27f5a18f | 108 | <body id="ttrssMobile"> |
9338b88c | 109 | |
8e3f7217 | 110 | <div id="content"> |
e9e95dae | 111 | <?php |
42096f52 | 112 | if (!$go) { |
ca35939d | 113 | render_feeds_list($link); |
2f468537 AD |
114 | } else if ($go == "vf") { |
115 | render_headlines($link); | |
42096f52 AD |
116 | } else if ($go == "view") { |
117 | render_article($link); | |
0809065e AD |
118 | } else if ($go == "sform") { |
119 | render_search_form($link, $_GET["aid"], $_GET["ic"]); | |
8e3f7217 | 120 | } else { |
793185a9 | 121 | print __("Internal error: Function not implemented"); |
ca35939d AD |
122 | } |
123 | ||
124 | ?> | |
8e3f7217 AD |
125 | </div> |
126 | ||
9123c2ef AD |
127 | <?php if (!$go) { ?> |
128 | ||
8e3f7217 | 129 | <div id="footer"> |
8865bdc0 AD |
130 | <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> |
131 | <?php if (!defined('HIDE_VERSION')) { ?> | |
132 | v<?php echo VERSION ?> | |
133 | <?php } ?> | |
134 | © 2005-2008 Andrew Dolgov | |
8e3f7217 | 135 | </div> |
ca35939d | 136 | |
9123c2ef AD |
137 | <?php } ?> |
138 | ||
9338b88c AD |
139 | </body> |
140 | </html> |