]> git.wh0rd.org Git - tt-rss.git/blob - tt-rss.php
pref-feeds editor preserves cat_id when categories are disabled, fix feed order in...
[tt-rss.git] / tt-rss.php
1 <?
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 <html>
21 <head>
22         <title>Tiny Tiny RSS</title>
23
24         <link rel="stylesheet" type="text/css" href="tt-rss.css">
25
26         <?      $user_theme = $_SESSION["theme"];
27                 if ($user_theme) { ?>
28                 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
29         <? } ?>
30
31         <? if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
32
33         <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
34         <? if ($user_css_url) { ?>
35                 <link type="text/css" href="<?= $user_css_url ?>"/> 
36         <? } ?>
37
38         <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
39
40                 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
41
42         <? } else { ?>
43
44                 <link title="Compact Stylesheet" rel="alternate stylesheet" 
45                         type="text/css" href="tt-rss_compact.css"/> 
46
47         <? } ?>
48
49         <script type="text/javascript" src="prototype.js"></script>
50
51         <script type="text/javascript" src="tt-rss.js?<?= $dt_add ?>"></script>
52         <script type="text/javascript" src="functions.js?<?= $dt_add ?>"></script>
53         <!--[if gte IE 5.5000]>
54                 <script type="text/javascript" src="pngfix.js"></script>
55                 <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
56         <![endif]-->
57         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
58
59         <script type="text/javascript">
60                 if (navigator.userAgent.match("Opera")) {
61                         document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
62                 }
63                 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
64                         document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
65                 }
66         </script>
67 </head>
68
69 <body>
70
71 <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
72 <div id="fatal_error"><div id="fatal_error_inner">
73         <h1>Fatal Error</h1>
74         <div id="fatal_error_msg">Unknown Error</div>
75 </div></div>
76
77 <script type="text/javascript">
78 if (document.addEventListener) {
79         document.addEventListener("DOMContentLoaded", init, null);
80 }
81 window.onload = init;
82 </script>
83
84 <div id="noDaemonWarning">
85         <b>Warning:</b> Update daemon is enabled in configuration, but daemon
86         process is not running, which prevents all feeds from updating. Please
87         start the daemon process or contact instance owner.
88 </div>
89
90 <ul id="debug_output"></ul>
91
92 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
93 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
94 <tr>
95         <td colspan="2" class="headerBox" id="mainHeader">
96                 <table cellspacing="0" cellpadding="0" width="100%"><tr>
97                         <td rowspan="2" class="header" valign="middle"> 
98                                 <img src="<?= $theme_image_path ?>images/ttrss_logo.png" alt="logo">    
99                         </td>
100                         <td valign="top" class="notifyBox">
101                                 <div id="notify"><span id="notify_body">&nbsp;</span></div>
102                         </td>
103
104                         <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
105
106                 </tr><tr><td class="welcomePrompt">
107                         <? if (!SINGLE_USER_MODE) { ?>
108                                 Hello, <b><?= $_SESSION["name"] ?></b>
109                                 (<a href="logout.php">Logout</a>)
110                         <? } ?>
111                         </td>                   
112                 </tr></table>
113         </td>
114 </tr>
115 <? } else { ?>
116 <tr>
117         <td class="small" id="mainHeader">
118                 <div id="notify"><span id="notify_body">&nbsp;</span></div>
119                 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
120         </td><td class="welcomePrompt">
121                 <? if (!SINGLE_USER_MODE) { ?>
122                         Hello, <b><?= $_SESSION["name"] ?></b>
123                         (<a href="logout.php">Logout</a>)
124                 <? } ?>
125 </td></tr>
126 <? } ?>
127 <tr>
128         <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) 
129                         $feeds_rowspan = 2;
130                 else 
131                         $feeds_rowspan = 3; ?>
132         <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds"> 
133                 <table class="innerFeedTable" 
134                         cellspacing="0" cellpadding="0" height="100%" width="100%">
135                 <tr><td>
136                         <div id="dispSwitch"> 
137                         <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
138                 </div>
139                 </td></tr>      
140                 <tr><td height="100%" width="100%" valign="top">
141
142                 <iframe frameborder="0" 
143                         id="feeds-frame" name="feeds-frame" class="feedsFrame"></iframe>
144
145                 </td></tr></table>
146
147         </td>
148         <td valign="top" class="headlinesToolbarBox">
149                 <table width="100%" cellpadding="0" cellspacing="0">
150
151                 <tr><td class="headlinesToolbar" id="headlinesToolbar">
152
153                 <form id="main_toolbar_form">
154
155                 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
156                 <input name="query"
157                         onKeyPress="return filterCR(event)"
158                         onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
159                 <input class="button" type="submit"
160                         onclick="return viewCurrentFeed(0)" value="Search">
161                 &nbsp; 
162                 <? } ?>
163
164                 View:           
165                 <select name="view_mode" onchange="viewCurrentFeed(0, '')">
166                         <option selected value="adaptive">Adaptive</option>
167                         <option value="all_articles">All Articles</option>
168                         <option value="marked">Starred</option>
169                         <option value="unread">Unread</option>
170                 </select>
171                 
172                 &nbsp;Limit:            
173                 <?
174                 $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
175                         
176                 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
177
178                 if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
179                         $limits[$def_art_limit] = $def_art_limit; 
180                 }
181
182                 asort($limits);
183
184                 if (!$def_art_limit) {
185                         $def_art_limit = 30;
186                 }
187
188                 print_select_hash("limit", $def_art_limit, $limits, 
189                         'onchange="viewCurrentFeed(0, \'\')"');
190         
191                 ?>              
192                 </form>
193
194                 <!-- &nbsp;<input class="button" type="submit"
195                         onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
196
197                 &nbsp;<input class="button" type="submit"
198                         onclick="viewCurrentFeed(0, 'ForceUpdate')" value="Update">
199
200                 <input class="button" type="submit"
201                         onclick="viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read"> 
202
203                 </td>
204                 <td align="right">
205                         <select id="quickMenuChooser" onchange="quickMenuChange()">
206                                 <option value="qmcDefault" selected>Actions...</option>
207                                 <option value="qmcPrefs">Preferences</option>
208                                 <option value="qmcSearch">Search</option>
209                                 <option disabled>--------</option>
210                                 <option style="color : #5050aa" disabled>Feed actions:</option>
211                                 <option value="qmcAddFeed">&nbsp;&nbsp;Subscribe to feed</option>
212                                 <option value="qmcRemoveFeed">&nbsp;&nbsp;Unsubscribe</option>
213                                 <!-- <option>Edit this feed</option> -->
214                                 <option disabled>--------</option>
215                                 <option style="color : #5050aa" disabled>All feeds:</option>
216                                 <? if (!ENABLE_UPDATE_DAEMON) { ?>
217                                 <option value="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
218                                 <? } ?>
219                                 <option value="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>                         
220                                 <option value="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
221                                 <option disabled>--------</option>
222                                 <option style="color : #5050aa" disabled>Other actions:</option>                                
223                                 <option value="qmcAddFilter">&nbsp;&nbsp;Create filter</option>
224                         </select>
225                 </td>
226                 </tr>
227                 </table>
228         </td>
229 </tr>
230 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
231 <tr>
232         <td id="headlines" class="headlines2" valign="top">
233                 <iframe frameborder="0" name="headlines-frame" 
234                         id="headlines-frame" class="headlinesFrame"></iframe>
235         </td>
236 </tr>
237 <? } else { ?>
238 <tr>
239         <td id="headlines" class="headlines" valign="top">
240                 <iframe frameborder="0" name="headlines-frame" 
241                         id="headlines-frame" class="headlinesFrame"></iframe>
242         </td>
243 </tr><tr>
244         <td class="content" id="content" valign="top">
245                 <iframe frameborder="0" name="content-frame" 
246                         id="content-frame" class="contentFrame"> </iframe>
247         </td>
248 </tr>
249 <? } ?>
250 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
251 <tr>
252         <td colspan="2" class="footer" id="mainFooter">
253                 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
254                 <? if (WEB_DEMO_MODE) { ?>
255                 <br>Running in demo mode, some functionality is disabled.
256                 <? } ?>
257         </td>
258 </td>
259 <? } ?>
260 </table>
261
262 <? db_close($link); ?>
263
264 <script type="text/javascript">
265         /* for IE */
266         function statechange() {
267                 if (document.readyState == "interactive") init();
268         }
269
270         if (document.readyState) {      
271                 if (document.readyState == "interactive" || document.readyState == "complete") {
272                         init();
273                 } else {
274                         document.onreadystatechange = statechange;
275                 }
276         }
277 </script>
278
279 </body>
280 </html>