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