OSDN Git Service

embrj
[embrj/master.git] / setting.php
1 <?php
2         include ('lib/twitese.php');
3         $title = "Settings";
4         include ('inc/header.php');     
5         if (!loginStatus()) header('location: login.php');      
6 ?>
7 <script src="js/colorpicker.js"></script>
8 <script src="js/setting.js"></script>
9 <link rel="stylesheet" href="css/colorpicker.css" />
10 <div id="statuses" class="column round-left">
11         <div id="setting">
12 <div id="setting_nav">
13 <?php
14         $settingType = isset($_GET['t'])? $_GET['t'] : 1;
15         switch($settingType){
16                 case 'profile':
17 ?>
18                         <span class="subnavLink"><a href="setting.php">Customize</a></span><span class="subnavNormal">Profile</span>
19 <?php                   
20                         break;
21                 default:
22 ?>
23                         <span class="subnavNormal">Customize</span><span class="subnavLink"><a href="setting.php?t=profile">Profile</a></span>
24 <?php   
25         }
26 ?>
27 </div>
28 <?php
29         switch($settingType){
30                 case 'profile':
31                         $user = getTwitter()->veverify(true);
32 ?>
33                         <form id="setting_form" action="ajax/uploadImage.php?do=profile" method="post" enctype="multipart/form-data">
34                                 <fieldset class="settings">
35                                 <legend>Avatar</legend>
36                                 <ol>
37                                 <li style="display:inline-block"><img src="<?php echo isset($_COOKIE['imgurl']) ? $_COOKIE['imgurl'] : getAvatar($user->profile_image_url)?>" id="avatarimg"></img></li>
38                                 <ol style="margin-left:29px">
39                                         <li><input type="file" name="image" id="profile_image"/></li>
40                                         <li><input type="submit" id="AvatarUpload" class="btn" value="Upload"/><small style="margin-left:10px;vertical-align: middle;">BMP,JPG or PNG accepted, less than 800K.</small></li>
41                                 </ol></ol>
42                                 </fieldset>
43                         </form>
44                         <form id="setting_form" action="ajax/uploadImage.php?do=background" method="post" enctype="multipart/form-data">
45                                 <fieldset class="settings">
46                                 <legend>Background</legend>
47                                 <ol>
48                                 <li style="display:inline-block"><img src="<?php echo getAvatar($user->profile_background_image_url)?>" id="backgroundimg" style="max-width: 460px;"></img></li>
49                                 <li><input type="file" name="image" id="profile_background"/></li>
50                                 <li><input type="submit" id="BackgroundUpload" class="btn" value="Upload"/><small style="margin-left:10px;vertical-align: middle;">BMP,JPG or PNG accepted, less than 800K.</small></li>
51                                 <li>
52                                 <input id="tile" type="checkbox" <?php echo $user->profile_background_tile ? 'checked="checked"' : '' ?> />
53                                 <label>Tile the profile background</label>
54                                 </li>
55                                 </ol>
56                                 </fieldset>
57                         </form>
58                         <form id="setting_form" action="ajax/updateProfile.php" method="post">
59                                 <fieldset class="settings">
60                                 <legend>Literature</legend>
61                                 <table id="setting_table">
62                                 <tr>
63                                 <td class="setting_title">Name: </td>
64                                 <td><input class="setting_input" type="text" name="name" value="<?php echo isset($user->name) ? $user->name : ''?>" /></td>
65                                 </tr>
66                                 <tr>
67                                 <td class="setting_title">URL: </td>
68                                 <td><input class="setting_input" type="text" name="url" value="<?php
69                         if (!isset($user->url))
70                                 echo '';
71                         else {
72                                 $hops = array();
73                                 $newurl = expandRedirect($user->url, $hops);
74                                 echo $newurl;
75                         }
76                 ?>" /></td>
77                                 </tr>
78                                 <tr>
79                                 <td class="setting_title">Location: </td>
80                                 <td><input class="setting_input" type="text" name="location" value="<?php echo isset($user->location) ? $user->location : '' ?>" /></td>
81                                 </tr>
82                                 <tr>
83                                 <td class="setting_title">Bio: </td><td><small style="margin-left:5px;vertical-align: top;">*Max 160 chars</small></td>
84                                 </tr><tr>
85                                 <td></td>
86                                 <td><textarea id="setting_text" name="description"><?php echo isset($user->description) ? $user->description : '' ?></textarea></td>
87                                 </tr>
88                                 </table>
89                                 <input type="submit" id="saveProfile" class="btn" value="Save" />
90                                 </fieldset>
91 <?php
92                         break;
93                 default:
94 ?>
95                 <form id="style_form" action="setting.php" method="post">
96                         
97                         <fieldset class="settings">
98
99                         <legend>Utility</legend>
100
101                         <input id="proxifyAvatar" type="checkbox" />
102                         <label>Proxify the Avatar</label>
103                         
104                         <br /><br />                    
105                         <input id="autoscroll" type="checkbox" />
106                         <label>Timeline Autopaging</label>
107                         
108                         <br /><br />                    
109                         <input id="sidebarscroll" type="checkbox" />
110                         <label>Fixed Sidebar</label>
111                         
112                         </fieldset>
113                         
114                         <fieldset class="settings">
115
116                         <legend>Media Preview</legend>
117
118                         <input id="showpic" type="checkbox" checked="checked" />
119                         <label>Enable Images Preview</label>
120                         <small>(Supports common image hostings)</small>
121
122                         <br /><br />
123
124                         <input id="mediaPreSelect" type="checkbox" checked="checked" />
125                         <label>Enable Videos Preview</label>
126                         <small>(Supports Xiami and Tudou)</small><br />
127
128                         </fieldset>
129
130                         <fieldset class="settings">
131
132                         <legend>Auto Refresh Interval</legend>
133
134                         <label>Home Page</label>
135                         <select id="homeInterval" name="homeInterval" value="<?php echo getCookie('homeInterval')?>">
136                                 <option value="1">1 min</option>
137                                 <option value="2" selected="selected">2 min (Default)</option>
138                                 <option value="3">3 min</option>
139                                 <option value="5">5 min</option>
140                                 <option value="10">10 min</option>
141                                 <option value="0">Never</option>
142                         </select>
143                         <label>Updates Page</label>
144                         <select id="updatesInterval" name="updatesInterval" value="<?php echo getCookie('updatesInterval')?>">
145                                 <option value="1">1 min</option>
146                                 <option value="2">2 min</option>
147                                 <option value="3" selected="selected">3 min (Default)</option>
148                                 <option value="5">5 min</option>
149                                 <option value="10">10 min</option>
150                                 <option value="0">Never</option>
151                         </select>
152
153                         </fieldset>
154
155                         <fieldset class="settings">
156
157                         <legend>UI Preferences</legend>
158                         <input id="twitterbg" type="checkbox" />
159                         <label>Use twitter account background</label>
160                         
161                         <br /><br />
162
163                         <input id="shownick" type="checkbox" />
164                         <label>Use nickname instead of username</label>
165
166                         <br /><br />
167                         
168                         <label>Custom Themes</label>
169                         <select id="styleSelect"></select>
170                         <small>(We have awesome themes for you!)</small>
171
172                         <br /><br />
173
174                         <label>Background Color</label>
175                         <input class="bg_input" type="text" id="bodyBg" name="bodyBg" value="<?php echo getDefCookie("Bgcolor","") ?>" />
176                         <small>(Choose your favorite color here)</small>
177
178                         <br /><br />
179
180                         <label>Font Size</label>
181                         <select id="fontsize" name="fontsize" value="<?php echo getCookie('fontsize')?>">
182                                 <option value="12px">Small</option>
183                                 <option value="13px" selected="selected">Middle(Default)</option>
184                                 <option value="14px">Large</option>
185                                 <option value="15px">Extra Large</option>
186                         </select>
187                         <small>(Set the font size)</small>
188
189                         <br /><br />            
190
191                         <label>Customize CSS</label>
192                         <small>(You can put your own CSS hack here, or your Twitter style code)</small>
193                         <br />
194                         <label>Tips:</label>
195                         <small>You must use <a href="http://i.zou.lu/csstidy/" target="_blank" title="Powered by Showfom">CSSTidy</a> to compress your stylesheet.</small>
196                         <br />
197                         <textarea type="text" id="myCSS" name="myCSS" value="" /><?php echo getDefCookie("myCSS","") ?></textarea>
198                         </fieldset>
199
200 <?php
201         }
202 ?>
203         <a id="reset_link" href="#" title="You will lose all customized settings!">Reset to default</a>
204
205 </form>
206         </div>
207 </div>
208
209 <?php 
210         include ('inc/sidebar.php');
211         include ('inc/footer.php');
212 ?>