]> git.wh0rd.org - tt-rss.git/blob - prefs.php
getAllCounters: add rate limit (5 sec)
[tt-rss.git] / prefs.php
1 <?php
2 error_reporting(E_ERROR | E_WARNING | E_PARSE);
3
4 require_once "functions.php";
5 require_once "sessions.php";
6 require_once "sanity_check.php";
7 require_once "version.php";
8 require_once "config.php";
9 require_once "db-prefs.php";
10
11 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
12
13 login_sequence($link);
14
15 $dt_add = get_script_dt_add();
16
17 no_cache_incantation();
18
19 ?>
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
21 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22 <html>
23 <head>
24 <title>Tiny Tiny RSS : Preferences</title>
25 <link rel="stylesheet" href="tt-rss.css" type="text/css">
26
27 <?php $user_theme = $_SESSION["theme"];
28 if ($user_theme) { ?>
29 <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
30 <?php } ?>
31
32 <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
33
34 <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
35 <?php if ($user_css_url) { ?>
36 <link type="text/css" href="<?php echo $user_css_url ?>"/>
37 <?php } ?>
38
39 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
40
41 <script type="text/javascript" src="prototype.js"></script>
42 <script type="text/javascript" src="scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
43
44 <script type="text/javascript" src="localized_js.php?<?php echo $dt_add ?>"></script>
45
46 <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
47 <script type="text/javascript" src="prefs.js?<?php echo $dt_add ?>"></script>
48
49 <!--[if lt IE 7]>
50 <script type="text/javascript" src="pngfix.js"></script>
51 <link rel="stylesheet" type="text/css" href="ie6.css">
52 <![endif]-->
53
54 <!--[if IE 7]>
55 <link rel="stylesheet" type="text/css" href="ie7.css">
56 <![endif]-->
57
58 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
59
60 <script type="text/javascript">
61 if (navigator.userAgent.match("Opera")) {
62 document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
63 }
64 if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
65 document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
66 }
67 </script>
68 </head>
69
70 <body>
71
72 <div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
73 <?php rounded_table_start("hho"); ?>
74 <?php include "help/4.php" ?>
75 <?php rounded_table_end(); ?>
76 </div>
77
78 <img id="piggie" src="images/piggie.png" style="display : none" alt="piggie">
79
80 <script type="text/javascript">
81 if (document.addEventListener) {
82 document.addEventListener("DOMContentLoaded", init, null);
83 }
84 window.onload = init;
85 </script>
86
87 <ul id="debug_output" style='display : none'></ul>
88
89 <div id="fatal_error"><div id="fatal_error_inner">
90 <h1>Fatal Error</h1>
91 <div id="fatal_error_msg"><?php echo __('Unknown Error') ?></div>
92 </div></div>
93
94 <div id="prefHeader">
95 <div class="topLinks">
96 <?php if (!SINGLE_USER_MODE) { ?>
97 <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
98 <?php } ?>
99 <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
100 <?php if (!SINGLE_USER_MODE) { ?>
101 | <a href="logout.php"><?php echo __('Logout') ?></a>
102 <?php } ?>
103 </div>
104 <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
105 </div>
106
107 <div id="prefTabs">
108 <!-- <div class="return">
109 <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
110 </div> -->
111
112 <div class='prefKbdHelp'>
113 <img src="images/small_question.png" alt="?"> <a href='#' onclick="Effect.Appear('hotkey_help_overlay', {duration: 0.3})">Keyboard shortcuts</a>
114 </div>
115
116 <div class="firstTab">&nbsp;</div>
117
118 <div id="genConfigTab" class="prefsTab"
119 onclick="selectTab('genConfig')"><?php echo __('Preferences') ?></div>
120 <div id="feedConfigTab" class="prefsTab"
121 onclick="selectTab('feedConfig')"><?php echo __('My Feeds') ?></div>
122 <?php if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) { ?>
123 <div id="feedBrowserTab" class="prefsTab"
124 onclick="selectTab('feedBrowser')"><?php echo __('Other Feeds') ?></div>
125 <?php } ?>
126 <!-- <div id="pubItemsTab" class="prefsTab"
127 onclick="selectTab('pubItems')"><?php echo __('Published Articles') ?></div> -->
128 <div id="filterConfigTab" class="prefsTab"
129 onclick="selectTab('filterConfig')"><?php echo __('Content Filtering') ?></div>
130 <?php if (get_pref($link, 'ENABLE_LABELS')) { ?>
131 <div id="labelConfigTab" class="prefsTab"
132 onclick="selectTab('labelConfig')"><?php echo __('Label Editor') ?></div>
133 <?php } ?>
134 <?php if ($_SESSION["access_level"] >= 10) { ?>
135 <div id="userConfigTab" class="prefsTab"
136 onclick="selectTab('userConfig')"><?php echo __('User Manager') ?></div>
137 <?php } ?>
138 </div>
139
140 <div id="prefContent">
141 <p><?php echo __('Loading, please wait...') ?></p>
142 <noscript>
143 <div class="error">
144 <?php echo __("Your browser doesn't support Javascript, which is required
145 for this application to function properly. Please check your
146 browser settings.") ?></div>
147 </noscript>
148 </div>
149
150 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
151 <div id="infoBoxShadow"><div id="infoBox">BAH</div></div>
152
153 <div id="dialog_overlay"> </div>
154
155 <div id="prefFooter">
156 <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
157 <select id="userSwitch" onchange="userSwitch()">
158 <?php
159 foreach (array('admin', 'fox', 'test') as $u) {
160 $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
161 print "<option $op_sel>$u</option>";
162 }
163 ?>
164 </select>
165 <?php } ?>
166 <a href="http://tt-rss.org/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005&ndash;2008 <a href="http://bah.org.ru/">Andrew Dolgov</a>
167 </div>
168
169 <?php db_close($link); ?>
170
171 <script type="text/javascript">
172 /* for IE */
173 function statechange() {
174 if (document.readyState == "interactive") init();
175 }
176
177 if (document.readyState) {
178 if (document.readyState == "interactive" || document.readyState == "complete") {
179 init();
180 } else {
181 document.onreadystatechange = statechange;
182 }
183 }
184 </script>
185
186 </body>
187 </html>