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