]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
layout tweaks, enable hotkeys
[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 type="text/css" href="<?php echo $user_css_url ?>"/>
38 <?php } ?>
39
40 <?php if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
41
42 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
43
44 <?php } else { ?>
45
46 <link title="Compact Stylesheet" rel="alternate stylesheet"
47 type="text/css" href="tt-rss_compact.css"/>
48
49 <?php } ?>
50
51 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
52
53 <script type="text/javascript" src="prototype.js"></script>
54
55 <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
56 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
57 <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
58 <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
59
60 <!--[if gte IE 5.5000]>
61 <script type="text/javascript" src="pngfix.js"></script>
62 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
63 <![endif]-->
64 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
65
66 <script type="text/javascript">
67 if (navigator.userAgent.match("Opera")) {
68 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
69 }
70 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
71 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
72 }
73 </script>
74 </head>
75
76 <body>
77
78 <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
79
80 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
81
82 <div id="fatal_error"><div id="fatal_error_inner">
83 <h1>Fatal Error</h1>
84 <div id="fatal_error_msg">Unknown Error</div>
85 </div></div>
86
87 <script type="text/javascript">
88 if (document.addEventListener) {
89 document.addEventListener("DOMContentLoaded", init, null);
90 }
91 window.onload = init;
92 </script>
93
94 <div id="noDaemonWarning">
95 <b>Warning:</b> Update daemon is enabled in configuration, but daemon
96 process is not running, which prevents all feeds from updating. Please
97 start the daemon process or contact instance owner.
98 </div>
99
100 <ul id="debug_output"></ul>
101
102 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
103
104 <?php if (get_pref($link, 'DISPLAY_HEADER')) { ?>
105 <div id="header">
106 <?php if (!SINGLE_USER_MODE) { ?>
107 <div style="float : right">
108 Hello, <b><?php echo $_SESSION["name"] ?></b>
109 (<a href="logout.php">Logout</a>)
110 </div>
111 <?php } ?>
112 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS">
113 </div>
114 <?php } else if (!SINGLE_USER_MODE) { ?>
115 <div style="float : right">
116 Hello, <b><?php echo $_SESSION["name"] ?></b>
117 (<a href="logout.php">Logout</a>)
118 </div>
119 <?php } ?>
120
121 <div id="feeds-holder">
122 <div id="dispSwitch">
123 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
124 </div>
125 <div id="feeds-frame">-fixme-</div>
126 </div>
127
128 <div id="toolbar">
129
130 <div style="float : right">
131 <select id="quickMenuChooser" onchange="quickMenuChange()">
132 <option value="qmcDefault" selected>Actions...</option>
133 <option value="qmcPrefs">Preferences</option>
134 <option value="qmcSearch">Search</option>
135 <option disabled>--------</option>
136 <option style="color : #5050aa" disabled>Feed actions:</option>
137 <option value="qmcAddFeed">&nbsp;&nbsp;Subscribe to 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 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
156 <input name="query"
157 onKeyPress="return filterCR(event)"
158 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
159 <input class="button" type="submit"
160 onclick="return viewCurrentFeed(0)" value="Search">
161 &nbsp;
162 <?php } ?>
163
164 View:
165 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
166 <option selected value="adaptive">Adaptive</option>
167 <option value="all_articles">All Articles</option>
168 <option value="marked">Starred</option>
169 <option value="unread">Unread</option>
170 </select>
171
172 &nbsp;Limit:
173 <?php
174 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
175
176 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
177
178 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
179 $limits[$def_art_limit] = $def_art_limit;
180 }
181
182 asort($limits);
183
184 if (!$def_art_limit) {
185 $def_art_limit = 30;
186 }
187
188 print_select_hash("limit", $def_art_limit, $limits,
189 'onchange="viewCurrentFeed(0, \'\')"');
190
191 ?>
192 </form>
193
194 <!-- &nbsp;<input class="button" type="submit"
195 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
196
197 &nbsp;<input class="button" type="submit"
198 onclick="viewCurrentFeed('ForceUpdate')" value="Update">
199
200 <input class="button" type="submit"
201 onclick="catchupCurrentFeed()" value="Mark as read">
202
203 </div>
204
205 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
206 <div id="headlines-frame" class="headlines_normal"><div class="whiteBox">&nbsp;</div></div>
207 <div id="content-frame">&nbsp;</div>
208 <?php } else { ?>
209 <div id="headlines-frame" class="headlines_cdm"><div class="whiteBox">&nbsp;</div></div>
210 <?php } ?>
211
212 <?php if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
213 <div id="footer">
214 <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2006 Andrew Dolgov
215 </div>
216 <?php } ?>
217
218 <?php db_close($link); ?>
219
220 <script type="text/javascript">
221 /* for IE */
222 function statechange() {
223 if (document.readyState == "interactive") init();
224 }
225
226 if (document.readyState) {
227 if (document.readyState == "interactive" || document.readyState == "complete") {
228 init();
229 } else {
230 document.onreadystatechange = statechange;
231 }
232 }
233 </script>
234
235 </body>
236 </html>