aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_profile.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-01-10 12:19:39 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-01-10 12:19:39 +0000
commit62429cb9fbec7192478bbdf9148324300445485f (patch)
tree5fde147248b4833d8da93070671f7f03a385b7d6 /phpBB/includes/ucp/ucp_profile.php
parent36f039cb1b15a7c4b5aa59932a8b543a64ce763c (diff)
downloadforums-62429cb9fbec7192478bbdf9148324300445485f.tar
forums-62429cb9fbec7192478bbdf9148324300445485f.tar.gz
forums-62429cb9fbec7192478bbdf9148324300445485f.tar.bz2
forums-62429cb9fbec7192478bbdf9148324300445485f.tar.xz
forums-62429cb9fbec7192478bbdf9148324300445485f.zip
display/store custom profile fields
git-svn-id: file:///svn/phpbb/trunk@4739 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_profile.php')
-rw-r--r--phpBB/includes/ucp/ucp_profile.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index d9038980ae..e1d0921c1b 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -192,6 +192,11 @@ class ucp_profile extends module
case 'profile_info':
+ include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ $cp = new custom_profile();
+
+ $cp_data = $cp_error = array();
+
if ($submit)
{
$var_ary = array(
@@ -239,7 +244,10 @@ class ucp_profile extends module
extract($data);
unset($data);
- if (!sizeof($error))
+ // validate custom profile fields
+ $cp->submit_cp_field('profile', $cp_data, $cp_error);
+
+ if (!sizeof($error) && !sizeof($cp_error))
{
$sql_ary = array(
'user_icq' => $icq,
@@ -259,6 +267,19 @@ class ucp_profile extends module
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
+ // Update Custom Fields
+ $sql = 'UPDATE phpbb_profile_fields_data
+ SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $db->sql_query($sql);
+ if (!$db->sql_affectedrows())
+ {
+ $db->return_on_error = true;
+ $cp_data['user_id'] = (int) $user->data['user_id'];
+ $db->sql_query('INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp_data));
+ $db->return_on_error = false;
+ }
+
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode");
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
trigger_error($message);
@@ -311,6 +332,11 @@ class ucp_profile extends module
'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options,
'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options,)
);
+
+ // Get additional profile fields and assign them to the template block var 'profile_fields'
+ $user->get_profile_fields($user->data['user_id']);
+ $cp->generate_profile_fields('profile', $user->get_iso_lang_id(), $cp_error);
+
break;
case 'signature':