]> git.wh0rd.org - tt-rss.git/blob - tt-rss.php
generic theme support, misc compact stylesheet iframe fixes
[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 <? if (get_pref($link, 'ENABLE_SPLASH')) { ?>
53 <div id="splash">
54 <table width='100%' height='100%'><tr>
55 <td class="innerSplash" valign="middle" align="center">
56 <img src="images/ttrss_logo.png" alt="logo">
57 <p>Loading, please wait...</p>
58 </td></tr></table>
59 </div>
60 <? } ?>
61
62 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
63 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
64 <tr>
65 <td colspan="2">
66 <table cellspacing="0" cellpadding="0" width="100%"><tr>
67 <td rowspan="2" class="header" valign="middle">
68 <img src="images/ttrss_logo.png" alt="logo">
69 </td>
70 <td align="right" valign="top">
71 <div id="notify"><span id="notify_body"></div>
72 </td>
73
74 <div id="userDlg">&nbsp;</div>
75
76 </tr><tr><td class="welcomePrompt">
77 <? if (!SINGLE_USER_MODE) { ?>
78 Hello, <b><?= $_SESSION["name"] ?></b>
79 (<a href="logout.php">Logout</a>)
80 <? } ?>
81 </td>
82 </tr></table>
83 </td>
84 </tr>
85 <? } else { ?>
86 <div id="userDlg">&nbsp;</div>
87 <? } ?>
88 <tr>
89 <td valign="top" rowspan="3" class="feeds">
90 <table class="innerFeedTable"
91 cellspacing="0" cellpadding="0" height="100%" width="100%">
92 <tr><td>
93 <div id="dispSwitch">
94 <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
95 </div>
96 </td></tr>
97 <tr><td height="100%" width="100%" valign="top">
98
99 <!-- <div id="feeds">&nbsp;</div> -->
100
101
102 <iframe frameborder="0"
103 src="backend.php?op=error&msg=Loading,%20please wait..."
104 id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
105
106 </td></tr></table>
107
108 <? if (get_pref($link, 'DISPLAY_FEEDLIST_ACTIONS')) { ?>
109
110 <div align="center">All feeds:
111
112 <select id="allFeedsChooser">
113 <option>Update</option>
114 <option>Mark as read</option>
115 <option>Show only unread</option>
116 </select>
117
118 <input type="submit" class="button" onclick="allFeedsMenuGo()" value="Go">
119
120 </div>
121
122
123 <? } ?>
124
125 </td>
126 <td valign="top" class="headlinesToolbarBox">
127 <table width="100%" cellpadding="0" cellspacing="0">
128
129 <tr><td class="headlinesToolbar" id="headlinesToolbar">
130 <input id="searchbox"
131 onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()"
132 onchange="javascript:search()">
133 <select id="searchmodebox">
134 <option>This feed</option>
135 <option>All feeds</option>
136 </select>
137
138 <input type="submit"
139 class="button" onclick="javascript:search()" value="Search">
140
141 &nbsp;
142
143 View:
144
145 <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
146 <option>All Articles</option>
147 <option>Starred</option>
148 <option selected>Unread</option>
149 <option>Unread or Starred</option>
150 <option>Unread or Updated</option>
151 </select>
152
153 &nbsp;Limit:
154
155 <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
156
157 <?
158 $limits = array(15 => 15, 30 => 30, 60 => 60);
159
160 $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
161
162 print $def_art_limit;
163
164 if ($def_art_limit >= 0) {
165 $limits[$def_art_limit] = $def_art_limit;
166 }
167
168 asort($limits);
169
170 array_push($limits, 0);
171
172 foreach ($limits as $key) {
173 print "<option";
174 if ($key == $def_art_limit) { print " selected"; }
175 print ">";
176
177 if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
178
179 print "</option>";
180 } ?>
181
182 </select>
183
184 &nbsp;Feed: <input class="button" type="submit"
185 onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
186
187 <input class="button" type="submit" id="btnMarkFeedAsRead"
188 onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
189
190 </td>
191 <td align="right">
192 Actions: <select id="quickMenuChooser">
193 <option id="qmcPrefs" selected>Preferences...</option>
194 <option disabled>--------</option>
195 <option style="color : #5050aa" disabled>Feed actions:</option>
196 <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
197 <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
198 <!-- <option>Edit this feed</option> -->
199 <option disabled>--------</option>
200 <option style="color : #5050aa" disabled>All feeds:</option>
201 <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
202 <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
203 <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
204 </select>
205 <input type="submit" class="button" onclick="quickMenuGo()" value="Go">
206 </td>
207 </tr>
208 </table>
209 </td>
210 </tr><tr>
211 <td id="headlines" class="headlines" valign="top">
212 <iframe frameborder="0" name="headlines-frame"
213 id="headlines-frame" class="headlinesFrame"
214 src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
215 </td>
216 </tr><tr>
217 <td class="content" id="content" valign="top">
218 <iframe frameborder="0" name="content-frame"
219 id="content-frame" class="contentFrame"> </iframe>
220 </td>
221 </tr>
222 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
223 <tr>
224 <td colspan="2" class="footer">
225 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005 Andrew Dolgov
226 <? if (WEB_DEMO_MODE) { ?>
227 <br>Running in demo mode, some functionality is disabled.
228 <? } ?>
229 </td>
230 </td>
231 <? } ?>
232 </table>
233
234 <? db_close($link); ?>
235
236 </body>
237 </html>