]> git.wh0rd.org Git - tt-rss.git/blob - tt-rss.php
new option: ENABLE_SEARCH_TOOLBAR
[tt-rss.git] / tt-rss.php
1 <?
2         session_start();
3
4         require_once "sanity_check.php";
5         require_once "version.php"; 
6         require_once "config.php";
7         require_once "db-prefs.php";
8         require_once "functions.php"; 
9
10         $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
11
12         login_sequence($link);
13
14 ?>
15 <html>
16 <head>
17         <title>Tiny Tiny RSS</title>
18
19         <link rel="stylesheet" type="text/css" href="tt-rss.css">
20
21         <?      $user_theme = $_SESSION["theme"];
22                 if ($user_theme) { ?>
23                 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
24         <? } ?>
25
26         <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
27         <? if ($user_css_url) { ?>
28                 <link type="text/css" href="<?= $user_css_url ?>"/> 
29         <? } ?>
30
31         <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
32
33                 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
34
35         <? } else { ?>
36
37                 <link title="Compact Stylesheet" rel="alternate stylesheet" 
38                         type="text/css" href="tt-rss_compact.css"/> 
39
40         <? } ?>
41
42         <script type="text/javascript" src="functions.js"></script>
43         <script type="text/javascript" src="tt-rss.js"></script>
44         <!--[if gte IE 5.5000]>
45                 <script type="text/javascript" src="pngfix.js"></script>
46         <![endif]-->
47         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
48 </head>
49
50 <body onload="init()">
51
52 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
53 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
54 <tr>
55         <td colspan="2" class="headerBox">
56                 <table cellspacing="0" cellpadding="0" width="100%"><tr>
57                         <td rowspan="2" class="header" valign="middle"> 
58                                 <img src="images/ttrss_logo.png" alt="logo">    
59                         </td>
60                         <td valign="top" class="notifyBox">
61                                 <div id="notify"><span id="notify_body">&nbsp;</span></div>
62                         </td>
63
64                         <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
65
66                 </tr><tr><td class="welcomePrompt">
67                         <? if (!SINGLE_USER_MODE) { ?>
68                                 Hello, <b><?= $_SESSION["name"] ?></b>
69                                 (<a href="logout.php">Logout</a>)
70                         <? } ?>
71                         </td>                   
72                 </tr></table>
73         </td>
74 </tr>
75 <? } else { ?>
76 <tr>
77         <td class="small">
78                 <div id="notify"><span id="notify_body">&nbsp;</span></div>
79                 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
80         </td><td class="welcomePrompt">
81                 <? if (!SINGLE_USER_MODE) { ?>
82                         Hello, <b><?= $_SESSION["name"] ?></b>
83                         (<a href="logout.php">Logout</a>)
84                 <? } ?>
85 </td></tr>
86 <? } ?>
87 <tr>
88         <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) 
89                         $feeds_rowspan = 2;
90                 else 
91                         $feeds_rowspan = 3; ?>
92         <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds"> 
93                 <table class="innerFeedTable" 
94                         cellspacing="0" cellpadding="0" height="100%" width="100%">
95                 <tr><td>
96                         <div id="dispSwitch"> 
97                         <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
98                 </div>
99                 </td></tr>      
100                 <tr><td height="100%" width="100%" valign="top">
101                 
102                 <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
103
104                 <iframe frameborder="0" 
105                         src="backend.php?op=error&msg=Loading,%20please wait..."
106                         id="feeds-frame" name="feeds-frame" class="feedsFrameWithActions"> </iframe>
107
108                 <div align="center">All feeds: 
109                 
110                 <select id="allFeedsChooser">
111                         <option>Update</option>
112                         <option>Mark as read</option>
113                         <option>Show only unread</option>
114                 </select>
115
116                 <input type="submit" class="button" onclick="allFeedsMenuGo()" value="Go">
117
118                 </div>
119                 
120                 <? } else { ?>
121
122                 <iframe frameborder="0" 
123                         src="backend.php?op=error&msg=Loading,%20please wait..."
124                         id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
125
126                 <? } ?>
127
128                 </td></tr></table>
129
130         </td>
131         <td valign="top" class="headlinesToolbarBox">
132                 <table width="100%" cellpadding="0" cellspacing="0">
133
134                 <tr><td class="headlinesToolbar" id="headlinesToolbar">
135
136                 <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
137
138                 <input id="searchbox"
139                         onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()"
140                         onchange="javascript:search()">
141                 <select id="searchmodebox">
142                         <option>This feed</option>
143                         <option>All feeds</option>
144                 </select>
145                 
146                 <input type="submit" 
147                         class="button" onclick="javascript:search()" value="Search">
148
149                 &nbsp;
150                 
151                 <? } ?>
152                 
153                 View: 
154                 
155                 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
156                         <option selected>Adaptive</option>
157                         <option>All Articles</option>
158                         <option>Starred</option>
159                         <option>Unread</option>
160                 </select>
161
162                 &nbsp;Limit:
163
164                 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
165                 
166                 <?
167                         $limits = array(15 => 15, 30 => 30, 60 => 60);
168                         
169                         $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
170
171                         print $def_art_limit;
172         
173                         if ($def_art_limit >= 0) {
174                                 $limits[$def_art_limit] = $def_art_limit; 
175                         }
176                         
177                         asort($limits);
178
179                         array_push($limits, 0);
180
181                         foreach ($limits as $key) {
182                                 print "<option";
183                                 if ($key == $def_art_limit) { print " selected"; }
184                                 print ">";
185                                 
186                                 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
187                                 
188                                 print "</option>";
189                         } ?>
190                 
191                 </select>
192
193 <!--            &nbsp;Selection:
194
195                 <select id="headopbox">
196                         <option id="hopToggleRead">Toggle (un)read</option>
197                 </select>
198
199                 <input class="button" type="submit" onclick="headopGo()" value="Go"> -->
200
201                 &nbsp;Feed: <input class="button" type="submit"
202                         onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
203
204                 <input class="button" type="submit" id="btnMarkFeedAsRead"
205                         onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read"> 
206
207                 </td>
208                 <td align="right">
209                         Actions: <select id="quickMenuChooser">
210                                 <option id="qmcPrefs" selected>Preferences...</option>
211                                 <option disabled>--------</option>
212                                 <option style="color : #5050aa" disabled>Feed actions:</option>
213                                 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed...</option>
214                                 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed...</option>
215                                 <!-- <option>Edit this feed</option> -->
216                                 <option disabled>--------</option>
217                                 <option style="color : #5050aa" disabled>All feeds:</option>
218                                 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
219                                 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
220                                 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
221                                 <option disabled>--------</option>
222                                 <option style="color : #5050aa" disabled>Other actions:</option>                                
223                                 <option id="qmcAddFilter">&nbsp;&nbsp;Add filter...</option>
224                         </select>
225                         <input type="submit" class="button" onclick="quickMenuGo()" value="Go">
226                 </td>
227                 </tr>
228                 </table>
229         </td>
230 </tr>
231 <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
232 <tr>
233         <td id="headlines" class="headlines2" valign="top">
234                 <iframe frameborder="0" name="headlines-frame" 
235                         id="headlines-frame" class="headlinesFrame" 
236                                 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
237         </td>
238 </tr>
239 <? } else { ?>
240 <tr>
241         <td id="headlines" class="headlines" valign="top">
242                 <iframe frameborder="0" name="headlines-frame" 
243                         id="headlines-frame" class="headlinesFrame" 
244                                 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
245         </td>
246 </tr><tr>
247         <td class="content" id="content" valign="top">
248                 <iframe frameborder="0" name="content-frame" 
249                         id="content-frame" class="contentFrame"> </iframe>
250         </td>
251 </tr>
252 <? } ?>
253 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
254 <tr>
255         <td colspan="2" class="footer">
256                 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005 Andrew Dolgov
257                 <? if (WEB_DEMO_MODE) { ?>
258                 <br>Running in demo mode, some functionality is disabled.
259                 <? } ?>
260         </td>
261 </td>
262 <? } ?>
263 </table>
264
265 <? db_close($link); ?>
266
267 </body>
268 </html>