Why you do not want let users login also via phpBB? ... by the way
you speak about phpBB login, so you can't achieve this via a WordPress plugin only, without adding code into phpBB also.
The effective way that will work with easy, without exploring more complicate and not effective ways ...
Same concept is here explained, but this is a good solution if you want let users login in phpBB, then redirect to WordPress:
Add user at same time into WordPress when register/login in phpBB side
But you want a redirect before,
when user try to login in phpBB should be redirected to WP login.
This can be achieved with easy in two ways: pure Javascript or pure Php. Maybe both.
Javascript/jQuery:
open your overall_footer.html
maybe just after this line to make it simple (but would be better on overall_header.html file for the second instruction, by the way it work fine also as is)
Code: Select all
<!-- EVENT overall_footer_body_after -->
add the follow:
Code: Select all
<script type="text/javascript">
$(".quick-login").click(function(){
window.location.replace("http://localhost/wp49/wp-login.php");
});
if(window.location.href.indexOf("mode=login") > -1) {
window.location.replace("http://localhost/wp49/wp-login.php");
}
</script>
change
http://localhost/wp49/wp-login.php with the url you want to point to and remember to recompile the phpBB template.
First instruction:
now when an user click on the quick login form fields, assuming your theme use as class name the default one, to wrap the quick login form, so
quick-login, if not change with your class name (link your forum if not work and you can't get the name of this class), will be redirected to the assigned url.
Second instruction:
if the url point to upc.php with a var mode set to login, then redirect to the assigned url.
Now all this is very nice until Javascript is enabled on browser, while will have no effect if js is disabled. Then there are more, really several and elegant ways to force the correct redirect in any case.
this problem resolved via php, let with a quick login problem: with js, and the above code, when user go to click into quick login form pass or username field to digit his credentials, then will be redirected before he click on login button and possibly before he start to digit, to the proper page.
Via php it is not possible the same result: like the second instruction js solution do, it can only detect when the page will load successively, that is the ucp.php page and that point to login (when user will click into login button).
Then in this case: remove the quick login form from template
OR leaving the quick login form in place you can get the result editing on template file, the quick login html form to point to the login url in wp, passing correct vars names as wp expect to receive.
I stop here at moment, and hope this will be sufficient clear! In effect it is rare that js have been disabled on browser, so may just the above code will be sufficient for you.
Why you do not want let users login also via phpBB? ... by the way
[b]you speak about phpBB login, so you can't achieve this via a WordPress plugin only, without adding code into phpBB also.[/b]
The effective way that will work with easy, without exploring more complicate and not effective ways ...
Same concept is here explained, but this is a good solution if you want let users login in phpBB, then redirect to WordPress:
[url=https://www.axew3.com/w3/forums/viewtopic.php?f=2&t=643]Add user at same time into WordPress when register/login in phpBB side[/url]
But you want a redirect before, [b]when user try to login in phpBB should be redirected to WP login.[/b]
This can be achieved with easy in two ways: pure Javascript or pure Php. Maybe both.
Javascript/jQuery:
open your overall_footer.html
maybe just after this line to make it simple (but would be better on overall_header.html file for the second instruction, by the way it work fine also as is)
[code]<!-- EVENT overall_footer_body_after -->[/code]
add the follow:
[code]<script type="text/javascript">
$(".quick-login").click(function(){
window.location.replace("http://localhost/wp49/wp-login.php");
});
if(window.location.href.indexOf("mode=login") > -1) {
window.location.replace("http://localhost/wp49/wp-login.php");
}
</script>[/code]
change [i]http://localhost/wp49/wp-login.php[/i] with the url you want to point to and remember to recompile the phpBB template.
[b]First instruction:[/b]
now when an user click on the quick login form fields, assuming your theme use as class name the default one, to wrap the quick login form, so [i]quick-login[/i], if not change with your class name (link your forum if not work and you can't get the name of this class), will be redirected to the assigned url.
[b]Second instruction:[/b]
if the url point to upc.php with a var mode set to login, then redirect to the assigned url.
Now all this is very nice until Javascript is enabled on browser, while will have no effect if js is disabled. Then there are more, really several and elegant ways to force the correct redirect in any case.
this problem resolved via php, let with a quick login problem: with js, and the above code, when user go to click into quick login form pass or username field to digit his credentials, then will be redirected before he click on login button and possibly before he start to digit, to the proper page.
Via php it is not possible the same result: like the second instruction js solution do, it can only detect when the page will load successively, that is the ucp.php page and that point to login (when user will click into login button).
Then in this case: remove the quick login form from template [b]OR leaving the quick [i]login form[/i] in place you can get the result editing on template file, the quick login html form to point to the login url in wp, passing correct vars names as wp expect to receive.[/b]
I stop here at moment, and hope this will be sufficient clear! In effect it is rare that js have been disabled on browser, so may just the above code will be sufficient for you.