bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Adding a new User Type

(6 posts)
  • Started 1 year ago by Thrift
  • Latest reply from fel64
  • This topic is not resolved
  1. Thrift
    Member

    How can I add a new user category/group/type? I have the private forum plugin setup and I want to allow a specific group of people access to it. My only option of doing that right now is to put those people in the moderator group. This seems like it should be a simple thing to do (I know this feature is fairly common on all other forum scripts) so am I just overlooking it?

    Any help is appreciated!

    Posted 1 year ago #
  2. It's pretty simple, but you need a plugin to do it. Here's how it probably goes.

    <?php
    /*
    Plugin Name: Add lusers
    Description: adds the luser role
    Author: fel64
    */
    add_filter('get_roles', 'addlusers');
    
    function addlusers( $roles ) {
    $roles['luser'] = $roles['member']; //duplicate member capabilities
    $roles['luser'] =& $luser; //convenience
    $luser['name'] = __('Luser');
    $lusercaps = array('be_sucky', 'be_awesome', 'see_secrets');
    foreach( $lusercaps AS $cap ) {
    $luser['capabilities'][$cap] = true;
    }
    return $roles;
    }
    ?>

    I hope that's not too complex, I took some shortcuts. Basically all you have to do is put that in an empty text file, save as lusers.php (or whatever), upload to your server and activate. You just need to customise a few lines: change all the instances of luser to whatever you want, and customise the extra capabilities you want them to have if any. These capabilities will be on top of the ones normal members have. (Poo, I just realised the $bb_roles->add_role() function makes it all much easier. Ah well, at least this way you can use the member as your base.)

    Then go to the members' profiles and make them all lusers. Or whatever.

    Posted 1 year ago #
  3. Thrift
    Member

    How about removing a user group?

    Posted 1 year ago #
  4. Thrift
    Member

    Nevermind, If I just deactivate the plugin it will remove them.

    I still can't use these users groups with the private forums plugin. I want to make a new user group so that only they have access to the private forum.

    Posted 1 year ago #
  5. amazon3d
    Member

    Im in the same boat, I know things like BB(something) has it so you can set mods to see this group or that group and super mods can post in those but regulars can see the groups. So like Unregistered;rights=1 Member;rights= 2 Student;rights=3 Teacher;rights=4 Mod;rights=5 SuperMod;rights=6

    Where the #= the level of forum they can access like setting thread "teachers" to level 4 would make it so anything lower could not access it. And level 5 would make it so mods can see it but not post. & Level 6 would be like a place where you place questionable threads.

    I really don't know alot about php yet but in due time I'm sure I will. Is there a way to make it like this?

    Posted 1 year ago #
  6. Not easily. You can stop people seeing certain forums using a plugin, but you can't stop them seeing other groups (unless you remove that bit from the template, but there's no backend method). Presumably you can use it to set multiple forum restrictions. And you can create new user groups (just adopt my plugin to create more groups). So everything but hiding the groups is fairly easy.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.