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: 1971
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: 1971
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

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

Re: Forum constantly reloads when not logged in.

Post by axew3 »

Ehy! Just gave a try, i registered alias. All seem to work perfect, by the way, i see a js error on console, coming out into your wordpress theme header, a js function that cause this:

Code: Select all

TypeError: document.getElementById(...) is null forum:421:54
    resizeIframe https://www.nylaathria.dk/forum/:421
    callResize https://www.nylaathria.dk/nyl/viewforum.php?f=13:868
but this is NOT the iframe resizer of the plugin, it is from your wp theme, you should resolve this that output into wordpress page-forum causing the js error where dynheight return a null value on page-forum (it output into wordpress header)

Code: Select all

<script type="text/javascript">
//   reSize Iframe when ever child  calls  it
function resizeIframe(dynheight)
        {
            document.getElementById("iforum").height=parseInt(dynheight)+10;
        }
 
</script>
this can be resolved in various ways, first of all may detecting why this function called in this case (on page -forum) return a null value for the passed
dynheight var

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 »

I've updated the theme we're using (Hestia), which was a couple of versions behind - mainly due to my changes - However, the "Gutenberg" thing was kind of broke, so had to :p

Forum looks, in my opinion, better now, as in: it looks more like it belongs to the page -- Just some sizing issues, it's cutting off the bottom of the forum. I'll look into that later, it's about time I get some sleep :P

I'll look into the js error when I get back up.

Thanks for the help!

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

Re: Forum constantly reloads when not logged in.

Post by axew3 »

Nighty wrote:
Thu May 14, 2020 6:46 am
-- Just some sizing issues
So you may will take a look into this to resolve definitively any resizer issue
viewtopic.php?p=4505#p4505

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 »

Hm.

A guildie pointed out to me that the site (forum) seems to be back on a reload loop after the design changes, so kind of back to square one.
Got an idea about what's going on there?

As the site is now, when not logged in.

Post Reply