1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 11:13:59 +02:00

[ticket/12187] Do not make clickable when using as contact field

PHPBB3-12187
This commit is contained in:
Joas Schilling
2014-03-04 09:10:57 +01:00
parent c650078904
commit 03ef39c1f1
6 changed files with 54 additions and 28 deletions

View File

@@ -337,12 +337,14 @@ class manager
}
/**
* Assign the user's profile fields data to the template
*
* @param array $profile_row Array with users profile field data
* @return array
*/
public function generate_profile_fields_template_data($profile_row)
* Assign the user's profile fields data to the template
*
* @param array $profile_row Array with users profile field data
* @param bool $use_contact_fields Should we display contact fields as such?
* This requires special treatments (links should not be parsed in the values, and more)
* @return array
*/
public function generate_profile_fields_template_data($profile_row, $use_contact_fields = true)
{
// $profile_row == $user_fields[$row['user_id']];
$tpl_fields = array();
@@ -358,15 +360,20 @@ class manager
continue;
}
$field_desc = $this->user->lang($ident_ary['data']['field_contact_desc']);
if (strpos($field_desc, '%s') !== false)
$field_desc = $contact_url = '';
if ($use_contact_fields)
{
$field_desc = sprintf($field_desc, $value);
}
$contact_url = '';
if (strpos($ident_ary['data']['field_contact_url'], '%s') !== false)
{
$contact_url = sprintf($ident_ary['data']['field_contact_url'], $value);
$value = $profile_field->get_profile_contact_value($ident_ary['value'], $ident_ary['data']);
$field_desc = $this->user->lang($ident_ary['data']['field_contact_desc']);
if (strpos($field_desc, '%s') !== false)
{
$field_desc = sprintf($field_desc, $value);
}
$contact_url = '';
if (strpos($ident_ary['data']['field_contact_url'], '%s') !== false)
{
$contact_url = sprintf($ident_ary['data']['field_contact_url'], $value);
}
}
$tpl_fields['row'] += array(