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