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