]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
fix mysql bool setting bug in editFeed
[tt-rss.git] / tt-rss.php
1 <?
2 require_once "functions.php";
3
4 basic_nosid_redirect_check();
5
6 require_once "sessions.php";
7
8 require_once "sanity_check.php";
9 require_once "version.php";
10 require_once "config.php";
11 require_once "db-prefs.php";
12
13 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
14
15 login_sequence($link);
16
17 ?>
18 <html>
19 <head>
20 <title>Tiny Tiny RSS</title>
21
22 <link rel="stylesheet" type="text/css" href="tt-rss.css">
23
24 <? $user_theme = $_SESSION["theme"];
25 if ($user_theme) { ?>
26 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
27 <? } ?>
28
29 <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
30 <? if ($user_css_url) { ?>
31 <link type="text/css" href="<?= $user_css_url ?>"/>
32 <? } ?>
33
34 <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
35
36 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
37
38 <? } else { ?>
39
40 <link title="Compact Stylesheet" rel="alternate stylesheet"
41 type="text/css" href="tt-rss_compact.css"/>
42
43 <? } ?>
44
45 <script type="text/javascript" src="tt-rss.js"></script>
46 <script type="text/javascript" src="functions.js"></script>
47 <!--[if gte IE 5.5000]>
48 <script type="text/javascript" src="pngfix.js"></script>
49 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
50 <![endif]-->
51 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
52
53 <script type="text/javascript">
54 if (navigator.userAgent.match("Opera")) {
55 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
56 }
57 </script>
58 </head>
59
60 <body>
61
62 <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
63
64 <script type="text/javascript">
65 if (document.addEventListener) {
66 document.addEventListener("DOMContentLoaded", init, null);
67 }
68 window.onload = init;
69 </script>
70
71 <? if (ENABLE_UPDATE_DAEMON && !file_is_locked("update_daemon.lock")) { ?>
72 <div class="warning">
73 <b>Warning:</b> Update daemon is enabled in configuration, but daemon
74 process is not running, which prevents all feeds from updating. Please
75 start the daemon process or contact instance owner.
76 </div>
77 <? } ?>
78
79 <ul id="debug_output"></ul>
80
81 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
82 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
83 <tr>
84 <td colspan="2" class="headerBox" id="mainHeader">
85 <table cellspacing="0" cellpadding="0" width="100%"><tr>
86 <td rowspan="2" class="header" valign="middle">
87 <img src="images/ttrss_logo.png" alt="logo">
88 </td>
89 <td valign="top" class="notifyBox">
90 <div id="notify"><span id="notify_body">&nbsp;</span></div>
91 </td>
92
93 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
94
95 </tr><tr><td class="welcomePrompt">
96 <? if (!SINGLE_USER_MODE) { ?>
97 Hello, <b><?= $_SESSION["name"] ?></b>
98 (<a href="logout.php">Logout</a>)
99 <? } ?>
100 </td>
101 </tr></table>
102 </td>
103 </tr>
104 <? } else { ?>
105 <tr>
106 <td class="small" id="mainHeader">
107 <div id="notify"><span id="notify_body">&nbsp;</span></div>
108 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
109 </td><td class="welcomePrompt">
110 <? if (!SINGLE_USER_MODE) { ?>
111 Hello, <b><?= $_SESSION["name"] ?></b>
112 (<a href="logout.php">Logout</a>)
113 <? } ?>
114 </td></tr>
115 <? } ?>
116 <tr>
117 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE'))
118 $feeds_rowspan = 2;
119 else
120 $feeds_rowspan = 3; ?>
121 <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds">
122 <table class="innerFeedTable"
123 cellspacing="0" cellpadding="0" height="100%" width="100%">
124 <tr><td>
125 <div id="dispSwitch">
126 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
127 </div>
128 </td></tr>
129 <tr><td height="100%" width="100%" valign="top">
130
131 <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
132
133 <iframe frameborder="0"
134 src="backend.php?op=error&msg=Loading,%20please wait..."
135 id="feeds-frame" name="feeds-frame" class="feedsFrameWithActions"> </iframe>
136
137 <div align="center">
138
139 <select id="allFeedsChooser" onchange="allFeedsMenuChange()">
140 <option selected>All feeds...</option>
141 <? if (!ENABLE_UPDATE_DAEMON) { ?>
142 <option>Update</option>
143 <? } ?>
144 <option>Mark as read</option>
145 <option>Show only unread</option>
146 </select>
147
148 </div>
149
150 <? } else { ?>
151
152 <iframe frameborder="0"
153 src="backend.php?op=error&msg=Loading,%20please wait..."
154 id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
155
156 <? } ?>
157
158 </td></tr></table>
159
160 </td>
161 <td valign="top" class="headlinesToolbarBox">
162 <table width="100%" cellpadding="0" cellspacing="0">
163
164 <tr><td class="headlinesToolbar" id="headlinesToolbar">
165
166 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
167
168 <input id="searchbox"
169 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
170 <select id="searchmodebox">
171 <option>This feed</option>
172 <? if (get_pref($link, 'ENABLE_FEED_CATS')) { ?>
173 <option>This category</option>
174 <? } ?>
175 <option>All feeds</option>
176 </select>
177
178 <input type="submit"
179 class="button" onclick="javascript:search()" value="Search">
180
181 &nbsp;
182
183 <? } ?>
184
185 View:
186
187 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
188 <option selected>Adaptive</option>
189 <option>All Articles</option>
190 <option>Starred</option>
191 <option>Unread</option>
192 </select>
193
194 &nbsp;Limit:
195
196 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
197
198 <?
199 $limits = array(15 => 15, 30 => 30, 60 => 60);
200
201 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
202
203 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
204 $limits[$def_art_limit] = $def_art_limit;
205 }
206
207 asort($limits);
208 array_push($limits, 0);
209
210 if (!$def_art_limit) {
211 $def_art_limit = 30;
212 }
213
214 foreach ($limits as $key) {
215 print "<option";
216 if ($key == $def_art_limit) { print " selected"; }
217 print ">";
218
219 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
220
221 print "</option>";
222 } ?>
223
224 </select>
225
226 <!-- &nbsp;Selection:
227
228 <select id="headopbox">
229 <option id="hopToggleRead">Toggle (un)read</option>
230 </select>
231
232 <input class="button" type="submit" onclick="headopGo()" value="Go"> -->
233
234 &nbsp;Feed: <input class="button" type="submit"
235 onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
236
237 <input class="button" type="submit" id="btnMarkFeedAsRead"
238 onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
239
240 </td>
241 <td align="right">
242 <select id="quickMenuChooser" onchange="quickMenuChange()">
243 <option id="qmcDefault" selected>Actions...</option>
244 <option id="qmcPrefs">Preferences</option>
245 <option id="qmcSearch">Search</option>
246 <option disabled>--------</option>
247 <option style="color : #5050aa" disabled>Feed actions:</option>
248 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
249 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
250 <!-- <option>Edit this feed</option> -->
251 <option disabled>--------</option>
252 <option style="color : #5050aa" disabled>All feeds:</option>
253 <? if (!ENABLE_UPDATE_DAEMON) { ?>
254 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
255 <? } ?>
256 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
257 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
258 <option disabled>--------</option>
259 <option style="color : #5050aa" disabled>Other actions:</option>
260 <option id="qmcAddFilter">&nbsp;&nbsp;Add filter</option>
261 </select>
262 </td>
263 </tr>
264 </table>
265 </td>
266 </tr>
267 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
268 <tr>
269 <td id="headlines" class="headlines2" valign="top">
270 <iframe frameborder="0" name="headlines-frame"
271 id="headlines-frame" class="headlinesFrame"
272 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
273 </td>
274 </tr>
275 <? } else { ?>
276 <tr>
277 <td id="headlines" class="headlines" valign="top">
278 <iframe frameborder="0" name="headlines-frame"
279 id="headlines-frame" class="headlinesFrame"
280 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
281 </td>
282 </tr><tr>
283 <td class="content" id="content" valign="top">
284 <iframe frameborder="0" name="content-frame"
285 id="content-frame" class="contentFrame"> </iframe>
286 </td>
287 </tr>
288 <? } ?>
289 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
290 <tr>
291 <td colspan="2" class="footer" id="mainFooter">
292 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
293 <? if (WEB_DEMO_MODE) { ?>
294 <br>Running in demo mode, some functionality is disabled.
295 <? } ?>
296 </td>
297 </td>
298 <? } ?>
299 </table>
300
301 <? db_close($link); ?>
302
303 <script type="text/javascript">
304 /* for IE */
305 function statechange() {
306 if (document.readyState == "interactive") init();
307 }
308
309 if (document.readyState) {
310 if (document.readyState == "interactive" || document.readyState == "complete") {
311 init();
312 } else {
313 document.onreadystatechange = statechange;
314 }
315 }
316 </script>
317
318 </body>
319 </html>