Forum constantly reloads when not logged in.

Nighty
User w
User w
Posts: 6
Joined: Tue Jan 28, 2020 11:09 am

Forum constantly reloads when not logged in.

Post by Nighty »

Helloes,

Got the issue the subject line describes - When I'm not logged in on the forum it keeps trying to reload the.. iframe, till you log in through other means (wordpress/eqdkp+).
Everything works perfectly fine once logged in.

I'm guessing my iframe integration is wrong, which is causing it to do what it does - However, I'm currently at a loss to figure out why it does it.
Any help would be appreciated.

Domain: https://www.nylaathria.dk/nylv5/forum/


Best Regards,
Nighty
User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Forum constantly reloads when not logged in.

Post by axew3 »

for what i see, you may need to:
rebuild forum page on plugin admin
or substitute it with new one manually
https://www.axew3.com/w3/2020/01/phpbb- ... iframe-v5/
are you using iframe code v5, on old page forum?

Update both to latest!
Let know
User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Forum constantly reloads when not logged in.

Post by axew3 »

p.s update also the file iframeResizer.contentWindow.min.js into phpBB root.
Substantially, follow steps as indicated into the update/install procedure linked above
Nighty
User w
User w
Posts: 6
Joined: Tue Jan 28, 2020 11:09 am

Re: Forum constantly reloads when not logged in.

Post by Nighty »

First off - I apologise for the slow slow reply. Been a bit going on.

Anyhow, the code I followed at the time should've been all up-to-date, and I did do the iframeResizer.contentWindow.min.js as well.

Am guessing it might be due to the way I integrated the thing, which is essentially just copying over the iFrame data, as doing the rebuild resulted in the page not working at all - as in, am guessing that the theme I use doesn't quite work with the "normal" way of doing things (Using Hestia).


However, it has been a fair bit of time since last, and you've certainly done some updates, and I've got some time now to work on our new page -- so, I'll mess about with it some, make sure everything is updated to your last codes, and then I'll get back to you - thanks for the replies! :)

Code: Select all

<!-- START iframe div -->
<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
<div class="">
<noscript><h3>It seem that your browser have Javascript disabled: you can't load the forum page at this Url. Please enable Javascript on your browser or <a href="https://www.nylaathria.dk/nyl/index.php">visit the forum here</a>.<br><br></h3></noscript>
<iframe id="w3all_phpbb_iframe" style="width: 1px; min-width: 100%; border: 0px; overflow: hidden; height: 1494px;" scrolling="no" src="https://www.nylaathria.dk/nyl/index.php"></iframe>
<script type="text/javascript">
		document.domain = 'nylaathria.dk';
		// document.domain = 'mydomain.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)
		var wp_u_logged = 1;
		
		function w3all_ajaxup_from_phpbb(res){
			var w3all_phpbb_u_logged  = /#w3all_phpbb_u_logged=1/ig.exec(res);
			 if( w3all_phpbb_u_logged == null && wp_u_logged > 0  ){
			 document.location.replace('https://www.nylaathria.dk/nylv5/index.php/forum/');
       }
       if(wp_u_logged == 0 && res.indexOf('#w3all_phpbb_u_logged=1') > -1){
       document.location.replace('https://www.nylaathria.dk/nylv5/index.php/forum/');
       }
       
			var w3all_phpbbpmcount = /.*(#w3all_phpbbpmcount)=([0-9]+).*/ig.exec(res);
      if(w3all_phpbbpmcount !== null){
         w3all_ajaxup_from_phpbb_do(w3all_phpbbpmcount[2]);
       }   
       
   } // END function w3all_ajaxup_from_phpbb(res){
     
    iFrameResize({
				log                     : false,
				inPageLinks             : true,
        targetOrigin: 'https://www.nylaathria.dk/nyl/index.php', 
        checkOrigin : 'nylaathria.dk', // if js error: 'Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin. Need to fit YOUR domain, ex: mydomain.com
     // heightCalculationMethod: 'documentElementOffset', // If iframe not resize correctly, un-comment (or change with one of others available resize methods) 
     // see: https://github.com/davidjbradshaw/iframe-resizer#heightcalculationmethod
       
				messageCallback : function(messageData){ // Callback fn when message is received 	
	   
				// w3all simple js check and redirects
				var w3all_passed_url = messageData.message.toString();
			  var w3all_ck = "www.nylaathria.dk";
        var w3all_pass_ext  = (w3all_passed_url.indexOf(w3all_ck) > -1);    
        var w3all_ck_preview = (w3all_passed_url.indexOf('preview') > -1);

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); 
    }
}

// security: do not pass to be encoded an url with sid or if point to phpBB admin ACP via iframe
if( /[^-0-9A-Za-z\._#\:\?\/=&%]/ig.exec(w3all_passed_url) !== null || /adm\//ig.exec(w3all_passed_url) !== null || /sid=/ig.exec(w3all_passed_url) !== null ){
	w3all_passed_url = '';
}
// PUSH phpBB URLs //
w3all_passed_url = window.btoa(unescape(encodeURIComponent(w3all_passed_url)));
w3all_passed_url_push = 'https://www.nylaathria.dk/nylv5/forum/?w3=' + w3all_passed_url;
history.pushState({w3all_passed_url: w3all_passed_url}, "Forum", w3all_passed_url_push);
}
});

</script></div>
<!-- END iframe div -->
Nighty
User w
User w
Posts: 6
Joined: Tue Jan 28, 2020 11:09 am

Re: Forum constantly reloads when not logged in.

Post by Nighty »

Right! I found / remember some of the reasons behind my changes now.

Atm I've set it up here: https://www.nylaathria.dk/nylv5/forum/

However, the top is missing (menu, lack of some sort of margin-top), as well as just keeping the top layout (gap).
The page loads too far down (auto-scrolls?).
And, the page layout is dropped - the left-side boxes are dropped (Recruitment/Progression).

Which is why I tried to do the iframe idea downstairs, basically just copying the parts into a page (I think I got the idea from somewhere on your site? But it's been so long that I'm unsure now). The iframe idea kept the site's layout, but caused the constant page reloading while not being logged in.

Any ideas, thoughts?

Thanks,
Nighty
Nighty
User w
User w
Posts: 6
Joined: Tue Jan 28, 2020 11:09 am

Re: Forum constantly reloads when not logged in.

Post by Nighty »

Not sure if I see a "Edit" button - So I do apologise for possibly missing it.

Anyhow, I moved the site to https://www.nylaathria.dk/forum/ - Live now.
Still working on it however. :D
Post Reply