]> git.wh0rd.org Git - tt-rss.git/blob - prefs.php
auto refresh active feed when new messages are detected
[tt-rss.git] / prefs.php
1 <?
2         require_once "sessions.php";
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 <html>
15 <head>
16         <title>Tiny Tiny RSS : Preferences</title>
17         <link rel="stylesheet" href="tt-rss.css" type="text/css">
18
19         <?      $user_theme = $_SESSION["theme"];
20                 if ($user_theme) { ?>
21                 <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
22         <? } ?>
23
24         <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
25         <? if ($user_css_url) { ?>
26                 <link type="text/css" href="<?= $user_css_url ?>"/> 
27         <? } ?>
28
29         <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
30
31                 <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
32
33         <? } else { ?>
34
35                 <link title="Compact Stylesheet" rel="alternate stylesheet" 
36                         type="text/css" href="tt-rss_compact.css"/> 
37
38         <? } ?>
39
40         
41         <script type="text/javascript" src="functions.js"></script>
42         <script type="text/javascript" src="prefs.js"></script>
43
44         <!--[if gte IE 5.5000]>
45                 <script type="text/javascript" src="pngfix.js"></script>
46         <![endif]-->
47         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
48
49         <script type="text/javascript">
50                 if (navigator.userAgent.match("Opera")) {
51                         document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
52                 }
53         </script>
54 </head>
55
56 <body>
57
58 <div id="piggie" class="invisible">&nbsp;</div>
59
60 <script type="text/javascript">
61 if (document.addEventListener) {
62         document.addEventListener("DOMContentLoaded", init, null);
63 }
64 window.onload = init;
65 </script>
66
67 <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
68 <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
69 <tr>
70         <td colspan="2">
71                 <table cellspacing="0" cellpadding="0" width="100%"><tr>
72                         <td rowspan="2" class="header" valign="middle"> 
73                                 <img src="images/ttrss_logo.png" alt="logo">    
74                         </td>
75                         <td valign="top" class="notifyBox">
76                                 <div id="notify"><span id="notify_body">&nbsp;</span></div>
77                         </td>
78                 </tr><tr><td class="welcomePrompt">
79                         <? if (!SINGLE_USER_MODE) { ?>
80                                 Hello, <b><?= $_SESSION["name"] ?></b>
81                                 (<a href="logout.php">Logout</a>)
82                         <? } ?>
83                         </td>
84                 </tr></table>
85         </td>
86 </tr>
87 <? } else { ?>
88 <tr>
89         <td class="small">
90                 <div id="notify"><span id="notify_body">&nbsp;</span></div>
91                 <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
92         </td><td class="welcomePrompt">
93                 <? if (!SINGLE_USER_MODE) { ?>
94                         Hello, <b><?= $_SESSION["name"] ?></b>
95                         (<a href="logout.php">Logout</a>)
96                 <? } ?>
97 </td></tr>
98 <? } ?>
99 <tr>
100         <td class="prefsTabs" align="left" valign="bottom">
101                 <input id="genConfigTab" class="prefsTab" type="submit" value="Preferences"
102                         onclick="selectTab('genConfig')">
103                 <input id="feedConfigTab" class="prefsTab" type="submit" value="Feed Configuration"
104                         onclick="selectTab('feedConfig')">
105                 <? if (ENABLE_FEED_BROWSER) { ?>
106                 <input id="feedBrowserTab" class="prefsTab" type="submit" value="Feed Browser"
107                         onclick="selectTab('feedBrowser')">
108                 <? } ?>
109                 <input id="filterConfigTab" class="prefsTab" type="submit" value="Content Filtering"
110                         onclick="selectTab('filterConfig')">
111                 <? if (GLOBAL_ENABLE_LABELS && get_pref($link, 'ENABLE_LABELS')) { ?>
112                 <input id="labelConfigTab" class="prefsTab" type="submit" value="Label Editor"
113                         onclick="selectTab('labelConfig')">
114                 <? } ?>
115                 <? if ($_SESSION["access_level"] >= 10) { ?>
116                 <input id="userConfigTab" class="prefsTab" type="submit" value="User Manager"
117                         onclick="selectTab('userConfig')">
118                 <? } ?>         
119         </td>
120         <td class="prefsToolbar" valign="middle" align="right"> 
121                 <input type="submit" onclick="gotoMain()" class="button" value="Return to main">
122         </td>
123         </tr>
124 </tr>
125         <td id="prefContent" class="prefContent" valign="top" colspan="2">
126
127                 <p>Loading, please wait...</p>
128
129         </td>
130 </tr>
131 <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
132 <tr>
133         <td class="footer" colspan="2">
134                 <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
135                 <? if (WEB_DEMO_MODE) { ?>
136                 <br>Running in demo mode, some functionality is disabled.
137                 <? } ?>
138         </td>
139 </td>
140 <? } ?>
141 </table>
142
143 <? db_close($link); ?>
144
145 <script type="text/javascript">
146         /* for IE */
147         function statechange() {
148                 if (document.readyState == "interactive") init();
149         }
150
151         if (document.readyState) {      
152                 if (document.readyState == "interactive" || document.readyState == "complete") {
153                         init();
154                 } else {
155                         document.onreadystatechange = statechange;
156                 }
157         }
158 </script>
159
160 </body>
161 </html>