Page 4 of 6

Re: 1 pixel iframe (instructions followed) on subdomain

Posted: Tue Dec 31, 2019 2:29 pm
by axew3
i see that if you point your mouse over a topic link, as you see here it is:

Code: Select all

https://www.axew3.com/w3/forums/viewtopic.php?f=2&t=1450
while your miss starting http
dev.my80isfantastic.eu/phpBB3/viewtopic.php?f=61&p=188457#p188457

if i open the link with right click open new tab all work fine :?:

Re: 1 pixel iframe (instructions followed) on subdomain

Posted: Tue Dec 31, 2019 2:40 pm
by axew3
p.s
on page forum there is this code:

Code: Select all

if (w3all_ck_preview == false) { // or the phpBB passed preview link, will be recognized as external, and preview will redirect to full forum url instead
 // so these are maybe, external iframe redirects
    if (w3all_pass_ext == true) {
     	window.location.replace(w3all_passed_url); 
     }
    if (/^(f|ht)tps?:\/\//i.test(w3all_passed_url)) {
      window.location.replace(w3all_passed_url); 
    }
}
change into:

Code: Select all

if (w3all_ck_preview == false) { // or the phpBB passed preview link, will be recognized as external, and preview will redirect to full forum url instead
 // so these are maybe, external iframe redirects
    if (w3all_pass_ext == true) {
     	//window.location.replace(w3all_passed_url); 
     }
    if (/^(f|ht)tps?:\/\//i.test(w3all_passed_url)) {
     // window.location.replace(w3all_passed_url); 
    }
}
should work, think i have understand the problem.
But in this state, if a link points to external url into a phpBB post, may will load into iframe.
Substantially, i think this line in page forum

Code: Select all

var w3all_pass_ext  = (w3all_passed_url.indexOf(w3all_ck) > -1);  
fail because passed linnk not contain http

Re: 1 pixel iframe (instructions followed) on subdomain

Posted: Wed Jan 01, 2020 7:47 pm
by axew3
Hi there! So, resuming here all things about iframe and correct configuration for subdomains.
I will may setup something to fix all issues as possible, in the while this is the point.

First of all: you were may using code iframe v3, but using forum page for v4.
This because, the link into plugin admin to the help install steps, point to v3 code, where was written that the new version to use is v4, but maybe not so clearly (now it is clear and i will setup a way to avoid mistakes in the future).

Second:
so i've resumed subdomains setups into my localhost.
then i installed both phpBB WP into this subdomain:

Code: Select all

https://subdomain.w3host.com/wordpress
https://subdomain.w3host.com/phpbb3
all work sparkly, i've just setup for the overall_footer.html code, subdomain.w3host.com, and nothing else needed.

But of course, the problem have come out when i installed

Code: Select all

https://w3host.com/wordpress
linking it to the subdomain phpBB.
So,in this kind of scenario, wp is at w3host.com, while phpBB is on subdomain subdomain.w3host.com.

What to do to make it work fine is just this:
into phpBB overall_footer.html:

Code: Select all

document.domain = 'w3host.com'; // MANDATORY! // Set/Change this value to your domain (example: axew3.com (or leave localhost if on localhost))
then open page-forum (or whatever named)
where this:

Code: Select all

document.domain = '".$document_domain."';
//document.domain = 'w3host.com'; // NOTE: reset/setup this with domain if js error when WP is installed like on mysite.domain.com and phpBB on domain.com: js origin error can come out for example when WordPress is on subdomain install and phpBB on domain. The origin fix is needed: (do this also on phpBB overall_footer.html added code)
change into:

Code: Select all

//document.domain = '".$document_domain."';
document.domain = 'w3host.com'; // NOTE: reset/setup this with domain if js error when WP is installed like on mysite.domain.com and phpBB on domain.com: js origin error can come out for example when WordPress is on subdomain install and phpBB on domain. The origin fix is needed: (do this also on phpBB overall_footer.html added code)
then change this:

Code: Select all

 // array() of allowed domains
    var w3all_orig_domains = ['".$w3all_orig."','".$w3all_orig_www."','https://localhost','http://localhost'];
into this:

Code: Select all

 // array() of allowed domains
    var w3all_orig_domains = ['".$w3all_orig."','".$w3all_orig_www."','https://localhost','http://localhost','https://w3host.com','http://w3host.com'];
All will work fine.

NOTE IMPORTANT: http://w3host.com is recognized differently by http://www.w3host.com (like http and https).
So if your server not force a way or other, and is accessible may both via https or http, and www or not www, then you have to add these possible variants into this array.

I will try to automatize for subdomains all this, by the way it will be not simple, because the problem are domains like:
mydomain.co.uk
that's not clearly a subdomain.
So it is not so easy to work around this. I've do a little code that using array of possible registered valid domains, check for correct value and never fail. By the way to use it, then the code should iterate into each time, or i need to provide a procedure once that will setup correct values.
Maybe a simple tutorial ( and may well linked :) ) will do the work.

Let know if still in trouble with : into passed url-

Re: 1 pixel iframe (instructions followed) on subdomain

Posted: Wed Jan 01, 2020 8:52 pm
by axew3
An excerpt of this post, as temporary procedure, has been done and linked into the iframe template help install procedure
How to Domain/subdomain iframe template integration

Re: 1 pixel iframe (instructions followed) on subdomain

Posted: Thu Jan 02, 2020 4:04 pm
by madoma73
Hello
I have followed the instructions but if you have a look at http://dev.my80isfantastic.eu/phpbb_forum/
you will see that I have a 1 pixel iframe.

Re: 1 pixel iframe (instructions followed) on subdomain

Posted: Thu Jan 02, 2020 4:37 pm
by madoma73
the only error that I can see now is on:
parent.w3all_ajaxup_from_phpbb(w3appendevents);

and issue is:
index.php:1261 Uncaught DOMException: Blocked a frame with origin "http://dev.my80isfantastic.eu" from accessing a cross-origin frame.
at http://dev.my80isfantastic.eu/phpBB3/index.php:1261:8
at dispatch (http://dev.my80isfantastic.eu/phpBB3/as ... 25:3:12444)
at r.handle (http://dev.my80isfantastic.eu/phpBB3/as ... =25:3:9173)