Template integration: parent WP page URLs push and common solutions

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

Template integration: parent WP page URLs push and common solutions

Post by axew3 »

Think that Peerke refer to the fact that for example, an user could copy the URL base64 encoded (WP page url) and go to share it, so it is true that:
1) if the template integration code will be removed, then those links will lead to nowhere.
2) if a BOT/SPIDER go to check it, because it has been pasted by someone into an external site, will be probably redirected to a NOT FOUND even while the template integration is used, because or will follow the redirect (but i do not know what bots/spiders do in those cases, normally they completely ignore javascript) or also just as the code is, since bots are excluded by run the overall_header js code (it start with <!-- IF not S_IS_BOT --><script>) then again, the BOT will not found any URL.
Of course bots access to the forum at the real url, and the js code do not affect, but if it is true that a ranking for a site is given also by how many external sites links his url, who know (i don't) if the bots will consider anyway to top up the ranking or simply ignore because the link url do not exist?
This topic is reserved to explore all possible solutions, so to not have URLs pushed into the Parent WP forum page (the WP page that embed/display the phpBB iframed), and to have as result, at mean time, a good users navigation experience. Because it is not a point about SEO, that probably impact 0,1% of the total, due to the aspect above mentioned (maybe not completely well explained), anyway how much, it depend by how many external links you'll loose due to this, that could rank up your site and instead, maybe will not.

The first solution is very easy, do NOT push URLs into the Parent WP page, so users are forced to copy urls within the iframe, without the possibility to copy on the parent address bar:
open up page-forum(orWhateverNamed).php into your active template folder or the shortcode file /wp-content/plugins/wp-w3all-phpbb-integration/views/wp_w3all_phpbb_iframe_short.php (depend which you are using, maybe both) then into, change this:

Chnage this line of code:

Code: Select all

history.replaceState({}, \"\", w3all_passed_url_push);
INTO this

Code: Select all

//history.replaceState({}, \"\", w3all_passed_url_push);
so more below, just BEFORE the closing </script> tag,
ADD the follow:

Code: Select all

    let w3all_passed_url_push = '".$w3allhomeurl."/".$wp_w3all_forum_folder_wp."/';
    history.replaceState({}, \"\", w3all_passed_url_push);
All done, the parent WP page address isn't pushed to be changed, and changed only one time when the page load.
The unique point here, that IS NOT covered, is this fact:
IF YOU RELOAD the page (the WP parent page), the iframe will always load on refresh, the phpBB index, NOT the post or topic we are on at the time we go to refresh.

I am over to fix this aspect, anybody know how it could be fixed?

[EDITED 3 times]
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Template integration: parent WP page URLs push and common solutions

Post by axew3 »

The above code has been fixed, because the previous was leading to the same result, but with wrongs results after maybe (on browser history) and was not so correct.
This is the right version, and i think i figured out how to resolve the reload mentioned issue.
I will try to translate it on code this night!
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Template integration: parent WP page URLs push and common solutions

Post by axew3 »

The second solution
so to not have URLs pushed into the Parent WP forum page
I will try to deny myself.

In this second, it could be possible with some tricks, to push real phpBB urls into the address bar, but to have this done, the forum MUST RESIDE into same domain: it is not possible to achieve the same result, so having real phpBB urls pushed into the address bar, between domain/subdomain. The forum need to stay on same domain.

It is not possible, in fact, to push a different domain URL into the address bar, nor if it is a subdomain of it.
As possible i will try also this way.
Post Reply