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