Skip to:
Content
Pages
Categories
Search
Top
Bottom

Limit Amount of blogs a user can register

  • @kennibc

    Participant

    Does a plugin exist for WPMU + BP that would limit the amount of blogs a user could register? I don’t want the students creating more than 9 at most. One for possibly 7 classes and 2 for personal.

    I am so glad BP exists, I can’t wait to share this with our students/teachers and turn it over to them!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @johnjamesjacoby

    Keymaster

    I would do this by going into /member-themes/buddypress-member/blogs/create.php and doing…

    <?php if ( bp_blog_signup_enabled() ) : ?>
    <?php
    global $bp;
    $blogs = bp_blogs_get_blogs_for_user($bp->loggedin_user->id);
    if ($blogs['count'] != 9)
    {
    bp_show_blog_signup_form();
    }
    else
    {
    ?>
    <div id="message" class="info">
    <?php _e( 'Limit nine blogs per member. If you would like another, please contact an Admin for assistance.', 'buddypress' ); ?>

    </div>
    <?php
    }
    ?>

    <?php else: ?>

    <div id="message" class="info">
    <?php _e( 'Blog registration is currently disabled', 'buddypress' ); ?>

    </div>

    <?php endif; ?>

    Just remember not to overwrite the member theme if you do a BuddyPress update. ;)

    @kennibc

    Participant

    AWESOME. Dang John. You Rock. I just added the code and it worked. I changed the number to 1 just for testing and it worked when I tried to create the 2nd blog. With unlimited blogs, I don’t want students to go crazy with them! One bored 14 year old could create 20 or 30 in an evening.

    @slaffik

    Moderator

    How can I hook bp_show_blog_signup_form() or bp_create_blog_link or other related function?

    I want it not to show registration blog content. I mean when user “has limited his numbers of blogs per member” there is no link to create a blog.

    Or even better: There is a link, but without blog signup form, but with the message: ‘Limit nine blogs per member. If you would like another, please contact an Admin for assistance.’

    I do not want to hard coding in member-themes’ files. I’m creating a plugin with Admin page to configure this.

    @aronjay

    Participant

    much better solution here.. with an option to set the number of blogs you want the user to have..

    https://buddypress.org/forums/topic.php?id=1900

    EDIT: i didn’t notice that this topic was 3 weeks ago..

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Limit Amount of blogs a user can register’ is closed to new replies.
Skip to toolbar