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