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