Skip to:
Content
Pages
Categories
Search
Top
Bottom

One automatic private Forum per User


  • schumann
    Participant

    @schumann

    Hi everyone,

    I’m trying to sort a bit of a strange thing.

    I’d like for every new user registered on my site, to automatically have their own forum associated to their account.

    The idea is that as soon as a new user has registered they’ll be directed to a dashboard page that I’ve created. On that page, among other things, they’ll see a forum (probably called ‘My Forum’) that can contain any number of topics. But only that specific user can see that forum, each user will have their own. And only admins and the automatically assigned user and post in that forum. Users should not be able to see the other forums, only what’s inside their own. They also won’t see that there are several forums, because the page loading the forum will already have their own forum open – so they’ll simply see the topics posted in it.

    It’s important to note that ever new registered user will be directed to the exact same dashboard page, so it’s important that the coding will automatically load their specific forum.

    Hope that I haven’t made that explanation too complicated.

    Does anyone know if this is possible and if so, how to do it?

    Any and all help would be greatly appreciated.

    Many thanks,

    Florian

Viewing 7 replies - 1 through 7 (of 7 total)

  • Robin W
    Moderator

    @robin-w

    hmm…. there’s no limit to the number of ways people want to use the forums !!

    Would take a bit of coding, and suspect you’d need to pay to get this developed.

    I don’t have time I’m afraid

    http://jobs.wordpress.net/


    schumann
    Participant

    @schumann

    Thanks Robin,

    I thought I might be asking a lot.

    I can’t afford to pay anyone to do this, but I have some basic knowledge on php.

    Any chance you or anyone here can point me in the right direction – i.e. what areas do I need to look at to implement this features? 🙂

    Thanks again,

    Florian


    Robin W
    Moderator

    @robin-w

    I would start with

    https://wordpress.org/plugins/bbp-private-groups/

    this will give you private forums per group, so you can have a user allocated to a group, and a forum allocated to a group. so you would just have a different group for each user, and just one forum allocated to that group.

    Then on registration, you would need to

    create a forum
    create a private group – probably using the $user_id, so that it is unique
    Allocate the private group to the forum
    Allocate the private group to the user

    you’d use an add_action to user_register to do the above, the example below comes from

    https://codex.wordpress.org/Customizing_the_Registration_Form, but you can in effect get wordpress to do anything when the user hits the submit key

     //3. Finally, save our extra registration user meta.
        add_action( 'user_register', 'myplugin_user_register' );
        function myplugin_user_register( $user_id ) {
            if ( ! empty( $_POST['first_name'] ) ) {
                update_user_meta( $user_id, 'first_name', trim( $_POST['first_name'] ) );
            }
        }
    

    so you would need to look at putting code into that function :
    create forum – what’s updated in the database when you create a forum – start with bbpress\includes\forums\functions.php and look at what function bbp_new_forum does, you’ll probably need to write a version for the above function.

    create a private group (for that one see the private groups plugin includes/settings.php and look at the group settings – and for info $rpg_groups = get_option ( ‘rpg_groups’) 😉
    allocate private group to forum – (for that one see the private groups plugin includes/meta-box.php and look at $meta = get_post_meta( $post->ID, ‘_private_group’, false );
    allocate the user to the group – see includes/user-view_post.php it’s looked up using $check=get_user_meta( $user_id, ‘private_group’,true);

    Since I’ve now written so much, I am expecting in the spirit of community software, you to share the solution when you get it going, and post the result back here !


    schumann
    Participant

    @schumann

    Hi again Robin,

    Sorry for my long delay in replying.

    Thanks so much for this, you have been most helpful.

    I really appreciate it.

    Thanks,

    Florian


    Robin W
    Moderator

    @robin-w

    Great – and thanks for coming back. Have you managed to achieve this? or is it still work in progress ?


    schumann
    Participant

    @schumann

    Still very much a work in progress… (slow progress, unfortunately, but progress all the same.)


    Robin W
    Moderator

    @robin-w

    🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar