Skip to:
Content
Pages
Categories
Search
Top
Bottom

Urgent: Need to substitute member names with username


  • sawyerh
    Participant

    @sawyerh

    Hi Everyone,

    I hope this is a quick fix, as I need to do it ASAP since the site is live.

    The issue I am having is: all of the member’s names are set to be displayed publicly as First Last. The problem this is creating is, all of the links that are ” bp_member_permalink() ” are being redirected to the homepage since the link is saying their username is First Last instead of their actual username. Funny thing though, when you are viewing a single forum topic and click the poster’s member link (“bp_the_topic_post_poster_link”), it takes them to the correct link with the username as their actual username.

    I can’t change the setting of their full name being displayed publicly since this is automatically set by a membership plugin we had professionally set up.

    Is there any way to fix this problem? If I didn’t explain well enough, just let me know and I will try to give more details.

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)

  • sawyerh
    Participant

    @sawyerh

    To clarify: the bp_member_permalink() is displaying the member’s links as http://www.link.com/members/First Last

    and I need it to display the link as http://www.link.com/members/username


    sawyerh
    Participant

    @sawyerh

    I found where the bp_member_permalink() function is created, although I’m not sure how to edit it to display the user’s username instead of display name:

    Here’s the code:

    function bp_member_permalink() {

    echo bp_get_member_permalink();

    }

    function bp_get_member_permalink() {

    global $members_template;

    return apply_filters( 'bp_get_member_permalink', bp_core_get_user_domain( $members_template->member->id, $members_template->member->user_nicename, $members_template->member->user_login ) );

    }

    function bp_member_link() { echo bp_get_member_permalink(); }

    function bp_get_member_link() { return bp_get_member_permalink(); }


    r-a-y
    Keymaster

    @r-a-y

    Put this in /wp-content/plugins/bp-custom.php:

    define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );

    Make sure you have open and closing PHP tags as well.

    BP1.2? Did you try defined( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’ ) ?

    this will switch the username from user_login to user_nicename


    sawyerh
    Participant

    @sawyerh

    @r-a-y: This did take care of the issue with the bp_member_permalink() but now the bp_the_topic_post_poster_link is messed up :( Any idea why this would have changed that function’s link?


    sawyerh
    Participant

    @sawyerh

    @etiviti – Yup, I’m using BP 1.2 on WP 1.9.2 – I did what r-a-y said:

    define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );

    But now have another issue (see above :])


    sawyerh
    Participant

    @sawyerh

    Even when I replace bp_the_topic_post_poster_link with bp_member_permalink() on the forum topic, it still doesn’t have the username at the end of the link. Weird??

    The problem also still exists in the activity stream.


    sawyerh
    Participant

    @sawyerh

    Hi Guys,

    Still haven’t been able to find a solution to this problem and would love to figure this out.

    Here’s an update on the what’s working and what is not:

    The initial problem was the username wasn’t being displayed at the end of the member’s links which was causing the links to redirect to the homepage. This problem was sitewide EXCEPT when on the forum topics (weird). By adding define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true ); to /wp-content/plugins/bp-custom.php, I was able to get the username to display at the end of the member’s links inside the Member’s list, but by doing so, it is now causing the problem to occur on member’s links on forum topics. The problem is also still occurring in the activity streams.

    Any help?

    Thanks!


    sawyerh
    Participant

    @sawyerh

    Update:

    It seems to only take effect on new activity. However, the links in the forum topics are still going to the wrong page.

    some of the references in the activity are hardcoded in the content column – so you may have to edit it manually to reference the updated member links.

    as for the bbpress stuff – some last_poster names are also stored in the topic/posts tables – double check that.


    sawyerh
    Participant

    @sawyerh

    as for the bbpress stuff – some last_poster names are also stored in the topic/posts tables – double check that.

    I’m not sure what you mean by this. I accessed the mySQL database via phpMyAdmin and am looking at the topic tables. What should I change to solve the problem?

    Thanks


    sawyerh
    Participant

    @sawyerh

    @etiviti: Here is a screenshot of the tables for topics: http://img535.yfrog.com/img535/6128/mysqlscreen.jpg


    sawyerh
    Participant

    @sawyerh

    Note: new members who sign up do not experience this problem.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Urgent: Need to substitute member names with username’ is closed to new replies.
Skip to toolbar