Code to create link to user's phpBB profile
Posted: Tue Jun 16, 2020 4:48 pm
Hello,
Is there any PHP code available that lets logged in users on the Wordpress side visit their phpBB profile?
I've tried myself already with this:
<a href="/memberlist.php?mode=viewprofile&u=<?php global $current_user; get_currentuserinfo(); echo '' . $current_user->ID . "
"; ?>">
This successfully takes the user to a phpBB profile page, but it's not the correct user. Why? Because the user IDs in wordpress don't match the user IDs in phpBB - this is because phpBB user IDs are higher, because bot users have IDs. For example:
A user has phpBB ID 54.
But because there are 45 bots in phpBB, and these bots are not added to Wordpress, it means that once transferred to WP via the w3all transfer, their user ID will be 9.
So I thought okay, no problem, I'll just get PHP to add on the extra 45 to the user number in the link:
<a href="/memberlist.php?mode=viewprofile&u=<?php global $current_user; get_currentuserinfo(); echo '' . $current_user->ID + 45 . "
"; ?>">
But this still takes the user to the wrong profile page. So something else is the problem now. The issue is of course that if there are existing users on WP and phpBB side, their numbers will never match up, even if bots were taken out of the equation, because they would have all registered at different times and therefore all of the user IDs are mixed up!
SO.
Is there a PHP function to create a link for the user on WP side, and this link takes them to their phpBB profile page? So like, a function that gets their phpBB user ID from the w3all database tables, and appends this to a link? Does this already exist? Are phpBB user IDs even imported and stored in the w3all database tables when a transfer is made?
Thanks,
Tom
Is there any PHP code available that lets logged in users on the Wordpress side visit their phpBB profile?
I've tried myself already with this:
<a href="/memberlist.php?mode=viewprofile&u=<?php global $current_user; get_currentuserinfo(); echo '' . $current_user->ID . "
"; ?>">
This successfully takes the user to a phpBB profile page, but it's not the correct user. Why? Because the user IDs in wordpress don't match the user IDs in phpBB - this is because phpBB user IDs are higher, because bot users have IDs. For example:
A user has phpBB ID 54.
But because there are 45 bots in phpBB, and these bots are not added to Wordpress, it means that once transferred to WP via the w3all transfer, their user ID will be 9.
So I thought okay, no problem, I'll just get PHP to add on the extra 45 to the user number in the link:
<a href="/memberlist.php?mode=viewprofile&u=<?php global $current_user; get_currentuserinfo(); echo '' . $current_user->ID + 45 . "
"; ?>">
But this still takes the user to the wrong profile page. So something else is the problem now. The issue is of course that if there are existing users on WP and phpBB side, their numbers will never match up, even if bots were taken out of the equation, because they would have all registered at different times and therefore all of the user IDs are mixed up!
SO.
Is there a PHP function to create a link for the user on WP side, and this link takes them to their phpBB profile page? So like, a function that gets their phpBB user ID from the w3all database tables, and appends this to a link? Does this already exist? Are phpBB user IDs even imported and stored in the w3all database tables when a transfer is made?
Thanks,
Tom