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? 07-21-2011 02:42 PM

How can't I show banned users in online page?
 
Hello,

How can't I show banned users in online page?

Thanks

Badshah93 07-21-2011 04:47 PM

you can create one plugin at

forumhome_loggedinuser_query

WIth This Code

Code:

$hook_query_where .=" AND user.usergroupid != 8";

Note: This will hide ban user from Who's Online for everyone

Adem GEN? 07-21-2011 07:21 PM

Okay, Thank you very much

John Lester 09-03-2011 09:49 PM

Quote:

Originally Posted by Sherif (Post 2223275)
you can create one plugin at

forumhome_loggedinuser_query

WIth This Code

Code:

$hook_query_where .=" AND user.usergroupid != 8";

Note: This will hide ban user from Who's Online for everyone

How do you "create one plugin" ?

BirdOPrey5 09-04-2011 01:28 AM

Quote:

Originally Posted by John Lester (Post 2241658)
How do you "create one plugin" ?

Go to your Admin CP -> Plugins & Products -> Add New Plugin

prodct: vbulletin
hook: forumhome_loggedinuser_query
title: hide banned users
exec. order: 5
php code:
PHP Code:

$hook_query_where .=" AND user.usergroupid != 8"

Set Active to YES and hit save.

John Lester 09-04-2011 02:12 PM

Oh my that's not how I was trying to do it :D Thanks BoP5 :)

silvermerc 09-05-2011 01:24 AM

I've done that code and its still showing the banned usergroup on the who's online

BirdOPrey5 09-05-2011 01:30 AM

Quote:

Originally Posted by silvermerc (Post 2242041)
I've done that code and its still showing the banned usergroup on the who's online

Is your banned usergroup, usergroup 8 and only usergroup 8?

silvermerc 09-05-2011 04:29 AM

Im trying to do it on a 3.8.3.
Would that effect it at all?

BirdOPrey5 09-05-2011 10:57 AM

No it's the same on all 3.8/3.7 versions... But I noticed you posted your index.php isn't working- so that would make a difference since this is only visible on index.php.

Boofo 09-05-2011 12:31 PM

They want it on the who's online page. ;)

Badshah93 09-05-2011 01:04 PM

Quote:

Originally Posted by silvermerc (Post 2242041)
I've done that code and its still showing the banned usergroup on the who's online

banner users are showing in forumhome or in Who's online page ?

this code will work for forumhome.

BirdOPrey5 09-05-2011 01:45 PM

Quote:

Originally Posted by Boofo (Post 2242164)
They want it on the who's online page. ;)

Doh... I never visit that page, I forget it exists. :o

Lynne 09-05-2011 02:59 PM

Try using the same plugin code, only use hook location "online_query" instead.

Concha 09-13-2011 01:25 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2241703)
Go to your Admin CP -> Plugins & Products -> Add New Plugin

prodct: vbulletin
hook: forumhome_loggedinuser_query
title: hide banned users
exec. order: 5
php code:
PHP Code:

$hook_query_where .=" AND user.usergroupid != 8"

Set Active to YES and hit save.

With this code, in vb 3.8.7 Show only members en who's Online.
Guests are not counted.

Example: Active Users: 316 (316 members and 0 visitors.)
Don't show banned users, but not counted visitors

BirdOPrey5 09-14-2011 03:56 PM

What exactly are you trying to do and on what page? Who's Online or Who's logged in? (They are different pages.)

Concha 09-14-2011 08:06 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2245937)
What exactly are you trying to do and on what page? Who's Online or Who's logged in? (They are different pages.)

In forumhome, Currently Active Users.

Not forum/online.php

BirdOPrey5 09-15-2011 06:54 AM

Indeed I can confirm it does remove all the guests as well. Unfortunately I have no explanation as to why though... This is a pretty simple query adjustment... :confused:

Boofo 09-15-2011 07:20 AM

Have you tried:

Code:

$hook_query_where .=" AND user.usergroupid <> '8'";
Is the banned usergroup id 8 on your site?

