Please or Register to create posts and topics.

Add content in the profile page

Hi

I would like to add some more info on the profile page of each member. In fact I would like to add the surname and the nickname. I assume that I have to use the hook asgarosforum_custom_profile_content but I am not quite sure how to do it.

Could you please give me a hint?

Regards,

Andreas Lazaris

Hi

Here is how I did it.

  1. I found the file forum-profile.php in the Asgaros forum plugin (includes>forum-profile.php).
  2. After the first name code, I added the following code:
// Show last name.
if (!empty($userData->last_name)) {
$profileRows['last_name'] = array(
'title' => __('Last Name:', 'asgaros-forum'),
'value' => $userData->last_name
);
}

// Show Nickname.
if (!empty($userData->nickname)) {
$profileRows['nickname'] = array(
'title' => __('Nickname:', 'asgaros-forum'),
'value' => '@'.$userData->nickname
);
}

        // Show last name.
if (!empty($userData->last_name)) {
$profileRows['last_name'] = array(
'title' => __('Last Name:', 'asgaros-forum'),
'value' => $userData->last_name
);
}

// Show Nickname.
if (!empty($userData->nickname)) {
$profileRows['nickname'] = array(
'title' => __('Nickname:', 'asgaros-forum'),
'value' => '@'.$userData->nickname
);
}
        
  // Show Email.
if (!empty($userData->user_email)) {
$profileRows['email'] = array(
'title' => __('Email:', 'asgaros-forum'),
'value' => $userData->user_email
);
}

Now, all info, First Name, Last Name and Nickname are shown in the profile page. You can have a look at the attached image.

 

Andreas Lazaris

 

 

Uploaded files:
  • Screen-Shot-2021-06-08-at-9.00.33-PM.png
Asgaros has reacted to this post.
Asgaros

Hey @andreasml,

if you want to add or customize the existing profile rows you will have to use the filter asgarosforum_filter_profile_row and it should work. With your approach, you will lose all the changes with the next update. This hook is already documented here:

https://github.com/Asgaros/asgaros-forum/blob/master/hooks.md#asgarosforum_filter_profile_row

 

 

Need professional help with Asgaros Forum? Book an appointment with us at domra Web Solutions for setup and customization services. Learn more about our Toolbox for Asgaros Forum plugin to enhance your forum experience.

Hi @qualmy91,

Thank you for your response. I am not quite sure how I can use the filter.

Regards,

Andreas