OSDN Git Service

1f35604307a89b63312866700c32b753f257adfd
[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)?>"></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/updateProfile.php" method="post">
45                                 <fieldset class="settings">
46                                 <legend>Literature</legend>
47                                 <table id="setting_table">
48                                 <tr>
49                                 <td class="setting_title">Name:</td>
50                                 <td><input class="setting_input" type="text" name="name" value="<?php echo isset($user->name) ? $user->name : ''?>" /></td>
51                                 </tr>
52                                 <tr>
53                                 <td class="setting_title">URL:</td>
54                                 <td><input class="setting_input" type="text" name="url" value="<?php echo isset($user->url) ? $user->url : '' ?>" /></td>
55                                 </tr>
56                                 <tr>
57                                 <td class="setting_title">Location:</td>
58                                 <td><input class="setting_input" type="text" name="location" value="<?php echo isset($user->location) ? $user->location : '' ?>" /></td>
59                                 </tr>
60                                 <tr>
61                                 <td class="setting_title">Bio:</td><td><small style="margin-left:5px;vertical-align: top;">*Max 160 chars</small></td>
62                                 </tr><tr>
63                                 <td></td>
64                                 <td><textarea id="setting_text" name="description"><?php echo isset($user->description) ? $user->description : '' ?></textarea></td>
65                                 </tr>
66                                 </table>
67                                 <input type="submit" id="saveProfile" class="btn" value="Save" />
68                                 </fieldset>
69 <?php
70                         break;
71                 default:
72 ?>
73                 <form id="style_form" action="setting.php" method="post">
74                         
75                         <fieldset class="settings">
76
77                         <legend>Utility</legend>
78
79                         <input id="proxifyAvatar" type="checkbox" />
80                         <label>Proxify the Avatar</label>
81                         
82                         <br /><br />                    
83                         <input id="autoscroll" type="checkbox" />
84                         <label>Timeline Autopaging</label>
85                         
86                         <br /><br />                    
87                         <input id="sidebarscroll" type="checkbox" />
88                         <label>Fixed Sidebar</label>
89                         
90                         </fieldset>
91                         
92                         <fieldset class="settings">
93
94                         <legend>Media Preview</legend>
95
96                         <input id="showpic" type="checkbox" checked="checked" />
97                         <label>Enable Images Preview</label>
98                         <small>(Supports common image hostings)</small>
99
100                         <br /><br />
101
102                         <input id="mediaPreSelect" type="checkbox" checked="checked" />
103                         <label>Enable Videos Preview</label>
104                         <small>(Supports Xiami and Tudou)</small><br />
105
106                         </fieldset>
107
108                         <fieldset class="settings">
109
110                         <legend>Auto Refresh Interval</legend>
111
112                         <label>Home Page</label>
113                         <select id="homeInterval" name="homeInterval" value="<?php echo getCookie('homeInterval')?>">
114                                 <option value="0.5">30 sec</option>
115                                 <option value="1" selected="selected">1 min(Default)</option>
116                                 <option value="3">3 min</option>
117                                 <option value="5">5 min</option>
118                                 <option value="10">10 min</option>
119                                 <option value="0">Never</option>
120                         </select>
121                         <label>Updates Page</label>
122                         <select id="updatesInterval" name="updatesInterval" value="<?php echo getCookie('updatesInterval')?>">
123                                 <option value="0.5">30 sec</option>
124                                 <option value="1">1 min</option>
125                                 <option value="3" selected="selected">3 min(Default)</option>
126                                 <option value="5">5 min</option>
127                                 <option value="10">10 min</option>
128                                 <option value="0">Never</option>
129                         </select>
130
131                         </fieldset>
132
133                         <fieldset class="settings">
134
135                         <legend>UI Preferences</legend>
136                         <input id="twitterbg" type="checkbox" />
137                         <label>Use twitter account background</label>
138                         
139                         <br /><br />
140                         
141                         <label>Custom Themes</label>
142                         <select id="styleSelect"></select>
143                         <small>(We have awesome themes for you!)</small>
144
145                         <br /><br />
146
147                         <label>Background Color</label>
148                         <input class="bg_input" type="text" id="bodyBg" name="bodyBg" value="<?php echo getDefCookie("Bgcolor","") ?>" />
149                         <small>(Choose your favorite color here)</small>
150
151                         <br /><br />
152
153                         <label>Font Size</label>
154                         <select id="fontsize" name="fontsize" value="<?php echo getCookie('fontsize')?>">
155                                 <option value="12px">Small</option>
156                                 <option value="13px" selected="selected">Middle(Default)</option>
157                                 <option value="14px">Large</option>
158                                 <option value="15px">Extra Large</option>
159                         </select>
160                         <small>(Set the font size)</small>
161
162                         <br /><br />            
163
164                         <label>Customize CSS</label>
165                         <small>(You can put your own CSS hack here, or your Twitter style code)</small>
166                         <br />
167                         <label>Tips:</label>
168                         <small>You must use <a href="http://i.zou.lu/csstidy/" target="_blank" title="Powered by Showfom">CSSTidy</a> to compress your stylesheet.</small>
169                         <br />
170                         <textarea type="text" id="myCSS" name="myCSS" value="" /><?php echo getDefCookie("myCSS","") ?></textarea>
171                         </fieldset>
172
173 <?php
174         }
175 ?>
176         <a id="reset_link" href="#" title="You will lose all customized settings!">Reset to default</a>
177
178 </form>
179         </div>
180 </div>
181
182 <?php 
183         include ('inc/sidebar.php');
184         include ('inc/footer.php');
185 ?>