V3 concept for the iframe integration
Posted: Sat Nov 17, 2018 10:08 am
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 ...
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):
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 ...
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:
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 ...
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 ...
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;
}
}
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
}
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 -->
Stay tuned cool people, the integration plugin's core files will be soon improved and the iframe version will jump to next V3 version ...