Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
BuddyPress Profile Display Links
Avatar
Jan Bosman
Member
Free Members
sp_UserOfflineSmall Offline
Jun 7, 2012 - 2:32 am

Hey there,

Got a strange quirk going on. I set SP's profile mode set to link forum profiles to Buddypress profiles. The links that SP is generating that should go to a user's profile include their username in the URL as opposed to the users' user_nicename value, which is what BuddyPress uses. This results in every profile link on my site being broken. Do I have something configured wrong here?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 7, 2012 - 9:18 am

is this some setting in bp somewhere?  or forced differently by a bp plugin?  or a recent change?

we seem to conflicting reports from users on what bp uses there...  in the past, we used user_nicename but had a bunch of users say it broke it... so we changed it and it got them working... now a report of the opposite...

so just confused on this one...

Avatar
Jan Bosman
Member
Free Members
sp_UserOfflineSmall Offline
Jun 7, 2012 - 12:30 pm

Yeah, I can understand this being a hard one to track and replicate, so I'll give you a bit more background.

I was working on redesigning an existing site, which wasn't previously using SimplePress. This meant setting up the site on a test server to build it before making it live. It is a members site (also using WLM), and we wanted to further separate what the public sees and what the members site is, so what was the test site would actually become the permanent home for the site. Which means instead of moving the site from the test site to the live site once we finished, it was the opposite - a final import of database info from the live site to the test site so that it was up to date (before, obviously, redirecting login forms to go to the new members site).

Somewhere in that process is where things changed, and I feel like had the order been different, this might not have occurred. What had to be moved over was the newer user tables, then the forum info (previously bbPress), then importing that forum data into a new SP install. The wildcard is that somewhere in that process - my guess is after the forum import - I triggered another process that altered all of the users' user_nicename values. The first time we had moved data over from the live site to the members dev site was the initial import needed to start working on it - and in that process, I believe the nicename-changing process happened before the SP import. I could be mistaken though.

As far as changes that might give you a clue, that's all that comes to mind. That said, the development of the site was about 4 months, and the change may have happened on your end. Where the nicename profile link was working for us before, we likely upgraded SP builds and the new system broke our profile links.

I'm guessing SimplePress builds its own list of BuddyPress profile links and doesn't actually sync them up with BP. Is there any way to rebuild that list?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jun 7, 2012 - 9:15 pm

well, its not really a list... its hardcoded to use the user login value from the wp users table...

however, a while back someone had changed it similarly so we added a filter to the link so that you can change it yourself...

just hook into our hook 'sph_buddypress_profile' and you can return the url that you want... you will get two arguments to the filter when you use it... first is the url and second is the user object.. so you can rebuild the url to use the nicename instead...

Avatar
Jan Bosman
Member
Free Members
sp_UserOfflineSmall Offline
Aug 21, 2012 - 9:07 pm

Sorry to resurrect this old post - I still haven't been able to get this working.

Would you be able to give an example of how to use that sph_buddypress_profile hook to return another URL?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 21, 2012 - 9:33 pm

add_filter('sph_buddypress_profile', 'my_url_routine', 10, 2)
function my_url_routine($site, $user) {
   $site = xxxxx;
}

and return the url you want for the page instead of xxxxx...  if you need to construct the url, the user object is passed to the routine and available in the $user variable...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626