Problem z nowym polem przy rejestracji


(Vegeta2500) #1

Witam.Mam stronke na extreme-fusion. Siedzę już nad tym kilka godzin i nie moge znaleść tego w czym tkwi problem. Stworzyłem sobie nowe pole do profilu(nowa pole w tabeli ef_users, modyfikacje edit_profile.php,profile.php itd.), zrobiłem tak by to pole było wymagane podczas rejestracji.Problem tkwi w tym że jak wpisuje podczas rejestracji w moim przypadku nick to pisze że rejestracja została pomyślnie..., a tak naprawde to ten nick który wpisuje podczas rejestracji nie jest wpisywane do tego pola które dodałem w tabeli ef_users - pole po prostu jest puste.

Moje pole to user_nick

Oto mój plik register.php

<?php

/*---------------------------------------------------+

| PHP-Fusion 6 Content Management System

+----------------------------------------------------+

| Copyright © 2002 - 2005 Nick Jones

| http://www.php-fusion.co.uk/

+----------------------------------------------------+

| Released under the terms & conditions of v2 of the

| GNU General Public License. For details refer to

| the included gpl.txt file or visit http://gnu.org

+----------------------------------------------------*/

require_once "maincore.php";

require_once "subheader.php";

require_once "side_left.php";

include LOCALE.LOCALESET."admin/rules.php";

include LOCALE.LOCALESET."register.php";

include LOCALE.LOCALESET."user_fields.php";

//Dodane by Rafik89   

include INCLUDES."recaptcha/recaptchalib.php";

//Koniec by Rafik89   

if (iMEMBER) fallback("index.php");


