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