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