OK don't want/need Membership on my primary site, only on sub-sites (on demand)
WPMU DEV Community
OK don't want/need Membership on my primary site, only on sub-sites (on demand)
Elite
56 pointsSerious WPMU DEV-sterI'm new here
Michael Kimb
Member
—
21st November 2010 (1 year ago)
I'm currently playing around with Membership on one of my MU installs which is set up as detailed here using the Global WPMU access (activates on all blogs in the install) - basically throw everything in 'mu-plugins' - BUT its not quite what I need and after reading a LOT of posts around here, I'm wondering of what I need IS in fact possible :)
BASICALLY - I don't need Membership enabled on all of my sites in the network and ESPECIALLY not on my main, admin-root blog/site - its really not needed here.
I only need the plugin to work on sub-sites where users want to run membership features. For users who are admins of their own sites and NOT super-admins and without any interaction of membership levels or users across sites. IS this possible? If so, how? :)
Do I need to install as a standard WP plugin and just get the user to 'enable' from their backend? From what I've read, I'm not sure it will show up because of the security features in the plugin around super-admin users?
Last note: I'm currently experimenting with the MP Blog Register plugin which fixes the issue of users registering for single-sites - it looks perfect, I just need clarity on Membership before I port this over to my live MU network.
tl;dr - I have membership set up network-wide, only need it on selected blogs in the network and definitely not on the root site ;)
I'm currently playing around with Membership on one of my MU installs which is set up as detailed here using the Global WPMU access (activates on all blogs in the install) - basically throw everything in 'mu-plugins' - BUT its not quite what I need and after reading a LOT of posts around here, I'm wondering of what I need IS in fact possible :)
BASICALLY - I don't need Membership enabled on all of my sites in the network and ESPECIALLY not on my main, admin-root blog/site - its really not needed here.
I only need the plugin to work on sub-sites where users want to run membership features. For users who are admins of their own sites and NOT super-admins and without any interaction of membership levels or users across sites. IS this possible? If so, how? :)
Do I need to install as a standard WP plugin and just get the user to 'enable' from their backend? From what I've read, I'm not sure it will show up because of the security features in the plugin around super-admin users?
Last note: I'm currently experimenting with the MP Blog Register plugin which fixes the issue of users registering for single-sites - it looks perfect, I just need clarity on Membership before I port this over to my live MU network.
tl;dr - I have membership set up network-wide, only need it on selected blogs in the network and definitely not on the root site ;)
10635 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Sales & Support Lead
—
22nd November 2010 (1 year ago)
#
Hiya Michael,
As far as I can tell, you are right on all counts. Yes, you can install Membership in your plugins folder and then activate it on any sub-site you like (it will then only apply membership rules to that sub-site).
You could make the plugin one that 'auto-activates' as part of the Supporter package if you like, but you will need to add the usernames individually to the membership-config file in order for them to see the admin menus.
I'll ask Barry to comment on this as well as I may have left something out, but I believe using it this way will get you the results your after.
You could make the plugin one that 'auto-activates' as part of the Supporter package if you like, but you will need to add the usernames individually to the membership-config file in order for them to see the admin menus.
You need to add a capability to each user that wants to admin the membership system - though if you are running it on a site by site basis and want the admin user for each site to have full control of the membership plugin (i.e. you aren't actually using the plugin to restrict which menus / plugins / etc... are available) then you can create small plugin to go in mu-plugins that has the following: <?php
add_action('user_register', 'm_add_user_cap', 10, 1);
function m_add_user_cap( $user_id ) {
$user = new WP_User( $user_id );
I've been reading the forum posts and I am hoping maybe there is a solution out there that will work for me.
Setting up a membership based web site. To help people market online. I would like the setup to be very similar to what you have going with wpmudev. That is people can see content to some extent but they are limited to accessing the backend and downloads.
The next part of the membership is to offer members a sub-domain based web site. I will create a template site in the multi site set up. That will be the master template for all the other sub-domain sites.
1- Is there a way to use the Membership Plugin to manage the main site, control the protected content and then allow members to manage or be administrator for their own sub-domain site and still be able to login to the main site and to access the training material?
2- What plugins do you recommend using to be able to manage all this?
3- would it be wiser to have two separate domains one as the main site with the membership training and the second to manage all the sub-domain sites. Is it possible to be able to use the same usernamesand passwords for both access points.
Adding the capability in the code snippet above to a new admin user will allow the membership plugin to be controlled by that user - so putting that bit of code in a php file (with any name) should give new admin users the capability required.
The other method is to change the word "membershipadmin" to "administrator" throughout the plugin - should only be in two of the files.
I'm going to add a configuration value for this in an updated version, but it won't be for a while yet as there are a few other things in development for it that we need to get complete.
@nueranet - that really is a different topic to the post you've appended it to, and would be better in a separate thread where it would get more attention.
But 1. is the default behaviour as far as i understand your post.
Responses (13)
Sales & Support Lead — 22nd November 2010 (1 year ago) #
Hiya Michael,
As far as I can tell, you are right on all counts. Yes, you can install Membership in your plugins folder and then activate it on any sub-site you like (it will then only apply membership rules to that sub-site).
You could make the plugin one that 'auto-activates' as part of the Supporter package if you like, but you will need to add the usernames individually to the membership-config file in order for them to see the admin menus.
I'll ask Barry to comment on this as well as I may have left something out, but I believe using it this way will get you the results your after.
Thanks!
Member — 22nd November 2010 (1 year ago) #
Thanks Mason,
After much tinkering and throwing files around I think I've cracked what I need maybe 90%. Its not how I designed it in my head, but it works for now.
Now for a DB/server clearout and re-install :) *joy*
Developer — 26th November 2010 (1 year ago) #
You need to add a capability to each user that wants to admin the membership system - though if you are running it on a site by site basis and want the admin user for each site to have full control of the membership plugin (i.e. you aren't actually using the plugin to restrict which menus / plugins / etc... are available) then you can create small plugin to go in mu-plugins that has the following:
<?phpadd_action('user_register', 'm_add_user_cap', 10, 1);
function m_add_user_cap( $user_id ) {
$user = new WP_User( $user_id );
if(!empty($user) && method_exists($user, 'has_cap') && $user->has_cap('administrator') && !$user->has_cap('membershipadmin')) {
$user->add_cap('membershipadmin');
}
}
?>
Member — 27th December 2010 (1 year ago) #
Hi Barry,
Is that all that is needed in order to allow sub-sites to create there own membership sites?
In my instance the plan was to allow "supporter upgraded" sites to create their own membership content.
Member — 28th December 2010 (1 year ago) #
I am also very interested in this. I wanted the same capabilities for the admins of sub-sites.
To create the plugin mentioned above does it need to have a specific file name: i.e. admin-membership.php with the code in it?
Working Friendly
Mike
Member — 28th December 2010 (1 year ago) #
Would also like to know about this.
Started this thread on this topic some time ago:
http://premium.wpmudev.org/forums/topic/membership-plugin-subblog-users-still-have-access-to-restrict-all-buddypress-groups
Problem was that Buddypress features were visible to all members.
Member — 28th December 2010 (1 year ago) #
Hi Barry and Mason,
I've been reading the forum posts and I am hoping maybe there is a solution out there that will work for me.
Setting up a membership based web site. To help people market online. I would like the setup to be very similar to what you have going with wpmudev. That is people can see content to some extent but they are limited to accessing the backend and downloads.
The next part of the membership is to offer members a sub-domain based web site. I will create a template site in the multi site set up. That will be the master template for all the other sub-domain sites.
1- Is there a way to use the Membership Plugin to manage the main site, control the protected content and then allow members to manage or be administrator for their own sub-domain site and still be able to login to the main site and to access the training material?
2- What plugins do you recommend using to be able to manage all this?
3- would it be wiser to have two separate domains one as the main site with the membership training and the second to manage all the sub-domain sites. Is it possible to be able to use the same usernamesand passwords for both access points.
Thank you
Developer — 28th December 2010 (1 year ago) #
Adding the capability in the code snippet above to a new admin user will allow the membership plugin to be controlled by that user - so putting that bit of code in a php file (with any name) should give new admin users the capability required.
The other method is to change the word "membershipadmin" to "administrator" throughout the plugin - should only be in two of the files.
I'm going to add a configuration value for this in an updated version, but it won't be for a while yet as there are a few other things in development for it that we need to get complete.
@nueranet - that really is a different topic to the post you've appended it to, and would be better in a separate thread where it would get more attention.
But 1. is the default behaviour as far as i understand your post.
Member — 29th December 2010 (1 year ago) #
I added the code above to a php file and loaded it to the mu-plugins folder. But the membership menu does not appear in the dashboard.
Any suggestions?
Working Friendly
Mike
Member — 29th January 2011 (1 year ago) #
Ping Barry,
If I wanted to add the capability on activation of the plugin.
would this work ok
define( 'MEMBERSHIP_MASTER_ADMIN', is_admin());
Developer — 30th January 2011 (1 year ago) #
no, you need to grab the admin user - so something like:
<?php
$user = wp_get_current_user();
define( 'MEMBERSHIP_MASTER_ADMIN', $user->user_login);
?>
Keeper of the Dark Chocolate — 30th January 2011 (1 year ago) #
Wouldn;t that code example instead assign all users to be membership_master_admin's though?
Member — 1st February 2011 (1 year ago) #
Hi Mike,
So different users of the blog would automatically be the membership admin because the plugin is activated for that blog?
That would be undesirable if that is the case.. :-)
Become a member