MyBB Community Forums

Full Version: Who's Online Wrong Location
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
(2015-11-24, 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
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.