Icy Phoenix

     
 

Custom Profile Field Not Shown In Viewprofile

Category: Profile
Version Icy Phoenix 2.0 Beta (PHP 5.x - MySQL 5.x)
Description
andrea75
Sat 26 May, 2012 16:27
The Custom profile field are not shown in viewprofile page.
To fix that I take the old array mode of the last file version, but I don't think this is the right solution.
Reply
Mighty Gorgon
Sat 12 Jan, 2013 21:40
Hi,
I have just tested on my local setup and it is working fine.

Can you please check again?
Details Assigned To: Mighty Gorgon
Priority: Low
Status: Fixed
Fixed: Yes
 


 



Messages

Posted by andrea75 • Wed 04 Jul, 2012 22:04


For me is not solved...

I have had to put the old code in includes/usercp_viewprofile.php

Code: [Hide] [Select]
// Custom Profile Fields - BEGIN
// Include Language
setup_extra_lang(array('lang_profile_fields'));

include_once(IP_ROOT_PATH . 'includes/functions_profile.' . PHP_EXT);
$profile_data = get_fields('WHERE view_in_profile = ' . VIEW_IN_PROFILE . ' AND users_can_view = ' . ALLOW_VIEW);
$profile_names = array();

$abouts = array();
$contacts = array();
foreach($profile_data as $field)
{
$name = $field['field_name'];
$col_name = text_to_column($field['field_name']);
$id = $profiledata['user_id'];
$type = $field['field_type'];
$location = $field['profile_location'];

$field_id = $field['field_id'];
$field_name = $field['field_name'];
if (isset($lang[$field_id . '_' . $field_name]))
{
$field_name = $lang[$field_id . '_' . $field_name];
}

$sql = "SELECT $col_name FROM " . USERS_TABLE . "
WHERE user_id = $id";
$result = $db->sql_query($sql);
$temp = $db->sql_fetchrow($result);
$profile_names[$name] = displayable_field_data($temp[$col_name], $field['field_type']);
$tmp_field = $profile_names[$name];
if (isset($lang[$field_id . '_' . $tmp_field]))
{
$profile_names[$name] = $lang[$field_id . '_' . $tmp_field];
}

if($location == 1)
{
$contacts[] = '<td valign="top" class="' . $theme['td_class2'] . '"><b><span class="genmed">' . $field_name . '</span></b></td><td class="' . $theme['td_class1'] . ' post-buttons"><span class="genmed">' . $profile_names[$name] . '&nbsp;</span></td>';
}
else
{
$abouts[] = '<td valign="top" class="' . $theme['td_class2'] . '"><b><span class="genmed">' . $field_name . '</span></b></td><td class="' . $theme['td_class1'] . ' post-buttons"><span class="genmed">' . $profile_names[$name] . '&nbsp;</span></td>';
}
}

foreach($abouts as $about_field)
{
$template->assign_block_vars('custom_about',array('ABOUT' => $about_field));
}

foreach($contacts as $contact_field)
{
$template->assign_block_vars('custom_contact',array('CONTACT' => $contact_field));
}
// Custom Profile Fields - END







Posted by Mighty Gorgon • Sat 12 Jan, 2013 21:40


Because problem was related to template file not updated, copy the code from default:

Code: [Hide] [Select]
<!-- BEGIN custom_about -->
<tr>
<td class="row2" valign="top"><b><span class="genmed">{custom_about.NAME}</span></b></td>
<td class="row1 post-buttons"><span class="genmed">{custom_about.VALUE}</span></td>
</tr>
<!-- END custom_about -->


Same for CONTACT section.







  
Page 1 of 1




 

  cron