]> git.wh0rd.org - tt-rss.git/blame - tt-rss.php
mobile: interface tweaks
[tt-rss.git] / tt-rss.php
CommitLineData
4062022e 1<?
7ae65adf
AD
2 require_once "functions.php";
3
4 basic_nosid_redirect_check();
5
36bfab86 6 require_once "sessions.php";
66581886
AD
7
8 require_once "sanity_check.php";
4062022e
AD
9 require_once "version.php";
10 require_once "config.php";
11 require_once "db-prefs.php";
da5d0d09 12
4062022e 13 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
c93f38c4 14
b8aa49bc 15 login_sequence($link);
ff485f1d 16
4062022e 17?>
1cd17194
AD
18<html>
19<head>
20 <title>Tiny Tiny RSS</title>
da5d0d09 21
430bf183
AD
22 <link rel="stylesheet" type="text/css" href="tt-rss.css">
23
503eb349
AD
24 <? $user_theme = $_SESSION["theme"];
25 if ($user_theme) { ?>
26 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
27 <? } ?>
28
386d7b5b
AD
29 <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
30 <? if ($user_css_url) { ?>
31 <link type="text/css" href="<?= $user_css_url ?>"/>
32 <? } ?>
33
4062022e 34 <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
da5d0d09 35
430bf183 36 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
da5d0d09
AD
37
38 <? } else { ?>
39
430bf183
AD
40 <link title="Compact Stylesheet" rel="alternate stylesheet"
41 type="text/css" href="tt-rss_compact.css"/>
da5d0d09
AD
42
43 <? } ?>
628eb1bd 44
1cd17194 45 <script type="text/javascript" src="tt-rss.js"></script>
97dcd654 46 <script type="text/javascript" src="functions.js"></script>
d5224f0d
AD
47 <!--[if gte IE 5.5000]>
48 <script type="text/javascript" src="pngfix.js"></script>
96737ce9 49 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
d5224f0d 50 <![endif]-->
d76a3b03 51 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
362698ad
AD
52
53 <script type="text/javascript">
54 if (navigator.userAgent.match("Opera")) {
55 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
56 }
57 </script>
1cd17194
AD
58</head>
59
97dcd654
AD
60<body>
61
2055d4a6
AD
62<div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
63
97dcd654
AD
64<script type="text/javascript">
65if (document.addEventListener) {
66 document.addEventListener("DOMContentLoaded", init, null);
67}
68window.onload = init;
69</script>
1cd17194 70
27981ca3
AD
71<? if (ENABLE_UPDATE_DAEMON && !file_is_locked("update_daemon.lock")) { ?>
72 <div class="warning">
73 <b>Warning:</b> Update daemon is enabled in configuration, but daemon
74 process is not running, which prevents all feeds from updating. Please
75 start the daemon process or contact instance owner.
76 </div>
77<? } ?>
78
0ee1d1a0
AD
79<ul id="debug_output"></ul>
80
828a8ecc 81<table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
4062022e 82<? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
1cd17194 83<tr>
1de2b92c 84 <td colspan="2" class="headerBox" id="mainHeader">
828a8ecc 85 <table cellspacing="0" cellpadding="0" width="100%"><tr>
c93f38c4 86 <td rowspan="2" class="header" valign="middle">
828a8ecc
AD
87 <img src="images/ttrss_logo.png" alt="logo">
88 </td>
82e1fe00 89 <td valign="top" class="notifyBox">
036f45ab 90 <div id="notify"><span id="notify_body">&nbsp;</span></div>
828a8ecc 91 </td>
69919a24 92
76332f3c 93 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
69919a24 94
c93f38c4 95 </tr><tr><td class="welcomePrompt">
7d4c898a 96 <? if (!SINGLE_USER_MODE) { ?>
9f78104c
AD
97 Hello, <b><?= $_SESSION["name"] ?></b>
98 (<a href="logout.php">Logout</a>)
8cb74804
AD
99 <? } ?>
100 </td>
828a8ecc 101 </tr></table>
2c1dd701
AD
102 </td>
103</tr>
69919a24 104<? } else { ?>
82e1fe00 105<tr>
1de2b92c 106 <td class="small" id="mainHeader">
82e1fe00
AD
107 <div id="notify"><span id="notify_body">&nbsp;</span></div>
108 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
109 </td><td class="welcomePrompt">
110 <? if (!SINGLE_USER_MODE) { ?>
111 Hello, <b><?= $_SESSION["name"] ?></b>
112 (<a href="logout.php">Logout</a>)
113 <? } ?>
b8dc6247 114</td></tr>
da5d0d09 115<? } ?>
1cd17194 116<tr>
06300301
AD
117 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE'))
118 $feeds_rowspan = 2;
119 else
120 $feeds_rowspan = 3; ?>
121 <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds">
28fa9253
AD
122 <table class="innerFeedTable"
123 cellspacing="0" cellpadding="0" height="100%" width="100%">
124 <tr><td>
125 <div id="dispSwitch">
126 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
127 </div>
128 </td></tr>
129 <tr><td height="100%" width="100%" valign="top">
caa4e57f 130
f69ea84d 131 <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
8143ae1f 132
5bfef089 133 <iframe frameborder="0"
6adbdbee 134 src="backend.php?op=error&msg=Loading,%20please wait..."
f69ea84d 135 id="feeds-frame" name="feeds-frame" class="feedsFrameWithActions"> </iframe>
7a991cac 136
c09ec856 137 <div align="center">
caa4e57f 138
c09ec856
AD
139 <select id="allFeedsChooser" onchange="allFeedsMenuChange()">
140 <option selected>All feeds...</option>
085a5a74 141 <? if (!ENABLE_UPDATE_DAEMON) { ?>
3745788e 142 <option>Update</option>
085a5a74 143 <? } ?>
3745788e 144 <option>Mark as read</option>
cbe45fa8 145 <option>Show only unread</option>
3745788e
AD
146 </select>
147
3745788e 148 </div>
28fa9253 149
f69ea84d
AD
150 <? } else { ?>
151
152 <iframe frameborder="0"
153 src="backend.php?op=error&msg=Loading,%20please wait..."
154 id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
caa4e57f 155
7a991cac
AD
156 <? } ?>
157
f69ea84d
AD
158 </td></tr></table>
159
1cd17194 160 </td>
f0601b87 161 <td valign="top" class="headlinesToolbarBox">
e828e31e 162 <table width="100%" cellpadding="0" cellspacing="0">
5238347d 163
ac43eba1 164 <tr><td class="headlinesToolbar" id="headlinesToolbar">
5238347d
AD
165
166 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
167
168 <input id="searchbox"
b0005823 169 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
52b51244
AD
170 <select id="searchmodebox">
171 <option>This feed</option>
b0005823
AD
172 <? if (get_pref($link, 'ENABLE_FEED_CATS')) { ?>
173 <option>This category</option>
174 <? } ?>
52b51244
AD
175 <option>All feeds</option>
176 </select>
177
ac43eba1 178 <input type="submit"
4ce19859 179 class="button" onclick="javascript:search()" value="Search">
f0601b87 180
5238347d
AD
181 &nbsp;
182
183 <? } ?>
184
185 View:
f0601b87
AD
186
187 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
0ee2d12f 188 <option selected>Adaptive</option>
d6f55ce8 189 <option>All Articles</option>
f0601b87 190 <option>Starred</option>
0ee2d12f 191 <option>Unread</option>
f0601b87
AD
192 </select>
193
cb1083a1
AD
194 &nbsp;Limit:
195
196 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
f1b9a8ee
AD
197
198 <?
199 $limits = array(15 => 15, 30 => 30, 60 => 60);
200
4062022e
AD
201 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
202
59b77643 203 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
4062022e 204 $limits[$def_art_limit] = $def_art_limit;
f1b9a8ee 205 }
f1b9a8ee 206
59b77643 207 asort($limits);
f1b9a8ee
AD
208 array_push($limits, 0);
209
59b77643
AD
210 if (!$def_art_limit) {
211 $def_art_limit = 30;
212 }
213
f1b9a8ee
AD
214 foreach ($limits as $key) {
215 print "<option";
4062022e 216 if ($key == $def_art_limit) { print " selected"; }
f1b9a8ee
AD
217 print ">";
218
219 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
220
221 print "</option>";
222 } ?>
4062022e 223
cb1083a1
AD
224 </select>
225
1572afe5
AD
226<!-- &nbsp;Selection:
227
228 <select id="headopbox">
229 <option id="hopToggleRead">Toggle (un)read</option>
230 </select>
231
232 <input class="button" type="submit" onclick="headopGo()" value="Go"> -->
233
ac43eba1
AD
234 &nbsp;Feed: <input class="button" type="submit"
235 onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
f0601b87 236
a7de14fc 237 <input class="button" type="submit" id="btnMarkFeedAsRead"
1572afe5 238 onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
f0601b87 239
a14f82f2
AD
240 </td>
241 <td align="right">
c09ec856
AD
242 <select id="quickMenuChooser" onchange="quickMenuChange()">
243 <option id="qmcDefault" selected>Actions...</option>
244 <option id="qmcPrefs">Preferences</option>
245 <option id="qmcSearch">Search</option>
7a991cac
AD
246 <option disabled>--------</option>
247 <option style="color : #5050aa" disabled>Feed actions:</option>
c09ec856
AD
248 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
249 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
e2f8f7b4 250 <!-- <option>Edit this feed</option> -->
7a991cac
AD
251 <option disabled>--------</option>
252 <option style="color : #5050aa" disabled>All feeds:</option>
085a5a74 253 <? if (!ENABLE_UPDATE_DAEMON) { ?>
cbe45fa8 254 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
085a5a74
AD
255 <? } ?>
256 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
cbe45fa8 257 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
a24f525c
AD
258 <option disabled>--------</option>
259 <option style="color : #5050aa" disabled>Other actions:</option>
c09ec856 260 <option id="qmcAddFilter">&nbsp;&nbsp;Add filter</option>
e2f8f7b4 261 </select>
a14f82f2
AD
262 </td>
263 </tr>
f0601b87 264 </table>
386cbf27
AD
265 </td>
266</tr>
267<? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
268<tr>
269 <td id="headlines" class="headlines2" valign="top">
270 <iframe frameborder="0" name="headlines-frame"
271 id="headlines-frame" class="headlinesFrame"
272 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
273 </td>
274</tr>
275<? } else { ?>
276<tr>
1cd17194 277 <td id="headlines" class="headlines" valign="top">
5bfef089 278 <iframe frameborder="0" name="headlines-frame"
e828e31e
AD
279 id="headlines-frame" class="headlinesFrame"
280 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
1cd17194 281 </td>
bb7cface 282</tr><tr>
1cd17194 283 <td class="content" id="content" valign="top">
5bfef089
AD
284 <iframe frameborder="0" name="content-frame"
285 id="content-frame" class="contentFrame"> </iframe>
1cd17194
AD
286 </td>
287</tr>
386cbf27 288<? } ?>
4062022e 289<? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
1cd17194 290<tr>
1de2b92c 291 <td colspan="2" class="footer" id="mainFooter">
36ae0574 292 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
0b615681
AD
293 <? if (WEB_DEMO_MODE) { ?>
294 <br>Running in demo mode, some functionality is disabled.
295 <? } ?>
1cd17194
AD
296 </td>
297</td>
da5d0d09 298<? } ?>
1cd17194
AD
299</table>
300
ab49d368 301<? db_close($link); ?>
1cd17194 302
97dcd654
AD
303<script type="text/javascript">
304 /* for IE */
305 function statechange() {
306 if (document.readyState == "interactive") init();
307 }
308
309 if (document.readyState) {
310 if (document.readyState == "interactive" || document.readyState == "complete") {
311 init();
312 } else {
313 document.onreadystatechange = statechange;
314 }
315 }
316</script>
317
1cd17194
AD
318</body>
319</html>