Please or Register to create posts and topics.

Link to Ultimate Member Profiles

This code works great! But obviously now I have lost the information that was being displayed in Asgaros Forum profile like '# of topics started' etc. Is there a way to incorporate Asgaros Profile data into UM profile page?

Any help on this?

Hello @glazerjoni

Was it working before? Did it happen after the last update?

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

@Asgaros

No, it wasn't working before the update.  Using UM Profiles means losing forum-related information.

@glazerjoni

I've also wondered about integrating forum activity information with UM, but am not well versed in PHP so I haven't figured out how to do it just yet.

Here's a possible framework (modified from UM support docs) which adds a separate profile tab for 'Forum Activity'.

/***UM Custom tab for Forum Activity***/
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {
 $tabs['forumactivity'] = array(
  'name' => 'Forum Activity',
  'icon' => 'um-faicon-comments',
 );
 return $tabs;
}
add_action('um_profile_content_forumactivity_default', 'um_profile_content_forumactivity_default');
function um_profile_content_forumactivity_default( $args ) {
  echo '';
}

That's the easy part.  Accessing the relevant data is another matter.  If I come up with a nice solution I'll let you know.

glazerjoni has reacted to this post.
glazerjoni

@Collab is right. The information that is displayed in the Profile page in Asgaros is not the same as the one in UM (Obviously). However, I was inquiring if its possible to include that info in the UM profile.

@Collab - Interesting code snippet. Let me try it and report back soon. Thanks!

Quote from collab on July 19, 2018, 12:27 am
  1. /***UM Custom tab for Forum Activity***/
  2. add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
  3. function add_custom_profile_tab( $tabs ) {
  4. $tabs['forumactivity'] = array(
  5. 'name' => 'Forum Activity',
  6. 'icon' => 'um-faicon-comments',
  7. );
  8. return $tabs;
  9. }
  10. add_action('um_profile_content_forumactivity_default', 'um_profile_content_forumactivity_default');
  11. function um_profile_content_forumactivity_default( $args ) {
  12. echo '';
  13. }
/***UM Custom tab for Forum Activity***/
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {
 $tabs['forumactivity'] = array(
  'name' => 'Forum Activity',
  'icon' => 'um-faicon-comments',
 );
 return $tabs;
}
add_action('um_profile_content_forumactivity_default', 'um_profile_content_forumactivity_default');
function um_profile_content_forumactivity_default( $args ) {
  echo '';
}

That's the easy part.  Accessing the relevant data is another matter.  If I come up with a nice solution I'll let you know.

I've tried to insert this code in functions.php in my theme's folder and nothing changed 🙁

Quote from childledj on July 19, 2018, 9:52 am

I've tried to insert this code in functions.php in my theme's folder and nothing changed 🙁

In WP Admin > Ultimate Member > Settings > Appearance > Profile Menu, there should be an option for the newly created 'Forum Activity' tab.  Try disabling/re-enabling this, then save changes.

childledj has reacted to this post.
childledj

Here's a bit of extra code that will at least link to the user's forum profile and post history.  Can surely be refined further with styles, etc.

/***UM Custom tab for Forum Activity***/
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {
  $tabs['forumactivity'] = array(
    'name' => 'Forum Activity',
    'icon' => 'um-faicon-comments',
  );
  return $tabs;
}
add_action('um_profile_content_forumactivity_default', 'um_profile_content_forumactivity_default');
function um_profile_content_forumactivity_default( $args ) {	
  $um_user_name = um_user('user_login');
  echo '<a href="' . home_url( '/forum/history/'.$um_user_name) . '">Post History</a><br>';
  echo '<a href="' . home_url( '/forum/profile/'.$um_user_name) . '">Forum Profile</a>';
}
childledj and glazerjoni have reacted to this post.
childledjglazerjoni

Thank you! Now it works fine!

One more question:

On the bottom of forum profile page is the link "Edit profile" it links to "wp-admin/profile.php"

Ном can I change it to "/user/?profiletab=main&um_action=edit" ???

Sweet @Collab! That worked. I do see Post History and Forum Profile showup as links although when I click on them, they go to 404. Will play around to see how to fix that and lead to actual values, rather than 404. And you are right, needs CSS 🙂