Redirect phpbb Registration to Wordpress

Ezrael
User ww
User ww
Posts: 22
Joined: Wed Nov 15, 2023 9:11 pm

Redirect phpbb Registration to Wordpress

Post by Ezrael »

Due to the fact, that Wordpress provide better options to send html email to new users or emails to the admins about the registration I would prefer to use just the WP Registration instead of the phpbb.

Do you know any possibility to change/redirect the phpbb registration to a Wordpress registration form?
User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Redirect phpbb Registration to Wordpress

Post by axew3 »

You can easily use javascript adding this:

Code: Select all

<script>
 if(/mode=login/ig.exec(window.location.href) !== null)
 {
  document.location.replace('https://mysite/mypage');
 }
</script>
into the overall_header.html, just after

Code: Select all

<title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF not S_VIEWTOPIC and not S_VIEWFORUM -->{SITENAME} - <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}<!-- IF S_VIEWTOPIC or S_VIEWFORUM --> - {SITENAME}<!-- ENDIF --></title>

{META}
change https://mysite/mypage to fit your page

or if you are using the phpBB wp extension, or any other that hook into the
core.common
event listener in phpBB, just adding the required Php code, that's also very short, and redirect in any case, even if javascript is disabled on browser, but maybe the easy js one can be ok because js is +- always active on any browser 99.9% of times.

Remember to Recompile Stale templates into phpBB (option in ACP) if you add code into template files so to see changes you applied and let them take effect.

[EDITED]
Post Reply