]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
more debugging in feedlist init
[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 <iframe frameborder="0"
132 src="backend.php?op=error&msg=Loading,%20please wait..."
133 id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
134
135 </td></tr></table>
136
137 </td>
138 <td valign="top" class="headlinesToolbarBox">
139 <table width="100%" cellpadding="0" cellspacing="0">
140
141 <tr><td class="headlinesToolbar" id="headlinesToolbar">
142
143 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
144
145 <input id="searchbox"
146 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
147 <select id="searchmodebox">
148 <option>This feed</option>
149 <? if (get_pref($link, 'ENABLE_FEED_CATS')) { ?>
150 <option>This category</option>
151 <? } ?>
152 <option>All feeds</option>
153 </select>
154
155 <input type="submit"
156 class="button" onclick="javascript:search()" value="Search">
157
158 &nbsp;
159
160 <? } ?>
161
162 View:
163
164 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
165 <option selected>Adaptive</option>
166 <option>All Articles</option>
167 <option>Starred</option>
168 <option>Unread</option>
169 </select>
170
171 &nbsp;Limit:
172
173 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
174
175 <?
176 $limits = array(15 => 15, 30 => 30, 60 => 60);
177
178 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
179
180 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
181 $limits[$def_art_limit] = $def_art_limit;
182 }
183
184 asort($limits);
185 array_push($limits, 0);
186
187 if (!$def_art_limit) {
188 $def_art_limit = 30;
189 }
190
191 foreach ($limits as $key) {
192 print "<option";
193 if ($key == $def_art_limit) { print " selected"; }
194 print ">";
195
196 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
197
198 print "</option>";
199 } ?>
200
201 </select>
202
203 <!-- &nbsp;Selection:
204
205 <select id="headopbox">
206 <option id="hopToggleRead">Toggle (un)read</option>
207 </select>
208
209 <input class="button" type="submit" onclick="headopGo()" value="Go"> -->
210
211 &nbsp;Feed: <input class="button" type="submit"
212 onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
213
214 <input class="button" type="submit" id="btnMarkFeedAsRead"
215 onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
216
217 </td>
218 <td align="right">
219 <select id="quickMenuChooser" onchange="quickMenuChange()">
220 <option id="qmcDefault" selected>Actions...</option>
221 <option id="qmcPrefs">Preferences</option>
222 <option id="qmcSearch">Search</option>
223 <option disabled>--------</option>
224 <option style="color : #5050aa" disabled>Feed actions:</option>
225 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
226 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
227 <!-- <option>Edit this feed</option> -->
228 <option disabled>--------</option>
229 <option style="color : #5050aa" disabled>All feeds:</option>
230 <? if (!ENABLE_UPDATE_DAEMON) { ?>
231 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
232 <? } ?>
233 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
234 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
235 <option disabled>--------</option>
236 <option style="color : #5050aa" disabled>Other actions:</option>
237 <option id="qmcAddFilter">&nbsp;&nbsp;Add filter</option>
238 </select>
239 </td>
240 </tr>
241 </table>
242 </td>
243 </tr>
244 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
245 <tr>
246 <td id="headlines" class="headlines2" valign="top">
247 <iframe frameborder="0" name="headlines-frame"
248 id="headlines-frame" class="headlinesFrame"
249 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
250 </td>
251 </tr>
252 <? } else { ?>
253 <tr>
254 <td id="headlines" class="headlines" valign="top">
255 <iframe frameborder="0" name="headlines-frame"
256 id="headlines-frame" class="headlinesFrame"
257 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
258 </td>
259 </tr><tr>
260 <td class="content" id="content" valign="top">
261 <iframe frameborder="0" name="content-frame"
262 id="content-frame" class="contentFrame"> </iframe>
263 </td>
264 </tr>
265 <? } ?>
266 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
267 <tr>
268 <td colspan="2" class="footer" id="mainFooter">
269 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
270 <? if (WEB_DEMO_MODE) { ?>
271 <br>Running in demo mode, some functionality is disabled.
272 <? } ?>
273 </td>
274 </td>
275 <? } ?>
276 </table>
277
278 <? db_close($link); ?>
279
280 <script type="text/javascript">
281 /* for IE */
282 function statechange() {
283 if (document.readyState == "interactive") init();
284 }
285
286 if (document.readyState) {
287 if (document.readyState == "interactive" || document.readyState == "complete") {
288 init();
289 } else {
290 document.onreadystatechange = statechange;
291 }
292 }
293 </script>
294
295 </body>
296 </html>