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