]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
add quick action to edit current feed
[tt-rss.git] / tt-rss.php
1 <?php
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
21 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22 <html>
23 <head>
24 <title>Tiny Tiny RSS</title>
25
26 <link rel="stylesheet" type="text/css" href="tt-rss.css">
27
28 <?php $user_theme = $_SESSION["theme"];
29 if ($user_theme) { ?>
30 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
31 <?php } ?>
32
33 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
34
35 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
36 <?php if ($user_css_url) { ?>
37 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
38 <?php } ?>
39
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
45 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
46
47 <script type="text/javascript" src="prototype.js"></script>
48
49 <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
50 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
51 <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
52 <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
53
54 <!--[if gte IE 5.5000]>
55 <script type="text/javascript" src="pngfix.js"></script>
56 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
57 <![endif]-->
58 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
59
60 <script type="text/javascript">
61 if (navigator.userAgent.match("Opera")) {
62 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
63 }
64 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
65 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
66 }
67 </script>
68 </head>
69
70 <body>
71
72 <iframe id="backReqBox"></iframe>
73
74 <div id="overlay">
75 <div id="overlay_inner">
76 <p>Loading, please wait...</p>
77 <noscript>
78 <div class="error">
79 Your browser doesn't support Javascript, which is required
80 for this application to function properly. Please check your
81 browser settings.</div>
82 </noscript>
83 </div>
84 </div>
85
86 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
87
88 <div id="fatal_error"><div id="fatal_error_inner">
89 <h1>Fatal Error</h1>
90 <div id="fatal_error_msg">Unknown Error</div>
91 </div></div>
92
93 <script type="text/javascript">
94 if (document.addEventListener) {
95 document.addEventListener("DOMContentLoaded", init, null);
96 }
97 window.onload = init;
98 </script>
99
100 <div id="noDaemonWarning">
101 <b>Warning:</b> Update daemon is enabled in configuration, but daemon
102 process is not running, which prevents all feeds from updating. Please
103 start the daemon process or contact instance owner.
104 </div>
105
106 <ul id="debug_output"></ul>
107
108 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
109
110 <div id="header">
111 <?php if (!SINGLE_USER_MODE) { ?>
112 <div style="float : right">
113 Hello, <b><?php echo $_SESSION["name"] ?></b>
114 (<a href="logout.php">Logout</a>)
115 </div>
116 <?php } ?>
117 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
118 </div>
119
120 <div id="feeds-holder">
121 <div id="dispSwitch">
122 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
123 </div>
124 <div id="feeds-frame">&nbsp;</div>
125 </div>
126
127 <div id="toolbar">
128
129 <div style="float : right">
130 <select id="quickMenuChooser" onchange="quickMenuChange()">
131 <option value="qmcDefault" selected>Actions...</option>
132 <option value="qmcPrefs">Preferences</option>
133 <option value="qmcSearch">Search</option>
134 <option disabled>--------</option>
135 <option style="color : #5050aa" disabled>Feed actions:</option>
136 <option value="qmcAddFeed">&nbsp;&nbsp;Subscribe to feed</option>
137 <option value="qmcEditFeed">&nbsp;&nbsp;Edit this feed</option>
138 <option value="qmcRemoveFeed">&nbsp;&nbsp;Unsubscribe</option>
139 <!-- <option>Edit this feed</option> -->
140 <option disabled>--------</option>
141 <option style="color : #5050aa" disabled>All feeds:</option>
142 <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
143 <option value="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
144 <?php } ?>
145 <option value="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
146 <option value="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
147 <option disabled>--------</option>
148 <option style="color : #5050aa" disabled>Other actions:</option>
149 <option value="qmcAddFilter">&nbsp;&nbsp;Create filter</option>
150 </select>
151 </div>
152
153 <form id="main_toolbar_form">
154
155 Search: <input name="query"
156 onKeyPress="return filterCR(event, viewCurrentFeed)"
157 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
158 &nbsp;
159 View:
160 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
161 <option selected value="adaptive">Adaptive</option>
162 <option value="all_articles">All Articles</option>
163 <option value="marked">Starred</option>
164 <option value="unread">Unread</option>
165 </select>
166
167 &nbsp;Limit:
168 <?php
169 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
170
171 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
172
173 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
174 $limits[$def_art_limit] = $def_art_limit;
175 }
176
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 ?>
187 </form>
188
189 <!-- &nbsp;<input class="button" type="submit"
190 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
191
192 &nbsp;<input class="button" type="submit"
193 onclick="viewCurrentFeed('ForceUpdate')" value="Update">
194
195 <!-- <input class="button" type="submit"
196 onclick="catchupCurrentFeed()" value="Mark as read"> -->
197
198 </div>
199
200 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
201 <div id="headlines-frame" class="headlines_normal"><div class="whiteBox">No feed selected.</div></div>
202 <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
203 <?php } else { ?>
204 <div id="headlines-frame" class="headlines_cdm"><div class="whiteBox">No feed selected.</div></div>
205 <?php } ?>
206
207 <div id="footer">
208 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
209 <select id="userSwitch" onchange="userSwitch()">
210 <?php
211 foreach (array('admin', 'fox', 'test') as $u) {
212 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
213 print "<option $op_sel>$u</option>";
214 }
215 ?>
216 </select>
217 <?php } ?>
218 <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2006 Andrew Dolgov
219 </div>
220
221 <?php db_close($link); ?>
222
223 <script type="text/javascript">
224 /* for IE */
225 function statechange() {
226 if (document.readyState == "interactive") init();
227 }
228
229 if (document.readyState) {
230 if (document.readyState == "interactive" || document.readyState == "complete") {
231 init();
232 } else {
233 document.onreadystatechange = statechange;
234 }
235 }
236 </script>
237
238 </body>
239 </html>