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