V3 concept for the iframe integration

User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

V3 concept for the iframe integration

Post by axew3 »

I've gotta to do several hacks for a work that i'm involved and i've come over to problems about redirections for digests emails: i had to find out a way to not go to edit any file on it, cause already deeply edited to send out, for example, full wordpress usernames and not phpBB usernames ... the board display for each user the wordpress full first and last name, thay want also on digests the same result.

The problem as said was that i do not want further more edit this phpBB digests mod adding the var ifr to redirect if the case to iframed phpBB in wp page ... :idea:

All phpBB links should load iframed wordpress page, without edit any phpBB file, without adding any var on links that points to direct phpBB, possible? Possible. This is just a draft, that someone will understand, someone else will need to wait for the full explain and easy running example.

In this way, the concept of the iframe integration is extended to be what need to be and with no compromises.

The way to inject the joke, is to add few lines of code into a plugin, that need to execute earlier, then for example, into wp_w3all.php file, on top, we could add something like this (or another more precise):

Code: Select all

if( !isset($_GET['w3']) && strpos($_SERVER['REQUEST_URI'], '/forums') !== false && !isset($_GET["forum_id"])){
  $v = explode('/',$_SERVER['REQUEST_URI']);
  $vr = array_pop($v);
 if( preg_match('/[^-0-9A-Za-z\._#\:\?\/=&%]/i',$v) ){
    header("Location: https://localhost/mmo-online/onboard/");
     exit;
   } else {
   	header("Location: https://localhost/mmo-online/onboard/?w3=". base64_encode($vr)."");
     exit;
   }
}
on this code, note the $_SERVER['REQUEST_URI'], '/forums')
that try to detect if the request contain the term '/forums' which in this case is the name of the iframe phpBB into wordpress page: substantially this is the name of the wordpress page that contain phpBB.
The code as you see, just check if a var w3 exists on the request: if the link point to forums page, and not contain the var w3 then this request will be encoded and a redirect forced to open the forum at correct wp forum page, with correct encoded request.

and if on phpBB overall_header.html, we go to add something like the above, that instead check if the w3 var exist, AND IF NOT, AND IF NOT in IFRAME ...

Code: Select all

var frameEl = window.frameElement;
if (frameEl) {
  if NOT w3 exist
  THEN extract the query string
  encode and reload page passing to proper wordpress forum page the w3 var/url to be processed
} 
With this, we go a step ahead, there is no necessity to edit any notification link for emails: we do not have to worry about copied links, substantially we get a complete integration: more tricks can be applied, for example,
on this, we can also take advantage of one thing: exclude for example bots, so the forum will be indexed by spiders, but force to redirect common guests or registered users.
This can be achieved with easy like this for example:

Code: Select all

<!-- IF not S_IS_BOT -->
execute the above, redirecting user to iframe
<!-- ENDIF -->
or may just leave users in the case that they are on forum but not iframe mode, a link to choose to switch or not, there are no limits making the concept working perfect for a perfect iframed integration.

Stay tuned cool people, the integration plugin's core files will be soon improved and the iframe version will jump to next V3 version ...
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: V3 concept for the iframe integration

Post by axew3 »

The new v3 phpBB WordPress template integration code has been published for all cool people. Will be tested little more before to be released on next plugin versions.
This new version fix any possible issue, quite deeply tested on any device.
Use pure Javascript solution to redirect phpBB notification emails and differ on some aspect respect the v1 and v2 versions.
It has not still been added on this online example which at date of this post still run v2 code.

v3 phpBB WordPress template integration is here
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: V3 concept for the iframe integration

Post by axew3 »

The overall_footer.html v3 code has been updated at date of this reply.
It fix a problem on redirect same domain links.
Now all should work smooth and perfect ...
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

V3 iframe concept applied online

Post by axew3 »

This online installation example at date of this post run:
the new v3 iframe code and phpBB 3.2.5.
Let check to resolve, in case, any possible remaining bug that by the way at moment seem to not come out in any way ;)

p.s beside all fixed in one shot about redirects of any kind, note that also inline posts links now loads without the "in iframe page reload" bad effect. Also this aspect has been definitively resolved.

Uh! let check this kind of links inline into a post:
viewforum.php?f=1

yeah, you have the same result! in any way you open it ...

you do not have to edit any phpBB notification email template to redirect users to iframe.
you do not have to edit htaccess.
you do not have to worry about spiders and seo.
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: V3 concept for the iframe integration

Post by axew3 »

the complete correct code has been published at date of this post, with new plugin 1.9.4 release.
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: V3 concept for the iframe integration

Post by axew3 »

the overall_header.html and overall_footer.html v3 JS code has been patched because it was hard for all to access ACP when iframe activated, and for several other reasons:
now the code has been changed to:
when phpBB admin ACP link clicked, new page will be opened if clicked within iframe.
when acp page, login or ACP admin, accessed via direct url, equally, it will be opened as called, external, no redirect to iframe will fire.
That will make the situation more clear and useful for all.
Post Reply