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