• Resolved arcklenda

    (@arcklenda)


    Hello WpDiscuz,

    I am facing a small problem, when I click on the person’s name in the comments, it should be directed to the Ultimate Member user profile, but unfortunately he redirects to the main page of the site, not to the user profile…

    [even though I enabled the “Configuration – Comment list / Profiles URL” function in the WpDiscuz settings]

    I’ve tried several different configurations, I’ve checked the integration code of “functions.php” but everything continues the same way, it’s simply not pointing to the user’s profile when clicking on his name in the comment …

    Please someone would know if any part of the integration code is incompatible with Ultimate Member 2.0?

    If anyone knows how to “fix” this problem, even temporarily, please inform me in the comments below ….

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter arcklenda

    (@arcklenda)

    *The problem is the same on Ultimate Member 1.3.88

    Plugin Support gVectors Support

    (@gvectorssupport)

    Hi arcklenda,

    Please use this code, put it in current active functions.php file:

    ////////////////////////////////////////////////////////////////////////
    // Ultimate Member Profile Display Name Integration ////////////////////
    ////////////////////////////////////////////////////////////////////////
    add_filter('wpdiscuz_comment_author', 'wpdiscuz_um_author', 10, 2);
    function wpdiscuz_um_author($author_name, $comment) {    
        if ($comment->user_id) {
            $column = 'display_name'; // Other options: 'user_login', 'user_nicename', 'nickname', 'first_name', 'last_name'
            if (class_exists('UM_API') || class_exists('UM')) {
                um_fetch_user($comment->user_id); $author_name = um_user($column); um_reset_user();
            } else {
                $author_name = get_the_author_meta($column, $comment->user_id);
            }
        }
        return $author_name;
    }
    ////////////////////////////////////////////////////////////////////////
    // Ultimate Member Profile URL Integration /////////////////////////////
    ////////////////////////////////////////////////////////////////////////
    add_filter('wpdiscuz_profile_url', 'wpdiscuz_um_profile_url', 10, 2);
    function wpdiscuz_um_profile_url($profile_url, $user) {   
        if ($user && (class_exists('UM_API') || class_exists('UM'))) {
            um_fetch_user($user->ID); $profile_url = um_user_profile_url();
        }
        return $profile_url;
    }   
    Thread Starter arcklenda

    (@arcklenda)

    Hello (@gvectorssupport),

    Thank you for the reply, i tried what you said and removed all the previous codes that I put in the functions.php.

    But, the problem persist…

    i tried to clean all caches, and browser cookies too…but the same problem…

    During the tests now, I noticed that the PROFILE IMAGE link next to the commentary is working normally, directing to the UM profile.

    But, the link about the name of the user just above the comment, it is that this problem, only it is pointing to the main page of the site … and not to the profile just like the profile picture.

    See this, when i click on the PROFILE PICTURE on the side, it's working! and, when i use the inspect browser tool on the profile picture i can see the working link to profile too...
    
    <div id="wc-comm-377_0" class="wc-comment wc-blog-user wc-blog-author wc_comment_level-1">
    <div class="wc-comment-left ">
    <div class="wpd-xborder"></div>
    <a href="https://www.my-site-EXAMPLE.com/usuario/sulean/" target="_blank">
    <img onerror="this.src='https://www.my-site-EXAMPLE.com/plugins/ultimate-member/assets/img/default_avatar.jpg';" src="https://www.my-site-EXAMPLE.com/plugins/ultimate-member/assets/img/default_avatar.jpg" class="func-um_user gravatar avatar avatar-64 um-avatar um-avatar-default" alt="Sulean " nymphetamine"="" moura"="" width="64" height="64"></a>
    <div class="wc-blog-user wc-blog-author wc-comment-label"><span>Membro</span></div></div>
    ...
    
    But, when i use the inspect browser tool on the comment author name, i can only be redirected to the main site....not to the profile.
    
    <div id="comment-377" class="wc-comment-right ">
    <div class="wc-comment-header">
    <div class="wc-comment-author "><a rel="nofollow" href="https://www.my-site-EXAMPLE.com" target="_blank">Sulean "Nymphetamine" Moura</a></div>
    <div class="wc-comment-link"></div>
    <div class="wpdiscuz_clear"></div>
    </div>
    <div class="wc-comment-text"><p>EXAMPLE</p></div>
    <div class="wc-comment-footer">
    ...

    I honestly do not know what could be wrong, I do not know if they can help me solve this problem …

    • This reply was modified 6 years, 11 months ago by arcklenda.
    Thread Starter arcklenda

    (@arcklenda)

    If anyone knows how to “fix” this problem, even temporarily, please inform me in the comments below…*

    Plugin Support gVectors Support

    (@gvectorssupport)

    @arcklenda

    The profile image link goes to Ultimate Member profile, however username links goes to the website URL, that user fills in his profile or in comment form.

    1. Website URLfrom profile

    2. Website URL from Comment form

    Thread Starter arcklenda

    (@arcklenda)

    Hello @gvectorssupport

    Now i can understand….but, it’s possible to change the username link to use the UM profile link, same as image link? to use the same link of profile?

    Plugin Support gVectors Support

    (@gvectorssupport)

    I’m sorry, but it is not possible yet. We’ll take this under consideration.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Ultimate Member 2.0 + WpDiscuz [Problem]’ is closed to new replies.