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
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(); }
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
@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?
@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 :])
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.
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!
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.
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
@etiviti: Here is a screenshot of the tables for topics: http://img535.yfrog.com/img535/6128/mysqlscreen.jpg
Note: new members who sign up do not experience this problem.