2 include ('lib/twitese.php');
\r
4 include ('inc/header.php');
\r
5 if (!loginStatus()) header('location: login.php');
\r
7 <script type="text/javascript" src="js/colorpicker.js"></script>
\r
8 <script type="text/javascript" src="js/setting.js?ver=20100206"></script>
\r
9 <link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
\r
10 <div id="statuses" class="column round-left">
\r
13 if (isset($_POST['name'])) {
\r
16 $args['name'] = $_POST['name'];
\r
17 $args['url'] = $_POST['url'];
\r
18 $args['location'] = $_POST['location'];
\r
19 $args['description'] = $_POST['description'];
\r
20 $result = $t->updateProfile($args);
\r
21 if ($result) echo "<div id=\"otherTip\">Your profile has been updated!</div>";
\r
22 else echo "<div id=\"otherTip\">Update failed. Please try again.</div>";
\r
25 if (isset($_GET['t'])){
\r
26 $settingType = $_GET['t'];
\r
29 <div id="setting_nav">
\r
31 switch($settingType){
\r
34 <span class="subnavLink"><a href="setting.php">Customize</a></span><span class="subnavNormal">Edit Profile</span><span class="subnavLink"><a href="setting.php?t=advanced">Advanced</a></span>
\r
39 <span class="subnavLink"><a href="setting.php">Customize</a></span><span class="subnavLink"><a href="setting.php?t=profile">Edit Profile</a></span><span class="subnavNormal">Advanced</span>
\r
44 <span class="subnavNormal">Customize</span><span class="subnavLink"><a href="setting.php?t=profile">Edit Profile</a></span><span class="subnavLink"><a href="setting.php?t=advanced">Advanced</a></span>
\r
50 switch($settingType){
\r
52 $user = getTwitter()->veverify();
\r
54 <form id="setting_form" action="setting.php?t=profile" method="post">
\r
55 <table id="setting_table">
\r
57 <td class="setting_title">Name:</td>
\r
58 <td><input class="setting_input" type="text" name="name" value="<?php echo isset($user->name) ? $user->name : ''?>" /></td>
\r
61 <td class="setting_title">URL:</td>
\r
62 <td><input class="setting_input" type="text" name="url" value="<?php echo isset($user->url) ? $user->url : '' ?>" /></td>
\r
65 <td class="setting_title">Location:</td>
\r
66 <td><input class="setting_input" type="text" name="location" value="<?php echo isset($user->location) ? $user->location : '' ?>" /></td>
\r
69 <td class="setting_title">Bio:</td>
\r
70 <td><textarea id="setting_text" name="description"><?php echo isset($user->description) ? $user->description : '' ?></textarea><small style="margin-left:5px;vertical-align: top;">*Max 160 chars</small></td>
\r
73 <td colspan="2"><input type="submit" class="btn" style="margin-left:62px !important" id="save_button" value="Save"></input></td>
\r
81 <div id="otherTip">More features coming soon!</div>
\r
85 if ( isset($_POST['myCSS']) ) {
\r
87 saveStyle($_POST['myCSS'], $_POST['fontsize'], $_POST['ad_display'], $_POST['bodyBg']);
\r
88 echo "<div id=\"otherTip\">Your style has been updated!</div>";
\r
90 preg_match('/\(([\w\/\.\-_\&\#\$\%\:]+)\)/i', $_POST['myCSS'], $arr);
\r
91 echo '<script>var styles = "/'.$arr[1].'";
\r
92 var newSS=document.createElement("link");
\r
93 newSS.rel="stylesheet";
\r
94 newSS.type="text/css";
\r
95 newSS.href=escape(styles);
\r
96 document.getElementsByTagName("head")[0].appendChild(newSS);</script>';
\r
97 } catch (Exception $e) {
\r
98 echo "<div id=\"otherTip\">Update failed. Please try again.</div>";
\r
101 if ( isset($_GET['reset']) ) {
\r
103 echo "<div id=\"otherTip\">Styles have been reseted!</div>";
\r
105 if(isset($_POST['updatesInterval'])){
\r
106 setcookie('updatesInterval', $_POST['updatesInterval'], time()+3600*24*365, '/');
\r
107 setcookie('intervalChanged', 'true', time()+3600*24*365, '/');
\r
109 if(isset($_POST['homeInterval'])){
\r
110 setcookie('homeInterval', $_POST['updatesInterval'], time()+3600*24*365, '/');
\r
111 setcookie('intervalChanged', 'true', time()+3600*24*365, '/');
\r
114 <form id="style_form" action="setting.php" method="post">
\r
116 <fieldset class="settings">
\r
118 <legend>Enhancements</legend>
\r
120 <input id="show_pic" type="checkbox" checked="checked" />
\r
121 <label>Enable Auto Images Preview</label>
\r
122 <small>(Supports mainstream image hostings)</small>
\r
126 <input id="mediaPreSelect" type="checkbox" />
\r
127 <label>Enable Auto Medias Preview</label>
\r
128 <small>(Supports Xiami and Tudou)</small><br />
\r
132 <fieldset class="settings">
\r
134 <legend>Auto Refresh Interval</legend>
\r
136 <label>Home Page</label>
\r
137 <select id="homeInterval" name="homeInterval" value="<?php echo getCookie('homeInterval')?>">
\r
138 <option value="0.5">30 sec</option>
\r
139 <option value="1" selected="selected">1 min(Default)</option>
\r
140 <option value="3">3 min</option>
\r
141 <option value="5">5 min</option>
\r
142 <option value="10">10 min</option>
\r
143 <option value="0">Never</option>
\r
145 <small>(https://rabr.in/index.php)</small>
\r
149 <label>Updates Page</label>
\r
150 <select id="updatesInterval" name="updatesInterval" value="<?php echo getCookie('updatesInterval')?>">
\r
151 <option value="0.5">30 sec</option>
\r
152 <option value="1">1 min</option>
\r
153 <option value="3" selected="selected">3 min(Default)</option>
\r
154 <option value="5">5 min</option>
\r
155 <option value="10">10 min</option>
\r
156 <option value="0">Never</option>
\r
158 <small>(https://rabr.in/all.php)</small>
\r
162 <fieldset class="settings">
\r
164 <legend>UI Preferences</legend>
\r
166 <label>Custom Themes</label>
\r
167 <select id="styleSelect"><option value="n/a">Choose one...</option></select>
\r
168 <small>(We have awesome themes for you!)</small>
\r
172 <label>Background Color</label>
\r
173 <input class="bg_input" type="text" id="bodyBg" name="bodyBg" value="<?php echo getColor("bodyBg","") ?>" />
\r
174 <small>(Choose your favorite color here)</small>
\r
178 <label>Font Size</label>
\r
179 <select id="fontsize" name="fontsize" value="<?php echo getCookie('fontsize')?>">
\r
180 <option value="12px">Small</option>
\r
181 <option value="13px" selected="selected">Middle(Default)</option>
\r
182 <option value="14px">Large</option>
\r
183 <option value="15px">Extra Large</option>
\r
185 <small>(Set the font size)</small>
\r
189 <label>Support Rabr</label>
\r
190 <select id="ad_display" name="ad_display" value="<?php echo getCookie('ad_display')?>">
\r
191 <option value="block" selected="selected">Count me in!</option>
\r
192 <option value="none">Nah, not me...</option>
\r
194 <small>(Sidebar AD display management)</small>
\r
198 <label>Customize CSS</label>
\r
199 <small>(You can put your own CSS hack here, or your Twitter style code)</small>
\r
201 <textarea type="text" id="myCSS" name="myCSS" value="" /><?php echo getColor("myCSS","") ?></textarea>
\r
208 <input type="submit" class="btn" id="save_button" value="Save" />
\r
209 <a id="reset_link" href="setting.php?reset=true" title="You will lose all customized settings!">Reset to default</a>
\r
223 include ('inc/sidebar.php');
\r
227 include ('inc/footer.php');
\r