OSDN Git Service

Small update added word filter. :)
[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: 12/13/2007 SVN 135 - Author: cooldude2k $
15 */
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="profilemain.php"||$File3Name=="/profilemain.php") {
18         require('index.php');
19         exit(); }
20
21 // Check if we can edit the profile
22 if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['CanEditProfile']=="no") {
23 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
24 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
25 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
26 if(!isset($_POST['update'])) { $_POST['update'] = null; }
27 ?>
28 <table class="Table3">
29 <tr style="width: 100%; vertical-align: top;">
30         <td style="width: 15%; vertical-align: top;">
31         <table id="ProfileLinks" class="Table1" style="width: 100%; float: left; vertical-align: top;">
32 <tr class="TableRow1">
33 <td class="TableRow1"><?php echo $ThemeSet['TitleIcon'] ?>Profile Settings</td>
34 </tr><tr class="TableRow2">
35 <td class="TableRow2">&nbsp;</td>
36 </tr><tr class="TableRow3">
37 <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>
38 </tr><tr class="TableRow3">
39 <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>
40 </tr><tr class="TableRow3">
41 <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>
42 </tr><tr class="TableRow3">
43 <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>
44 </tr><tr class="TableRow4">
45 <td class="TableRow4">&nbsp;</td>
46 </tr></table><div>&nbsp;</div>
47 <table class="Table1" style="width: 100%; float: left; vertical-align: top;">
48 <tr class="TableRow1">
49 <td class="TableRow1"><?php echo $ThemeSet['TitleIcon'] ?>Board Settings</td>
50 </tr><tr class="TableRow2">
51 <td class="TableRow2">&nbsp;</td>
52 </tr><tr class="TableRow3">
53 <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>
54 </tr><tr class="TableRow3">
55 <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>
56 </tr><tr class="TableRow4">
57 <td class="TableRow4">&nbsp;</td>
58 </tr></table>
59 </td>
60         <td style="width: 85%; vertical-align: top;">
61 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
62 $updateact = url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
63 $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
64 @redirect("refresh",$basedir.url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile'],FALSE),"3");
65 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
66 $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
67 ?>
68 <div class="Table1Border">
69 <table class="Table1" style="width: 100%;">
70 <tr class="TableRow1">
71 <td class="TableRow1"><span style="float: left;">
72 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
73 </span><span style="float: right;">&nbsp;</span></td>
74 </tr>
75 <tr id="ProfileTitle" class="TableRow2">
76 <th class="TableRow2">Updating Settings</th>
77 </tr>
78 <tr class="TableRow3" id="ProfileUpdate">
79 <td class="TableRow3">
80 <div style="text-align: center;">
81 <br />Profile updated <a href="<?php echo $updateact; ?>">click here</a> to go back. ^_^<br />&nbsp;</div>
82 <?php } if($_GET['act']=="view") {
83 if($_POST['update']!="now") {
84 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
85 $result=mysql_query($query);
86 $num=mysql_num_rows($result);
87 $i=0;
88 $YourID=mysql_result($result,$i,"id");
89 $Notes=mysql_result($result,$i,"Notes");
90 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
91 $notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
92 ?>
93 <div class="Table1Border">
94 <table class="Table1" style="width: 100%;">
95 <tr class="TableRow1">
96 <td class="TableRow1"><span style="float: left;">
97 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $noteact; ?>">NotePad</a>
98 </span><span style="float: right;">&nbsp;</span></td>
99 </tr>
100 <tr id="ProfileTitle" class="TableRow2">
101 <th class="TableRow2">NotePad</th>
102 </tr>
103 <tr class="TableRow3" id="NotePadRow">
104 <td class="TableRow3">
105 <form style="display: inline;" method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
106 <label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
107 <textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
108 <input type="hidden" name="act" value="view" style="display: none;" />
109 <input type="hidden" name="update" value="now" style="display: none;" />
110 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
111 </div></form></td>
112 </tr>
113 <tr id="ProfileEnd" class="TableRow4">
114 <td class="TableRow4">&nbsp;</td>
115 </tr>
116 </table>
117 </div>
118 <?php @mysql_free_result($result); }
119 if($_POST['update']=="now") {
120 if($_POST['act']=="view"&&
121         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
122         $_POST['NotePad'] = htmlspecialchars($_POST['NotePad'], ENT_QUOTES, $Settings['charset']);
123         $_POST['NotePad'] = remove_bad_entities($_POST['NotePad']);
124         //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
125         //$_POST['Signature'] = @remove_spaces($_POST['Signature']);
126         //$_POST['Signature'] = remove_bad_entities($_POST['Signature']);
127         /*    <_<  iWordFilter  >_>      
128     by René Johnson - Cool Dude 2k */
129         $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null));
130         $katarzynart=mysql_query($katarzynaqy);
131         $katarzynanm=mysql_num_rows($katarzynart);
132         $katarzynas=0;
133         while ($katarzynas < $katarzynanm) {
134         $Filter=mysql_result($katarzynart,$katarzynas,"Filter");
135         $Replace=mysql_result($katarzynart,$katarzynas,"Replace");
136         $CaseInsensitive=mysql_result($katarzynart,$katarzynas,"CaseInsensitive");
137         if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
138         if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
139         if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
140         $WholeWord=mysql_result($katarzynart,$katarzynas,"WholeWord");
141         if($WholeWord=="on") { $WholeWord = "yes"; }
142         if($WholeWord=="off") { $WholeWord = "no"; }
143         if($WholeWord!="yes"||$WholeWord!="no") { $WholeWord = "no"; }
144         $Filter = preg_quote($Filter, "/");
145         if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
146         $_POST['NotePad'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['NotePad']); }
147         if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
148         $_POST['NotePad'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['NotePad']); }
149         if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
150         $_POST['NotePad'] = preg_replace("/".$Filter."/", $Replace, $_POST['NotePad']); }
151         if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
152         $_POST['NotePad'] = preg_replace("/".$Filter."/i", $Replace, $_POST['NotePad']); }
153         ++$katarzynas; } @mysql_free_result($katarzynart);
154         $NewDay=GMTimeStamp();
155         $NewIP=$_SERVER['REMOTE_ADDR'];
156         $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `Notes`='%s',`LastActive`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['NotePad'],$NewDay,$NewIP,$_SESSION['UserID']));
157                 mysql_query($querynewskin); } } }
158 if($_GET['act']=="signature") {
159 if($_POST['update']!="now") {
160 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
161 $result=mysql_query($query);
162 $num=mysql_num_rows($result);
163 $i=0;
164 $YourID=mysql_result($result,$i,"id");
165 $Signature=mysql_result($result,$i,"Signature"); 
166 $signatureact = url_maker($exfile['profile'],$Settings['file_ext'],"act=signature",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
167 $profiletitle = " ".$ThemeSet['TitleDivider']." Signature Editor";
168 ?>
169 <div class="Table1Border">
170 <table class="Table1" style="width: 100%;">
171 <tr class="TableRow1">
172 <td class="TableRow1"><span style="float: left;">
173 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
174 </span><span style="float: right;">&nbsp;</span></td>
175 </tr>
176 <tr id="ProfileTitle" class="TableRow2">
177 <th class="TableRow2">Signature Editor</th>
178 </tr>
179 <tr class="TableRow3" id="SignatureRow">
180 <td class="TableRow3">
181 <form style="display: inline;" method="post" action="<?php echo $signatureact; ?>"><div style="text-align: center;">
182 <label class="TextBoxLabel" for="Signature">Your Signature</label><br />
183 <textarea class="TextBox" name="Signature" id="Signature" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Signature; ?></textarea>
184 <input type="hidden" name="act" value="signature" style="display: none;" />
185 <input type="hidden" name="update" value="now" style="display: none;" />
186 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
187 </div></form></td>
188 </tr>
189 <tr id="ProfileEnd" class="TableRow4">
190 <td class="TableRow4">&nbsp;</td>
191 </tr>
192 </table>
193 </div>
194 <?php @mysql_free_result($result); }
195 if($_POST['update']=="now") {
196 if($_POST['act']=="signature"&&
197         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
198         $_POST['Signature'] = stripcslashes(htmlspecialchars($_POST['Signature'], ENT_QUOTES));
199         //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
200         //$_POST['Signature'] = @remove_spaces($_POST['Signature']);
201         $_POST['Signature'] = remove_bad_entities($_POST['Signature']);
202         /*    <_<  iWordFilter  >_>      
203     by René Johnson - Cool Dude 2k */
204         $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null));
205         $katarzynart=mysql_query($katarzynaqy);
206         $katarzynanm=mysql_num_rows($katarzynart);
207         $katarzynas=0;
208         while ($katarzynas < $katarzynanm) {
209         $Filter=mysql_result($katarzynart,$katarzynas,"Filter");
210         $Replace=mysql_result($katarzynart,$katarzynas,"Replace");
211         $CaseInsensitive=mysql_result($katarzynart,$katarzynas,"CaseInsensitive");
212         if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
213         if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
214         if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
215         $WholeWord=mysql_result($katarzynart,$katarzynas,"WholeWord");
216         if($WholeWord=="on") { $WholeWord = "yes"; }
217         if($WholeWord=="off") { $WholeWord = "no"; }
218         if($WholeWord!="yes"||$WholeWord!="no") { $WholeWord = "no"; }
219         $Filter = preg_quote($Filter, "/");
220         if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
221         $_POST['Signature'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Signature']); }
222         if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
223         $_POST['Signature'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Signature']); }
224         if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
225         $_POST['Signature'] = preg_replace("/".$Filter."/", $Replace, $_POST['Signature']); }
226         if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
227         $_POST['Signature'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Signature']); }
228         ++$katarzynas; } @mysql_free_result($katarzynart);
229         $NewDay=GMTimeStamp();
230         $NewIP=$_SERVER['REMOTE_ADDR'];
231         $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `Signature`='%s',`LastActive`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['Signature'],$NewDay,$NewIP,$_SESSION['UserID']));
232         mysql_query($querynewskin); } } }
233 if($_GET['act']=="avatar") {
234 if($_POST['update']!="now") {
235 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
236 $result=mysql_query($query);
237 $num=mysql_num_rows($result);
238 $i=0;
239 $YourID=mysql_result($result,$i,"id");
240 $User1Avatar=mysql_result($result,$i,"Avatar"); 
241 $User1AvatarSize=mysql_result($result,$i,"AvatarSize");
242 $avataract = url_maker($exfile['profile'],$Settings['file_ext'],"act=avatar",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
243 $profiletitle = " ".$ThemeSet['TitleDivider']." Avatar Editor";
244 $Pre1Avatar = $User1Avatar;
245 if ($User1Avatar==null) { $User1Avatar="http://"; }
246 if ($Pre1Avatar=="http://"||$Pre1Avatar==null) {
247 $Pre1Avatar=$ThemeSet['NoAvatar'];
248 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
249 $AvatarSize1=explode("x", $User1AvatarSize);
250 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
251 ?>
252 <div class="Table1Border">
253 <table class="Table1" style="width: 100%;">
254 <tr class="TableRow1">
255 <td class="TableRow1"><span style="float: left;">
256 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
257 </span><span style="float: right;">&nbsp;</span></td>
258 </tr>
259 <tr id="ProfileTitle" class="TableRow2">
260 <th class="TableRow2">Avatar Editor</th>
261 </tr>
262 <tr class="TableRow3" id="AvatarEditor">
263 <td class="TableRow3">
264 <form style="display: inline;" method="post" action="<?php echo $avataract; ?>">
265  <?php  /* Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/ */  ?>
266  <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
267         <tr class="AvatarRow" style="width: 100%; height: 100%;">
268                 <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
269                 <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;" />
270                 </td>
271         </tr>
272  </table>
273 <table style="text-align: left;">
274 <tr style="text-align: left;">
275         <td style="width: 40%;"><label class="TextBoxLabel" for="Avatar">Your Avatar</label></td>
276         <td style="width: 60%;"><input type="text" class="TextBox" name="Avatar" id="Avatar" value="<?php echo $User1Avatar; ?>" size="20" /></td>
277         </tr><tr style="text-align: left;">
278         <td style="width: 40%;"><label class="TextBoxLabel" for="AvatarSizeW">Avatar Width</label></td>
279         <td style="width: 60%;"><select size="1" name="AvatarSizeW" id="AvatarSizeW" class="TextBox">
280         <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; } ?>
281 </select></td>
282 </tr><tr style="text-align: left;">
283         <td style="width: 40%;"><label class="TextBoxLabel" for="AvatarSizeH">Avatar Height</label></td>
284         <td style="width: 60%;"><select size="1" name="AvatarSizeH" id="AvatarSizeH" class="TextBox">
285 <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; } ?>
286 </select></td>
287 </tr></table>
288 <table style="text-align: left;">
289 <tr style="text-align: left;">
290 <td style="width: 100%;">
291 <input type="hidden" name="act" value="avatar" style="display: none;" />
292 <input type="hidden" name="update" value="now" style="display: none;" />
293 <input type="submit" class="Button" value="Save" />
294 <input class="Button" type="reset" />
295 </td></tr></table>
296 </form></td>
297 </tr>
298 <tr id="ProfileEnd" class="TableRow4">
299 <td class="TableRow4">&nbsp;</td>
300 </tr>
301 </table>
302 </div>
303 <?php @mysql_free_result($result); }
304 if($_POST['update']=="now") {
305 if($_POST['Avatar']!=null&&$_POST['AvatarSizeW']!=null&&$_POST['AvatarSizeH']!=null&&
306         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
307         if($_POST['AvatarSizeW']>=100) { $_POST['AvatarSizeW']=100; }
308         if($_POST['AvatarSizeH']>=100) { $_POST['AvatarSizeH']=100; }
309         $fullavatarsize = $_POST['AvatarSizeW']."x".$_POST['AvatarSizeH'];
310         $_POST['Avatar'] = htmlentities($_POST['Avatar'], ENT_QUOTES, $Settings['charset']);
311         $NewDay=GMTimeStamp();
312         $NewIP=$_SERVER['REMOTE_ADDR'];
313         $_POST['Avatar'] = @remove_spaces($_POST['Avatar']);
314         $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `Avatar`='%s',`AvatarSize`='%s',`LastActive`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['Avatar'],$fullavatarsize,$NewDay,$NewIP,$_SESSION['UserID']));
315         mysql_query($querynewskin); } } }
316 if($_GET['act']=="settings") {
317 if($_POST['update']!="now") {
318 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
319 $result=mysql_query($query);
320 $num=mysql_num_rows($result);
321 $i=0;
322 $YourID=mysql_result($result,$i,"id");
323 $User1TimeZone=mysql_result($result,$i,"TimeZone"); 
324 $tsa_mem = explode(":",$User1TimeZone);
325 $TimeZoneArray = array("offset" => $User1TimeZone, "hour" => $tsa_mem[0], "minute" => $tsa_mem[1]);
326 $User1DST=mysql_result($result,$i,"DST");
327 $settingsact = url_maker($exfile['profile'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
328 $profiletitle = " ".$ThemeSet['TitleDivider']." Board Settings"; ?>
329 <div class="Table1Border">
330 <table class="Table1" style="width: 100%;">
331 <tr class="TableRow1">
332 <td class="TableRow1"><span style="float: left;">
333 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
334 </span><span style="float: right;">&nbsp;</span></td>
335 </tr>
336 <tr id="ProfileTitle" class="TableRow2">
337 <th class="TableRow2">Board Settings</th>
338 </tr>
339 <tr class="TableRow3" id="BoardSettings">
340 <td class="TableRow3">
341 <form style="display: inline;" method="post" action="<?php echo $settingsact; ?>">
342 <table style="text-align: left;">
343 <tr style="text-align: left;">
344         <td style="width: 40%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
345         <td style="width: 60%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
346 <option selected="selected" value="<?php echo $TimeZoneArray['hour']; ?>">Old Value (<?php echo $TimeZoneArray['hour'].":00 hours"; ?>)</option>
347 <?php
348 $plusi = 1; $minusi = 12;
349 $plusnum = 13; $minusnum = 0;
350 while ($minusi > $minusnum) {
351 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n";
352 --$minusi; }
353 ?>
354 <option value="0">GMT +/- 0:00 hours</option>
355 <?php
356 while ($plusi < $plusnum) {
357 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n";
358 ++$plusi; }
359 ?></select></td>
360 </tr><tr style="text-align: left;">
361         <td style="width: 40%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
362         <td style="width: 60%;"><select id="MinOffSet" name="MinOffSet" class="TextBox">
363 <option selected="selected" value="<?php echo $TimeZoneArray['minute']; ?>">Old Value (<?php echo "0:".$TimeZoneArray['minute']." minutes"; ?>)</option>
364 <?php
365 $mini = 0; $minnum = 60;
366 while ($mini < $minnum) {
367 if(pre_strlen($mini)==2) { $showmin = $mini; }
368 if(pre_strlen($mini)==1) { $showmin = "0".$mini; }
369 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n";
370 ++$mini; }
371 ?></select></td>
372 </tr><tr style="text-align: left;">
373         <td style="width: 40%;"><label class="TextBoxLabel" for="skin">Pick a CSS Theme</label></td>
374         <td style="width: 60%;"><select id="skin" name="skin" class="TextBox">
375 <option selected="selected" value="<?php echo $_SESSION['Theme']; ?>">Old Value (<?php echo $_SESSION['Theme']; ?>)</option><?php
376 $skindir = dirname(realpath("settings.php"))."/".$SettDir['themes'];
377 if ($handle = opendir($skindir)) { $dirnum = null;
378    while (false !== ($file = readdir($handle))) {
379            if ($dirnum==null) { $dirnum = 0; }
380            if (file_exists($skindir.$file."/info.php")) {
381                    if ($file != "." && $file != "..") {
382            include($skindir.$file."/info.php");
383        $themelist[$dirnum] =  "<option value=\"".$file."\">".$ThemeInfo['ThemeName']."</option>";
384            ++$dirnum; } } }
385    closedir($handle); asort($themelist);
386    $themenum=count($themelist); $themei=0; 
387    while ($themei < $themenum) {
388    echo $themelist[$themei]."\n";
389    ++$themei; }
390 } ?></select></td>
391 </tr><tr style="text-align: left;">
392         <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>
393         <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
394 <?php if($User1DST=="off"||$User1DST!="on") { ?>
395 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
396 <?php } if($User1DST=="on") { ?>
397 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
398 <?php } echo "\n" ?></select></td>
399 </tr></table>
400 <table style="text-align: left;">
401 <tr style="text-align: left;">
402 <td style="width: 100%;">
403 <input type="hidden" name="act" value="settings" style="display: none;" />
404 <input type="hidden" name="update" value="now" style="display: none;" />
405 <input type="submit" class="Button" value="Save" />
406 <input class="Button" type="reset" />
407 </td></tr></table>
408 </form></td>
409 </tr>
410 <tr id="ProfileEnd" class="TableRow4">
411 <td class="TableRow4">&nbsp;</td>
412 </tr>
413 </table>
414 </div>
415 <?php @mysql_free_result($result); }
416 if($_POST['update']=="now") {
417 if($_POST['act']=="settings"&&
418         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
419         $NewDay=GMTimeStamp();
420         $NewIP=$_SERVER['REMOTE_ADDR'];
421         if(!is_numeric($_POST['YourOffSet'])) { $_POST['YourOffSet'] = "0"; }
422         if($_POST['YourOffSet']>12) { $_POST['YourOffSet'] = "12"; }
423         if($_POST['YourOffSet']<-12) { $_POST['YourOffSet'] = "-12"; }
424         if(!is_numeric($_POST['MinOffSet'])) { $_POST['MinOffSet'] = "00"; }
425         if($_POST['MinOffSet']>59) { $_POST['MinOffSet'] = "59"; }
426         if($_POST['MinOffSet']<0) { $_POST['MinOffSet'] = "00"; }
427         $_POST['YourOffSet'] = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
428         $_SESSION['UserTimeZone'] = $_POST['YourOffSet'];
429         $_SESSION['UserDST'] = $_POST['DST'];
430         $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `UseTheme`='%s',`TimeZone`='%s',`DST`='%s',`LastActive`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['skin'],$_POST['YourOffSet'],$_POST['DST'],$NewDay,$NewIP,$_SESSION['UserID']));
431         mysql_query($querynewskin); } } }
432 if($_GET['act']=="profile") {
433 if($_POST['update']!="now") {
434 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
435 $result=mysql_query($query);
436 $num=mysql_num_rows($result);
437 $i=0;
438 $YourID=mysql_result($result,$i,"id");
439 $User1Interests=mysql_result($result,$i,"Interests"); 
440 $User1Title=mysql_result($result,$i,"Title");
441 $User1Website=mysql_result($result,$i,"Website"); 
442 $User1Gender=mysql_result($result,$i,"Gender");
443 $User1TimeZone=mysql_result($result,$i,"TimeZone");
444 $BirthDay=mysql_result($result,$i,"BirthDay");
445 $BirthMonth=mysql_result($result,$i,"BirthMonth");
446 $BirthYear=mysql_result($result,$i,"BirthYear");
447 $User1Birthday = "MM/DD/YYYY";
448 if($BirthMonth!=null&&$BirthDay!=null&&$BirthYear!=null) { 
449         if($BirthYear=="0") { $BirthYear = "YYYY"; }
450         if($BirthDay=="0") { $BirthDay = "DD"; }
451         if($BirthMonth=="0") { $BirthMonth = "MM"; }
452         if(pre_strlen($BirthMonth)=="1") { $BirthMonth = "0".$BirthMonth; }
453         if(pre_strlen($BirthDay)=="1") { $BirthDay = "0".$BirthDay; }
454         $User1Birthday = $BirthMonth."/".$BirthDay."/".$BirthYear; }
455 $tsa_mem = explode(":",$User1TimeZone);
456 $TimeZoneArray = array("offset" => $User1TimeZone, "hour" => $tsa_mem[0], "minute" => $tsa_mem[1]);
457 $User1DST=mysql_result($result,$i,"DST");
458 $profileact = url_maker($exfile['profile'],$Settings['file_ext'],"act=profile",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
459 $profiletitle = " ".$ThemeSet['TitleDivider']." Profile Editor";
460 ?>
461 <div class="Table1Border">
462 <table class="Table1" style="width: 100%;">
463 <tr class="TableRow1">
464 <td class="TableRow1"><span style="float: left;">
465 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
466 </span><span style="float: right;">&nbsp;</span></td>
467 </tr>
468 <tr id="ProfileTitle" class="TableRow2">
469 <th class="TableRow2">Profile Editor</th>
470 </tr>
471 <tr class="TableRow3" id="ProfileEditor">
472 <td class="TableRow3">
473 <form style="display: inline;" method="post" action="<?php echo $profileact; ?>">
474 <table style="text-align: left;">
475 <tr style="text-align: left;">
476         <td style="width: 40%;"><label class="TextBoxLabel" for="Interests">Your Interests</label></td>
477         <td style="width: 60%;"><input type="text" class="TextBox" name="Interests" id="Interests" value="<?php echo $User1Interests; ?>" /></td>
478 </tr><tr style="text-align: left;">
479         <td style="width: 40%;"><label class="TextBoxLabel" for="Title">Your Title</label></td>
480         <td style="width: 60%;"><input type="text" class="TextBox" name="Title" id="Title" value="<?php echo $User1Title; ?>" /></td>
481 </tr><tr style="text-align: left;">
482         <td style="width: 40%;"><label class="TextBoxLabel" for="Website">Your Website</label></td>
483         <td style="width: 60%;"><input type="text" class="TextBox" name="Website" id="Website" value="<?php echo $User1Website; ?>" /></td>
484 </tr><tr style="text-align: left;">
485         <td style="width: 40%;"><label class="TextBoxLabel" for="EventDay">Your Birthday</label></td>
486         <td style="width: 60%;"><input maxlength="10" type="text" class="TextBox" name="EventDay" id="EventDay" value="<?php echo $User1Birthday; ?>" /></td>
487 </tr><tr style="text-align: left;">
488         <td style="width: 40%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
489         <td style="width: 60%;"><select id="YourOffSet" name="YourOffSet" class="TextBox">
490 <option selected="selected" value="<?php echo $TimeZoneArray['hour']; ?>">Old Value (<?php echo $TimeZoneArray['hour'].":00 hours"; ?>)</option>
491 <?php
492 $plusi = 1; $minusi = 12;
493 $plusnum = 13; $minusnum = 0;
494 while ($minusi > $minusnum) {
495 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n";
496 --$minusi; }
497 ?>
498 <option value="0">GMT +/- 0:00 hours</option>
499 <?php
500 while ($plusi < $plusnum) {
501 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n";
502 ++$plusi; }
503 ?></select></td>
504 </tr><tr style="text-align: left;">
505         <td style="width: 40%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
506         <td style="width: 60%;"><select id="MinOffSet" name="MinOffSet" class="TextBox">
507 <option selected="selected" value="<?php echo $TimeZoneArray['minute']; ?>">Old Value (<?php echo "0:".$TimeZoneArray['minute']." minutes"; ?>)</option>
508 <?php
509 $mini = 0; $minnum = 60;
510 while ($mini < $minnum) {
511 if(pre_strlen($mini)==2) { $showmin = $mini; }
512 if(pre_strlen($mini)==1) { $showmin = "0".$mini; }
513 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n";
514 ++$mini; }
515 ?></select></td>
516 </tr><tr style="text-align: left;">
517         <td style="width: 40%;"><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
518         <td style="width: 60%;"><select id="YourGender" name="YourGender" class="TextBox">
519 <option selected="selected" value="<?php echo $User1Gender; ?>">Old Value (<?php echo $User1Gender; ?>)</option>
520 <option value="Male">Male</option>
521 <option value="Female">Female</option>
522 <option value="Unknow">Unknow</option>
523 </select></td>
524 </tr><tr style="text-align: left;">
525         <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>
526         <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
527 <?php if($User1DST=="off"||$User1DST!="on") { ?>
528 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
529 <?php } if($User1DST=="on") { ?>
530 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
531 <?php } echo "\n" ?></select></td>
532 </tr></table>
533 <table style="text-align: left;">
534 <tr style="text-align: left;">
535 <td style="width: 100%;">
536 <input type="hidden" name="act" value="profile" style="display: none;" />
537 <input type="hidden" name="update" value="now" style="display: none;" />
538 <input type="submit" class="Button" value="Save" />
539 <input class="Button" type="reset" />
540 </td></tr></table>
541 </form></td>
542 </tr>
543 <tr id="ProfileEnd" class="TableRow4">
544 <td class="TableRow4">&nbsp;</td>
545 </tr>
546 </table>
547 </div>
548 <?php @mysql_free_result($result); }
549 if($_POST['update']=="now") {
550 if($_POST['act']=="profile"&&
551         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
552         $_POST['Interests'] = htmlspecialchars($_POST['Interests'], ENT_QUOTES, $Settings['charset']);
553         $_POST['Interests'] = @remove_spaces($_POST['Interests']);
554         $_POST['Title'] = htmlspecialchars($_POST['Title'], ENT_QUOTES, $Settings['charset']);
555         $_POST['Title'] = @remove_spaces($_POST['Title']);
556         $_POST['Website'] = htmlentities($_POST['Website'], ENT_QUOTES, $Settings['charset']);
557         $_POST['Website'] = @remove_spaces($_POST['Website']);
558         //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
559         //$_POST['Signature'] = @remove_spaces($_POST['Signature']);
560         //$_POST['Signature'] = remove_bad_entities($_POST['Signature']);
561         /*    <_<  iWordFilter  >_>      
562     by René Johnson - Cool Dude 2k */
563         $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null));
564         $katarzynart=mysql_query($katarzynaqy);
565         $katarzynanm=mysql_num_rows($katarzynart);
566         $katarzynas=0;
567         while ($katarzynas < $katarzynanm) {
568         $Filter=mysql_result($katarzynart,$katarzynas,"Filter");
569         $Replace=mysql_result($katarzynart,$katarzynas,"Replace");
570         $CaseInsensitive=mysql_result($katarzynart,$katarzynas,"CaseInsensitive");
571         if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
572         if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
573         if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
574         $WholeWord=mysql_result($katarzynart,$katarzynas,"WholeWord");
575         if($WholeWord=="on") { $WholeWord = "yes"; }
576         if($WholeWord=="off") { $WholeWord = "no"; }
577         if($WholeWord!="yes"||$WholeWord!="no") { $WholeWord = "no"; }
578         $Filter = preg_quote($Filter, "/");
579         if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
580         $_POST['Interests'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Interests']);
581         $_POST['Title'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Title']); }
582         if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
583         $_POST['Interests'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Interests']);
584         $_POST['Title'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Title']); }
585         if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
586         $_POST['Interests'] = preg_replace("/".$Filter."/", $Replace, $_POST['Interests']);
587         $_POST['Title'] = preg_replace("/".$Filter."/", $Replace, $_POST['Title']); }
588         if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
589         $_POST['Interests'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Interests']); 
590         $_POST['Title'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Title']); }
591         ++$katarzynas; } @mysql_free_result($katarzynart);
592         if(!isset($_POST['EventDay'])) { $_POST['EventDay'] = null; }
593         if($_POST['EventDay']!=null) {
594         $BirthExpl = explode("/",$_POST['EventDay']);
595         if(count($BirthExpl)=="3") {
596         if(is_numeric($BirthExpl[0])&&is_numeric($BirthExpl[1])&&is_numeric($BirthExpl[2])) {
597         if(pre_strlen($BirthExpl[0])=="1") { $BirthExpl[0] = "0".$BirthExpl[0]; }
598         if(pre_strlen($BirthExpl[1])=="1") { $BirthExpl[1] = "0".$BirthExpl[1]; }
599         if(pre_strlen($BirthExpl[0])=="2"&&pre_strlen($BirthExpl[1])=="2"&&pre_strlen($BirthExpl[2])=="4") {
600         $BirthIn = mktime(12,12,12,$BirthExpl[0],$BirthExpl[1],$BirthExpl[2]);
601         $BirthMonth=GMTimeChange("m",$BirthIn,0,0,"off");
602         $BirthDay=GMTimeChange("d",$BirthIn,0,0,"off");
603         $BirthYear=GMTimeChange("Y",$BirthIn,0,0,"off"); }
604         if(pre_strlen($BirthExpl[0])!="2"||pre_strlen($BirthExpl[1])!="2"||pre_strlen($BirthExpl[2])!="4") { 
605                 $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
606         if (!is_numeric($BirthExpl[0])||!is_numeric($BirthExpl[1])||!is_numeric($BirthExpl[2])) { 
607                 $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
608         if(count($BirthExpl)!="3") { $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
609         if($_POST['EventDay']==null) { $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; }
610         if(!is_numeric($_POST['YourOffSet'])) { $_POST['YourOffSet'] = "0"; }
611         if($_POST['YourOffSet']>12) { $_POST['YourOffSet'] = "12"; }
612         if($_POST['YourOffSet']<-12) { $_POST['YourOffSet'] = "-12"; }
613         if(!is_numeric($_POST['MinOffSet'])) { $_POST['MinOffSet'] = "00"; }
614         if($_POST['MinOffSet']>59) { $_POST['MinOffSet'] = "59"; }
615         if($_POST['MinOffSet']<0) { $_POST['MinOffSet'] = "00"; }
616         $_POST['YourOffSet'] = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
617         $_SESSION['UserTimeZone'] = $_POST['YourOffSet'];
618         $_SESSION['UserDST'] = $_POST['DST'];
619         $NewDay=GMTimeStamp();
620         $NewIP=$_SERVER['REMOTE_ADDR'];
621         $querynewprofile = query("UPDATE `".$Settings['sqltable']."members` SET `Interests`='%s',`Title`='%s',`Website`='%s',`TimeZone`='%s',`Gender`='%s',`DST`='%s',`LastActive`=%i,`BirthMonth`=%i,`BirthDay`=%i,`BirthYear`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['Interests'],$_POST['Title'],$_POST['Website'],$_POST['YourOffSet'],$_POST['YourGender'],$_POST['DST'],$NewDay,$BirthMonth,$BirthDay,$BirthYear,$NewIP,$_SESSION['UserID']));
622         mysql_query($querynewprofile); } } }
623 if($_GET['act']=="userinfo") {
624 if($_POST['update']!="now") {
625 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
626 $result=mysql_query($query);
627 $num=mysql_num_rows($result);
628 $i=0;
629 $YourID=mysql_result($result,$i,"id");
630 $User1Email=mysql_result($result,$i,"Email"); 
631 $userinfoact = url_maker($exfile['profile'],$Settings['file_ext'],"act=userinfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
632 $profiletitle = " ".$ThemeSet['TitleDivider']." User Info Editer";
633 ?>
634 <div class="Table1Border">
635 <table class="Table1" style="width: 100%;">
636 <tr class="TableRow1">
637 <td class="TableRow1"><span style="float: left;">
638 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
639 </span><span style="float: right;">&nbsp;</span></td>
640 </tr>
641 <tr id="ProfileTitle" class="TableRow2">
642 <th class="TableRow2">User Info Editer</th>
643 </tr>
644 <tr class="TableRow3" id="UserInfoEditor">
645 <td class="TableRow3">
646 <form style="display: inline;" method="post" action="<?php echo $userinfoact; ?>">
647 <table style="text-align: left;">
648 <tr style="text-align: left;">
649         <td style="width: 40%;"><label class="TextBoxLabel" for="OldPass">Insert old Password:</label></td>
650         <td style="width: 60%;"><input maxlength="30" type="password" class="TextBox" name="OldPass" size="20" id="OldPass" /></td>
651 </tr><tr style="text-align: left;">
652         <td style="width: 40%;"><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
653         <td style="width: 60%;"><input maxlength="30" type="password" class="TextBox" name="Password" size="20" id="Password" /></td>
654 </tr><tr style="text-align: left;">
655         <td style="width: 40%;"><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
656         <td style="width: 60%;"><input maxlength="30" type="password" class="TextBox" name="RePassword" size="20" id="RePassword" /></td>
657 </tr><tr style="text-align: left;">
658         <td style="width: 40%;"><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
659         <td style="width: 60%;"><input type="text" class="TextBox" name="Email" size="20" id="Email" value="<?php echo $User1Email; ?>" /></td>
660 </tr></table>
661 <table style="text-align: left;">
662 <tr style="text-align: left;">
663 <td style="width: 100%;">
664 <input type="hidden" name="act" value="userinfo" style="display: none;" />
665 <input type="hidden" name="update" value="now" style="display: none;" />
666 <input type="submit" class="Button" value="Save" />
667 <input class="Button" type="reset" />
668 </td></tr></table>
669 </form></td>
670 </tr>
671 <tr id="ProfileEnd" class="TableRow4">
672 <td class="TableRow4">&nbsp;</td>
673 </tr>
674 </table>
675 </div>
676 <?php @mysql_free_result($result); }
677 if($_POST['update']=="now") {
678 if($_POST['act']=="userinfo"&&
679         $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
680         $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
681         $result=mysql_query($query);
682         $num=mysql_num_rows($result);
683         $i=0;
684         $OldPassword=mysql_result($result,$i,"Password");
685         $OldHashType=mysql_result($result,$i,"HashType");
686         $OldJoined=mysql_result($result,$i,"Joined");
687         $OldSalt=mysql_result($result,$i,"Salt");
688         $UpdateHash = false; $NewSalt = salt_hmac(); 
689 if($OldHashType=="ODFH") { 
690         $YourPassword = sha1(md5($_POST['OldPass']));
691         $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
692 if($OldHashType=="DF4H") { 
693         $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1");
694         $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
695 if($OldHashType=="iDBH"&&$UpdateHash!=true) { 
696         $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1");
697         $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
698 if($YourPassword!=$OldPassword) { $Error="Yes"; ?>
699 <div class="TableMessage" style="text-align: center;">Your old Password did not match.<br />&nbsp;</div>
700 <?php } if(pre_strlen($_POST['Password'])=="30") { $Error="Yes"; ?>
701 <div class="TableMessage" style="text-align: center;">Your password is too big.<br />&nbsp;</div>
702 <?php } if(pre_strlen($_POST['OldPass'])=="30") { $Error="Yes"; ?>
703 <div class="TableMessage" style="text-align: center;">Your old password is too big.<br />&nbsp;</div>
704 <?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes";  ?>
705 <div class="TableMessage" style="text-align: center;">Your passwords did not match.<br />&nbsp;</div>
706 <?php }
707         $NewDay=GMTimeStamp();
708         $NewIP=$_SERVER['REMOTE_ADDR'];
709         if ($Error!="Yes") { $_SESSION['UserPass']=$NewPassword;
710         if($cookieDomain==null) {
711         @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
712         if($cookieDomain!=null) {
713         if($cookieSecure==true) {
714         @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
715         if($cookieSecure==false) {
716         @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } }
717         $_POST['Email'] = @remove_spaces($_POST['Email']);
718         $querynewuserinfo = query("UPDATE `".$Settings['sqltable']."members` SET `Password`='%s',`HashType`='iDBH',`Email`='%s',`LastActive`=%i,`IP`='%s',`Salt`='%s' WHERE `id`=%i", array($NewPassword,$_POST['Email'],$NewDay,$NewIP,$NewSalt,$_SESSION['UserID']));
719         mysql_query($querynewuserinfo); } } } }
720 ?>
721 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
722         $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
723 </td></tr>
724 <tr id="ProfileTitleEnd" class="TableRow4">
725 <td class="TableRow4">&nbsp;</td>
726 </tr></table></div><?php } ?>
727 </td></tr>
728 </table>
729 <div>&nbsp;</div>