Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

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

Re: Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

Post by axew3 »

ehi! :D yes please posts answers are two, of course you noticed of this, there is a lot of my bad Eng to read!
Looking to your as soon ...
mLgz0rn
User ww
User ww
Posts: 42
Joined: Fri Jan 20, 2017 5:23 pm

Re: Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

Post by mLgz0rn »

Alright.

Everything seems to be working great!
However, when I copy the link (rightclick the page and copy) it's http://rng.clanroyal.dk/forums/app.php/ ... frame=true instead of http://rng.clanroyal.dk/forums/app.php/ ... cationform
User avatar
axew3
w3all User
w3all User
Posts: 2937
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

Post by axew3 »

ok! i will take a look to the piece of JS that need to be "seriously" improved to get the correct result on any situation.
The actual code is:

Code: Select all

$( "a" ).contextmenu(function() {
  var href = $(this).attr("href");
  var shortlink = /^#p[0-9]+/ig.exec(href);
	var ck  = (href.indexOf('iframe=true') > -1);
	var ckl = /^(http[s]?:\/\/[-a-z0-9\.]+)/ig.exec(href); // check if link point to external resource: a passed phpBB url (attr("href")) is relative, not absolute: so we assume that if http(s) is present, 
	// than it should be a link that point to an external iframe resource. Can be improved further more using this same pattern result.
	
	 if ( ck == false && ckl == null && shortlink == null ){ // not re-append // not append if short link like #p49 (link of the post on viewtopic) or passed link point to an external resource
	 	  var href0 = href.split('?');
	 	  if(href0[1] == null){ href0[1] = ''; } else { href0[1] = '&' + href0[1]; }
      var href1 = href0[0] + '?iframe=true' + href0[1];
    $(this).attr("href", href1); // send out before mouseup ...
   }
});
$( "a" ).mouseup(function() { // but remove on mouseup, or leaving iframe=true we'll loop with htaccess ...
  var href = $(this).attr("href");
  $(this).attr("href", href.replace('iframe=true&', ''));
});
but it also fail in certain particular links of some phpBB page, so we go to make it better
mLgz0rn
User ww
User ww
Posts: 42
Joined: Fri Jan 20, 2017 5:23 pm

Re: Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

Post by mLgz0rn »

Another thing I was thinking about, to make the iframed forum seem faster, if running on a potato server :D.
Since it's basically an iframe, would it be possible to lazyload it?
User avatar
axew3
w3all User
w3all User
Posts: 2937
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

Post by axew3 »

wow, google translator say me nothing when i put lazyload :D
so i maybe have not well understand this sorry! (red face again)
what it mean: a sort of cache for phpBB or what?

p.s while if i put lazy load it still say something i can't associate to understand ...
mLgz0rn
User ww
User ww
Posts: 42
Joined: Fri Jan 20, 2017 5:23 pm

Re: Get custom page link (and email activation) rewrite to redirect to iframed phpBB?

Post by mLgz0rn »

axew3 wrote: Mon Apr 30, 2018 3:34 pm wow, google translator say me nothing when i put lazyload :D
so i maybe have not well understand this sorry! (red face)
what you mean: a sort of cache for phpBB or what?

p.s while if i put lazy load it say still something i can't associate to something useful ...
So what lazyload does, is it only loads images/videos/iframes that are in the viewport.
And when you scroll it loads stuff that comes into the viewport.
You can even set this to load content that are out of the viewport with an amount of pixels.

The problem here is, I don't think it would work as I think with this, since it's an entire iframe that needs to be loaded, so if you could like only load parts of the iframed forum that are in the viewport, instead of the entire iframed forum.
It could make it seem faster.

Hope you understand what I mean :D

a few examples
https://www.andreaverlicchi.eu/lazyload/
https://github.com/emn178/jquery-lazyload-any
http://afarkas.github.io/lazysizes/
Post Reply