]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
add back-req iframe
[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 <iframe id="backReqBox"></iframe>
79
80 <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
81
82 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
83
84 <div id="fatal_error"><div id="fatal_error_inner">
85 <h1>Fatal Error</h1>
86 <div id="fatal_error_msg">Unknown Error</div>
87 </div></div>
88
89 <script type="text/javascript">
90 if (document.addEventListener) {
91 document.addEventListener("DOMContentLoaded", init, null);
92 }
93 window.onload = init;
94 </script>
95
96 <div id="noDaemonWarning">
97 <b>Warning:</b> Update daemon is enabled in configuration, but daemon
98 process is not running, which prevents all feeds from updating. Please
99 start the daemon process or contact instance owner.
100 </div>
101
102 <ul id="debug_output"></ul>
103
104 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
105
106 <?php if (get_pref($link, 'DISPLAY_HEADER')) { ?>
107 <div id="header">
108 <?php if (!SINGLE_USER_MODE) { ?>
109 <div style="float : right">
110 Hello, <b><?php echo $_SESSION["name"] ?></b>
111 (<a href="logout.php">Logout</a>)
112 </div>
113 <?php } ?>
114 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS">
115 </div>
116 <?php } else if (!SINGLE_USER_MODE) { ?>
117 <div style="float : right">
118 Hello, <b><?php echo $_SESSION["name"] ?></b>
119 (<a href="logout.php">Logout</a>)
120 </div>
121 <?php } ?>
122
123 <div id="feeds-holder">
124 <div id="dispSwitch">
125 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
126 </div>
127 <div id="feeds-frame">-fixme-</div>
128 </div>
129
130 <div id="toolbar">
131
132 <div style="float : right">
133 <select id="quickMenuChooser" onchange="quickMenuChange()">
134 <option value="qmcDefault" selected>Actions...</option>
135 <option value="qmcPrefs">Preferences</option>
136 <option value="qmcSearch">Search</option>
137 <option disabled>--------</option>
138 <option style="color : #5050aa" disabled>Feed actions:</option>
139 <option value="qmcAddFeed">&nbsp;&nbsp;Subscribe to feed</option>
140 <option value="qmcRemoveFeed">&nbsp;&nbsp;Unsubscribe</option>
141 <!-- <option>Edit this feed</option> -->
142 <option disabled>--------</option>
143 <option style="color : #5050aa" disabled>All feeds:</option>
144 <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
145 <option value="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
146 <?php } ?>
147 <option value="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
148 <option value="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
149 <option disabled>--------</option>
150 <option style="color : #5050aa" disabled>Other actions:</option>
151 <option value="qmcAddFilter">&nbsp;&nbsp;Create filter</option>
152 </select>
153 </div>
154
155 <form id="main_toolbar_form">
156
157 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
158 <input name="query"
159 onKeyPress="return filterCR(event)"
160 onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
161 <input class="button" type="submit"
162 onclick="return viewCurrentFeed(0)" value="Search">
163 &nbsp;
164 <?php } ?>
165
166 View:
167 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
168 <option selected value="adaptive">Adaptive</option>
169 <option value="all_articles">All Articles</option>
170 <option value="marked">Starred</option>
171 <option value="unread">Unread</option>
172 </select>
173
174 &nbsp;Limit:
175 <?php
176 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
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
186 if (!$def_art_limit) {
187 $def_art_limit = 30;
188 }
189
190 print_select_hash("limit", $def_art_limit, $limits,
191 'onchange="viewCurrentFeed(0, \'\')"');
192
193 ?>
194 </form>
195
196 <!-- &nbsp;<input class="button" type="submit"
197 onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
198
199 &nbsp;<input class="button" type="submit"
200 onclick="viewCurrentFeed('ForceUpdate')" value="Update">
201
202 <input class="button" type="submit"
203 onclick="catchupCurrentFeed()" value="Mark as read">
204
205 </div>
206
207 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
208 <div id="headlines-frame" class="headlines_normal"><div class="whiteBox">&nbsp;</div></div>
209 <div id="content-frame">&nbsp;</div>
210 <?php } else { ?>
211 <div id="headlines-frame" class="headlines_cdm"><div class="whiteBox">&nbsp;</div></div>
212 <?php } ?>
213
214 <?php if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
215 <div id="footer">
216 <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2006 Andrew Dolgov
217 </div>
218 <?php } ?>
219
220 <?php db_close($link); ?>
221
222 <script type="text/javascript">
223 /* for IE */
224 function statechange() {
225 if (document.readyState == "interactive") init();
226 }
227
228 if (document.readyState) {
229 if (document.readyState == "interactive" || document.readyState == "complete") {
230 init();
231 } else {
232 document.onreadystatechange = statechange;
233 }
234 }
235 </script>
236
237 </body>
238 </html>