vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How can't I show banned users in online page? (https://vborg.vbsupport.ru/showthread.php?t=267184)

Adem GEN? 09-27-2011 11:07 PM

Hello,

For Plugin This: Who Has Visited Today
Total members that have visited the forum in the last 24 hours:

What should I do to not display the members of the banned?

Thanks

thedave 02-17-2012 12:24 PM

Since guest have also usergroup 8 (which is strange I guess) you may something like this in your plugin:

Code:

    $hook_query_where .= " AND (usergroupid != 8 OR posts=0)";
This filters banned users but skips guests (which have 0 posts). Since you often ban users which have posted something improper. This is a crude workaround, but nothing better has come to mind yet. :)

DSforumtechs 08-22-2012 09:45 PM

gave me some headache but finally came up with this solution for the online_query hook:
PHP Code:

// showmembers is used for 'all' and 'members' selection, therefore we have to check for ISNULL before removing banned users. 
// If not showmembers, the banned users are removed anyway as they are users.

$hook_query_where .= iif($showmembers
    
" AND 
        (
            ISNULL(user.username) 
            OR 
            (NOT ISNULL(user.username) AND user.usergroupid <> 8)
        )"

    
""); 

The problem is, that the usergroupid only exists for users (incl. banned ones). But guests and robots only have NULL values. This screwed up the whole procedure.

The showmember condition is needed, because otherwise ISNULL is checked twice and non-guests are included again.


All times are GMT. The time now is 10:21 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.01147 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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