]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
drop updated articles from adaptive view
[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') && 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
164 <option value="qmcAddLabel"><?php echo __('&nbsp;&nbsp;Create label') ?></option>
165 <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
166 <option value="qmcResetUI"><?php echo __('&nbsp;&nbsp;Reset UI layout') ?></option>
167 <option value="qmcResetCats"><?php echo __('&nbsp;&nbsp;Reset category order') ?></option>
168
169 <option value="qmcHKhelp"><?php echo __('&nbsp;&nbsp;Keyboard shortcuts') ?></option>
170 </select>
171 </div>
172
173 <form id="main_toolbar_form" action="" onsubmit='return false'>
174
175 <input type="submit" value="&lt;&lt;"
176 id="collapse_feeds_btn" onclick="collapse_feedlist()" class="button"
177 title="<?php echo __('Collapse feedlist') ?>" style="display : none"/>
178
179 <input type="submit" value="<?php echo __("Toggle Feedlist") ?>"
180 id="toggle_feeds_btn" class="button"
181 onclick="toggle_feedlist()" style="display : none"/>
182
183 &nbsp;
184
185 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
186
187 <?php echo __('Search:') ?>
188 <input name="query" type="text"
189 onkeypress="return filterCR(event, viewCurrentFeed)"
190 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();"/>
191
192 <?php } ?>
193
194 <select name="view_mode" onchange="viewModeChanged()">
195 <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
196 <option value="all_articles"><?php echo __('All Articles') ?></option>
197 <option value="marked"><?php echo __('Starred') ?></option>
198 <option value="unread"><?php echo __('Unread') ?></option>
199 <!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
200 <option value="updated"><?php echo __('Updated') ?></option>
201 </select>
202
203 <?php echo __('Order:') ?>
204
205 <select name="order_by" onchange="viewModeChanged()">
206 <option selected="selected" value="default"><?php echo __('Default') ?></option>
207 <option value="date"><?php echo __('Date') ?></option>
208 <option value="title"><?php echo __('Title') ?></option>
209 <option value="score"><?php echo __('Score') ?></option>
210 </select>
211
212
213 <?php echo __('Limit:') ?>
214 <?php
215 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
216
217 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
218
219 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
220 $limits[$def_art_limit] = $def_art_limit;
221 }
222
223 asort($limits);
224
225 if (!$def_art_limit) {
226 $def_art_limit = 30;
227 }
228
229 print_select_hash("limit", $def_art_limit, $limits,
230 'onchange="viewLimitChanged()"');
231
232 ?>
233
234 &nbsp;
235
236 <input class="button" type="submit"
237 onclick="return viewCurrentFeed('ForceUpdate')"
238 value="<?php echo __('Update') ?>"/>
239
240 </form>
241
242 <!-- &nbsp;<input class="button" type="submit"
243 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
244
245 <!-- <input class="button" type="submit"
246 onclick="catchupCurrentFeed()" value="Mark as read"> -->
247
248 </div>
249
250 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
251 <div id="headlines-frame" class="headlines_normal">
252 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
253 <div id="content-frame">
254 <div id="resize-grabber"
255 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
256 title="<?php echo __('Drag me to resize panels') ?>">
257 <img src="images/resize_handle_horiz.png" id="resize-handle"
258 onmouseover="enable_resize(true)" onmouseout="enable_resize(false)"
259 alt=""/>
260 </div>
261 <div id="content-insert">&nbsp;</div>
262 <!-- <div class="whiteBox">&nbsp;</div> --> </div>
263 <?php } else { ?>
264 <div id="headlines-frame" class="headlines_cdm">
265 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
266 <?php } ?>
267
268 <div id="footer">
269 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
270 <select id="userSwitch" onchange="userSwitch()">
271 <?php
272 foreach (array('admin', 'fox', 'test') as $u) {
273 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
274 print "<option $op_sel>$u</option>";
275 }
276 ?>
277 </select>
278 <?php } ?>
279 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
280 <?php if (!defined('HIDE_VERSION')) { ?>
281 v<?php echo VERSION ?>
282 <?php } ?>
283 &copy; 2005&ndash;2009 <a href="http://bah.org.ru/">Andrew Dolgov</a>
284 </div>
285
286 <?php db_close($link); ?>
287
288 <script type="text/javascript">
289 /* for IE */
290 function statechange() {
291 if (document.readyState == "interactive") init();
292 }
293
294 if (document.readyState) {
295 if (document.readyState == "interactive" || document.readyState == "complete") {
296 init();
297 } else {
298 document.onreadystatechange = statechange;
299 }
300 }
301 </script>
302
303 </body>
304 </html>