]> git.wh0rd.org Git - tt-rss.git/blob - tt-rss.php
42b1bf35bc2ec294c7a7d5ee1a64d147458c9061
[tt-rss.git] / tt-rss.php
1 <?php
2         require_once "functions.php"; 
3         require_once "sessions.php";
4         require_once "sanity_check.php";
5         require_once "version.php"; 
6         require_once "config.php";
7         require_once "db-prefs.php";
8
9         $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
10
11         login_sequence($link);
12
13         $dt_add = get_script_dt_add();
14
15 ?>
16 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
17         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
18 <html>
19 <head>
20         <title>Tiny Tiny RSS</title>
21
22         <link rel="stylesheet" type="text/css" href="tt-rss.css">
23
24         <?php   $user_theme = $_SESSION["theme"];
25                 if ($user_theme) { ?>
26                 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
27         <?php } ?>
28
29         <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
30
31         <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
32         <?php if ($user_css_url) { ?>
33                 <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/> 
34         <?php } ?>
35
36         <!--[if gte IE 5.5000]>         
37                 <script type="text/javascript" src="pngfix.js"></script>
38                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
39         <![endif]-->
40
41         <link rel="shortcut icon" type="image/png" href="images/favicon.png">
42
43         <script type="text/javascript" src="prototype.js"></script>
44
45         <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
46         <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
47         <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
48         <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
49
50         <!--[if gte IE 5.5000]>
51                 <script type="text/javascript" src="pngfix.js"></script>
52                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
53         <![endif]-->
54         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
55
56         <script type="text/javascript">
57                 if (navigator.userAgent.match("Opera")) {
58                         document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
59                 }
60                 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
61                         document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
62                 }
63         </script>
64 </head>
65
66 <body>
67
68 <iframe id="backReqBox"></iframe>
69
70 <div id="overlay">
71         <div id="overlay_inner">
72         <p><?php echo _("Loading, please wait...") ?></p>
73         <noscript>
74                 <div class="error"><?php echo
75                 _("Your browser doesn't support Javascript, which is required
76                 for this application to function properly. Please check your
77                 browser settings.") ?></div>
78         </noscript>
79         </div>
80 </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 <ul id="debug_output"></ul>
97
98 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
99
100 <div id="header">
101         <div style="float : right">
102         <?php if (!SINGLE_USER_MODE) { ?>
103                         <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
104                         (<a href="javascript:logoutUser()">Logout</a>)
105         <?php } ?>
106         <img id="newVersionIcon" onclick="javascript:explainError(2)" 
107                 src="images/new_version.png" title="New version is available!" 
108                 alt="new_version_icon">
109         </div>
110         <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>   
111 </div>
112
113 <div id="feeds-holder">
114         <div id="dispSwitch"> 
115                 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
116         </div>
117         <div id="feeds-frame">&nbsp;</div>
118 </div>
119
120 <div id="toolbar">
121
122                 <div style="float : right">
123                         <select id="quickMenuChooser" onchange="quickMenuChange()">
124                                         <option value="qmcDefault" selected><?php echo _('Actions...') ?></option>
125                                         <option value="qmcSearch"><?php echo _('Search') ?></option>
126                                         <option value="qmcPrefs"><?php echo _('Preferences') ?></option>
127                                         <option disabled>--------</option>
128                                         <option style="color : #5050aa" disabled><?php echo _('Feed actions:') ?></option>
129                                         <option value="qmcAddFeed"><?php echo _('&nbsp;&nbsp;Subscribe to feed') ?></option>
130                                         <option value="qmcEditFeed"><?php echo _('&nbsp;&nbsp;Edit this feed') ?></option>
131                                         <option value="qmcRemoveFeed"><?php echo _('&nbsp;&nbsp;Unsubscribe') ?></option>
132                                         <!-- <option>Edit this feed</option> -->
133                                         <option disabled>--------</option>
134                                         <option style="color : #5050aa" disabled><?php echo _('All feeds:') ?></option>
135                                         <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
136                                         <option value="qmcUpdateFeeds"><?php echo _('&nbsp;&nbsp;Update') ?></option>
137                                         <?php } ?>
138                                         <option value="qmcCatchupAll"><?php echo _('&nbsp;&nbsp;Mark as read') ?></option>
139                                         <option value="qmcShowOnlyUnread"><?php echo _('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
140                                         <option disabled>--------</option>
141                                         <option style="color : #5050aa" disabled><?php echo _('Other actions:') ?></option>                             
142                                         <option value="qmcAddFilter"><?php echo _('&nbsp;&nbsp;Create filter') ?></option>
143                         </select>
144                 </div>
145
146                 <form id="main_toolbar_form">
147
148                 <?php echo _('Search:') ?>
149                 <input name="query"
150                         onKeyPress="return filterCR(event, viewCurrentFeed)"
151                         onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
152
153                 <?php echo _('View:') ?>
154                 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
155                         <option selected value="adaptive"><?php echo _('Adaptive') ?></option>
156                         <option value="all_articles"><?php echo _('All Articles') ?></option>
157                         <option value="marked"><?php echo _('Starred') ?></option>
158                         <option value="unread"><?php echo _('Unread') ?></option>
159                 </select>
160                 
161                 <?php echo _('Limit:') ?>
162                 <?php
163                 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
164                         
165                 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
166
167                 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
168                         $limits[$def_art_limit] = $def_art_limit; 
169                 }
170
171                 asort($limits);
172
173                 if (!$def_art_limit) {
174                         $def_art_limit = 30;
175                 }
176
177                 print_select_hash("limit", $def_art_limit, $limits, 
178                         'onchange="viewCurrentFeed(0, \'\')"');
179         
180                 ?>              
181
182                 &nbsp;
183
184                 <input class="button" type="submit"
185                         onclick="return viewCurrentFeed('ForceUpdate')" 
186                         value="<?php echo _('Update') ?>">
187
188                 </form>
189
190                 <!-- &nbsp;<input class="button" type="submit"
191                         onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
192
193                 <!-- <input class="button" type="submit"
194                         onclick="catchupCurrentFeed()" value="Mark as read">  -->
195
196         </div>
197
198 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
199         <div id="headlines-frame" class="headlines_normal">
200                 <div class="whiteBox"><?php echo _('No feed selected.') ?></div></div>
201         <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
202 <?php } else { ?>
203         <div id="headlines-frame" class="headlines_cdm">
204                 <div class="whiteBox"><?php echo _('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-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
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>