OSDN Git Service

Another small update.
[idb/iDB.git.git] / inc / profilemain.php
index 5471a03..80fcac0 100644 (file)
@@ -8,10 +8,10 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     Revised BSD License for more details.
 
-    Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
-    Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
+    Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
+    Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: profilemain.php - Last Update: 11/10/2007 SVN 124 - Author: cooldude2k $
+    $FileInfo: profilemain.php - Last Update: 12/12/2008 SVN 215 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="profilemain.php"||$File3Name=="/profilemain.php") {
@@ -25,37 +25,54 @@ ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
 if(!isset($_POST['update'])) { $_POST['update'] = null; }
 ?>
+<div class="NavLinks"><?php echo $ThemeSet['NavLinkIcon']; ?><a href="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">Board index</a><?php echo $ThemeSet['NavLinkDivider']; ?><a href="<?php echo url_maker($exfile['profile'],$Settings['file_ext'],"act=".$_GET['act'],$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); ?>">Profile Editor</a></div>
+<div class="DivNavLinks">&nbsp;</div>
 <table class="Table3">
 <tr style="width: 100%; vertical-align: top;">
        <td style="width: 15%; vertical-align: top;">
-       <table id="ProfileLinks" class="Table1" style="width: 100%; float: left; vertical-align: top;">
-<tr class="TableRow1">
-<td class="TableRow1"><?php echo $ThemeSet['TitleIcon'] ?>Profile Settings</td>
-</tr><tr class="TableRow2">
-<td class="TableRow2">&nbsp;</td>
-</tr><tr class="TableRow3">
-<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>
-</tr><tr class="TableRow3">
-<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>
-</tr><tr class="TableRow3">
-<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>
-</tr><tr class="TableRow3">
-<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>
-</tr><tr class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
-</tr></table><div>&nbsp;</div>
-<table class="Table1" style="width: 100%; float: left; vertical-align: top;">
-<tr class="TableRow1">
-<td class="TableRow1"><?php echo $ThemeSet['TitleIcon'] ?>Board Settings</td>
-</tr><tr class="TableRow2">
-<td class="TableRow2">&nbsp;</td>
-</tr><tr class="TableRow3">
-<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>
-</tr><tr class="TableRow3">
-<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>
-</tr><tr class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
-</tr></table>
+       <div class="TableSMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableSMenuRow1">
+<?php echo $ThemeSet['TitleIcon']; ?>Profile Settings</div>
+<?php } ?>
+<table id="ProfileLinks" class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableSMenuRow1">
+<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Profile Settings</td>
+</tr><?php } ?>
+<tr class="TableSMenuRow2">
+<td class="TableSMenuColumn2">&nbsp;</td>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><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>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><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>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><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>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><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>
+</tr><tr class="TableSMenuRow4">
+<td class="TableSMenuColumn4">&nbsp;</td>
+</tr></table></div>
+<div class="DivSMenu">&nbsp;</div>
+<div class="TableSMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableSMenuRow1">
+<?php echo $ThemeSet['TitleIcon']; ?>Board Settings</div>
+<?php } ?>
+<table class="TableSMenu" style="width: 100%; text-align: left; vertical-align: top;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableSMenuRow1">
+<td class="TableSMenuColumn1"><?php echo $ThemeSet['TitleIcon']; ?>Board Settings</td>
+</tr><?php } ?>
+<tr class="TableSMenuRow2">
+<td class="TableSMenuColumn2">&nbsp;</td>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><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>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><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>
+</tr><tr class="TableSMenuRow4">
+<td class="TableSMenuColumn4">&nbsp;</td>
+</tr></table></div>
 </td>
        <td style="width: 85%; vertical-align: top;">
 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
@@ -65,23 +82,30 @@ $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
 $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
 ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">Updating Settings</th>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $updateact; ?>">Updating Settings</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">Updating Settings</th>
 </tr>