Badshah93 09-15-2011 09:05 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2246224)
Indeed I can confirm it does remove all the guests as well. Unfortunately I have no explanation as to why though... This is a pretty simple query adjustment... :confused:

it does not show guest count for member but for guest(user) it shows guest count.

Anyway, i have made a new code for this thing, which is much better than previous one.


Why it is better:
it counts banned user in online list but don't show their username. (like invisible mode)


Plugin Hook: forumhome_loggedinuser

Code:

Code:

if ($loggedin['usergroupid'] == 8) {

unset ($loggedin);
}


Note:


1. where 8 is the banned usergroupid.
2. And don't forget to remove old plugin (if u created) for this thing.

BirdOPrey5 09-15-2011 10:50 AM

Quote:

Originally Posted by Boofo (Post 2246231)
Have you tried:

Code:

$hook_query_where .=" AND user.usergroupid <> '8'";
Is the banned usergroup id 8 on your site?

No difference for me...

Boofo 09-15-2011 11:05 AM

Quote:

Originally Posted by Sherif (Post 2246241)
it does not show guest count for member but for guest(user) it shows guest count.

Anyway, i have made a new code for this thing, which is much better than previous one.


Why it is better:
it counts banned user in online list but don't show their username. (like invisible mode)


Plugin Hook: forumhome_loggedinuser

Code:

Code:

if ($loggedin['usergroupid'] == 8) {

unset ($loggedin);
}


Note:


1. where 8 is the banned usergroupid.
2. And don't forget to remove old plugin (if u created) for this thing.

But this will not affect the Who's Online page as that is what I took him for wanting.

Badshah93 09-15-2011 01:25 PM

Quote:

Originally Posted by Boofo (Post 2246269)
But this will not affect the Who's Online page as that is what I took him for wanting.

for online page i have to see, even in one of mod this is giving problem.. i will try to findout something for it.

Concha 09-16-2011 03:28 PM

Works in forumhome, Currently Active Users, but increase server load (2000 users online)

Quote:

Originally Posted by Sherif (Post 2246241)
it does not show guest count for member but for guest(user) it shows guest count.

Anyway, i have made a new code for this thing, which is much better than previous one.


Why it is better:
it counts banned user in online list but don't show their username. (like invisible mode)


Plugin Hook: forumhome_loggedinuser

Code:

Code:

if ($loggedin['usergroupid'] == 8) {

unset ($loggedin);
}


Note:


1. where 8 is the banned usergroupid.
2. And don't forget to remove old plugin (if u created) for this thing.


Badshah93 09-16-2011 03:55 PM

Quote:

Originally Posted by Concha (Post 2246817)
Works in forumhome, Currently Active Users, but increase server load (2000 users online)

i don't think so it will increase too much.. how many members (not guest) are online at a time in ur site ?

if u have 2000 member (excluding guest) online, then i think you should not even have currently active users list.

Boofo 09-20-2011 11:04 PM

Quote:

Originally Posted by Sherif (Post 2246301)
for online page i have to see, even in one of mod this is giving problem.. i will try to findout something for it.

Any word on this yet?

Badshah93 09-24-2011 01:30 PM

Quote:

Originally Posted by Boofo (Post 2248394)
Any word on this yet?

for online page user need to edit online.php file

Find:

PHP Code:

($hook vBulletinHook::fetch_hook('online_user')) ? eval($hook) : false;
    } 

Add After

PHP Code:

if ($users['usergroupid'] == 8
{
unset (
$userinfo["$key"]);



Boofo 09-24-2011 06:22 PM

Why not just use the hook?

Badshah93 09-25-2011 04:42 AM

Quote:

Originally Posted by Boofo (Post 2249663)
Why not just use the hook?

i could have used hook, but guest function is not closed before the hook. if u will see that file you will understand why i didn't use hook.

Boofo 09-25-2011 05:12 AM

Kind of defeats the purpose of making it easy on upgrades. There has to be an easier way to accomplish it. I will see what I can figure out.

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:08 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.03132 seconds
  • Memory Usage 1,818KB
  • 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
  • (8)bbcode_code_printable
  • (5)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (33)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