Notifications
Clear all

wpForo 1.x.x [Closed] Link to User's profile page

8 Posts
2 Users
2 Reactions
6,469 Views
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

Thank you wolfpup64,

there was a wrong variable name, i just updated, please use the updated code.

wolfpup64
Posts: 19
Topic starter
(@wolfpup64)
Eminent Member
Joined: 8 years ago

Oh sorry man, I realized I actually screwed up. Because I'm trying to link from a user's BuddyPress profile to the same user's wpForo page, I actually need a way to link from the currently displayed user's page. I'm a total noob at this stuff. I managed to create the tab by bogarting some code from some other support page, however the link is directed by a slug and if I remove the slug the whole tab disappears. It took me a while to find something that worked. Heres the code I'm using, located in mu-plugin:

function add_communityprofile_tab() {
	global $bp;
	
	bp_core_new_nav_item( array(
		'name'                  => 'Community',
		'slug'                  => 'communityprofile',
		'parent_url'            => $bp->displayed_user->domain,
		'parent_slug'           => $bp->profile->slug,
		'screen_function'       => 'communityprofile_screen',			
		'position'              => 200,
		'default_subnav_slug'   => 'communityprofile'

add_action( 'bp_setup_nav', 'add_communityprofile_tab', 100 );

and I tried using this bit to link up to the wpForo page:

function communityprofile_screen() {
   bp_core_redirect( site_url( '/community/profile/'.bp_displayed_user_username() ) );

But it just links up to the wpForo main site page.

 

The url of the BuddyPress profile pages is: 

http://localhost/wordpress/users/*username*/profile/

What I'm trying to link up to is:

http://localhost/wordpress/community/profile/*username*

wolfpup64
Posts: 19
Topic starter
(@wolfpup64)
Eminent Member
Joined: 8 years ago

ah, somebody on the BuddyPress forum figured it out for me...now i just have to get it in the right place.

Page 2 / 2