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