vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Remove Admin from who's online counter (https://vborg.vbsupport.ru/showthread.php?t=284083)

peterherman 06-07-2012 07:53 AM

Remove Admin from who's online counter
 
Hello,

i want to reduce the counter "registered users" in the footer if the admin (hidden) is online.

Is it possible with the Hook "forumhome_loggedinuser" ?
Can someone give me a tip how I can implement this?

Thanks
peterherman

borbole 06-07-2012 11:28 AM

Have a look here on how to hide the admin at the online list

https://vborg.vbsupport.ru/showthread.php?t=230238

kh99 06-07-2012 11:38 AM

I think this should work (using forumhome_loggedinuser):

Code:

if (!fetch_online_status($loggedin))
{
  $numberregistered--;
}


peterherman 06-07-2012 11:50 AM

@borbole
thanks for the tip!

@kh99,

The Code works perfect!

Thank you very very much.

Regards
peterherman

peterherman 06-07-2012 03:37 PM

1 Attachment(s)
Hello,

sorry, but i have one more question.

The counter on the forumhomepage is correct now.
But the page "who is online" counts one more registered member as the forum homepage.
See also the attached pictures.
Is the problem to solve?

Thanks

kh99 06-07-2012 04:30 PM

Try creating a new plugin using hook online_complete and this code:

Code:

$numbermembers -= $numberinvisible;

peterherman 06-07-2012 05:02 PM

Sorry kh99, but the Code doesent work.
With this code the counter in "who is online" is two numerator to large. (from the perspective of an registered user)
Example: One registered Member is online and the (hidden) Administrator is online.
Then the counter says "3 registered members online"
From the perspective of the admin is all ok.

kh99 06-07-2012 05:07 PM

Seems to work for me - are you sure you got the code right? I don't see how it could increase the member count.

peterherman 06-07-2012 05:24 PM

I have test it again, but it does not work.
I create a new plugin with th hook online_complete, then i put the code in and activate it and save it.
Then i see, that the counter increase the member count.
After, i deactivate the plugin, then the counter decrease.

kh99 06-07-2012 05:29 PM

Hmm...what version of vb do you have?

As a test, try temporarily changing the code to this:

Code:

$numbermembers = "$numbermembers, $numberguests, $numberinvisible, $numbervisible";

peterherman 06-07-2012 05:36 PM

My vb version is 4.1.10

I have test it with the new code.
The result is the same as with the first code.

kh99 06-07-2012 05:40 PM

Quote:

Originally Posted by peterherman (Post 2337528)
My vb version is 4.1.10

Oh, that's the trouble. Try this:

Code:

$numbervisible -= $numberinvisible;

In fact it should be OK to leave both lines in there, and then it should still work if you upgrade some day.

peterherman 06-07-2012 05:51 PM

Thank you for your big patience with me, but it does not work yet.
The counter increase the member count now with one point not with two.

kh99 06-07-2012 05:58 PM

What does it say if you disable that plugin? I think there was a bug in online user counts but I'm not sure when it got fixed. I also don't have vb4.1.10 installed (I'm trying to install it now) so I haven't been able to try it myself.

peterherman 06-07-2012 06:12 PM

If i disable this plugin then the counter increase the member count two numerator.

kh99 06-07-2012 06:15 PM

Yeah, I think that was a bug in vb4.1.10. I have a completely fresh install with only 2 users, and the Who's Online page shows 3 Members (but only when one of them is invisible).

Try this code:

Code:

$numbervisible -= (2 * $numberinvisible);

peterherman 06-07-2012 06:50 PM

Yeaaar, it works now perfect.
Thank you very much and thanks for your patience.
I think i make an update in a few weeks, then i try the first Code.

Thank you an regards
peterherman


All times are GMT. The time now is 04:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01145 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete