phpBB

Code Changes

File: includes/functions_profile_fields.php

  Unmodified   Added   Modified   Removed
Line 455Line 455
			$db->sql_freeresult($result);

$user_fields = array();

			$db->sql_freeresult($result);

$user_fields = array();

 

$user_ids = $user_id;


// Go through the fields in correct order
foreach (array_keys($this->profile_cache) as $used_ident)


// Go through the fields in correct order
foreach (array_keys($this->profile_cache) as $used_ident)

Line 463Line 465
				{
$user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];

				{
$user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];

 
				}

foreach ($user_ids as $user_id)
{
if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue'])
{
$user_fields[$user_id][$used_ident]['value'] = '';
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}

				}
}


				}
}


Line 521Line 532
		switch ($this->profile_types[$field_type])
{
case 'int':

		switch ($this->profile_types[$field_type])
{
case 'int':

				if ($value === '')

				if (($value === '' || $value === null) && !$ident_ary['data']['field_show_novalue'])

				{
return NULL;
}

				{
return NULL;
}

Line 530Line 541

case 'string':
case 'text':


case 'string':
case 'text':

				if (!$value)

				if (!$value && !$ident_ary['data']['field_show_novalue'])

				{
return NULL;
}

				{
return NULL;
}

Line 548Line 559
				$month = (isset($date[1])) ? (int) $date[1] : 0;
$year = (isset($date[2])) ? (int) $date[2] : 0;


				$month = (isset($date[1])) ? (int) $date[1] : 0;
$year = (isset($date[2])) ? (int) $date[2] : 0;


				if (!$day && !$month && !$year)

				if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue'])

				{
return NULL;
}

				{
return NULL;
}

Line 571Line 582
					$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
}


					$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
}


				if ($value == $ident_ary['data']['field_novalue'])

				if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue'])

				{
return NULL;
}

				{
return NULL;
}

Line 580Line 591

// User not having a value assigned
if (!isset($this->options_lang[$field_id][$lang_id][$value]))


// User not having a value assigned
if (!isset($this->options_lang[$field_id][$lang_id][$value]))

 
				{
if ($ident_ary['data']['field_show_novalue'])
{
$value = $ident_ary['data']['field_novalue'];
}
else

				{
return NULL;

				{
return NULL;

 
					}

				}

return $this->options_lang[$field_id][$lang_id][$value];

				}

return $this->options_lang[$field_id][$lang_id][$value];

Line 593Line 611
				if (!isset($this->options_lang[$field_id][$lang_id]))
{
$this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);

				if (!isset($this->options_lang[$field_id][$lang_id]))
{
$this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);

 
				}

if (!$value && $ident_ary['data']['field_show_novalue'])
{
$value = $ident_ary['data']['field_default_value'];

				}

if ($ident_ary['data']['field_length'] == 1)

				}

if ($ident_ary['data']['field_length'] == 1)

Line 625Line 648

$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
$user_ident = $profile_row['field_ident'];


$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
$user_ident = $profile_row['field_ident'];

		// checkbox - only testing for isset

		// checkbox - set the value to "true" if it has been set to 1

		if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
{

		if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
{

			$value = (isset($_REQUEST[$profile_row['field_ident']])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);

			$value = (isset($_REQUEST[$profile_row['field_ident']]) && request_var($profile_row['field_ident'], $default_value) == 1) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);

		}
else if ($profile_row['field_type'] == FIELD_INT)
{

		}
else if ($profile_row['field_type'] == FIELD_INT)
{