]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
toggle no daemon warning @ runtime on refetch
[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 $dt_add = get_script_dt_add();
18
19 ?>
20 <html>
21 <head>
22 <title>Tiny Tiny RSS</title>
23
24 <link rel="stylesheet" type="text/css" href="tt-rss.css">
25
26 <? $user_theme = $_SESSION["theme"];
27 if ($user_theme) { ?>
28 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
29 <? } ?>
30
31 <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
32 <? if ($user_css_url) { ?>
33 <link type="text/css" href="<?= $user_css_url ?>"/>
34 <? } ?>
35
36 <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
37
38 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
39
40 <? } else { ?>
41
42 <link title="Compact Stylesheet" rel="alternate stylesheet"
43 type="text/css" href="tt-rss_compact.css"/>
44
45 <? } ?>
46
47 <script type="text/javascript" src="prototype.js"></script>
48
49 <script type="text/javascript" src="tt-rss.js?<?= $dt_add ?>"></script>
50 <script type="text/javascript" src="functions.js?<?= $dt_add ?>"></script>
51 <!--[if gte IE 5.5000]>
52 <script type="text/javascript" src="pngfix.js"></script>
53 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
54 <![endif]-->
55 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
56
57 <script type="text/javascript">
58 if (navigator.userAgent.match("Opera")) {
59 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
60 }
61 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
62 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
63 }
64 </script>
65 </head>
66
67 <body>
68
69 <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
70 <div id="fatal_error"><div id="fatal_error_inner">
71 <h1>Fatal Error</h1>
72 <div id="fatal_error_msg">Unknown Error</div>
73 </div></div>
74
75 <script type="text/javascript">
76 if (document.addEventListener) {
77 document.addEventListener("DOMContentLoaded", init, null);
78 }
79 window.onload = init;
80 </script>
81
82 <div id="noDaemonWarning">
83 <b>Warning:</b> Update daemon is enabled in configuration, but daemon
84 process is not running, which prevents all feeds from updating. Please
85 start the daemon process or contact instance owner.
86 </div>
87
88 <ul id="debug_output"></ul>
89
90 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
91 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
92 <tr>
93 <td colspan="2" class="headerBox" id="mainHeader">
94 <table cellspacing="0" cellpadding="0" width="100%"><tr>
95 <td rowspan="2" class="header" valign="middle">
96 <img src="images/ttrss_logo.png" alt="logo">
97 </td>
98 <td valign="top" class="notifyBox">
99 <div id="notify"><span id="notify_body">&nbsp;</span></div>
100 </td>
101
102 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
103
104 </tr><tr><td class="welcomePrompt">
105 <? if (!SINGLE_USER_MODE) { ?>
106 Hello, <b><?= $_SESSION["name"] ?></b>
107 (<a href="logout.php">Logout</a>)
108 <? } ?>
109 </td>
110 </tr></table>
111 </td>
112 </tr>
113 <? } else { ?>
114 <tr>
115 <td class="small" id="mainHeader">
116 <div id="notify"><span id="notify_body">&nbsp;</span></div>
117 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
118 </td><td class="welcomePrompt">
119 <? if (!SINGLE_USER_MODE) { ?>
120 Hello, <b><?= $_SESSION["name"] ?></b>
121 (<a href="logout.php">Logout</a>)
122 <? } ?>
123 </td></tr>
124 <? } ?>
125 <tr>
126 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE'))
127 $feeds_rowspan = 2;
128 else
129 $feeds_rowspan = 3; ?>
130 <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds">
131 <table class="innerFeedTable"
132 cellspacing="0" cellpadding="0" height="100%" width="100%">
133 <tr><td>
134 <div id="dispSwitch">
135 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
136 </div>
137 </td></tr>
138 <tr><td height="100%" width="100%" valign="top">
139
140 <iframe frameborder="0"
141 id="feeds-frame" name="feeds-frame" class="feedsFrame"></iframe>
142
143 </td></tr></table>
144
145 </td>
146 <td valign="top" class="headlinesToolbarBox">
147 <table width="100%" cellpadding="0" cellspacing="0">
148
149 <tr><td class="headlinesToolbar" id="headlinesToolbar">
150
151 <form id="main_toolbar_form">
152
153 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
154 <input name="query"
155 onKeyPress="return filterCR(event)"
156 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
157 <input class="button" type="submit"
158 onclick="return viewCurrentFeed(0)" value="Search">
159 &nbsp;
160 <? } ?>
161
162 View:
163 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
164 <option selected value="adaptive">Adaptive</option>
165 <option value="all_articles">All Articles</option>
166 <option value="marked">Starred</option>
167 <option value="unread">Unread</option>
168 </select>
169
170 &nbsp;Limit:
171 <?
172 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
173
174 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
175
176 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
177 $limits[$def_art_limit] = $def_art_limit;
178 }
179
180 asort($limits);
181
182 if (!$def_art_limit) {
183 $def_art_limit = 30;
184 }
185
186 print_select_hash("limit", $def_art_limit, $limits,
187 'onchange="viewCurrentFeed(0, \'\')"');
188
189 ?>
190 </form>
191
192 <!-- &nbsp;<input class="button" type="submit"
193 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
194
195 &nbsp;<input class="button" type="submit"
196 onclick="viewCurrentFeed(0, 'ForceUpdate')" value="Update">
197
198 <input class="button" type="submit"
199 onclick="viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
200
201 </td>
202 <td align="right">
203 <select id="quickMenuChooser" onchange="quickMenuChange()">
204 <option value="qmcDefault" selected>Actions...</option>
205 <option value="qmcPrefs">Preferences</option>
206 <option value="qmcSearch">Search</option>
207 <option disabled>--------</option>
208 <option style="color : #5050aa" disabled>Feed actions:</option>
209 <option value="qmcAddFeed">&nbsp;&nbsp;Subscribe to feed</option>
210 <option value="qmcRemoveFeed">&nbsp;&nbsp;Unsubscribe</option>
211 <!-- <option>Edit this feed</option> -->
212 <option disabled>--------</option>
213 <option style="color : #5050aa" disabled>All feeds:</option>
214 <? if (!ENABLE_UPDATE_DAEMON) { ?>
215 <option value="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
216 <? } ?>
217 <option value="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
218 <option value="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
219 <option disabled>--------</option>
220 <option style="color : #5050aa" disabled>Other actions:</option>
221 <option value="qmcAddFilter">&nbsp;&nbsp;Create filter</option>
222 </select>
223 </td>
224 </tr>
225 </table>
226 </td>
227 </tr>
228 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
229 <tr>
230 <td id="headlines" class="headlines2" valign="top">
231 <iframe frameborder="0" name="headlines-frame"
232 id="headlines-frame" class="headlinesFrame"></iframe>
233 </td>
234 </tr>
235 <? } else { ?>
236 <tr>
237 <td id="headlines" class="headlines" valign="top">
238 <iframe frameborder="0" name="headlines-frame"
239 id="headlines-frame" class="headlinesFrame"></iframe>
240 </td>
241 </tr><tr>
242 <td class="content" id="content" valign="top">
243 <iframe frameborder="0" name="content-frame"
244 id="content-frame" class="contentFrame"> </iframe>
245 </td>
246 </tr>
247 <? } ?>
248 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
249 <tr>
250 <td colspan="2" class="footer" id="mainFooter">
251 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
252 <? if (WEB_DEMO_MODE) { ?>
253 <br>Running in demo mode, some functionality is disabled.
254 <? } ?>
255 </td>
256 </td>
257 <? } ?>
258 </table>
259
260 <? db_close($link); ?>
261
262 <script type="text/javascript">
263 /* for IE */
264 function statechange() {
265 if (document.readyState == "interactive") init();
266 }
267
268 if (document.readyState) {
269 if (document.readyState == "interactive" || document.readyState == "complete") {
270 init();
271 } else {
272 document.onreadystatechange = statechange;
273 }
274 }
275 </script>
276
277 </body>
278 </html>