MyBB Community Forums

Full Version: Change users online to a number
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Basically i need to change this,

Who's Online: Name1, Name2, Name 3 10 Guest(s)

to

Who's Online: 1 Admin(s) 8 Members(s) 10 Guest(s)


Is this possible and if so how?


Thanks in advance.

(2014-09-09, 09:50 PM)dmpops22 Wrote: [ -> ]Basically i need to change this,

Who's Online: Name1, Name2, Name 3 10 Guest(s)

to

Who's Online: 1 Admin(s) 8 Members(s) 10 Guest(s)


Is this possible and if so how?


Thanks in advance.


Anyone?

Bump as this shouldnt be that hard to do......just a general direction of which file.
(2014-09-09, 09:50 PM)dmpops22 Wrote: [ -> ]Basically i need to change this,

Who's Online: Name1, Name2, Name 3 10 Guest(s)

to

Who's Online: 1 Admin(s) 8 Members(s) 10 Guest(s)


Is this possible and if so how?


Thanks in advance.


(2014-09-09, 09:50 PM)dmpops22 Wrote: [ -> ]Basically i need to change this,

Who's Online: Name1, Name2, Name 3 10 Guest(s)

to

Who's Online: 1 Admin(s) 8 Members(s) 10 Guest(s)


Is this possible and if so how?


Thanks in advance.


Anyone?


Bump as this shouldnt be that hard to do......just a general direction of which file.

The online.php file in the forum root directory is where its done at.
(2014-09-10, 02:40 AM)zamight Wrote: [ -> ]
(2014-09-09, 09:50 PM)dmpops22 Wrote: [ -> ]Basically i need to change this,

Who's Online: Name1, Name2, Name 3 10 Guest(s)

to

Who's Online: 1 Admin(s) 8 Members(s) 10 Guest(s)


Is this possible and if so how?


Thanks in advance.



(2014-09-09, 09:50 PM)dmpops22 Wrote: [ -> ]Basically i need to change this,

Who's Online: Name1, Name2, Name 3 10 Guest(s)

to

Who's Online: 1 Admin(s) 8 Members(s) 10 Guest(s)


Is this possible and if so how?


Thanks in advance.


Anyone?



Bump as this shouldnt be that hard to do......just a general direction of which file.

The online.php file in the forum root directory is where its done at.

Yeh, im looking at it now, This will change the users browsing forum part yes?
Or index.php
cant find anything in either that changes from text to a number Sad
Pretty sure has to be programmed to do it. There isn't a function that does it.
(2014-09-10, 03:11 AM)zamight Wrote: [ -> ]Pretty sure has to be programmed to do it. There isn't a function that does it.


ugh dam

i didnt think it would be this hard, since Guests have a users online number Sad
Alright, I was messing around cause i'm still new to MyBB development. But I got it to work (For 1.8. I'm sure it'll work for 1.6.)

Open up index.php.

Go to line 75 which should say $botcount = $membercount. Change it to below.

$botcount = $admincount = $membercount = $anoncount = $guestcount = 0;


Next go to line 92 and insert the following below.

				if($user['usergroup'] == 4) {
					$admincount++;
				}

Next you need to change the template. Get to template editor and edit index_whosonline. Its roughly line 5 that shows online member list. Below is an example what to change it to.



<td class="trow1"><span class="smalltext">This many Admins!: {$admincount}</span></td>
As you can see we use $admincount to count the admins which is usergroup id of 4. If you wan't to do mods you make a new $moderatorcount and add another check for that usergroup id and then display it on template also.
(2014-09-10, 03:40 AM)zamight Wrote: [ -> ]Alright, I was messing around cause i'm still new to MyBB development. But I got it to work (For 1.8. I'm sure it'll work for 1.6.)

Open up index.php.

Go to line 75 which should say $botcount = $membercount. Change it to below.


$botcount = $admincount = $membercount = $anoncount = $guestcount = 0;


Next go to line 92 and insert the following below.


 if($user['usergroup'] == 4) {
 $admincount++;
 }

Next you need to change the template. Get to template editor and edit index_whosonline. Its roughly line 5 that shows online member list. Below is an example what to change it to.




<td class="trow1"><span class="smalltext">This many Admins!: {$admincount}</span></td>
As you can see we use $admincount to count the admins which is usergroup id of 4. If you wan't to do mods you make a new $moderatorcount and add another check for that usergroup id and then display it on template also.


