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 ...