OSDN Git Service

Update SVN to iDB 0.1.5 SVN 1
[idb/iDB.git.git] / inc / profilemain.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
12     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
13
14     $FileInfo: profilemain.php - Last Update: 05/09/2007 SVN 1 - Author: cooldude2k $
15 */
16 $File1Name = dirname($_SERVER['SCRIPT_NAME'])."/";
17 $File2Name = $_SERVER['SCRIPT_NAME'];
18 $File3Name=str_replace($File1Name, null, $File2Name);
19 if ($File3Name=="profilemain.php"||$File3Name=="/profilemain.php") {
20         require('index.php');
21         exit(); }
22 ?>
23 <table class="Table3">
24 <tr style="width: 100%; vertical-align: top;">
25         <td style="width: 15%; vertical-align: top;">
26         <table id="ProfileLinks" class="Table1" style="width: 100%; float: left; vertical-align: top;">
27 <tr class="TableRow1">
28 <td class="TableRow1"><?php echo $ThemeSet['TitleIcon'] ?>Profile Settings</td>
29 </tr><tr class="TableRow2">
30 <td class="TableRow2">&nbsp;</td>
31 </tr><tr class="TableRow3">
32 <td class="TableRow3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit NotePad</a></td>
33 </tr><tr class="TableRow3">
34 <td class="TableRow3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=profile",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit Profile</a></td>
35 </tr><tr class="TableRow3">
36 <td class="TableRow3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=signature",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit Signature</a></td>
37 </tr><tr class="TableRow3">
38 <td class="TableRow3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=avatar",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Edit Avatar</a></td>
39 </tr><tr class="TableRow4">
40 <td class="TableRow4">&nbsp;</td>
41 </tr></table><div>&nbsp;</div>
42 <table class="Table1" style="width: 100%; float: left; vertical-align: top;">
43 <tr class="TableRow1">
44 <td class="TableRow1"><?php echo $ThemeSet['TitleIcon'] ?>Board Settings</td>
45 </tr><tr class="TableRow2">
46 <td class="TableRow2">&nbsp;</td>
47 </tr><tr class="TableRow3">
48 <td class="TableRow3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Board Settings</a></td>
49 </tr><tr class="TableRow3">
50 <td class="TableRow3"><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=userinfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Change User Info</a></td>
51 </tr><tr class="TableRow4">
52 <td class="TableRow4">&nbsp;</td>
53 </tr></table>
54 </td>
55         <td style="width: 85%; vertical-align: top;">
56 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
57 $updateact = url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
58 $profiletitle = " - Updating Settings";
59 @redirect("refresh",$basedir.url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile'],FALSE),"3");
60 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
61 $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
62 ?>
63 <div class="Table1Border">
64 <table class="Table1" style="width: 100%;">
65 <tr class="TableRow1">
66 <td class="TableRow1"><span style="float: left;">
67 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
68 </span><span style="float: right;">&nbsp;</span></td>
69 </tr>
70 <tr id="ProfileTitle" class="TableRow2">
71 <th class="TableRow2">Updating Settings</th>
72 </tr>
73 <tr class="TableRow3" id="ProfileUpdate">
74 <td class="TableRow3">
75 <div style="text-align: center;">
76 <br />Profile updated <a href="<?php echo $updateact; ?>">click here</a> to go back. ^_^<br />&nbsp;</div>
77 <?php } if($_GET['act']=="view") {
78 if($_POST['update']!="now") {
79 $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
80 $result=mysql_query($query);
81 $num=mysql_num_rows($result);
82 $i=0;
83 $YourID=mysql_result($result,$i,"id");
84 $Notes=mysql_result($result,$i,"Notes");
85 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
86 $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
87 ?>
88 <div class="Table1Border">
89 <table class="Table1" style="width: 100%;">
90 <tr class="TableRow1">
91 <td class="TableRow1"><span style="float: left;">
92 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $noteact; ?>">NotePad</a>
93 </span><span style="float: right;">&nbsp;</span></td>
94 </tr>
95 <tr id="ProfileTitle" class="TableRow2">
96 <th class="TableRow2">NotePad</th>
97 </tr>
98 <tr class="TableRow3" id="NotePadRow">
99 <td class="TableRow3">
100 <form method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
101 <label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
102 <textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
103 <input type="hidden" name="act" value="view" style="display: none;" />
104 <input type="hidden" name="update" value="now" style="display: none;" />
105 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
106 </div></form></td>
107 </tr>
108 <tr id="ProfileEnd" class="TableRow4">
109 <td class="TableRow4">&nbsp;</td>
110 </tr>
111 </table>
112 </div>
113 <?php @mysql_free_result($result); }
114 if($_POST['update']=="now") {
115 if($_POST['act']=="view"&&
116         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
117         $_POST['NotePad'] = htmlentities($_POST['NotePad'], ENT_QUOTES);
118         $NewDay=GMTimeStamp();
119         $NewIP=$_SERVER['REMOTE_ADDR'];
120         $querynewskin = query("update ".$Settings['sqltable']."members set Notes='%s',LastActive='%s',IP='%s' WHERE id=%i", array($_POST['NotePad'],$NewDay,$NewIP,$_SESSION['UserID']));
121                 mysql_query($querynewskin); } } }
122 if($_GET['act']=="signature") {
123 if($_POST['update']!="now") {
124 $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
125 $result=mysql_query($query);
126 $num=mysql_num_rows($result);
127 $i=0;
128 $YourID=mysql_result($result,$i,"id");
129 $Signature=mysql_result($result,$i,"Signature"); 
130 $signatureact = url_maker($exfile['profile'],$Settings['file_ext'],"act=signature",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
131 $profiletitle = " ".$ThemeSet['TitleDivider']." Signature Editor";
132 ?>
133 <div class="Table1Border">
134 <table class="Table1" style="width: 100%;">
135 <tr class="TableRow1">
136 <td class="TableRow1"><span style="float: left;">
137 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
138 </span><span style="float: right;">&nbsp;</span></td>
139 </tr>
140 <tr id="ProfileTitle" class="TableRow2">
141 <th class="TableRow2">Signature Editor</th>
142 </tr>
143 <tr class="TableRow3" id="SignatureRow">
144 <td class="TableRow3">
145 <form method="post" action="<?php echo $signatureact; ?>"><div style="text-align: center;">
146 <label class="TextBoxLabel" for="Signature">Your Signature</label><br />
147 <textarea class="TextBox" name="Signature" id="Signature" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Signature; ?></textarea>
148 <input type="hidden" name="act" value="signature" style="display: none;" />
149 <input type="hidden" name="update" value="now" style="display: none;" />
150 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
151 </div></form></td>
152 </tr>
153 <tr id="ProfileEnd" class="TableRow4">
154 <td class="TableRow4">&nbsp;</td>
155 </tr>
156 </table>
157 </div>
158 <?php @mysql_free_result($result); }
159 if($_POST['update']=="now") {
160 if($_POST['act']=="signature"&&
161         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
162         $_POST['Signature'] = htmlentities($_POST['Signature'], ENT_QUOTES);
163         $_POST['Signature'] = preg_replace("/\t+/"," ",$_POST['Signature']);
164         $_POST['Signature'] = preg_replace("/\s\s+/"," ",$_POST['Signature']);
165         $NewDay=GMTimeStamp();
166         $NewIP=$_SERVER['REMOTE_ADDR'];
167         $querynewskin = query("update ".$Settings['sqltable']."members set Signature='%s',LastActive='%s',IP='%s' WHERE id=%i", array($_POST['Signature'],$NewDay,$NewIP,$_SESSION['UserID']));
168         mysql_query($querynewskin); } } }
169 if($_GET['act']=="avatar") {
170 if($_POST['update']!="now") {
171 $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
172 $result=mysql_query($query);
173 $num=mysql_num_rows($result);
174 $i=0;
175 $YourID=mysql_result($result,$i,"id");
176 $User1Avatar=mysql_result($result,$i,"Avatar"); 
177 $User1AvatarSize=mysql_result($result,$i,"AvatarSize");
178 $avataract = url_maker($exfile['profile'],$Settings['file_ext'],"act=avatar",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
179 $profiletitle = " ".$ThemeSet['TitleDivider']." Avatar Editor";
180 $Pre1Avatar = $User1Avatar;
181 if ($User1Avatar==null) { $User1Avatar="http://"; }
182 if ($Pre1Avatar=="http://"||$Pre1Avatar==null) {
183 $Pre1Avatar=$ThemeSet['NoAvatar'];
184 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
185 $AvatarSize1=explode("x", $User1AvatarSize);
186 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
187 ?>
188 <div class="Table1Border">
189 <table class="Table1" style="width: 100%;">
190 <tr class="TableRow1">
191 <td class="TableRow1"><span style="float: left;">
192 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
193 </span><span style="float: right;">&nbsp;</span></td>
194 </tr>
195 <tr id="ProfileTitle" class="TableRow2">
196 <th class="TableRow2">Avatar Editor</th>
197 </tr>
198 <tr class="TableRow3" id="AvatarEditor">
199 <td class="TableRow3">
200 <form method="post" action="<?php echo $avataract; ?>">
201  <?php  /* Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/ */  ?>
202  <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
203         <tr class="AvatarRow" style="width: 100%; height: 100%;">
204                 <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
205                 <img src="<?php echo $Pre1Avatar; ?>" alt="<?php echo $_SESSION['MemberName']; ?>'s Avatar" title="<?php echo $_SESSION['MemberName']; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
206                 </td>
207         </tr>
208  </table>
209 <table style="text-align: left;">
210 <tr style="text-align: left;">
211         <td style="width: 40%;"><label class="TextBoxLabel" for="Avatar">Your Avatar</label></td>
212         <td style="width: 60%;"><input type="text" class="TextBox" name="Avatar" id="Avatar" value="<?php echo $User1Avatar; ?>" size="20" /></td>
213         </tr><tr style="text-align: left;">
214         <td style="width: 40%;"><label class="TextBoxLabel" for="AvatarSizeW">Avatar Width</label></td>
215         <td style="width: 60%;"><select size="1" name="AvatarSizeW" id="AvatarSizeW" class="TextBox">
216         <option value="<?php echo $AvatarSize1W; ?>" selected="selected"><?php echo $AvatarSize1W; ?></option><?php echo "\n"; $r=1; while ($r <= 100) { ?><option value="<?php echo $r ?>"><?php echo $r; ?></option><?php echo "\n"; ++$r; } ?>
217 </select></td>
218 </tr><tr style="text-align: left;">
219         <td style="width: 40%;"><label class="TextBoxLabel" for="AvatarSizeH">Avatar Height</label></td>
220         <td style="width: 60%;"><select size="1" name="AvatarSizeH" id="AvatarSizeH" class="TextBox">
221 <option value="<?php echo $AvatarSize1H; ?>" selected="selected"><?php echo $AvatarSize1H; ?></option><?php echo "\n"; $s=1; while ($s <= 100) { ?><option value="<?php echo $s ?>"><?php echo $s; ?></option><?php echo "\n"; ++$s; } ?>
222 </select></td>
223 </tr></table>
224 <table style="text-align: left;">
225 <tr style="text-align: left;">
226 <td style="width: 100%;">
227 <input type="hidden" name="act" value="avatar" style="display: none;" />
228 <input type="hidden" name="update" value="now" style="display: none;" />
229 <input type="submit" class="Button" value="Save" />
230 <input class="Button" type="reset" />
231 </td></tr></table>
232 </form></td>
233 </tr>
234 <tr id="ProfileEnd" class="TableRow4">
235 <td class="TableRow4">&nbsp;</td>
236 </tr>
237 </table>
238 </div>
239 <?php @mysql_free_result($result); }
240 if($_POST['update']=="now") {
241 if($_POST['Avatar']!=null&&$_POST['AvatarSizeW']!=null&&$_POST['AvatarSizeH']!=null&&
242         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
243         if($_POST['AvatarSizeW']>=100) { $_POST['AvatarSizeW']=100; }
244         if($_POST['AvatarSizeH']>=100) { $_POST['AvatarSizeH']=100; }
245         $fullavatarsize = $_POST['AvatarSizeW']."x".$_POST['AvatarSizeH'];
246         $_POST['Avatar'] = htmlentities($_POST['Avatar'], ENT_QUOTES);
247         $NewDay=GMTimeStamp();
248         $NewIP=$_SERVER['REMOTE_ADDR'];
249         $_POST['Avatar'] = @remove_spaces($_POST['Avatar']);
250         $querynewskin = query("update ".$Settings['sqltable']."members set Avatar='%s',AvatarSize='%s',LastActive='%s',IP='%s' WHERE id=%i", array($_POST['Avatar'],$fullavatarsize,$NewDay,$NewIP,$_SESSION['UserID']));
251         mysql_query($querynewskin); } } }
252 if($_GET['act']=="settings") {
253 if($_POST['update']!="now") {
254 $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
255 $result=mysql_query($query);
256 $num=mysql_num_rows($result);
257 $i=0;
258 $YourID=mysql_result($result,$i,"id");
259 $User1TimeZone=mysql_result($result,$i,"TimeZone"); 
260 $User1DST=mysql_result($result,$i,"DST");
261 $settingsact = url_maker($exfile['profile'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
262 $profiletitle = " ".$ThemeSet['TitleDivider']." Board Settings"; ?>
263 <div class="Table1Border">
264 <table class="Table1" style="width: 100%;">
265 <tr class="TableRow1">
266 <td class="TableRow1"><span style="float: left;">
267 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
268 </span><span style="float: right;">&nbsp;</span></td>
269 </tr>
270 <tr id="ProfileTitle" class="TableRow2">
271 <th class="TableRow2">Board Settings</th>
272 </tr>
273 <tr class="TableRow3" id="BoardSettings">
274 <td class="TableRow3">
275 <form method="post" action="<?php echo $settingsact; ?>">
276 <table style="text-align: left;">
277 <tr style="text-align: left;">
278         <td style="width: 40%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
279         <td style="width: 60%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
280 <option selected="selected" value="<?php echo $User1TimeZone; ?>">Old Value (<?php echo $User1TimeZone.":00 hours"; ?>)</option>
281 <?php
282 $plusi = 1; $minusi = 12;
283 $plusnum = 13; $minusnum = 0;
284 while ($minusi > $minusnum) {
285 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n";
286 --$minusi; }
287 ?>
288 <option value="0">GMT +/- 0:00 hours</option>
289 <?php
290 while ($plusi < $plusnum) {
291 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n";
292 ++$plusi; }
293 ?></select></td>
294 </tr><tr style="text-align: left;">
295         <td style="width: 40%;"><label class="TextBoxLabel" for="skin">Pick a CSS Theme</label></td>
296         <td style="width: 60%;"><select id="skin" name="skin" class="TextBox">
297 <option selected="selected" value="<?php echo $_SESSION['Theme']; ?>">Old Value (<?php echo $_SESSION['Theme']; ?>)</option><?php
298 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
299 if ($handle = opendir($skindir)) {
300    while (false !== ($file = readdir($handle))) {
301            if (file_exists($skindir.$file."/info.php")) {
302                    if ($file != "." && $file != "..") {
303            include($skindir.$file."/info.php");
304        echo "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>\n";
305    } } }
306    closedir($handle);
307 } ?>
308 </select></td>
309 </tr><tr style="text-align: left;">
310         <td style="width: 40%;"><label class="TextBoxLabel" for="DST">Is <span title="Daylight Savings Time">DST</span> / <span title="Summer Time">ST</span> on or off:</label></td>
311         <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
312 <?php if($User1DST=="off"||$User1DST!="on") { ?>
313 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
314 <?php } if($User1DST=="on") { ?>
315 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
316 <?php } echo "\n" ?></select></td>
317 </tr></table>
318 <table style="text-align: left;">
319 <tr style="text-align: left;">
320 <td style="width: 100%;">
321 <input type="hidden" name="act" value="settings" style="display: none;" />
322 <input type="hidden" name="update" value="now" style="display: none;" />
323 <input type="submit" class="Button" value="Save" />
324 <input class="Button" type="reset" />
325 </td></tr></table>
326 </form></td>
327 </tr>
328 <tr id="ProfileEnd" class="TableRow4">
329 <td class="TableRow4">&nbsp;</td>
330 </tr>
331 </table>
332 </div>
333 <?php @mysql_free_result($result); }
334 if($_POST['update']=="now") {
335 if($_POST['act']=="settings"&&
336         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
337         $NewDay=GMTimeStamp();
338         $NewIP=$_SERVER['REMOTE_ADDR'];
339         $querynewskin = query("update ".$Settings['sqltable']."members set UseTheme='%s',TimeZone='%s',DST='%s',LastActive='%s',IP='%s' WHERE id=%i", array($_POST['skin'],$_POST['YourOffSet'],$_POST['DST'],$NewDay,$NewIP,$_SESSION['UserID']));
340         mysql_query($querynewskin); } } }
341 if($_GET['act']=="profile") {
342 if($_POST['update']!="now") {
343 $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
344 $result=mysql_query($query);
345 $num=mysql_num_rows($result);
346 $i=0;
347 $YourID=mysql_result($result,$i,"id");
348 $User1Interests=mysql_result($result,$i,"Interests"); 
349 $User1Title=mysql_result($result,$i,"Title");
350 $User1Website=mysql_result($result,$i,"Website"); 
351 $User1Gender=mysql_result($result,$i,"Gender");
352 $User1TimeZone=mysql_result($result,$i,"TimeZone"); 
353 $User1DST=mysql_result($result,$i,"DST");
354 $profileact = url_maker($exfile['profile'],$Settings['file_ext'],"act=profile",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
355 $profiletitle = " ".$ThemeSet['TitleDivider']." Profile Editor";
356 ?>
357 <div class="Table1Border">
358 <table class="Table1" style="width: 100%;">
359 <tr class="TableRow1">
360 <td class="TableRow1"><span style="float: left;">
361 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
362 </span><span style="float: right;">&nbsp;</span></td>
363 </tr>
364 <tr id="ProfileTitle" class="TableRow2">
365 <th class="TableRow2">Profile Editor</th>
366 </tr>
367 <tr class="TableRow3" id="ProfileEditor">
368 <td class="TableRow3">
369 <form method="post" action="<?php echo $profileact; ?>">
370 <table style="text-align: left;">
371 <tr style="text-align: left;">
372         <td style="width: 40%;"><label class="TextBoxLabel" for="Interests">Your Interests</label></td>
373         <td style="width: 60%;"><input type="text" class="TextBox" name="Interests" id="Interests" value="<?php echo $User1Interests; ?>" /></td>
374 </tr><tr style="text-align: left;">
375         <td style="width: 40%;"><label class="TextBoxLabel" for="Title">Your Title</label></td>
376         <td style="width: 60%;"><input type="text" class="TextBox" name="Title" id="Title" value="<?php echo $User1Title; ?>" /></td>
377 </tr><tr style="text-align: left;">
378         <td style="width: 40%;"><label class="TextBoxLabel" for="Website">Your Website</label></td>
379         <td style="width: 60%;"><input type="text" class="TextBox" name="Website" id="Website" value="<?php echo $User1Website; ?>" /></td>
380 </tr><tr style="text-align: left;">
381         <td style="width: 40%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
382         <td style="width: 60%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
383 <option selected="selected" value="<?php echo $User1TimeZone; ?>">Old Value (<?php echo $User1TimeZone.":00 hours"; ?>)</option>
384 <?php
385 $plusi = 1; $minusi = 12;
386 $plusnum = 13; $minusnum = 0;
387 while ($minusi > $minusnum) {
388 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n";
389 --$minusi; }
390 ?>
391 <option value="0">GMT +/- 0:00 hours</option>
392 <?php
393 while ($plusi < $plusnum) {
394 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n";
395 ++$plusi; }
396 ?></select></td>
397 </tr><tr style="text-align: left;">
398         <td style="width: 40%;"><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
399         <td style="width: 60%;"><select id="YourGender" name="YourGender" class="TextBox">
400 <option selected="selected" value="<?php echo $User1Gender; ?>">Old Value (<?php echo $User1Gender; ?>)</option>
401 <option value="Male">Male</option>
402 <option value="Female">Female</option>
403 <option value="Unknow">Unknow</option>
404 </select></td>
405 </tr><tr style="text-align: left;">
406         <td style="width: 40%;"><label class="TextBoxLabel" for="DST">Is <span title="Daylight Savings Time">DST</span> / <span title="Summer Time">ST</span> on or off:</label></td>
407         <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
408 <?php if($User1DST=="off"||$User1DST!="on") { ?>
409 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
410 <?php } if($User1DST=="on") { ?>
411 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
412 <?php } echo "\n" ?></select></td>
413 </tr></table>
414 <table style="text-align: left;">
415 <tr style="text-align: left;">
416 <td style="width: 100%;">
417 <input type="hidden" name="act" value="profile" style="display: none;" />
418 <input type="hidden" name="update" value="now" style="display: none;" />
419 <input type="submit" class="Button" value="Save" />
420 <input class="Button" type="reset" />
421 </td></tr></table>
422 </form></td>
423 </tr>
424 <tr id="ProfileEnd" class="TableRow4">
425 <td class="TableRow4">&nbsp;</td>
426 </tr>
427 </table>
428 </div>
429 <?php @mysql_free_result($result); }
430 if($_POST['update']=="now") {
431 if($_POST['act']=="profile"&&
432         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
433         $_POST['Interests'] = htmlentities($_POST['Interests'], ENT_QUOTES);
434         $_POST['Interests'] = @remove_spaces($_POST['Interests']);
435         $_POST['Title'] = htmlentities($_POST['Title'], ENT_QUOTES);
436         $_POST['Title'] = @remove_spaces($_POST['Title']);
437         $_POST['Website'] = htmlentities($_POST['Website'], ENT_QUOTES);
438         $_POST['Website'] = @remove_spaces($_POST['Website']);
439         $_SESSION['UserTimeZone'] = $_POST['YourOffSet'];
440         $_SESSION['UserDST'] = $_POST['DST'];
441         $NewDay=GMTimeStamp();
442         $NewIP=$_SERVER['REMOTE_ADDR'];
443         $querynewprofile = query("update ".$Settings['sqltable']."members set Interests='%s',Title='%s',Website='%s',TimeZone='%s',Gender='%s',DST='%s',LastActive='%s',IP='%s' WHERE id=%i", array($_POST['Interests'],$_POST['Title'],$_POST['Website'],$_POST['YourOffSet'],$_POST['YourGender'],$_POST['DST'],$NewDay,$NewIP,$_SESSION['UserID']));
444         mysql_query($querynewprofile); } } }
445 if($_GET['act']=="userinfo") {
446 if($_POST['update']!="now") {
447 $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
448 $result=mysql_query($query);
449 $num=mysql_num_rows($result);
450 $i=0;
451 $YourID=mysql_result($result,$i,"id");
452 $User1Email=mysql_result($result,$i,"Email"); 
453 $userinfoact = url_maker($exfile['profile'],$Settings['file_ext'],"act=userinfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
454 $profiletitle = " ".$ThemeSet['TitleDivider']." User Info Editer";
455 ?>
456 <div class="Table1Border">
457 <table class="Table1" style="width: 100%;">
458 <tr class="TableRow1">
459 <td class="TableRow1"><span style="float: left;">
460 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
461 </span><span style="float: right;">&nbsp;</span></td>
462 </tr>
463 <tr id="ProfileTitle" class="TableRow2">
464 <th class="TableRow2">User Info Editer</th>
465 </tr>
466 <tr class="TableRow3" id="UserInfoEditor">
467 <td class="TableRow3">
468 <form method="post" action="<?php echo $userinfoact; ?>">
469 <table style="text-align: left;">
470 <tr style="text-align: left;">
471         <td style="width: 40%;"><label class="TextBoxLabel" for="OldPass">Insert old Password:</label></td>
472         <td style="width: 60%;"><input type="password" class="TextBox" name="OldPass" size="20" id="OldPass" maxlength="30" /></td>
473 </tr><tr style="text-align: left;">
474         <td style="width: 40%;"><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
475         <td style="width: 60%;"><input type="password" class="TextBox" name="Password" size="20" id="Password" maxlength="30" /></td>
476 </tr><tr style="text-align: left;">
477         <td style="width: 40%;"><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
478         <td style="width: 60%;"><input type="password" class="TextBox" name="RePassword" size="20" id="RePassword" maxlength="30" /></td>
479 </tr><tr style="text-align: left;">
480         <td style="width: 40%;"><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
481         <td style="width: 60%;"><input type="text" class="TextBox" name="Email" size="20" id="Email" value="<?php echo $User1Email; ?>" /></td>
482 </tr></table>
483 <table style="text-align: left;">
484 <tr style="text-align: left;">
485 <td style="width: 100%;">
486 <input type="hidden" name="act" value="userinfo" style="display: none;" />
487 <input type="hidden" name="update" value="now" style="display: none;" />
488 <input type="submit" class="Button" value="Save" />
489 <input class="Button" type="reset" />
490 </td></tr></table>
491 </form></td>
492 </tr>
493 <tr id="ProfileEnd" class="TableRow4">
494 <td class="TableRow4">&nbsp;</td>
495 </tr>
496 </table>
497 </div>
498 <?php @mysql_free_result($result); }
499 if($_POST['update']=="now") {
500 if($_POST['act']=="userinfo"&&
501         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
502         $query = query("select * from ".$Settings['sqltable']."members where `id`=%i", array($_SESSION['UserID']));
503         $result=mysql_query($query);
504         $num=mysql_num_rows($result);
505         $i=0;
506         $OldPassword=mysql_result($result,$i,"Password");
507         $OldHashType=mysql_result($result,$i,"HashType");
508         $OldJoined=mysql_result($result,$i,"Joined");
509         $OldSalt=mysql_result($result,$i,"Salt");
510         $UpdateHash = false; $NewSalt = salt_hmac(); 
511 if($OldHashType=="ODFH") { 
512         $YourPassword = sha1(md5($_POST['OldPass']));
513         $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
514 if($OldHashType=="DF4H") { 
515         $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1");
516         $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
517 if($OldHashType=="iDBH"&&$UpdateHash!=true) { 
518         $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1");
519         $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
520 if($YourPassword!=$OldPassword) { $Error="Yes"; ?>
521 <div class="TableMessage">Your old Password did not match.<br />&nbsp;</div>
522 <?php } if(strlen($_POST['Password'])=="30") { $Error="Yes"; ?>
523 <div class="TableMessage">Your password is too big.<br />&nbsp;</div>
524 <?php } if(strlen($_POST['OldPass'])=="30") { $Error="Yes"; ?>
525 <div class="TableMessage">Your old password is too big.<br />&nbsp;</div>
526 <?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes";  ?>
527 <div class="TableMessage">Your passwords did not match.<br />&nbsp;</div>
528 <?php }
529         $NewDay=GMTimeStamp();
530         $NewIP=$_SERVER['REMOTE_ADDR'];
531         if ($Error!="Yes") {
532         setcookie("SessPass", $NewPassword, time() + (7 * 86400), $basedir);
533         $_POST['Email'] = @remove_spaces($_POST['Email']);
534         $querynewuserinfo = query("update ".$Settings['sqltable']."members set Password='%s',HashType='iDBH',Email='%s',LastActive='%s',IP='%s',Salt='%s' WHERE id=%i", array($NewPassword,$_POST['Email'],$NewDay,$NewIP,$NewSalt,$_SESSION['UserID']));
535         mysql_query($querynewuserinfo); } } } }
536 ?>
537 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
538         $profiletitle = " - Updating Settings"; ?>
539 </td></tr>
540 <tr id="ProfileTitleEnd" class="TableRow4">
541 <td class="TableRow4">&nbsp;</td>
542 </tr></table></div><?php } ?>
543 </td></tr>
544 </table>