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