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";


All times are GMT. The time now is 09:29 AM.

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.01060 seconds
  • Memory Usage 1,727KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete