"; else print "The administrator has disabled new signups.
"; } else { $options = $reg[showemail] + $reg[showicq] + $reg[showaim] + $reg[showyahoo] + $reg[showbirthday] + $reg[showhomepage] + $reg[notification]; $birthday = $reg[year].convert($reg[month]).convert($reg[day]); if ($method == "new") { if (!$reg[email]) $regerror .= "You did not enter an email address.
"; else { $existinguser = db_numrows_sql("SELECT * FROM $config[utable] WHERE email='$reg[email]'"); if ($existinguser > 0 && !$config[allow_multiple_accts]) $regerror .= "The email adress you entered has already been used."; } if (!$reg[username]) $regerror .= "You did not enter a username.
"; if (!$reg[password]) $regerror .= "You did not enter a password.
"; if ($regerror) { print "Registration errors have occured:
$regerror
"; signup_form(); return; } $columns = "username,password,location,email,avatar,sig,icq,aim,yahoo,birthday,gender,homepage,options"; if ($config['pass_encrypt'] == "mysql") $values = "'$reg[username]', PASSWORD('$reg[password]'), '$reg[location]', '$reg[email]', '$reg[avatar]', '$reg[sig]', '$reg[icq]', '$reg[aim]', '$reg[yahoo]', '$birthday', '$reg[gender]', '$reg[homepage]', '$options'"; else $values = "'$reg[username]', '$reg[password]', '$reg[location]', '$reg[email]', '$reg[avatar]', '$reg[sig]', '$reg[icq]', '$reg[aim]', '$reg[yahoo]', '$birthday', '$reg[gender]', '$reg[homepage]', '$options'"; if (db_insert($config[utable],$columns,$values)) { if (!session_is_registered("forumsess")) session_register("forumsess"); $forumsess[$realm]["username"] = $reg[username]; print "Successfully saved your registration!

"; } else { print "There was an $lang[error] with your registration!

"; } } elseif ($method == "edit") { $columns = array("location","email","avatar","sig","icq","aim","yahoo","gender","birthday","homepage","options"); $values = array($reg[location],$reg[email],$reg[avatar],$reg[sig],$reg[icq],$reg[aim],$reg[yahoo],$reg[gender],$birthday,$reg[homepage],$options); db_update($config[utable],"username='".$forumsess[$realm][username]."'",$columns,$values); print "Successfully edited your $lang[profile]!

"; } else { print "An $lang[error] has occured.

"; } print ""; } } function savepass() { global $config,$forumsess,$realm,$pass,$lang; //$row = db_getrow($config[utable],"username='".$forumsess[$realm][username]."'"); //if ($pass[old]==$row[password]){ if ($config['pass_encrypt'] == "mysql") { if (db_numrows($config[utable],"username='".$forumsess[$realm][username]."' AND password=PASSWORD('$pass[old]')")==1) { //$columns = array("password"); //$values = array("PASSWORD(".$pass['new'].")"); $sql = "UPDATE $config[utable] SET password=PASSWORD('$pass[new]') WHERE username='".$forumsess[$realm][username]."'"; //db_update($config[utable],"username='".$forumsess[$realm][username]."'",$columns,$values); if (db_do($sql)) print "Successfully saved your new password!

"; else print "An $lang[error] has occured while attempting to update your password.

"; mainforums(); } else { print "$lang[error] You have entered an incorrect password!

"; passwordform(); } } else { $row = db_getrow($config[utable],"username='".$forumsess[$realm][username]."'"); if ($pass[old]==$row[password]) { $columns = array("password"); $values = array($pass['new']); db_update($config[utable],"username='".$forumsess[$realm][username]."'",$columns,$values); print "Successfully saved your new password!

"; mainforums(); } else { print "$lang[error] You have entered an incorrect password!

"; passwordform(); } } } function listavatars($currav) { global $config; $avatars = dir_list($config['avatar_dir']); ?>