]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
bc337ee3153f6e9cf355c5f77600f326ac23120d
[tt-rss.git] / tt-rss.php
1 <?php
2 require_once "functions.php";
3 require_once "sessions.php";
4 require_once "sanity_check.php";
5 require_once "version.php";
6 require_once "config.php";
7 require_once "db-prefs.php";
8
9 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
10
11 login_sequence($link);
12
13 $dt_add = get_script_dt_add();
14
15 no_cache_incantation();
16
17 ?>
18 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
19 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
20 <html>
21 <head>
22 <title>Tiny Tiny RSS</title>
23
24 <link rel="stylesheet" type="text/css" href="tt-rss.css">
25
26 <?php $user_theme = $_SESSION["theme"];
27 if ($user_theme) { ?>
28 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
29 <?php } ?>
30
31 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
32
33 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
34 <?php if ($user_css_url) { ?>
35 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
36 <?php } ?>
37
38 <!--[if gte IE 5.5000]>
39 <script type="text/javascript" src="pngfix.js"></script>
40 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
41 <![endif]-->
42
43 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
44
45 <script type="text/javascript" src="prototype.js"></script>
46
47 <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
48 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
49 <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
50 <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
51
52 <!--[if gte IE 5.5000]>
53 <script type="text/javascript" src="pngfix.js"></script>
54 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
55 <![endif]-->
56 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
57
58 <script type="text/javascript">
59 if (navigator.userAgent.match("Opera")) {
60 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
61 }
62 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
63 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
64 }
65 </script>
66 </head>
67
68 <body>
69
70 <iframe id="backReqBox"></iframe>
71
72 <div id="overlay">
73 <div id="overlay_inner">
74 <p><?php echo _("Loading, please wait...") ?></p>
75 <noscript>
76 <div class="error"><?php echo
77 _("Your browser doesn't support Javascript, which is required
78 for this application to function properly. Please check your
79 browser settings.") ?></div>
80 </noscript>
81 </div>
82 </div>
83
84 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
85
86 <div id="fatal_error"><div id="fatal_error_inner">
87 <h1>Fatal Error</h1>
88 <div id="fatal_error_msg">Unknown Error</div>
89 </div></div>
90
91 <script type="text/javascript">
92 if (document.addEventListener) {
93 document.addEventListener("DOMContentLoaded", init, null);
94 }
95 window.onload = init;
96 </script>
97
98 <ul id="debug_output"></ul>
99
100 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
101
102 <div id="header">
103 <div style="float : right">
104 <?php if (!SINGLE_USER_MODE) { ?>
105 <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
106 (<a href="logout.php">Logout</a>)
107 <?php } ?>
108 <img id="newVersionIcon" onclick="javascript:explainError(2)"
109 src="images/new_version.png" title="New version is available!"
110 alt="new_version_icon">
111 </div>
112 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
113 </div>
114
115 <div id="feeds-holder">
116 <div id="dispSwitch">
117 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
118 </div>
119 <div id="feeds-frame">&nbsp;</div>
120 </div>
121
122 <div id="toolbar">
123
124 <div style="float : right">
125 <select id="quickMenuChooser" onchange="quickMenuChange()">
126 <option value="qmcDefault" selected><?php echo _('Actions...') ?></option>
127 <option value="qmcSearch"><?php echo _('Search') ?></option>
128 <option value="qmcPrefs"><?php echo _('Preferences') ?></option>
129 <option disabled>--------</option>
130 <option style="color : #5050aa" disabled><?php echo _('Feed actions:') ?></option>
131 <option value="qmcAddFeed"><?php echo _('&nbsp;&nbsp;Subscribe to feed') ?></option>
132 <option value="qmcEditFeed"><?php echo _('&nbsp;&nbsp;Edit this feed') ?></option>
133 <option value="qmcRemoveFeed"><?php echo _('&nbsp;&nbsp;Unsubscribe') ?></option>
134 <!-- <option>Edit this feed</option> -->
135 <option disabled>--------</option>
136 <option style="color : #5050aa" disabled><?php echo _('All feeds:') ?></option>
137 <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
138 <option value="qmcUpdateFeeds"><?php echo _('&nbsp;&nbsp;Update') ?></option>
139 <?php } ?>
140 <option value="qmcCatchupAll"><?php echo _('&nbsp;&nbsp;Mark as read') ?></option>
141 <option value="qmcShowOnlyUnread"><?php echo _('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
142 <option disabled>--------</option>
143 <option style="color : #5050aa" disabled><?php echo _('Other actions:') ?></option>
144 <option value="qmcAddFilter"><?php echo _('&nbsp;&nbsp;Create filter') ?></option>
145 </select>
146 </div>
147
148 <form id="main_toolbar_form">
149
150 <?php echo _('Search:') ?>
151 <input name="query"
152 onKeyPress="return filterCR(event, viewCurrentFeed)"
153 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
154
155 <?php echo _('View:') ?>
156 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
157 <option selected value="adaptive"><?php echo _('Adaptive') ?></option>
158 <option value="all_articles"><?php echo _('All Articles') ?></option>
159 <option value="marked"><?php echo _('Starred') ?></option>
160 <option value="unread"><?php echo _('Unread') ?></option>
161 </select>
162
163 <?php echo _('Limit:') ?>
164 <?php
165 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
166
167 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
168
169 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
170 $limits[$def_art_limit] = $def_art_limit;
171 }
172
173 asort($limits);
174
175 if (!$def_art_limit) {
176 $def_art_limit = 30;
177 }
178
179 print_select_hash("limit", $def_art_limit, $limits,
180 'onchange="viewCurrentFeed(0, \'\')"');
181
182 ?>
183
184 &nbsp;
185
186 <input class="button" type="submit"
187 onclick="return viewCurrentFeed('ForceUpdate')"
188 value="<?php echo _('Update') ?>">
189
190 </form>
191
192 <!-- &nbsp;<input class="button" type="submit"
193 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
194
195 <!-- <input class="button" type="submit"
196 onclick="catchupCurrentFeed()" value="Mark as read"> -->
197
198 </div>
199
200 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
201 <div id="headlines-frame" class="headlines_normal">
202 <div class="whiteBox"><?php echo _('No feed selected.') ?></div></div>
203 <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
204 <?php } else { ?>
205 <div id="headlines-frame" class="headlines_cdm">
206 <div class="whiteBox"><?php echo _('No feed selected.') ?></div></div>
207 <?php } ?>
208
209 <div id="footer">
210 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
211 <select id="userSwitch" onchange="userSwitch()">
212 <?php
213 foreach (array('admin', 'fox', 'test') as $u) {
214 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
215 print "<option $op_sel>$u</option>";
216 }
217 ?>
218 </select>
219 <?php } ?>
220 <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>
221 </div>
222
223 <?php db_close($link); ?>
224
225 <script type="text/javascript">
226 /* for IE */
227 function statechange() {
228 if (document.readyState == "interactive") init();
229 }
230
231 if (document.readyState) {
232 if (document.readyState == "interactive" || document.readyState == "complete") {
233 init();
234 } else {
235 document.onreadystatechange = statechange;
236 }
237 }
238 </script>
239
240 </body>
241 </html>