]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
getRelativeFeedId iterates over hidden categories correctly (2)
[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">
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">
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="localized_js.php?<?php echo $dt_add ?>"></script>
53
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 <!--[if gte IE 5.5000]>
60 <script type="text/javascript" src="pngfix.js"></script>
61 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
62 <![endif]-->
63 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
64
65 <script type="text/javascript">
66 if (navigator.userAgent.match("Opera")) {
67 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
68 }
69 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
70 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
71 }
72 </script>
73 </head>
74
75 <body onresize="resize_headlines()">
76
77 <div id="overlay">
78 <div id="overlay_inner">
79 <p><?php echo __("Loading, please wait...") ?></p>
80 <noscript>
81 <div class="error"><?php echo
82 __("Your browser doesn't support Javascript, which is required
83 for this application to function properly. Please check your
84 browser settings.") ?></div>
85 </noscript>
86 </div>
87 </div>
88
89 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
90
91 <div id="fatal_error"><div id="fatal_error_inner">
92 <h1>Fatal Error</h1>
93 <div id="fatal_error_msg">Unknown Error</div>
94 </div></div>
95
96 <script type="text/javascript">
97 if (document.addEventListener) {
98 document.addEventListener("DOMContentLoaded", init, null);
99 }
100 window.onload = init;
101 </script>
102
103 <ul id="debug_output"></ul>
104
105 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
106
107 <div id="header">
108 <div style="float : right">
109 <?php if (!SINGLE_USER_MODE) { ?>
110 <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
111 (<a href="logout.php"><?= __('Logout') ?></a>)
112 <?php } ?>
113 <img id="newVersionIcon" onclick="javascript:explainError(2)"
114 src="images/new_version.png" title="New version is available!"
115 alt="new_version_icon">
116 </div>
117 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
118 </div>
119
120 <div id="feeds-holder">
121 <div id="dispSwitch">
122 <a id="dispSwitchPrompt"
123 href="javascript:toggleTags()"><?php echo __("display tags") ?></a>
124 </div>
125 <div id="feeds-frame">&nbsp;</div>
126 </div>
127
128 <div id="toolbar">
129
130 <div style="float : right">
131 <select id="quickMenuChooser" onchange="quickMenuChange()">
132 <option value="qmcDefault" selected><?php echo __('Actions...') ?></option>
133 <option value="qmcSearch"><?php echo __('Search') ?></option>
134 <option value="qmcPrefs"><?php echo __('Preferences') ?></option>
135 <option disabled>--------</option>
136 <option style="color : #5050aa" disabled><?php echo __('Feed actions:') ?></option>
137 <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
138 <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
139 <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
140 <!-- <option>Edit this feed</option> -->
141 <option disabled>--------</option>
142 <option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>
143 <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
144 <option value="qmcUpdateFeeds"><?php echo __('&nbsp;&nbsp;Update') ?></option>
145 <?php } ?>
146 <option value="qmcCatchupAll"><?php echo __('&nbsp;&nbsp;Mark as read') ?></option>
147 <option value="qmcShowOnlyUnread"><?php echo __('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
148 <option disabled>--------</option>
149 <option style="color : #5050aa" disabled><?php echo __('Other actions:') ?></option>
150 <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
151 </select>
152 </div>
153
154 <form id="main_toolbar_form" onsubmit='return false'>
155
156 <?php echo __('Search:') ?>
157 <input name="query"
158 onKeyPress="return filterCR(event, viewCurrentFeed)"
159 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
160
161 <?php echo __('View:') ?>
162 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
163 <option selected value="adaptive"><?php echo __('Adaptive') ?></option>
164 <option value="all_articles"><?php echo __('All Articles') ?></option>
165 <option value="marked"><?php echo __('Starred') ?></option>
166 <option value="unread"><?php echo __('Unread') ?></option>
167 </select>
168
169 <?php echo __('Limit:') ?>
170 <?php
171 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
172
173 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
174
175 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
176 $limits[$def_art_limit] = $def_art_limit;
177 }
178
179 asort($limits);
180
181 if (!$def_art_limit) {
182 $def_art_limit = 30;
183 }
184
185 print_select_hash("limit", $def_art_limit, $limits,
186 'onchange="viewCurrentFeed(0, \'\')"');
187
188 ?>
189
190 &nbsp;
191
192 <input class="button" type="submit"
193 onclick="return viewCurrentFeed('ForceUpdate')"
194 value="<?php echo __('Update') ?>">
195
196 </form>
197
198 <!-- &nbsp;<input class="button" type="submit"
199 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
200
201 <!-- <input class="button" type="submit"
202 onclick="catchupCurrentFeed()" value="Mark as read"> -->
203
204 </div>
205
206 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
207 <div id="headlines-frame" class="headlines_normal">
208 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
209 <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
210 <?php } else { ?>
211 <div id="headlines-frame" class="headlines_cdm">
212 <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
213 <?php } ?>
214
215 <div id="footer">
216 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
217 <select id="userSwitch" onchange="userSwitch()">
218 <?php
219 foreach (array('admin', 'fox', 'test') as $u) {
220 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
221 print "<option $op_sel>$u</option>";
222 }
223 ?>
224 </select>
225 <?php } ?>
226 <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
227 </div>
228
229 <?php db_close($link); ?>
230
231 <script type="text/javascript">
232 /* for IE */
233 function statechange() {
234 if (document.readyState == "interactive") init();
235 }
236
237 if (document.readyState) {
238 if (document.readyState == "interactive" || document.readyState == "complete") {
239 init();
240 } else {
241 document.onreadystatechange = statechange;
242 }
243 }
244 </script>
245
246 </body>
247 </html>