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