MyBB Community Forums
Who's Online Wrong Location - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Who's Online Wrong Location (/thread-186639.html)



Who's Online Wrong Location - Glandus - 11-24-2015

I am stumped on why this is happening. Basically, when some guests or members are viewing my forum, they show as normal 'Viewing Index'. However, quite a lot of the time they are showing as 'Viewing Portal'. I tested this by making 3 test accounts, and when viewing the index, they all said 'Viewing Portal'. Does anybody know why this happens? You might ask, how do you know they have not viewed Portal? Well i don't but even my test accounts show as viewing Portal when I'm on the index.

I'll add that my forum has a sidebox and is pulling the latest threads/posts and who's online from the portal page (no plugin). Not sure if this would matter or not, however, I imagine it may have something to do with the latest posts from the portal?

Link: http://www.forumlair.com - I do usually fix things when I need to, but this has stumped me. If it's to do with the above, I can easily change the way I have latest posts on the index instead of pulling from the portal.


P.S - Other than the above, the who's online works as normal.


RE: Who's Online Wrong Location - Devilshakerz - 11-24-2015

(11-24-2015, 08:43 PM)JĀ Greig Wrote: I'll add that my forum has a sidebox and is pulling the latest threads/posts and who's online from the portal page (no plugin). Not sure if this would matter or not, however, I imagine it may have something to do with the latest posts from the portal?

Indeed it does; the browser is making 3 additional requests to portal.php:
<script type="text/javascript">
jQuery(function(){
$(".latestthreads").load("portal.php .latestthreads_portal");
$(".whosonline").load("portal.php .whosonline");
$(".lateststats").load("portal.php .lateststats");
}); </script>
These requests are made after the index page is loaded, which sets the page they visited last to the portal.
Apart from the Who's Online issue, this might cause redundant use of server resources - it would be much better to use a plugin that would query the database for needed content only instead of running the whole MyBB script additionally 3 times Wink


RE: Who's Online Wrong Location - Glandus - 11-24-2015

It was a quick solution until I wrote my own plugins for them and seemed to worked fine, until I noticed this issue. But I'll take your advice and start the plugins now. Thanks for finally figuring this out for me because it did my head in.