vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Hide an admin in showgroups.php (https://vborg.vbsupport.ru/showthread.php?t=295330)

chefy 02-20-2013 01:37 PM

Hide an admin in showgroups.php
 
Hi,

I have some people on my Administrators usergroup and they all are being shown at showgroups.php. I'd like to prevent one of them from being displayed on that list without changing his usergroup. I have been searching for a solution and found this: https://vborg.vbsupport.ru/showthread.php?t=135503

But I can't figure out how to apply that to my 3.8.5 showgroups.php

Thanks!

--------------- Added [DATE]1361372230[/DATE] at [TIME]1361372230[/TIME] ---------------

I got it but it doesn't look good.

In showgroups.php find:

Code:

return $user;
And replace with:

Code:

        if ($user['userid'] != X) {
        return $user;
        }

Issue here is that it still shows the row corresponding to that admin so people will know that there is a hidden admin out there: http://oi46.tinypic.com/2vmzwgx.jpg

Please help.

kh99 02-20-2013 02:58 PM

You could do this: find this section around line 97 and add the part in red:

Code:

// get usergroups who should be displayed on showgroups
// Scans too many rows. Usergroup Rows * User Rows
$users = $db->query_read_slave("
        SELECT user.*,
                usergroup.usergroupid, usergroup.title,
                user.options, usertextfield.buddylist,
                " . ($show['locationfield'] ? 'userfield.field2,' : '') . "
                IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid
        FROM " . TABLE_PREFIX . "user AS user
        LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON(usergroup.usergroupid = user.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids))
        LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
        LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
        WHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")
AND user.userid NOT IN (X)
");


That's just for the admin section - if you want to delete someone from the moderator section you'd need to add another line to the other query.


All times are GMT. The time now is 08:22 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.01057 seconds
  • Memory Usage 1,718KB
  • 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)post_thanks_navbar_search
  • (1)printthread
  • (2)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