Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-06-2001 Last Update: Never Installs: 0
 
No support by the author.

This one is for CJ:

it allows you to select in a usergroup's settings whether the members of this usergroup will show up in the Members List.

For example, on my Bulletin Board members of the "Banned Users" and "Users Awaiting Email Confirmation" are excluded and will not show up on the Members List.

Others might find it useful if they want to exclude Administrators or other site personnel.

In any case, it's a very simple hack (I think). It involves runnign one MySQL query and editing two scripts.

Installation:

1. Run the following MySQL command via phpMyAdmin or Telnet:

Code:
ALTER TABLE usergroup ADD showinlist SMALLINT (6) DEFAULT '1' not null
(explanation: the above query will add a column to the usergroup table 'showinlist' with the default value being '1' so that by default, ALL usergroups are included in the Members List (like it is now)).

2. Open admin/usergroup.php.

Find:

PHP Code:
makeyesnocode("Can modify profile","canmodifyprofile",1); 
BELOW it add:

PHP Code:
makeyesnocode("Appear in Members List","showinlist",1); 
Find:

Code:
candenypmreceipts,maxbuddypm,maxforwardpm)
REPLACE it with (change is in red):

Code:
candenypmreceipts,maxbuddypm,maxforwardpm,showinlist)
Find:

Code:
$maxbuddypm,$maxforwardpm)
REPLACE it with (change is in red):

Code:
$maxbuddypm,$maxforwardpm,$showinlist)
Find:

PHP Code:
makeyesnocode("Can modify profile","canmodifyprofile",$usergroup[canmodifyprofile]); 
BELOW it add:

PHP Code:
makeyesnocode("Appear in Members List","showinlist",$usergroup[showinlist]); 
Find:

Code:
maxforwardpm=$maxforwardpm
REPLACE it with (change is in red):

Code:
maxforwardpm=$maxforwardpm,showinlist=$showinlist
Save the file.

3. Open memberlist.php

Find:

PHP Code:
$memberlistbit ""
ABOVE it put:

PHP Code:
  $showugroup=$DB_site->query("SELECT usergroupid FROM usergroup WHERE showinlist=0");
    while(
$thisgroup=$DB_site->fetch_array($showugroup)) {
        
$condition.=" AND usergroupid!='$thisgroup[usergroupid]'";
  } 
Save and upload both files.


Now, go to the Control Panel -> User Groups and Permissions -> Modify.

Click on "edit" next to the usergroup you want to EXCLUDE from the Members List. (meaning: the members of that usergroup will not appear in the Members List).

Under the "Miscellaneous Permissions" section you will find a yes/no option whether members of this usergroup will show up in the Members List or not.



Cheers,

Bira

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-06-2001, 11:22 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One more thing.

I did not include this in the hack as it wasn't directly the same however I thought I'd mention this:

On my Bulletin Board, users with 0 posts are excluded from the members list as well.

If you are interested in this too (not showing users who never posted), then also do the following in memberlist.php:

Find TWICE:

Code:
WHERE $condition AND
And REPLACE it with (change is marked in red):

Code:
WHERE $condition AND posts!='0' AND
Cheers,

Bira
Reply With Quote
  #3  
Old 05-07-2001, 12:40 AM
wajones wajones is offline
 
Join Date: Oct 2001
Location: San Diego, California, US
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is great and on the lines of something I'm tying to achieve, but a little different. I want to have new members be able to join a particular group, show up in that groups membership list but not in other's. Sort of like having different lists for different groups but in actuallity everyone is in the same user table. Does that make any sense?
Well would I do something simular to this to achieve that or am I off base.
Reply With Quote
  #4  
Old 05-07-2001, 06:52 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wajones, this can be achieved quite easily:

Open memberlist.php

find:

PHP Code:
    if ($postsupper!="") {
      
$condition.=" AND posts<'$postsupper'";
    } 
Below it add:

PHP Code:
    if ($usergroup!="") {
      
$condition.=" AND usergroupid='$usergroup'";
    } 
Now, if you view the Members List via url memberlist.php?usergroup=xx

you will see only the users in usergroup whose id is xx

example:

http://www.atlasf1.com/bb/memberlist.php?usergroup=6 -- you will see all the members of the Administrator usergroup.

***
Now here's another twist you can add.

If you want a logged in user to see only members of his group, do the following instead:

PHP Code:
    if ($usergroup!="") {
      
$condition.=" AND usergroupid='$usergroup'";
    } elseif (
$bbuserinfo[usergroupid]!="") {
      
$condition.=" AND usergroupid='$bbuserinfo[usergroupid]'";
    } 
This means that a user viewing memberlist.php will see only members of his own usergroup listed. A user not logged in or unregistered will see ALL members (unless you excluded a certain group using the previously posted hack).
Reply With Quote
  #5  
Old 05-07-2001, 07:03 PM
wajones wajones is offline
 
Join Date: Oct 2001
Location: San Diego, California, US
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, Thank you very much!!!
Reply With Quote
  #6  
Old 05-07-2001, 07:35 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One more option for those interested:

If you want the "Registered Members: XXXX" on the BB's front page to NOT include those whom you excluded from the Members List (example: if you don't want Banned Users to be included in neither the Members List nor the total Members count), then do the following:

Open index.php

Find:

Code:
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
And REPLACE with (changes marked in red):

Code:
$condition="1=1";
$showugroup=$DB_site->query("SELECT usergroupid FROM usergroup WHERE showinlist=0");
  while($thisgroup=$DB_site->fetch_array($showugroup)) {
      $condition.=" AND usergroupid!='$thisgroup[usergroupid]'";
}        
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE $condition');
Cheers,

Bira
Reply With Quote
  #7  
Old 05-18-2001, 11:32 AM
netphreak
Guest
 
Posts: n/a
Default

Fatal error: Call to unsupported or undefined function ????while() in /home/sites/site25/web/bb/memberlist.php on line 90

Is this a result of using non-supported functions by php3?

Really, all I am looking for is a way to prevent (COPPA) Users to show up in the "Welcome to our newest user, XXXXX"

And preferably a way to show (COPPA) Users on the index site, as links to their profiles.

I tried to add this in the index.php:

PHP Code:
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max] AND usergroupid=2"); 
where the code I added was "AND usergroupid=2"

Shouldn't this work?

-net
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03820 seconds
  • Memory Usage 2,286KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (10)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete