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