Page 1 of 1

Point to phpBB profile from WP

Posted: Thu Nov 21, 2019 12:41 pm
by zawin
Hello,
how can I point to phpBB user profile from Wordpress? Wordpress User ID is different from phpBB user ID and I need $w3phpbbuid.

Thank you

Re: Point to phpBB profile from WP

Posted: Thu Nov 21, 2019 8:30 pm
by axew3
Well no, you do not need userid, you need username because IDs normally mismatch.
You want that if an user click into a profile url that isn't his own profile, to view another user profile, then phpBB url profile of this user should be provided.

may a db call to phpBB done when a profile url clicked in wordpress (js event listener) then an ajax call will fire to execute the query, retrieve uid in phpBB, return value, and build url to point to phpBB (that need to contain id).
This is maybe the wordpress side way.

But you could do the same passing to phpBB the username, that would be also more easy to do.
Normal phpBB profile url look like this:

Code: Select all

https://www.axew3.com/w3/forums/memberlist.php?mode=viewprofile&u=390
Let say that in wordpress you edit wp profile urls to point to something like this:

Code: Select all

https://www.axew3.com/w3/forums/memberlist.php?mode=viewprofile&uname=anUsername
Then on top of phpBB viewprofile.php if you're wild, or via a phpBB mod:
On top of the file, you could $_GET the var uname, sanitize, and execute a query to check the phpBB id of this username, then build the url to phpBB profile adding the user id, stop code execution, reload page to correct phpBB user profile.

I will consider to add the wordpress way as soon into plugin.

Re: Point to phpBB profile from WP

Posted: Thu Nov 21, 2019 8:39 pm
by axew3
P.s : the wordpress way is very easy also doing this without any javascript:
just add action when wordpress profile page event hook fire (or grab the username of the user where/when exist in various ways), execute the query, retrieve phpBB ID, load phpBB profile.
Easy and short. I will add soon on next version this convenient way, will be easy to be adapted for any scope.