]> git.wh0rd.org Git - tt-rss.git/blob - tt-rss.php
misc updater tweaks
[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 rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/> 
38         <?php } ?>
39
40         <!--[if gte IE 5.5000]>         
41                 <script type="text/javascript" src="pngfix.js"></script>
42                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
43         <![endif]-->
44
45         <link rel="shortcut icon" type="image/png" href="images/favicon.png">
46
47         <script type="text/javascript" src="prototype.js"></script>
48
49         <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
50         <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
51         <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
52         <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
53
54         <!--[if gte IE 5.5000]>
55                 <script type="text/javascript" src="pngfix.js"></script>
56                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
57         <![endif]-->
58         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
59
60         <script type="text/javascript">
61                 if (navigator.userAgent.match("Opera")) {
62                         document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
63                 }
64                 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
65                         document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
66                 }
67         </script>
68 </head>
69
70 <body>
71
72 <iframe id="backReqBox"></iframe>
73
74 <div id="overlay">
75         <div id="overlay_inner">
76         <p><?php echo _("Loading, please wait...") ?></p>
77         <noscript>
78                 <div class="error"><?php echo
79                 _("Your browser doesn't support Javascript, which is required
80                 for this application to function properly. Please check your
81                 browser settings.") ?></div>
82         </noscript>
83         </div>
84 </div> 
85
86 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
87
88 <div id="fatal_error"><div id="fatal_error_inner">
89         <h1>Fatal Error</h1>
90         <div id="fatal_error_msg">Unknown Error</div>
91 </div></div>
92
93 <script type="text/javascript">
94 if (document.addEventListener) {
95         document.addEventListener("DOMContentLoaded", init, null);
96 }
97 window.onload = init;
98 </script>
99
100 <ul id="debug_output"></ul>
101
102 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
103
104 <div id="header">
105         <div style="float : right">
106         <?php if (!SINGLE_USER_MODE) { ?>
107                         <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
108                         (<a href="logout.php">Logout</a>)
109         <?php } ?>
110         <img id="newVersionIcon" onclick="javascript:explainError(2)" 
111                 src="images/new_version.png" title="New version is available!" 
112                 alt="new_version_icon">
113         </div>
114         <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>   
115 </div>
116
117 <div id="feeds-holder">
118         <div id="dispSwitch"> 
119                 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
120         </div>
121         <div id="feeds-frame">&nbsp;</div>
122 </div>
123
124 <div id="toolbar">
125
126                 <div style="float : right">
127                         <select id="quickMenuChooser" onchange="quickMenuChange()">
128                                         <option value="qmcDefault" selected><?php echo _('Actions...') ?></option>
129                                         <option value="qmcSearch"><?php echo _('Search') ?></option>
130                                         <option value="qmcPrefs"><?php echo _('Preferences') ?></option>
131                                         <option disabled>--------</option>
132                                         <option style="color : #5050aa" disabled><?php echo _('Feed actions:') ?></option>
133                                         <option value="qmcAddFeed"><?php echo _('&nbsp;&nbsp;Subscribe to feed') ?></option>
134                                         <option value="qmcEditFeed"><?php echo _('&nbsp;&nbsp;Edit this feed') ?></option>
135                                         <option value="qmcRemoveFeed"><?php echo _('&nbsp;&nbsp;Unsubscribe') ?></option>
136                                         <!-- <option>Edit this feed</option> -->
137                                         <option disabled>--------</option>
138                                         <option style="color : #5050aa" disabled><?php echo _('All feeds:') ?></option>
139                                         <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
140                                         <option value="qmcUpdateFeeds"><?php echo _('&nbsp;&nbsp;Update') ?></option>
141                                         <?php } ?>
142                                         <option value="qmcCatchupAll"><?php echo _('&nbsp;&nbsp;Mark as read') ?></option>
143                                         <option value="qmcShowOnlyUnread"><?php echo _('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
144                                         <option disabled>--------</option>
145                                         <option style="color : #5050aa" disabled><?php echo _('Other actions:') ?></option>                             
146                                         <option value="qmcAddFilter"><?php echo _('&nbsp;&nbsp;Create filter') ?></option>
147                         </select>
148                 </div>
149
150                 <form id="main_toolbar_form">
151
152                 <?php echo _('Search:') ?>
153                 <input name="query"
154                         onKeyPress="return filterCR(event, viewCurrentFeed)"
155                         onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
156
157                 <?php echo _('View:') ?>
158                 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
159                         <option selected value="adaptive"><?php echo _('Adaptive') ?></option>
160                         <option value="all_articles"><?php echo _('All Articles') ?></option>
161                         <option value="marked"><?php echo _('Starred') ?></option>
162                         <option value="unread"><?php echo _('Unread') ?></option>
163                 </select>
164                 
165                 <?php echo _('Limit:') ?>
166                 <?php
167                 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
168                         
169                 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
170
171                 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
172                         $limits[$def_art_limit] = $def_art_limit; 
173                 }
174
175                 asort($limits);
176
177                 if (!$def_art_limit) {
178                         $def_art_limit = 30;
179                 }
180
181                 print_select_hash("limit", $def_art_limit, $limits, 
182                         'onchange="viewCurrentFeed(0, \'\')"');
183         
184                 ?>              
185
186                 &nbsp;
187
188                 <input class="button" type="submit"
189                         onclick="return viewCurrentFeed('ForceUpdate')" 
190                         value="<?php echo _('Update') ?>">
191
192                 </form>
193
194                 <!-- &nbsp;<input class="button" type="submit"
195                         onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
196
197                 <!-- <input class="button" type="submit"
198                         onclick="catchupCurrentFeed()" value="Mark as read">  -->
199
200         </div>
201
202 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
203         <div id="headlines-frame" class="headlines_normal">
204                 <div class="whiteBox"><?php echo _('No feed selected.') ?></div></div>
205         <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
206 <?php } else { ?>
207         <div id="headlines-frame" class="headlines_cdm">
208                 <div class="whiteBox"><?php echo _('No feed selected.') ?></div></div>
209 <?php } ?>
210
211 <div id="footer">
212         <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
213                 <select id="userSwitch" onchange="userSwitch()">
214                 <?php 
215                         foreach (array('admin', 'fox', 'test') as $u) {
216                                 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
217                                 print "<option $op_sel>$u</option>";
218                         }
219                 ?>
220                 </select>
221         <?php } ?>
222         <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>
223 </div>
224
225 <?php db_close($link); ?>
226
227 <script type="text/javascript">
228         /* for IE */
229         function statechange() {
230                 if (document.readyState == "interactive") init();
231         }
232
233         if (document.readyState) {      
234                 if (document.readyState == "interactive" || document.readyState == "complete") {
235                         init();
236                 } else {
237                         document.onreadystatechange = statechange;
238                 }
239         }
240 </script>
241
242 </body>
243 </html>