Its not working for me, Going to try it again.

Nothing really changes.

Nope tried it once more still nothing Sad

thanks for trying.

(2014-09-10, 03:56 AM)dmpops22 Wrote: [ -> ]
(2014-09-10, 03:40 AM)zamight Wrote: [ -> ]Alright, I was messing around cause i'm still new to MyBB development. But I got it to work (For 1.8. I'm sure it'll work for 1.6.)

Open up index.php.

Go to line 75 which should say $botcount = $membercount. Change it to below.



$botcount = $admincount = $membercount = $anoncount = $guestcount = 0;


Next go to line 92 and insert the following below.



 if($user['usergroup'] == 4) {
 $admincount++;
 }

Next you need to change the template. Get to template editor and edit index_whosonline. Its roughly line 5 that shows online member list. Below is an example what to change it to.





<td class="trow1"><span class="smalltext">This many Admins!: {$admincount}</span></td>
As you can see we use $admincount to count the admins which is usergroup id of 4. If you wan't to do mods you make a new $moderatorcount and add another check for that usergroup id and then display it on template also.


Its not working for me, Going to try it again.

Nothing really changes.

Nope tried it once more still nothing Sad

thanks for trying.

Would it not be working because its not the index but the forumdisplay in which it is located,

Only thing that effects the users is if i change forumdisplay_usersbrowsing and mess with these.

{$onlinemembers} {$onlinesep}{$invisonline}{$onlinesep2}{$guestsonline}

(2014-09-10, 03:56 AM)dmpops22 Wrote: [ -> ]
(2014-09-10, 03:40 AM)zamight Wrote: [ -> ]Alright, I was messing around cause i'm still new to MyBB development. But I got it to work (For 1.8. I'm sure it'll work for 1.6.)

Open up index.php.

Go to line 75 which should say $botcount = $membercount. Change it to below.



$botcount = $admincount = $membercount = $anoncount = $guestcount = 0;


Next go to line 92 and insert the following below.



 if($user['usergroup'] == 4) {
 $admincount++;
 }

Next you need to change the template. Get to template editor and edit index_whosonline. Its roughly line 5 that shows online member list. Below is an example what to change it to.





<td class="trow1"><span class="smalltext">This many Admins!: {$admincount}</span></td>
As you can see we use $admincount to count the admins which is usergroup id of 4. If you wan't to do mods you make a new $moderatorcount and add another check for that usergroup id and then display it on template also.


Its not working for me, Going to try it again.

Nothing really changes.

Nope tried it once more still nothing Sad

thanks for trying.


(2014-09-10, 03:56 AM)dmpops22 Wrote: [ -> ]
(2014-09-10, 03:40 AM)zamight Wrote: [ -> ]Alright, I was messing around cause i'm still new to MyBB development. But I got it to work (For 1.8. I'm sure it'll work for 1.6.)

Open up index.php.

Go to line 75 which should say $botcount = $membercount. Change it to below.




$botcount = $admincount = $membercount = $anoncount = $guestcount = 0;


Next go to line 92 and insert the following below.




 if($user['usergroup'] == 4) {
 $admincount++;
 }

Next you need to change the template. Get to template editor and edit index_whosonline. Its roughly line 5 that shows online member list. Below is an example what to change it to.






<td class="trow1"><span class="smalltext">This many Admins!: {$admincount}</span></td>
As you can see we use $admincount to count the admins which is usergroup id of 4. If you wan't to do mods you make a new $moderatorcount and add another check for that usergroup id and then display it on template also.


Its not working for me, Going to try it again.

Nothing really changes.

Nope tried it once more still nothing Sad

thanks for trying.

Would it not be working because its not the index but the forumdisplay in which it is located,

Only thing that effects the users is if i change forumdisplay_usersbrowsing and mess with these.

{$onlinemembers} {$onlinesep}{$invisonline}{$onlinesep2}{$guestsonline}


For future reference of anyone who wants to do the same,

Change this in forumdisplay_usersbrowsing

{$onlinemembers}

to

$membercount

- it will count both admins/mods/members though

if anyone can tell me how to add a variable to count all staff that would be great
This is rather difficult (not simple/easy) to achieve the right way with simple edits and IMO it is not worth it.
Pages: 1 2