MyBB Community Forums

Full Version: show totall online user number in index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
how to show totall online user number in index page sidebar. see the image bellow

[Image: 134419d9bdce1ceeb0e1bd6d0380374f.png]
guys please help me. i wanna show totall number of online member+guest
thanks for your reply but i want to show only totall online member counter (member+guest)
Use this variable in WOL template to fetch the total number:
{$onlinecount}
(2020-11-07, 12:56 PM)effone Wrote: [ -> ]Use this variable in WOL template to fetch the total number:
{$onlinecount}
sir i am trying to show it in advance sidebox    asb_sidebox_column  template.  nothing is showing. by default its shows like this

[Image: 742f6b5d87a8c13ce97fc085706f4aa2.png]

i just want to show the 4 number only
You can't fetch that variable value in other templates by just placing it in, I'm afraid.
But there is a js workaround, if you are okay with that...
sir what you mean by js workaround?
can you please tell me what to do.  i can place it in index sidebar thats my moto


and sir one more question i want to ask you. in my forum default theme online status showing like that

[Image: 7ddddbcab6b517897590e9c3a3117293.png]

but in my custom theme its show only online. right now what he is doing not showing. can you help me with that please?
1. Add this to your index sidebar template, exactly where you want the number to show up:
<span id="onlinecount"></span>

2. Add this at the end of your index_whosonline template:
<script type="text/javascript">
var onlinecount = {$onlinecount};
$(function(){$('#onlinecount').text(onlinecount);});
</script>


Save the templates.
For your other query, open template member_profile_online and make sure this chunk of code is present at the end:
({$location} @ {$location_time})
Pages: 1 2