]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
enable processing of article-date filter (closes #225)
[tt-rss.git] / tt-rss.php
1 <?php
2 error_reporting(E_ERROR | E_WARNING | E_PARSE);
3
4 require_once "functions.php";
5 require_once "sessions.php";
6 require_once "sanity_check.php";
7 require_once "version.php";
8 require_once "config.php";
9 require_once "db-prefs.php";
10
11 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
12
13 login_sequence($link);
14
15 $dt_add = get_script_dt_add();
16
17 no_cache_incantation();
18
19 header('Content-Type: text/html; charset=utf-8');
20
21 ?>
22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
24 <html>
25 <head>
26 <title>Tiny Tiny RSS</title>
27
28 <link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
29
30 <?php $user_theme = $_SESSION["theme"];
31 if ($user_theme) { ?>
32 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css?<?php echo $dt_add ?>">
33 <?php } ?>
34
35 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
36
37 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
38 <?php if ($user_css_url) { ?>
39 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
40 <?php } ?>
41
42 <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
43
44 <script type="text/javascript" src="prototype.js"></script>
45 <script type="text/javascript" src="scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
46 <script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
47 <script type="text/javascript" charset="utf-8" src="tt-rss.js?<?php echo $dt_add ?>"></script>
48 <script type="text/javascript" charset="utf-8" src="functions.js?<?php echo $dt_add ?>"></script>
49 <script type="text/javascript" charset="utf-8" src="feedlist.js?<?php echo $dt_add ?>"></script>
50 <script type="text/javascript" charset="utf-8" src="viewfeed.js?<?php echo $dt_add ?>"></script>
51
52 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
53
54 <script type="text/javascript">
55 //<![CDATA[
56 if (navigator.userAgent.match("Opera")) {
57 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
58 }
59 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
60 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
61 }
62 window.onresize=resize_headlines;
63 //]]>
64 </script>
65 </head>
66
67 <body id="ttrssMain">
68
69 <div id="overlay" style="display : block">
70 <div id="overlay_inner">
71 <?php echo __("Loading, please wait...") ?>
72
73 <div id="l_progress_o">
74 <div id="l_progress_i"></div>
75 </div>
76
77 <noscript>
78 <div class="error"><?php echo
79 __("Your browser doesn't support Javascript, which is required
80 for this application to function properly. Please check your
81 browser settings.") ?></div>
82 </noscript>
83 </div>
84 </div>
85
86 <div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
87 <?php rounded_table_start("hho"); ?>
88 <?php include "help/3.php" ?>
89 <?php rounded_table_end(); ?>
90 </div>
91
92 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
93
94 <div id="fatal_error"><div id="fatal_error_inner">
95 <h1>Fatal Error</h1>
96 <div id="fatal_error_msg">Unknown Error</div>
97 </div></div>
98
99 <div id="dialog_overlay" style="display : none"> </div>
100
101 <script type="text/javascript">
102 if (document.addEventListener) {
103 document.addEventListener("DOMContentLoaded", init, null);
104 }
105 window.onload = init;
106 </script>
107
108 <ul id="debug_output" style='display : none'><li>&nbsp;</li></ul>
109
110 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
111
112 <div id="header">
113 <div class="topLinks">
114 <?php if (!SINGLE_USER_MODE) { ?>
115 <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
116 <?php } ?>
117 <a href="prefs.php"><?php echo __('Preferences') ?></a>
118
119 <?php if (defined('FEEDBACK_URL')) { ?>
120 | <a target="_blank" class="feedback" href="<?php echo FEEDBACK_URL ?>">
121 <?php echo __('Comments?') ?></a>
122 <?php } ?>
123
124 <?php if (!SINGLE_USER_MODE) { ?>
125 | <a href="logout.php"><?php echo __('Logout') ?></a>
126 <?php } ?>
127
128 <img id="newVersionIcon" style="display:none;" onclick="javascript:explainError(2)"
129 src="images/new_version.png" title="New version is available!"
130 alt="new_version_icon"/>
131 </div>
132 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
133 </div>
134
135 <div id="feeds-holder">
136 <div id="dispSwitch">
137 <a id="dispSwitchPrompt"
138 href="javascript:toggleTags()"><?php echo __("tag cloud") ?></a>
139 </div>
140 <div id="feeds-frame">&nbsp;</div>
141 </div>
142
143 <div id="toolbar">
144
145 <div style="float : right">
146 <select id="quickMenuChooser" onchange="quickMenuChange()">
147 <option value="qmcDefault" selected="selected"><?php echo __('Actions...') ?></option>
148 <option value="qmcSearch"><?php echo __('Search') ?></option>
149 <!-- <option value="qmcPrefs"><?php echo __('Preferences') ?></option> -->
150 <option disabled="disabled">--------</option>
151 <option style="color : #5050aa" disabled="disabled"><?php echo __('Feed actions:') ?></option>
152 <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
153 <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
154 <!-- <option value="qmcClearFeed"><?php echo __('&nbsp;&nbsp;Clear articles') ?></option> -->
155 <option value="qmcRescoreFeed"><?php echo __('&nbsp;&nbsp;Rescore feed') ?></option>
156 <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
157 <option disabled="disabled">--------</option>
158 <option style="color : #5050aa" disabled="disabled"><?php echo __('All feeds:') ?></option>
159 <option value="qmcCatchupAll"><?php echo __('&nbsp;&nbsp;Mark as read') ?></option>
160 <option value="qmcShowOnlyUnread"><?php echo __('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
161 <option disabled="disabled">--------</option>
162 <option style="color : #5050aa" disabled="disabled"><?php echo __('Other actions:') ?></option>
163 <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
164 <option value="qmcResetUI"><?php echo __('&nbsp;&nbsp;Reset UI layout') ?></option>
165 <option value="qmcResetCats"><?php echo __('&nbsp;&nbsp;Reset category order') ?></option>
166
167 <option value="qmcHKhelp"><?php echo __('&nbsp;&nbsp;Keyboard shortcuts') ?></option>
168 </select>
169 </div>
170
171 <form id="main_toolbar_form" action="" onsubmit='return false'>
172
173 <input type="submit" value="&lt;&lt;"
174 id="collapse_feeds_btn" onclick="collapse_feedlist()" class="button"
175 title="<?php echo __('Collapse feedlist') ?>" style="display : none"/>
176
177 <input type="submit" value="<?php echo __("Toggle Feedlist") ?>"
178 id="toggle_feeds_btn" class="button"
179 onclick="toggle_feedlist()" style="display : none"/>
180
181 &nbsp;
182
183 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
184
185 <?php echo __('Search:') ?>
186 <input name="query" type="text"
187 onkeypress="return filterCR(event, viewCurrentFeed)"
188 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();"/>
189
190 <?php } ?>
191
192 <select name="view_mode" onchange="viewModeChanged()">
193 <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
194 <option value="all_articles"><?php echo __('All Articles') ?></option>
195 <option value="marked"><?php echo __('Starred') ?></option>
196 <option value="unread"><?php echo __('Unread') ?></option>
197 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
198 </select>
199
200 <?php echo __('Order:') ?>
201
202 <select name="order_by" onchange="viewModeChanged()">
203 <option selected="selected" value="default"><?php echo __('Default') ?></option>
204 <option value="date"><?php echo __('Date') ?></option>
205 <option value="title"><?php echo __('Title') ?></option>
206 <option value="score"><?php echo __('Score') ?></option>
207 </select>
208
209
210 <?php echo __('Limit:') ?>
211 <?php
212 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
213
214 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
215
216 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
217 $limits[$def_art_limit] = $def_art_limit;
218 }
219
220 asort($limits);
221
222 if (!$def_art_limit) {
223 $def_art_limit = 30;
224 }
225
226 print_select_hash("limit", $def_art_limit, $limits,
227 'onchange="viewLimitChanged()"');
228
229 ?>
230
231 &nbsp;
232
233 <input class="button" type="submit"
234 onclick="return viewCurrentFeed('ForceUpdate')"
235 value="<?php echo __('Update') ?>"/>
236
237 </form>
238
239 <!-- &nbsp;<input class="button" type="submit"
240 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
241
242 <!-- <input class="button" type="submit"
243 onclick="catchupCurrentFeed()" value="Mark as read"> -->
244
245 </div>
246
247 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
248 <div id="headlines-frame" class="headlines_normal">
249 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
250 <div id="content-frame">
251 <div id="resize-grabber"
252 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
253 title="<?php echo __('Drag me to resize panels') ?>">
254 <img src="images/resize_handle_horiz.png" id="resize-handle"
255 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
256 alt=""/>
257 </div>
258 <div id="content-insert">&nbsp;</div>
259 <!-- <div class="whiteBox">&nbsp;</div> --> </div>
260 <?php } else { ?>
261 <div id="headlines-frame" class="headlines_cdm">
262 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
263 <?php } ?>
264
265 <div id="footer">
266 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
267 <select id="userSwitch" onchange="userSwitch()">
268 <?php
269 foreach (array('admin', 'fox', 'test') as $u) {
270 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
271 print "<option $op_sel>$u</option>";
272 }
273 ?>
274 </select>
275 <?php } ?>
276 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
277 <?php if (!defined('HIDE_VERSION')) { ?>
278 v<?php echo VERSION ?>
279 <?php } ?>
280 &copy; 2005&ndash;2008 <a href="http://bah.org.ru/">Andrew Dolgov</a>
281 </div>
282
283 <?php db_close($link); ?>
284
285 <script type="text/javascript">
286 /* for IE */
287 function statechange() {
288 if (document.readyState == "interactive") init();
289 }
290
291 if (document.readyState) {
292 if (document.readyState == "interactive" || document.readyState == "complete") {
293 init();
294 } else {
295 document.onreadystatechange = statechange;
296 }
297 }
298 </script>
299
300 </body>
301 </html>