Notifications
Clear all

wpForo 1.x.x [Closed] How to redirect users profiles links to my own users profiles pages ?

14 Posts
4 Users
2 Reactions
3,400 Views
Posts: 3
Topic starter
(@geve2009)
Active Member
Joined: 6 years ago

Hi,

I've seen somewhere that it could not be possible, but my website (intras.fr) already get hundred of profiles pages, well referenced. I just have created some forums using the (very good) WPForo plugin, but it creates many new profiles pages.

My profiles pages are custom one and I don't want to change them !

Is it possible to create something like "add action" with some function ?

Thanks for your answer and sorry for any mistakes, my native language is french.

13 Replies
Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @geve2009,

Yes that's possible. Please leave your website URL and some example of the profile pages.

Posts: 3
Topic starter
(@geve2009)
Active Member
Joined: 6 years ago

Hi,

website url with your forum : https://www.intras.fr/forum/forum-formation/

Examples of profile page :

https://www.intras.fr/formateurs/fiche-membre/?ID=37

and

https://www.intras.fr/freelances/profil-freelance/?ID=463

 

This is depending on user's role.

Thanks for any help 🙂

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

You should only change the profile page, but leave the Account, Subscription and Activity Menus. They are forum specific pages and your forum users will not be able to change account information in forum.

To replace profile URLs to your custom profile URLs put this code in your active WordPress theme functions.php file:

function change_wpforo_profile_to_custom_url( $url = '', $member = array(), $template = 'profile' ){
if( wpfval($member, 'ID') ){
return get_option('siteurl') . '/formateurs/fiche-membre/?ID=' . $member['ID'];
}
return $url;
}
add_filter( 'wpforo_member_profile_url', 'change_wpforo_profile_to_custom_url', 10, 3 );

How to Easily Add Custom Code in WordPress (without Breaking Your Site)

9 Replies
(@geve2009)
Joined: 6 years ago

Active Member
Posts: 3

Thousand thanks for this fast an nice answer. It works well and I had customized it for my own use.

Suggestion : Why don't add this in your next update ?
A backoffice screen which offer options to select the profile link (UM profile, WC profile, ... and custom profile).

It would be very usefull for anyone.

 😀  Of course, I went to submit a 5 stars review for your nice plugin, but...

I would be happy to get ALL my WPForo screens translated into french language...
I had completed the PO file for french translation, but it seems that some words aren't into the translation file (i.e. "Unread posts" as link at the bottom of a forum, and some others... Thanks to check.

(@habbodreams)
Joined: 2 years ago

Eminent Member
Posts: 23

@robert

Hello, I allow myself to highlight this subject because I would like to use this code but I must fill it in incorrectly because it does not work correctly for me, the links change well but I would need help please ;).

Here are the links I get for visiting a user's profile on my site:

https://habbodreams.net/mon-profile/?uid=37

https://habbodreams.net/mon-profile/?uid=13

It is only the "?uid=(number) that changes according to each profile.

Can you tell me how to modify the code correctly please? Cordially

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3627

@habbodreams,

Please try the (above code)old code, and then provide more info about what doesn't work.

Screenshot with the issue would be good.

(@habbodreams)
Joined: 2 years ago

Eminent Member
Posts: 23

@chris Hello, I have put the original code back and as you can see in the first screenshots, the number of the ID changes well and corresponds to the profile (13 and 39) but does not lead where it necessary, only on the profile of the user who is connected. On the last screenshot, in the member search, we can see the real base url that works with the IUD. It is this address that is needed for it to work, the codes that you provided me later display IUD at the end of the url but do not generate the code 🙁 We are almost there I think. Thank you again for your help and your perseverance, it's very professional on your part, I will give you a favorable opinion for your great plugin as well as for your support :). Cordially.

 

wpforoiud wpforoiud2 wpforoiud3 wpforoiud4

(@habbodreams)
Joined: 2 years ago

Eminent Member
Posts: 23

I saw that in the plugin in question, I could modify the slug of the user, could that help?

optionslug
logo hd free

Chris
(@chris)
Joined: 3 years ago

Famed Member
Posts: 3627

@habbodreams,

please enable wpForoSupport Account.

(@habbodreams)
Joined: 2 years ago

Eminent Member
Posts: 23

@chris It's ok 🙂

(@habbodreams)
Joined: 2 years ago

Eminent Member
Posts: 23

@chris

Hello, would it help you to have admin access to the site to make things easier for you? otherwise I'll send it to you by pm on the site ☺️
(@habbodreams)
Joined: 2 years ago

Eminent Member
Posts: 23

Hello, thank you again for your help and I announce that I have found the solution 👍 I will explain it for other WpForo users 🙂. To start, download the "Redirection" plugin available here.

After installing the plugin, go to it in the redirection tab, insert in the Source URL: /participant/(.*) Uncheck the first 2 options (ignore my slash and case) and only enable "Regex".  Leave the other options untouched. Target URL: ( I give the example I made for my site. )

 /mon-profil/?uid=$1

It all depends on the custom profile url you are using, if it is for example /pageprofil/?id= , you will add $1 at the end to display the user's ID number. Remember to modify in the WpForo settings, member profile, display user Id if your profile redirects to a numerical value of the ID. Hoping you help in my brief explanation, looking forward to helping you if needed by posting an answer 👌

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Also I recommend disable wpForo Profile Page indexing in Dashboard > Forums > Settings > Features admin page: