limit 1 blog per user
-
I’ve read on a few different wpmu forums how to edit the wp-signup files so it’s possible to limit ONE blog per each member.
Is there a way anyone knows how to limit this in buddypress? So when a member tries to create another blog it is disabled, (if they already have a blog)?
thanks!
-
Anyone?
It isn’t a buddypress configuration, but it depends on wp-mu.
The choice are two: editing wp-signup, or install plug-ins and edit buddypress template, now it’s so complicated if you don’t know php or if you don’t want writing code..
I have installed a few different plug-ins for wp-mu, neither have seemed to work when using buddypress.
Maybe I should make sure I edited/installed/configured them right, think I did though…
i think that you’ve to ask in wordpress-mu forum, not here..
Good point.
Just wondering if anyone knew anything that I didn’t…maybe.
thanks though
This seems pretty easy.
neuromancer2701, that’s actually the exact modifications I did… for some reason buddypress lets more than one blog per person. I’ll look to make sure I installed it right.
I wanted to removed “Create a Blog!” from of the buddypress admin bar.
This is what I got to work:
wp-content/mu-plugins/bp-core/bp-core-adminbar.php
$blogscheck = get_blogs_of_user($current_user->ID);
if ( ! empty($blogscheck)
{
echo '<a href="' . $bp['loggedin_domain'] . $bp['blogs']['slug'] . '/create-a-blog">' . __("Create a Blog!", 'buddypress') . '</a>';
}Hey neuromancer2701,
Where in the file (line #, etc.) did you place this?
Thanks.
I found a solution, but I’m not a PHP programmer, It’s a hack of the code of this topic https://mu.wordpress.org/forums/topic.php?id=5930
Let’s go only if you are using the lasted trunk:
Open the mu-plugins/bp-blogs/bp-blogs-templatetags.php – Find this code starting at line 682 end at 696
<?php printf(__("By filling out the form below, you can <strong>add a blog to your account</strong>. There is no limit to the number of blogs you can have, so create to your heart's content, but blog responsibly.", 'buddypress'), $current_user->display_name) ?>
<?php _e("If you’re not going to use a great blog domain, leave it for a new user. Now have at it!", 'buddypress') ?>
<form id="setupform" method="post" action="<?php echo $bp->loggedin_user->domain . $bp->blogs->slug . '/create-a-blog' ?>">
<input type="hidden" name="stage" value="gimmeanotherblog" />
<?php do_action( "signup_hidden_fields" ); ?>
<?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
<input id="submit" type="submit" name="submit" class="submit" value="<?php _e('Create Blog »', 'buddypress') ?>" />
<?php wp_nonce_field( 'bp_blog_signup_form' ) ?>
</form>Replace using this newbie code:
// One Blog Only HACK START
<?php $blogscheck = get_blogs_of_user($current_user->ID);
$blogarrayvalue = (get_object_vars($blogscheck[1]));
$blogsiteURL = "http://locutorpro.com.br";
if ($blogarrayvalue[siteurl] == $blogsiteURL)
{
echo "";
printf(__("By filling out the form below, you can <strong>add a blog to your account</strong>.", 'buddypress'), $current_user->display_name);
echo "
";
printf(__("If you’re not going to use a great blog domain, leave it for a new user. Now have at it!", 'buddypress'));
echo "
";
echo "<form id='setupform' method='post' action='";
echo $bp->loggedin_user->domain . $bp->blogs->slug ;
echo "/create-a-blog'>";
echo "<input type='hidden' name='stage' value='gimmeanotherblog' />";
echo do_action( "signup_hidden_fields" );
echo bp_blogs_signup_blog($blogname, $blog_title, $errors);
echo "<input id='submit' type='submit' name='submit' class='submit' value='";
printf(__("Create Blog »"));
echo "' />
"; echo wp_nonce_field( 'bp_blog_signup_form' );
echo "</form>";
}
else
{
printf(__("Sorry, you can have 1 blog only.", 'buddypress'));
}
?>
// One Blog Only HACK ENDI hope it help!
Thank you for all dev team!
In $blogsite=URL you gotta fill in your URL.
- The topic ‘limit 1 blog per user’ is closed to new replies.