]> git.wh0rd.org Git - tt-rss.git/blob - tt-rss.php
interface 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 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         <!--[if gte IE 5.5000]>         
52                 <script type="text/javascript" src="pngfix.js"></script>
53                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
54         <![endif]-->
55
56         <link rel="shortcut icon" type="image/png" href="images/favicon.png">
57
58         <script type="text/javascript" src="prototype.js"></script>
59
60         <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
61         <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
62         <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
63         <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
64
65         <!--[if gte IE 5.5000]>
66                 <script type="text/javascript" src="pngfix.js"></script>
67                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
68         <![endif]-->
69         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
70
71         <script type="text/javascript">
72                 if (navigator.userAgent.match("Opera")) {
73                         document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
74                 }
75                 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
76                         document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
77                 }
78         </script>
79 </head>
80
81 <body>
82
83 <iframe id="backReqBox"></iframe>
84
85 <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div> 
86
87 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
88
89 <div id="fatal_error"><div id="fatal_error_inner">
90         <h1>Fatal Error</h1>
91         <div id="fatal_error_msg">Unknown Error</div>
92 </div></div>
93
94 <script type="text/javascript">
95 if (document.addEventListener) {
96         document.addEventListener("DOMContentLoaded", init, null);
97 }
98 window.onload = init;
99 </script>
100
101 <div id="noDaemonWarning">
102         <b>Warning:</b> Update daemon is enabled in configuration, but daemon
103         process is not running, which prevents all feeds from updating. Please
104         start the daemon process or contact instance owner.
105 </div>
106
107 <ul id="debug_output"></ul>
108
109 <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
110
111 <?php if (get_pref($link, 'DISPLAY_HEADER')) { ?>
112         <div id="header">
113                 <?php if (!SINGLE_USER_MODE) { ?>
114                         <div style="float : right">
115                                 Hello, <b><?php echo $_SESSION["name"] ?></b>
116                                 (<a href="logout.php">Logout</a>)
117                         </div>
118                 <?php } ?>
119                 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS">    
120         </div>
121 <?php } else if (!SINGLE_USER_MODE) { ?>
122         <div style="float : right">
123                 Hello, <b><?php echo $_SESSION["name"] ?></b>
124                 (<a href="logout.php">Logout</a>)
125         </div>
126 <?php } ?>
127
128 <div id="feeds-holder">
129         <div id="dispSwitch"> 
130                 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
131         </div>
132         <div id="feeds-frame">&nbsp;</div>
133 </div>
134
135 <div id="toolbar">
136
137                 <div style="float : right">
138                         <select id="quickMenuChooser" onchange="quickMenuChange()">
139                                         <option value="qmcDefault" selected>Actions...</option>
140                                         <option value="qmcPrefs">Preferences</option>
141                                         <option value="qmcSearch">Search</option>
142                                         <option disabled>--------</option>
143                                         <option style="color : #5050aa" disabled>Feed actions:</option>
144                                         <option value="qmcAddFeed">&nbsp;&nbsp;Subscribe to feed</option>
145                                         <option value="qmcRemoveFeed">&nbsp;&nbsp;Unsubscribe</option>
146                                         <!-- <option>Edit this feed</option> -->
147                                         <option disabled>--------</option>
148                                         <option style="color : #5050aa" disabled>All feeds:</option>
149                                         <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
150                                         <option value="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
151                                         <?php } ?>
152                                         <option value="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>                         
153                                         <option value="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
154                                         <option disabled>--------</option>
155                                         <option style="color : #5050aa" disabled>Other actions:</option>                                
156                                         <option value="qmcAddFilter">&nbsp;&nbsp;Create filter</option>
157                         </select>
158                 </div>
159
160                 <form id="main_toolbar_form">
161
162                 <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
163                 <input name="query"
164                         onKeyPress="return filterCR(event)"
165                         onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
166                 <input class="button" type="submit"
167                         onclick="return viewCurrentFeed(0)" value="Search">
168                 &nbsp; 
169                 <?php } ?>
170
171                 View:           
172                 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
173                         <option selected value="adaptive">Adaptive</option>
174                         <option value="all_articles">All Articles</option>
175                         <option value="marked">Starred</option>
176                         <option value="unread">Unread</option>
177                 </select>
178                 
179                 &nbsp;Limit:            
180                 <?php
181                 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
182                         
183                 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
184
185                 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
186                         $limits[$def_art_limit] = $def_art_limit; 
187                 }
188
189                 asort($limits);
190
191                 if (!$def_art_limit) {
192                         $def_art_limit = 30;
193                 }
194
195                 print_select_hash("limit", $def_art_limit, $limits, 
196                         'onchange="viewCurrentFeed(0, \'\')"');
197         
198                 ?>              
199                 </form>
200
201                 <!-- &nbsp;<input class="button" type="submit"
202                         onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
203
204                 &nbsp;<input class="button" type="submit"
205                         onclick="viewCurrentFeed('ForceUpdate')" value="Update">
206
207                 <!-- <input class="button" type="submit"
208                         onclick="catchupCurrentFeed()" value="Mark as read">  -->
209
210         </div>
211
212 <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
213         <div id="headlines-frame" class="headlines_normal"><div class="whiteBox">No feed selected.</div></div>
214         <div id="content-frame">&nbsp;</div>
215 <?php } else { ?>
216         <div id="headlines-frame" class="headlines_cdm"><div class="whiteBox">No feed selected.</div></div>
217 <?php } ?>
218
219 <?php if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
220         <div id="footer">
221                 <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2006 Andrew Dolgov
222         </div>
223 <?php } ?>
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>