by axew3 » Thu Jul 19, 2018 7:38 am
Since 2.4.5> use this instead:
viewtopic.php?f=2&t=1670
OBSOLETE
How to add an user that register in phpBB that you want added also in WordPress at mean time
in phpBB, OPEN file
includes/upc/ucp_register.php
search for this code:
Code: Select all
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
/* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->add_notifications('notification.type.admin_activate_user', array(
'user_id' => $user_id,
'user_actkey' => $user_row['user_actkey'],
'user_regdate' => $user_row['user_regdate'],
));
}
immediately after
add this code OR the next piece of code if you want
user redirection in phpBB after wp user addition:
change http://192.168.1.5/wordpress to fit/point your wordpress URL (DO NOT ADD A FINAL SLASH)
not redirect the user in phpBB after addition in wp
Code: Select all
$wordpress_url = 'http://192.168.1.5/wordpress'; // SET HERE the WordPress URL you want to point to - DO NOT ADD FINAL SLASH (or change the code below)
$rurl = stristr(htmlspecialchars_decode($url), '&sid=', true); // 'REMOVE this line' to pass entire URL (with also sid var included) // stristr as of PHP 5.3.0 or >
if( strpos($rurl, '/') == 0 ){ $rurl = trim(substr($rurl, 1)); }
$rurl = base64_encode(generate_board_url() . '/'. str_replace('./', '', $rurl)); // this is, in case, for redirect into phpBB // w3insu=$utwpa&rurl=$rurl
$utwpa = base64_encode($data['username']);
header("Location: $wordpress_url/?w3insu=$utwpa");
exit;
to redirect the user in phpBB after addition in wp, use/add this code instead:
Code: Select all
$wordpress_url = 'http://192.168.1.5/wordpress'; // SET HERE the WordPress URL you want to point to - DO NOT ADD FINAL SLASH (or change the code below)
$rurl = stristr(htmlspecialchars_decode($url), '&sid=', true); // 'REMOVE this line' to pass entire URL (with also sid var included) // stristr as of PHP 5.3.0 or >
if( strpos($rurl, '/') == 0 ){ $rurl = trim(substr($rurl, 1)); }
$rurl = base64_encode(generate_board_url() . '/'. str_replace('./', '', $rurl)); // this is, in case, for redirect into phpBB // w3insu=$utwpa&rurl=$rurl
$utwpa = base64_encode($data['username']);
header("Location: $wordpress_url/?w3insu=$utwpa&w3rtb=$rurl");
exit;
When an user register in phpBB and completed correctly the registration procedure, will be then redirected and added into wordpress.
If you need that after addition in wordpress the user being redirected into phpBB (like the onlogin solution), then use the second suggested snippet right here above.
[color=#BF0040][size=200]Since 2.4.5> use this instead:[/size][/color]
[size=150][url]https://www.axew3.com/w3/forums/viewtopic.php?f=2&t=1670[/url][/size]
OBSOLETE
[strike][size=140][b]How to add an user that register in phpBB that you want added also in WordPress at mean time[/b][/size][/strike]
in phpBB, OPEN file
[b]includes/upc/[i]ucp_register.php[/i][/b]
[b]search for this code:[/b]
[code] if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
/* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->add_notifications('notification.type.admin_activate_user', array(
'user_id' => $user_id,
'user_actkey' => $user_row['user_actkey'],
'user_regdate' => $user_row['user_regdate'],
));
}[/code]
immediately after [b]add this code OR the next[/b] piece of code if you want [b]user redirection in phpBB[/b] after wp user addition:
[b]change[/b] http://192.168.1.5/wordpress to fit/point your wordpress URL (DO NOT ADD A FINAL SLASH)
[b][size=140][color=#FF0000]not redirect[/color] the user in phpBB after addition in wp[/size][/b]
[code]$wordpress_url = 'http://192.168.1.5/wordpress'; // SET HERE the WordPress URL you want to point to - DO NOT ADD FINAL SLASH (or change the code below)
$rurl = stristr(htmlspecialchars_decode($url), '&sid=', true); // 'REMOVE this line' to pass entire URL (with also sid var included) // stristr as of PHP 5.3.0 or >
if( strpos($rurl, '/') == 0 ){ $rurl = trim(substr($rurl, 1)); }
$rurl = base64_encode(generate_board_url() . '/'. str_replace('./', '', $rurl)); // this is, in case, for redirect into phpBB // w3insu=$utwpa&rurl=$rurl
$utwpa = base64_encode($data['username']);
header("Location: $wordpress_url/?w3insu=$utwpa");
exit;[/code]
[b][size=140][color=#FF0000]to redirect[/color] the user in phpBB after addition in wp, [color=#FF0000]use/add this code instead:[/color][/size][/b]
[code]$wordpress_url = 'http://192.168.1.5/wordpress'; // SET HERE the WordPress URL you want to point to - DO NOT ADD FINAL SLASH (or change the code below)
$rurl = stristr(htmlspecialchars_decode($url), '&sid=', true); // 'REMOVE this line' to pass entire URL (with also sid var included) // stristr as of PHP 5.3.0 or >
if( strpos($rurl, '/') == 0 ){ $rurl = trim(substr($rurl, 1)); }
$rurl = base64_encode(generate_board_url() . '/'. str_replace('./', '', $rurl)); // this is, in case, for redirect into phpBB // w3insu=$utwpa&rurl=$rurl
$utwpa = base64_encode($data['username']);
header("Location: $wordpress_url/?w3insu=$utwpa&w3rtb=$rurl");
exit;[/code]
When an user register in phpBB and completed correctly the registration procedure, will be then redirected and added into wordpress.
If you need that after addition in wordpress the user being redirected into phpBB (like the onlogin solution), then use the second suggested snippet right here above.