-<tr class="TableRow3" id="ProfileUpdate">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="ProfileUpdate">
+<td class="TableMenuColumn3">
 <div style="text-align: center;">
 <br />Profile updated <a href="<?php echo $updateact; ?>">click here</a> to go back. ^_^<br />&nbsp;</div>
 <?php } if($_GET['act']=="view") {
 if($_POST['update']!="now") {
-$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
 $i=0;
@@ -90,18 +114,25 @@ $Notes=mysql_result($result,$i,"Notes");
 $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
 $notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad";
 ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $noteact; ?>">NotePad</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">NotePad</th>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $noteact; ?>">NotePad</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">NotePad</th>
 </tr>
-<tr class="TableRow3" id="NotePadRow">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="NotePadRow">
+<td class="TableMenuColumn3">
 <form style="display: inline;" method="post" action="<?php echo $notepadact; ?>"><div style="text-align: center;">
 <label class="TextBoxLabel" for="NotePad">Your NotePad</label><br />
 <textarea class="TextBox" name="NotePad" id="NotePad" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Notes; ?></textarea>
@@ -110,8 +141,8 @@ $notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad"
 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
 </div></form></td>
 </tr>
-<tr id="ProfileEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr>
 </table>
 </div>
@@ -121,13 +152,43 @@ if($_POST['act']=="view"&&
        $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
        $_POST['NotePad'] = htmlspecialchars($_POST['NotePad'], ENT_QUOTES, $Settings['charset']);
        $_POST['NotePad'] = remove_bad_entities($_POST['NotePad']);
+       //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
+       //$_POST['Signature'] = @remove_spaces($_POST['Signature']);
+       //$_POST['Signature'] = remove_bad_entities($_POST['Signature']);
+       /*    <_<  iWordFilter  >_>      
+    by Kazuki Przyborowski - Cool Dude 2k */
+       $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null));
+       $katarzynart=mysql_query($katarzynaqy);
+       $katarzynanm=mysql_num_rows($katarzynart);
+       $katarzynas=0;
+       while ($katarzynas < $katarzynanm) {
+       $Filter=mysql_result($katarzynart,$katarzynas,"Filter");
+       $Replace=mysql_result($katarzynart,$katarzynas,"Replace");
+       $CaseInsensitive=mysql_result($katarzynart,$katarzynas,"CaseInsensitive");
+       if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
+       if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
+       if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
+       $WholeWord=mysql_result($katarzynart,$katarzynas,"WholeWord");
+       if($WholeWord=="on") { $WholeWord = "yes"; }
+       if($WholeWord=="off") { $WholeWord = "no"; }
+       if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
+       $Filter = preg_quote($Filter, "/");
+       if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
+       $_POST['NotePad'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['NotePad']); }
+       if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
+       $_POST['NotePad'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['NotePad']); }
+       if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
+       $_POST['NotePad'] = preg_replace("/".$Filter."/", $Replace, $_POST['NotePad']); }
+       if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
+       $_POST['NotePad'] = preg_replace("/".$Filter."/i", $Replace, $_POST['NotePad']); }
+       ++$katarzynas; } @mysql_free_result($katarzynart);
        $NewDay=GMTimeStamp();
        $NewIP=$_SERVER['REMOTE_ADDR'];
        $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `Notes`='%s',`LastActive`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['NotePad'],$NewDay,$NewIP,$_SESSION['UserID']));
                mysql_query($querynewskin); } } }
 if($_GET['act']=="signature") {
 if($_POST['update']!="now") {
-$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
 $i=0;
@@ -136,18 +197,25 @@ $Signature=mysql_result($result,$i,"Signature");
 $signatureact = url_maker($exfile['profile'],$Settings['file_ext'],"act=signature",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
 $profiletitle = " ".$ThemeSet['TitleDivider']." Signature Editor";
 ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">Signature Editor</th>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $signatureact; ?>">Signature Editer</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">Signature Editor</th>
 </tr>
-<tr class="TableRow3" id="SignatureRow">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="SignatureRow">
+<td class="TableMenuColumn3">
 <form style="display: inline;" method="post" action="<?php echo $signatureact; ?>"><div style="text-align: center;">
 <label class="TextBoxLabel" for="Signature">Your Signature</label><br />
 <textarea class="TextBox" name="Signature" id="Signature" style="width: 75%; height: 128px;" rows="10" cols="84"><?php echo $Signature; ?></textarea>
@@ -156,8 +224,8 @@ $profiletitle = " ".$ThemeSet['TitleDivider']." Signature Editor";
 <br /><input type="submit" class="Button" value="Save" />&nbsp;<input class="Button" type="reset" />
 </div></form></td>
 </tr>
-<tr id="ProfileEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr>
 </table>
 </div>
@@ -169,13 +237,40 @@ if($_POST['act']=="signature"&&
        //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
        //$_POST['Signature'] = @remove_spaces($_POST['Signature']);
        $_POST['Signature'] = remove_bad_entities($_POST['Signature']);
+       /*    <_<  iWordFilter  >_>      
+    by Kazuki Przyborowski - Cool Dude 2k */
+       $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null));
+       $katarzynart=mysql_query($katarzynaqy);
+       $katarzynanm=mysql_num_rows($katarzynart);
+       $katarzynas=0;
+       while ($katarzynas < $katarzynanm) {
+       $Filter=mysql_result($katarzynart,$katarzynas,"Filter");
+       $Replace=mysql_result($katarzynart,$katarzynas,"Replace");
+       $CaseInsensitive=mysql_result($katarzynart,$katarzynas,"CaseInsensitive");
+       if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
+       if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
+       if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
+       $WholeWord=mysql_result($katarzynart,$katarzynas,"WholeWord");
+       if($WholeWord=="on") { $WholeWord = "yes"; }
+       if($WholeWord=="off") { $WholeWord = "no"; }
+       if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
+       $Filter = preg_quote($Filter, "/");
+       if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
+       $_POST['Signature'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Signature']); }
+       if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
+       $_POST['Signature'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Signature']); }
+       if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
+       $_POST['Signature'] = preg_replace("/".$Filter."/", $Replace, $_POST['Signature']); }
+       if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
+       $_POST['Signature'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Signature']); }
+       ++$katarzynas; } @mysql_free_result($katarzynart);
        $NewDay=GMTimeStamp();
        $NewIP=$_SERVER['REMOTE_ADDR'];
        $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `Signature`='%s',`LastActive`=%i,`IP`='%s' WHERE `id`=%i", array($_POST['Signature'],$NewDay,$NewIP,$_SESSION['UserID']));
        mysql_query($querynewskin); } } }
 if($_GET['act']=="avatar") {
 if($_POST['update']!="now") {
-$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
 $i=0;
@@ -186,24 +281,32 @@ $avataract = url_maker($exfile['profile'],$Settings['file_ext'],"act=avatar",$Se
 $profiletitle = " ".$ThemeSet['TitleDivider']." Avatar Editor";
 $Pre1Avatar = $User1Avatar;
 if ($User1Avatar==null) { $User1Avatar="http://"; }
-if ($Pre1Avatar=="http://"||$Pre1Avatar==null) {
+if ($Pre1Avatar=="http://"||$Pre1Avatar==null||
+       strtolower($Pre1Avatar)=="noavatar") {
 $Pre1Avatar=$ThemeSet['NoAvatar'];
 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
 $AvatarSize1=explode("x", $User1AvatarSize);
 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
 ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
-</span><span style="float: right;">&nbsp;</span></td>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $avataract; ?>">Avatar Editer</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">Avatar Editor</th>
 </tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">Avatar Editor</th>
-</tr>
-<tr class="TableRow3" id="AvatarEditor">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="AvatarEditor">
+<td class="TableMenuColumn3">
 <form style="display: inline;" method="post" action="<?php echo $avataract; ?>">
  <?php  /* Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/ */  ?>
  <table class="AvatarTable" style="width: 100px; height: 100px; text-align: center;">
@@ -238,8 +341,8 @@ $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
 </td></tr></table>
 </form></td>
 </tr>
-<tr id="ProfileEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr>
 </table>
 </div>
@@ -247,7 +350,9 @@ $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
 if($_POST['update']=="now") {
 if($_POST['Avatar']!=null&&$_POST['AvatarSizeW']!=null&&$_POST['AvatarSizeH']!=null&&
        $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
+       if(!is_numeric($_POST['AvatarSizeW'])) { $_POST['AvatarSizeW'] = 100; }
        if($_POST['AvatarSizeW']>=100) { $_POST['AvatarSizeW']=100; }
+       if(!is_numeric($_POST['AvatarSizeH'])) { $_POST['AvatarSizeH'] = 100; }
        if($_POST['AvatarSizeH']>=100) { $_POST['AvatarSizeH']=100; }
        $fullavatarsize = $_POST['AvatarSizeW']."x".$_POST['AvatarSizeH'];
        $_POST['Avatar'] = htmlentities($_POST['Avatar'], ENT_QUOTES, $Settings['charset']);
@@ -258,7 +363,7 @@ if($_POST['Avatar']!=null&&$_POST['AvatarSizeW']!=null&&$_POST['AvatarSizeH']!=n
        mysql_query($querynewskin); } } }
 if($_GET['act']=="settings") {
 if($_POST['update']!="now") {
-$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
 $i=0;
@@ -269,18 +374,25 @@ $TimeZoneArray = array("offset" => $User1TimeZone, "hour" => $tsa_mem[0], "minut
 $User1DST=mysql_result($result,$i,"DST");
 $settingsact = url_maker($exfile['profile'],$Settings['file_ext'],"act=settings",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
 $profiletitle = " ".$ThemeSet['TitleDivider']." Board Settings"; ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">Board Settings</th>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $settingsact; ?>">Board Settings</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">Board Settings</th>
 </tr>
-<tr class="TableRow3" id="BoardSettings">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="BoardSettings">
+<td class="TableMenuColumn3">
 <form style="display: inline;" method="post" action="<?php echo $settingsact; ?>">
 <table style="text-align: left;">
 <tr style="text-align: left;">
@@ -307,8 +419,8 @@ echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n";
 <?php
 $mini = 0; $minnum = 60;
 while ($mini < $minnum) {
-if(strlen($mini)==2) { $showmin = $mini; }
-if(strlen($mini)==1) { $showmin = "0".$mini; }
+if(pre_strlen($mini)==2) { $showmin = $mini; }
+if(pre_strlen($mini)==1) { $showmin = "0".$mini; }
 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n";
 ++$mini; }
 ?></select></td>
@@ -332,6 +444,39 @@ if ($handle = opendir($skindir)) { $dirnum = null;
    ++$themei; }
 } ?></select></td>
 </tr><tr style="text-align: left;">
+       <td style="width: 40%;"><label class="TextBoxLabel" for="RepliesPerPage">Replies Per Page:</label></td>
+       <td style="width: 60%;"><select id="RepliesPerPage" name="RepliesPerPage" class="TextBox">
+<option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
+<option value="5">5</option>
+<option value="10">10</option>
+<option value="15">15</option>
+<option value="20">20</option>
+<option value="25">25</option>
+<option value="30">30</option>
+</select></td>
+</tr><tr style="text-align: left;">
+       <td style="width: 40%;"><label class="TextBoxLabel" for="TopicsPerPage">Topics Per Page:</label></td>
+       <td style="width: 60%;"><select id="TopicsPerPage" name="TopicsPerPage" class="TextBox">
+<option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
+<option value="5">5</option>
+<option value="10">10</option>
+<option value="15">15</option>
+<option value="20">20</option>
+<option value="25">25</option>
+<option value="30">30</option>
+</select></td>
+</tr><tr style="text-align: left;">
+       <td style="width: 40%;"><label class="TextBoxLabel" for="MessagesPerPage">Messages/Members Per Page:</label></td>
+       <td style="width: 60%;"><select id="MessagesPerPage" name="MessagesPerPage" class="TextBox">
+<option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
+<option value="5">5</option>
+<option value="10">10</option>
+<option value="15">15</option>
+<option value="20">20</option>
+<option value="25">25</option>
+<option value="30">30</option>
+</select></td>
+</tr><tr style="text-align: left;">
        <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>
        <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
 <?php if($User1DST=="off"||$User1DST!="on") { ?>
@@ -350,8 +495,8 @@ if ($handle = opendir($skindir)) { $dirnum = null;
 </td></tr></table>
 </form></td>
 </tr>
-<tr id="ProfileEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr>
 </table>
 </div>
@@ -370,11 +515,14 @@ if($_POST['act']=="settings"&&
        $_POST['YourOffSet'] = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
        $_SESSION['UserTimeZone'] = $_POST['YourOffSet'];
        $_SESSION['UserDST'] = $_POST['DST'];
-       $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']));
+       if(!is_numeric($_POST['RepliesPerPage'])) { $_POST['RepliesPerPage'] = "10"; }
+       if(!is_numeric($_POST['TopicsPerPage'])) { $_POST['TopicsPerPage'] = "10"; }
+       if(!is_numeric($_POST['MessagesPerPage'])) { $_POST['MessagesPerPage'] = "10"; }
+       $querynewskin = query("UPDATE `".$Settings['sqltable']."members` SET `UseTheme`='%s',`TimeZone`='%s',`DST`='%s',`LastActive`=%i,RepliesPerPage=%i,TopicsPerPage=%i,MessagesPerPage=%i,`IP`='%s' WHERE `id`=%i", array($_POST['skin'],$_POST['YourOffSet'],$_POST['DST'],$NewDay,$_POST['RepliesPerPage'],$_POST['TopicsPerPage'],$_POST['MessagesPerPage'],$NewIP,$_SESSION['UserID']));
        mysql_query($querynewskin); } } }
 if($_GET['act']=="profile") {
 if($_POST['update']!="now") {
-$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
 $i=0;
@@ -392,8 +540,11 @@ if($BirthMonth!=null&&$BirthDay!=null&&$BirthYear!=null) {
        if($BirthYear=="0") { $BirthYear = "YYYY"; }
        if($BirthDay=="0") { $BirthDay = "DD"; }
        if($BirthMonth=="0") { $BirthMonth = "MM"; }
-       if(strlen($BirthMonth)=="1") { $BirthMonth = "0".$BirthMonth; }
-       if(strlen($BirthDay)=="1") { $BirthDay = "0".$BirthDay; }
+       if(pre_strlen($BirthMonth)=="1") { $BirthMonth = "0".$BirthMonth; }
+       if(pre_strlen($BirthDay)=="1") { $BirthDay = "0".$BirthDay; }
+    if($BirthYear!="MM"&&$BirthYear!="DD"&&$BirthYear!="YYYY"&&
+       checkdate($BirthMonth,$BirthDay,$BirthYear)===false) {
+       $BirthMonth = "MM"; $BirthDay = "DD"; $BirthYear = "YYYY"; }
        $User1Birthday = $BirthMonth."/".$BirthDay."/".$BirthYear; }
 $tsa_mem = explode(":",$User1TimeZone);
 $TimeZoneArray = array("offset" => $User1TimeZone, "hour" => $tsa_mem[0], "minute" => $tsa_mem[1]);
@@ -401,18 +552,25 @@ $User1DST=mysql_result($result,$i,"DST");
 $profileact = url_maker($exfile['profile'],$Settings['file_ext'],"act=profile",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
 $profiletitle = " ".$ThemeSet['TitleDivider']." Profile Editor";
 ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">Profile Editor</th>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $profileact; ?>">Profile Editer</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">Profile Editor</th>
 </tr>
-<tr class="TableRow3" id="ProfileEditor">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="ProfileEditor">
+<td class="TableMenuColumn3">
 <form style="display: inline;" method="post" action="<?php echo $profileact; ?>">
 <table style="text-align: left;">
 <tr style="text-align: left;">
@@ -451,8 +609,8 @@ echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n";
 <?php
 $mini = 0; $minnum = 60;
 while ($mini < $minnum) {
-if(strlen($mini)==2) { $showmin = $mini; }
-if(strlen($mini)==1) { $showmin = "0".$mini; }
+if(pre_strlen($mini)==2) { $showmin = $mini; }
+if(pre_strlen($mini)==1) { $showmin = "0".$mini; }
 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n";
 ++$mini; }
 ?></select></td>
@@ -465,6 +623,39 @@ echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n";
 <option value="Unknow">Unknow</option>
 </select></td>
 </tr><tr style="text-align: left;">
+       <td style="width: 40%;"><label class="TextBoxLabel" for="RepliesPerPage">Replies Per Page:</label></td>
+       <td style="width: 60%;"><select id="RepliesPerPage" name="RepliesPerPage" class="TextBox">
+<option selected="selected" value="<?php echo $Settings['max_posts']; ?>">Old Value (<?php echo $Settings['max_posts']; ?>)</option>
+<option value="5">5</option>
+<option value="10">10</option>
+<option value="15">15</option>
+<option value="20">20</option>
+<option value="25">25</option>
+<option value="30">30</option>
+</select></td>
+</tr><tr style="text-align: left;">
+       <td style="width: 40%;"><label class="TextBoxLabel" for="TopicsPerPage">Topics Per Page:</label></td>
+       <td style="width: 60%;"><select id="TopicsPerPage" name="TopicsPerPage" class="TextBox">
+<option selected="selected" value="<?php echo $Settings['max_topics']; ?>">Old Value (<?php echo $Settings['max_topics']; ?>)</option>
+<option value="5">5</option>
+<option value="10">10</option>
+<option value="15">15</option>
+<option value="20">20</option>
+<option value="25">25</option>
+<option value="30">30</option>
+</select></td>
+</tr><tr style="text-align: left;">
+       <td style="width: 40%;"><label class="TextBoxLabel" for="MessagesPerPage">Messages/Members Per Page:</label></td>
+       <td style="width: 60%;"><select id="MessagesPerPage" name="MessagesPerPage" class="TextBox">
+<option selected="selected" value="<?php echo $Settings['max_pmlist']; ?>">Old Value (<?php echo $Settings['max_pmlist']; ?>)</option>
+<option value="5">5</option>
+<option value="10">10</option>
+<option value="15">15</option>
+<option value="20">20</option>
+<option value="25">25</option>
+<option value="30">30</option>
+</select></td>
+</tr><tr style="text-align: left;">
        <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>
        <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
 <?php if($User1DST=="off"||$User1DST!="on") { ?>
@@ -483,8 +674,8 @@ echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n";
 </td></tr></table>
 </form></td>
 </tr>
-<tr id="ProfileEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr>
 </table>
 </div>
@@ -498,22 +689,67 @@ if($_POST['act']=="profile"&&
        $_POST['Title'] = @remove_spaces($_POST['Title']);
        $_POST['Website'] = htmlentities($_POST['Website'], ENT_QUOTES, $Settings['charset']);
        $_POST['Website'] = @remove_spaces($_POST['Website']);
+       //$_POST['Signature'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['Signature']);
+       //$_POST['Signature'] = @remove_spaces($_POST['Signature']);
+       //$_POST['Signature'] = remove_bad_entities($_POST['Signature']);
+       /*    <_<  iWordFilter  >_>      
+    by Kazuki Przyborowski - Cool Dude 2k */
+       $katarzynaqy=query("SELECT * FROM `".$Settings['sqltable']."wordfilter`", array(null));
+       $katarzynart=mysql_query($katarzynaqy);
+       $katarzynanm=mysql_num_rows($katarzynart);
+       $katarzynas=0;
+       while ($katarzynas < $katarzynanm) {
+       $Filter=mysql_result($katarzynart,$katarzynas,"Filter");
+       $Replace=mysql_result($katarzynart,$katarzynas,"Replace");
+       $CaseInsensitive=mysql_result($katarzynart,$katarzynas,"CaseInsensitive");
+       if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
+       if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
+       if($CaseInsensitive!="yes"||$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
+       $WholeWord=mysql_result($katarzynart,$katarzynas,"WholeWord");
+       if($WholeWord=="on") { $WholeWord = "yes"; }
+       if($WholeWord=="off") { $WholeWord = "no"; }
+       if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
+       $Filter = preg_quote($Filter, "/");
+       if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
+       $_POST['Interests'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Interests']);
+       $_POST['Title'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['Title']); }
+       if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
+       $_POST['Interests'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Interests']);
+       $_POST['Title'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['Title']); }
+       if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
+       $_POST['Interests'] = preg_replace("/".$Filter."/", $Replace, $_POST['Interests']);
+       $_POST['Title'] = preg_replace("/".$Filter."/", $Replace, $_POST['Title']); }
+       if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
+       $_POST['Interests'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Interests']); 
+       $_POST['Title'] = preg_replace("/".$Filter."/i", $Replace, $_POST['Title']); }
+       ++$katarzynas; } @mysql_free_result($katarzynart);
+       if(!is_numeric($_POST['RepliesPerPage'])) { $_POST['RepliesPerPage'] = "10"; }
+       if(!is_numeric($_POST['TopicsPerPage'])) { $_POST['TopicsPerPage'] = "10"; }
+       if(!is_numeric($_POST['MessagesPerPage'])) { $_POST['MessagesPerPage'] = "10"; }
        if(!isset($_POST['EventDay'])) { $_POST['EventDay'] = null; }
        if($_POST['EventDay']!=null) {
        $BirthExpl = explode("/",$_POST['EventDay']);
-       if(count($BirthExpl)=="3") {
+       if(count($BirthExpl)!="3") { 
+       $BirthExpl[0] = "0"; $BirthExpl[1] = "0"; $BirthExpl[2] = "0"; }
+       if(!is_numeric($BirthExpl[0])) { $BirthExpl[0] = "0"; }
+       if(!is_numeric($BirthExpl[1])) { $BirthExpl[1] = "0"; }
+       if(!is_numeric($BirthExpl[2])) { $BirthExpl[2] = "0"; }
+       if(count($BirthExpl)=="3"&&checkdate($BirthExpl[0],$BirthExpl[1],$BirthExpl[2])===true) {
        if(is_numeric($BirthExpl[0])&&is_numeric($BirthExpl[1])&&is_numeric($BirthExpl[2])) {
-       if(strlen($BirthExpl[0])=="1") { $BirthExpl[0] = "0".$BirthExpl[0]; }
-       if(strlen($BirthExpl[1])=="1") { $BirthExpl[1] = "0".$BirthExpl[1]; }
-       if(strlen($BirthExpl[0])=="2"&&strlen($BirthExpl[1])=="2"&&strlen($BirthExpl[2])=="4") {
+       if(pre_strlen($BirthExpl[0])=="1") { $BirthExpl[0] = "0".$BirthExpl[0]; }
+       if(pre_strlen($BirthExpl[1])=="1") { $BirthExpl[1] = "0".$BirthExpl[1]; }
+       if(pre_strlen($BirthExpl[0])=="2"&&pre_strlen($BirthExpl[1])=="2"&&pre_strlen($BirthExpl[2])=="4") {
        $BirthIn = mktime(12,12,12,$BirthExpl[0],$BirthExpl[1],$BirthExpl[2]);
        $BirthMonth=GMTimeChange("m",$BirthIn,0,0,"off");
        $BirthDay=GMTimeChange("d",$BirthIn,0,0,"off");
        $BirthYear=GMTimeChange("Y",$BirthIn,0,0,"off"); }
-       if(strlen($BirthExpl[0])!="2"||strlen($BirthExpl[1])!="2"||strlen($BirthExpl[2])!="4") { 
+       if(pre_strlen($BirthExpl[0])!="2"||pre_strlen($BirthExpl[1])!="2"||pre_strlen($BirthExpl[2])!="4") { 
                $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
        if (!is_numeric($BirthExpl[0])||!is_numeric($BirthExpl[1])||!is_numeric($BirthExpl[2])) { 
                $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
+       if(count($BirthExpl)=="3"&&
+       checkdate($BirthExpl[0],$BirthExpl[1],$BirthExpl[2])===false) {
+       $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; }
        if(count($BirthExpl)!="3") { $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; } }
        if($_POST['EventDay']==null) { $BirthMonth="0"; $BirthDay="0"; $BirthYear="0"; }
        if(!is_numeric($_POST['YourOffSet'])) { $_POST['YourOffSet'] = "0"; }
@@ -527,11 +763,11 @@ if($_POST['act']=="profile"&&
        $_SESSION['UserDST'] = $_POST['DST'];
        $NewDay=GMTimeStamp();
        $NewIP=$_SERVER['REMOTE_ADDR'];
-       $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']));
+       $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,RepliesPerPage=%i,TopicsPerPage=%i,MessagesPerPage=%i,`IP`='%s' WHERE `id`=%i", array($_POST['Interests'],$_POST['Title'],$_POST['Website'],$_POST['YourOffSet'],$_POST['YourGender'],$_POST['DST'],$NewDay,$BirthMonth,$BirthDay,$BirthYear,$_POST['RepliesPerPage'],$_POST['TopicsPerPage'],$_POST['MessagesPerPage'],$NewIP,$_SESSION['UserID']));
        mysql_query($querynewprofile); } } }
 if($_GET['act']=="userinfo") {
 if($_POST['update']!="now") {
-$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+$query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
 $result=mysql_query($query);
 $num=mysql_num_rows($result);
 $i=0;
@@ -540,18 +776,25 @@ $User1Email=mysql_result($result,$i,"Email");
 $userinfoact = url_maker($exfile['profile'],$Settings['file_ext'],"act=userinfo",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']);
 $profiletitle = " ".$ThemeSet['TitleDivider']." User Info Editer";
 ?>
-<div class="Table1Border">
-<table class="Table1" style="width: 100%;">
-<tr class="TableRow1">
-<td class="TableRow1"><span style="float: left;">
-<?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
-</span><span style="float: right;">&nbsp;</span></td>
-</tr>
-<tr id="ProfileTitle" class="TableRow2">
-<th class="TableRow2">User Info Editer</th>
+<div class="TableMenuBorder">
+<?php if($ThemeSet['TableStyle']=="div") { ?>
+<div class="TableMenuRow1">
+<span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
+</span></div>
+<?php } ?>
+<table class="TableMenu" style="width: 100%;">
+<?php if($ThemeSet['TableStyle']=="table") { ?>
+<tr class="TableMenuRow1">
+<td class="TableMenuColumn1"><span style="text-align: left;">
+<?php echo $ThemeSet['TitleIcon']; ?><a href="<?php echo $userinfoact; ?>">User Info Editer</a>
+</span></td>
+</tr><?php } ?>
+<tr id="ProfileTitle" class="TableMenuRow2">
+<th class="TableMenuColumn2">User Info Editer</th>
 </tr>
-<tr class="TableRow3" id="UserInfoEditor">
-<td class="TableRow3">
+<tr class="TableMenuRow3" id="UserInfoEditor">
+<td class="TableMenuColumn3">
 <form style="display: inline;" method="post" action="<?php echo $userinfoact; ?>">
 <table style="text-align: left;">
 <tr style="text-align: left;">
@@ -577,8 +820,8 @@ $profiletitle = " ".$ThemeSet['TitleDivider']." User Info Editer";
 </td></tr></table>
 </form></td>
 </tr>
-<tr id="ProfileEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr>
 </table>
 </div>
@@ -586,7 +829,7 @@ $profiletitle = " ".$ThemeSet['TitleDivider']." User Info Editer";
 if($_POST['update']=="now") {
 if($_POST['act']=="userinfo"&&
        $_SESSION['UserGroup']!=$Settings['GuestGroup']) {
-       $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i", array($_SESSION['UserID']));
+       $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
        $result=mysql_query($query);
        $num=mysql_num_rows($result);
        $i=0;
@@ -601,14 +844,14 @@ if($OldHashType=="ODFH") {
 if($OldHashType=="DF4H") { 
        $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1");
        $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
-if($OldHashType=="iDBH"&&$UpdateHash!=true) { 
+if($OldHashType=="iDBH"&&$UpdateHash!==true) { 
        $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1");
        $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); }
 if($YourPassword!=$OldPassword) { $Error="Yes"; ?>
 <div class="TableMessage" style="text-align: center;">Your old Password did not match.<br />&nbsp;</div>
-<?php } if(strlen($_POST['Password'])=="30") { $Error="Yes"; ?>
+<?php } if(pre_strlen($_POST['Password'])=="30") { $Error="Yes"; ?>
 <div class="TableMessage" style="text-align: center;">Your password is too big.<br />&nbsp;</div>
-<?php } if(strlen($_POST['OldPass'])=="30") { $Error="Yes"; ?>
+<?php } if(pre_strlen($_POST['OldPass'])=="30") { $Error="Yes"; ?>
 <div class="TableMessage" style="text-align: center;">Your old password is too big.<br />&nbsp;</div>
 <?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes";  ?>
 <div class="TableMessage" style="text-align: center;">Your passwords did not match.<br />&nbsp;</div>
@@ -619,9 +862,9 @@ if($YourPassword!=$OldPassword) { $Error="Yes"; ?>
        if($cookieDomain==null) {
        @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
        if($cookieDomain!=null) {
-       if($cookieSecure==true) {
+       if($cookieSecure===true) {
        @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
-       if($cookieSecure==false) {
+       if($cookieSecure===false) {
        @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } }
        $_POST['Email'] = @remove_spaces($_POST['Email']);
        $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']));
@@ -630,9 +873,9 @@ if($YourPassword!=$OldPassword) { $Error="Yes"; ?>
 <?php if($_POST['update']=="now"&&$_GET['act']!=null) {
        $profiletitle = " ".$ThemeSet['TitleDivider']." Updating Settings"; ?>
 </td></tr>
-<tr id="ProfileTitleEnd" class="TableRow4">
-<td class="TableRow4">&nbsp;</td>
+<tr id="ProfileTitleEnd" class="TableMenuRow4">
+<td class="TableMenuColumn4">&nbsp;</td>
 </tr></table></div><?php } ?>
 </td></tr>
 </table>
-<div>&nbsp;</div>
\ No newline at end of file
+<div class="DivProfile">&nbsp;</div>
\ No newline at end of file