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