if ($settings['enable_registration']) {


if (isset($activate)) {

   if (!preg_match("/^[0-9a-z]{32}$/", $activate)) fallback("index.php");

   $result = dbquery("SELECT * FROM ".$db_prefix."new_users WHERE user_code='$activate'");

   if (dbrows($result) != 0) {

      $data = dbarray($result);

      $user_info = unserialize($data['user_info']);

      $activation = $settings['admin_activation'] == "1" ? "2" : "0";

      $d = dbarray(dbquery("SELECT * from ".$db_prefix."colors WHERE user_level=101"));

        $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_nick, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status, user_prefix, user_color, user_adds, user_email_act, user_rang, user_points, points_normal, points_bonus, points_punishment) VALUES ('".$user_info['user_name']."', '".$user_info['user_nick']."', '".$user_info['user_password']."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', 'Default', '0', '', '', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation', '".$d['user_prefix']."', '".$d['user_color']."', '0', '1', '', '0', '0', '0', '0')");

      $result = dbquery("DELETE FROM ".$db_prefix."new_users WHERE user_code='$activate'");   

      opentable($locale['401']);

      if ($settings['admin_activation'] == "1") {

         echo "


\n".$locale['455']."

\n".$locale['453']."

\n\n"; } else { echo "
\n".$locale['455']."

\n".$locale['452']."

\n\n"; } closetable(); } else { fallback("index.php"); } } else if (isset($_POST['register'])) { $error = ""; $username = stripinput(trim(eregi_replace(" +", " ", $_POST['username']))); $email = stripinput(trim(eregi_replace(" +", "", $_POST['email']))); $password1 = stripinput(trim(eregi_replace(" +", "", $_POST['password1']))); $nick = stripinput(trim(eregi_replace(" +", " ", $_POST['nick']))); if ($username == "" || $password1 == "" || $nick == "" || $email == "") $error .= $locale['402']." \n"; if (!preg_match("/^[-0-9A-Z_@\s]+$/i", $username)) $error .= $locale['403']." \n"; if (preg_match("/^[0-9A-Z@]{6,20}$/i", $password1)) { if ($password1 != $_POST['password2']) $error .= $locale['404']." \n"; } else { $error .= $locale['405']." \n"; } if (!preg_match("/^[-0-9A-Z_.]{1,50}@([-0-9A-Z_.]+.){1,50}([0-9A-Z]){2,4}$/i", $email)) { $error .= $locale['406']." \n"; } if ($_POST['rules'] == '0') { $error .= $locale['rul_04']; } $email_domain = substr(strrchr($email, "@"), 1); $result = dbquery("SELECT * FROM ".$db_prefix."blacklist WHERE blacklist_email='".$email."' OR blacklist_email='$email_domain'"); if (dbrows($result) != 0) $error = $locale['411']." \n"; $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='$username'"); if (dbrows($result) != 0) $error = $locale['407']." \n"; $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_email='".$email."'"); if (dbrows($result) != 0) $error = $locale['408']." \n"; if ($settings['email_verification'] == "1") { $result = dbquery("SELECT * FROM ".$db_prefix."new_users"); while ($new_users = dbarray($result)) { $user_info = unserialize($new_users['user_info']); if ($new_users['user_email'] == $email) { $error = $locale['409']." \n"; } if ($user_info['user_name'] == $username) { $error = $locale['407']." \n"; break; } } } //Dodane by Rafik89 if ($settings['recaptcha_register'] == 1){ if (($settings['recaptcha_status'] == 1) && ($settings['validation_method'] == "recaptcha")){ if (!empty($settings['recaptcha_priv_key'])){ $resp = recaptcha_check_answer ($settings['recaptcha_priv_key'], $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { $error .= $locale['410']." \n"; } } else { $error .= $locale['412']." "; } } else { if (!check_captcha($_POST['captcha_encode'], $_POST['captcha_code'])) { $error .= $locale['410']." \n"; } } } //Koniec by Rafik89 $user_hide_email = isNum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1"; if ($settings['email_verification'] == "0") { $user_location = isset($_POST['user_location']) ? stripinput(trim($_POST['user_location'])) : ""; if ($_POST['user_month'] != 0 && $_POST['user_day'] != 0 && $_POST['user_year'] != 0) { $user_birthdate = (isNum($_POST['user_year']) ? $_POST['user_year'] : "0000") ."-".(isNum($_POST['user_month']) ? $_POST['user_month'] : "00") ."-".(isNum($_POST['user_day']) ? $_POST['user_day'] : "00"); } else { $user_birthdate = "0000-00-00"; } $user_aim = isset($_POST['user_aim']) ? stripinput(trim($_POST['user_aim'])) : ""; $user_icq = isset($_POST['user_icq']) ? stripinput(trim($_POST['user_icq'])) : ""; $user_msn = isset($_POST['user_msn']) ? stripinput(trim($_POST['user_msn'])) : ""; $user_yahoo = isset($_POST['user_yahoo']) ? stripinput(trim($_POST['user_yahoo'])) : ""; $user_web = isset($_POST['user_web']) ? stripinput(trim($_POST['user_web'])) : ""; $user_theme = stripinput($_POST['user_theme']); $user_offset = is_numeric($_POST['user_offset']) ? $_POST['user_offset'] : "0"; $user_sig = isset($_POST['user_sig']) ? stripinput(trim($_POST['user_sig'])) : ""; } if ($error == "") { if ($settings['email_verification'] == "1") { require_once INCLUDES."sendmail_include.php"; mt_srand((double)microtime()*1000000); $salt = ""; for ($i=0;$i<=7;$i++) { $salt .= chr(rand(97, 122)); } $user_code = md5($email.$salt); $activation_url = $settings['siteurl']."register.php?activate=".$user_code; if (sendemail($username,$email,$settings['siteusername'],$settings['siteemail'],"Welcome to ".$settings['sitename'], $locale['450'].$activation_url)) { $user_info = serialize(array( "user_name" => $username, "user_password" => md5(md5($password1)), "user_email" => $email, "user_hide_email" => isNum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1" )); $result = dbquery("INSERT INTO ".$db_prefix."new_users (user_code, user_email, user_datestamp, user_info) VALUES('$user_code', '".$email."', '".time()."', '$user_info')"); opentable($locale['400']); echo "
\n".$locale['454']."

\n\n"; closetable(); } else { opentable($locale['456']); echo "
\n".$locale['457']."

\n\n"; closetable(); } } else { $activation = $settings['admin_activation'] == "1" ? "2" : "0"; $d = dbarray(dbquery("SELECT * from ".$db_prefix."colors WHERE user_level=101")); $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_nick, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status, user_prefix, user_color, user_adds, user_email_act, user_rang, user_points, points_normal, points_bonus, points_punishment) VALUES('$username','$user_nick', '".md5(md5($password1))."', '".$email."', '$user_hide_email', '$user_location', '$user_birthdate', '$user_aim', '$user_icq', '$user_msn', '$user_yahoo', '$user_web', '$user_theme', '$user_offset', '', '$user_sig', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation', '".$d['user_prefix']."', '".$d['user_color']."', '0', '0', '', '0', '0', '0', '0')"); opentable($locale['400']); if ($settings['admin_activation'] == "1") { echo "
\n".$locale['451']."

\n".$locale['453']."

\n\n"; } else { echo "
\n".$locale['451']."

\n".$locale['452']."

\n\n"; } closetable(); } } else { opentable($locale['456']); echo "
\n".$locale['458']."

\n$error
\n".$locale['459']."
\n"; closetable(); } } else { if ($settings['email_verification'] == "0") { $theme_files = makefilelist(THEMES, ".|..", true, "folders"); array_unshift($theme_files, "Default"); $offset_list = ""; for ($i=-13;$i<17;$i++) { if ($i > 0) { $offset="+".$i; } else { $offset=$i; } $offset_list .= "$offset\n"; } } opentable($locale['400']); echo "".$locale['500']."\n";

if ($settings['email_verification'] == "1") echo $locale['501']."\n";

echo $locale['502'];

if ($settings['email_verification'] == "1") echo "\n".$locale['503'];

echo "

| ".$locale['u001']."* | |

*".$locale['u002']."*".$locale['u004']."*".$locale['u005']."*".$locale['u006']."".$locale['u007']." ".$locale['u008']."\n"; //Dodane by Rafik89 if ($settings['recaptcha_register'] == 1){ echo "".$locale['504'].""; if (($settings['recaptcha_status'] == 1) && ($settings['validation_method'] == "recaptcha")){ if (!empty($settings['recaptcha_glob_key'])){ echo recaptcha_get_html($settings['recaptcha_glob_key']); } else { echo $locale['412']." "; } } else { echo make_captcha(); echo " \n"; } echo ""; } //Koniec by Rafik89 if ($settings['email_verification'] == "0") { echo "".$locale['u009']." ".$locale['u010']." (mm/dd/yyyy)\n\n"; for ($i=1;$i<=12;$i++) echo "$i\n"; echo "\n\n\n"; for ($i=1;$i<=31;$i++) echo "$i\n"; echo "\n\n\n"; for ($i=1900;$i<=2010;$i++) echo "$i\n"; echo " ".$locale['u021']." ".$locale['u011']." ".$locale['u012']." ".$locale['u013']." ".$locale['u014']." ".$locale['u015']." ".makefileopts($theme_files)." ".$locale['u016']." $offset_list ".$locale['u020']." ".$userdata['user_sig']." ', '');\"> ', '');\"> ', '');\"> ', '');\"> ', '');\"> \n"; } echo " Akceptuję ".$locale['rul_name01']."*".$locale['rul_06']."".$locale['rul_05']."\n "; closetable(); echo "\n"; } } else { opentable($locale['400']); echo "
\n".$locale['507']."

\n\n"; closetable(); } require_once "side_right.php"; require_once "footer.php"; ?>[/code]