membership basics

Hi there,

I'm really sorry - I'm just not getting it. So I hope you can help.

I have installed the membership plugin, and I have a VERY simple concept of what I want to do.

I want site visitors to see everything except 2 categories of posts.
Then I want to have an extended access area (people need to register for no cost) to be able to see whats in those 2 category areas.

I've followed the instructions - created my 2 new categories which I want to be hidden.
Then created my user levels 'Site Visitor' which is tagged as visitor in the options, and 'Extended Access'.

What I don't get is the Positive and negative rules.

For 'Site Visitor' I've just set-up a negative rule for the 2 categories that I want to be hidden.
Am I right in assuming that the membership will then assume that everything else (all the other pages etc) will be available to those people?

For the 'Extended Access' people - I've then not put anything in the rules, as again there are no negative rules as they can see everything - so does it assume that?

I've tested this out - and the category link (if I put it in the menu to test it) does redirect people to my register page - but if I put a link directly to a post within that category it will let me see it.

So I'm really confused.

Please can you help? my head really hurts!

Thanks in advance.

  • Philip John
    • DEV MAN’s Apprentice

    Hiya!

    You need to be very explicit about your rules with Membership.

    You have a level where you want people to see everything (positive) except two categories (negative) - so your positive and negative sections need to reflect that by having everything you want them to see in the positive section and those you want restricted in negative.

    That applies to both levels. If you omit something, Membership effectively doesn't know what to do with it.

    Hope that helps!

    Taking a look at these two tutorials might help you get used to how it all works, too:
    https://premium.wpmudev.org/blog/create-a-simple-tutorial-site-with-the-wpmu-dev-membership-plugin/
    https://premium.wpmudev.org/blog/drip-feed-your-content-with-the-wpmu-dev-membership-plugin/

    Phil

  • roobarb
    • Design Lord, Child of Thor

    Thanks for coming back to me Phil.

    I've just had a NIGHTMARE!

    I'd set the membership to disabled as I had some other housekeeping bits to do before I got back into it. I noticed as I was flicking around that the subcription form was still live on the front of the site, so clicked on it - and BOOM! Completely locked out of everything! Even though I know that membership was disabled!

    I went in via FTp and renamed the folder - but still couldn't use my login.

    Luckily I'd shown someone else around the backend yesteday and set her up with admin access so I could at least reset my admin level.

    So I've completely removed membership - and now I'm stuck!

    Maybe I was just trying to use a really complicted plugin for something really simple... but surely there should be a setting in the plugin to block the admin login from being changed???? Thats just bonkers that you can accidentally do that!

    So please help!!!!

    All I need to do it just make 2 categories only available to people who have logged in as subcribers to the site. Is there a simpler way of doing this?

    I still couldn't figure out why individual blogs within a blocked category were still accessible to just site visitors - does that mean for every new blog entered onto the site (from anyone) I have to manually tick that its blocked? even though its within one of those 2 categories?
    It really seems far too complex for what I'm trying to do. I looked at the tutorials you sent through - but I really still don't get how the backend admin relates to the front end site display? Did I need to have a membership level set-up for administrators too?? I'm sooooo confused.

    Any thoughts of how I can move forward? Please???

  • Jonathan
    • The Incredible Code Injector

    @roobarb,

    There is always an easier way... and agree membership is overkill for what you are trying to do. But first lets make sure we are on the same page.

    1) You aren't charging for access. No need for paypal / 2checkout etc?
    2) You want non logged in users (guests/visitors) to be able to access everything except 2 categories.
    3) You want those 2 categories protected and view-able only to logged in (registered users)

    Are we on the same page?

    If there is no need for the payment stuff (this is what complicates things) then you could use wordpress user roles as a default membership system. (this is what the whole role system is for). User registers (subscriber) and you protect the categories based on is the user a subscriber (has access) or isn't a subscriber (no access).

    Is this something you would be interested in?

    -------
    As for your previous questions on membership plugin:
    Admin sees all, you got to log out as admin and log in as test members to see how things work. I use 3 different browsers admin(chrome) stranger (ie) member (firefox).
    Yip, you can lock yourself out - especially using the free-subscription gateway.
    I wouldn't use the select post rules. I would only protect the categories. Drop categories into negative rules for stranger and tick the two categories you don't want them to access. That's it.

  • roobarb
    • Design Lord, Child of Thor

    Thanks so much Jonathan,

    1) You aren't charging for access. No need for paypal / 2checkout etc?
    2) You want non logged in users (guests/visitors) to be able to access everything except 2 categories.
    3) You want those 2 categories protected and view-able only to logged in (registered users)

    Are we on the same page?

    If there is no need for the payment stuff (this is what complicates things) then you could use wordpress user roles as a default membership system. (this is what the whole role system is for). User registers (subscriber) and you protect the categories based on is the user a subscriber (has access) or isn't a subscriber (no access).

    Is this something you would be interested in?

    This is exactly what I'm trying to do - its sounds perfect...

    Is this somthing thats simple for me to do? How do I start? oooooo I'm so excited now!

    Thanks again - can you point me in the right direction?

  • Jonathan
    • The Incredible Code Injector

    Thanks again - can you point me in the right direction?

    Well, there are a number of free plugins that can do this pretty easily. But personally when it comes to membership plugins they start of lightweight and super fast, but as time goes on they get bloated with all sorts of features. Now what you want to do is simply not allow non logged in users to access (read) 2 categories.

    So for 2 categories - I would choose to custom code that rather than rely on a plugin.

    Basically there are a number of ways to do this. But I think the easiest would be to create a function that checks if user is logged in or not and show info based on that.

    Reading Material:
    http://codex.wordpress.org/Function_Reference/is_user_logged_in

    So this is core code to do that

    if ( is_user_logged_in() ) {
        echo 'You are a Member!';
    } else {
        echo 'You are not a Member!';
    }

    But we want it to do a little more than that.

    So depending on your answer to the question below - decides whether we use existing plugins / create our own.

    We can leave the category page to show an excerpt or use the more tag (whatever your theme uses), but on single post template we can do the check to say if in x category or y category is user logged in? and show full content or if not logged in show you need to register or something.

    Would that be simple enough for you? How is your coding ability? What theme are you using? etc

    Sidenote: Thanks for the points - I really appreciate when folks like yourself give me points - it shows that I'm helping, and that you're grateful :wink: So thank you very much for the points :slight_smile:

    Edit: If you can paint a picture for me the exact process you are looking for. User arrives at site. User browses to restricted category (what you want to happen). user clicks link to restricted post(what you want user to see). User takes action and goes to register. User now member and browses to category etc etc

    And - How many posts are we talking about? And are you going to be adding more as time goes on?

  • roobarb
    • Design Lord, Child of Thor

    Hi Jonathan,

    Thanks again and you're welcome for the points, wish I had more to give out.

    Anyway - I'm not really a coder, more of a tweaker of css/html. I must admit the inner workings of WP are still beyond me. I just tend to take whats there and move it around if I need to, without really understanding it too much.

    You can check out the site here - its using a theme called 'amplifier' which I've css tweaked but thats about it. linky link

    The theme uses the more tag on the home page, and the excerpt on the category screen - just to confuse things.

  • roobarb
    • Design Lord, Child of Thor

    sorry - just noticed the edit!

    If you go to the site you'll see a page called The Harmony Zone.

    Thats the access page to the hidden area, I thought it might be easiest to have the sidebar showing links into the 2 hidden categories which are blocked if someone isn;t registered but open if they are?

    I'm not sure how best to work it to tell you the truth.

    There will be 2 categories to start - with perhaps 2 or 3 posts per month added.

    Hope that helps a bit - sorry to be so vague - but I am really a bit lost and my heads spinning with what I though would be quite a simple 'plugin and away' concept.

    Sigh!

  • Jonathan
    • The Incredible Code Injector

    To show you how simple it can be. If you were to add this to your functions.php file.
    And replace the array( 9, 'blue-cheese' etc with your own category either id/slug/name and what the function does is when user either clicks on category link to open the category if he isn't logged in he gets directed to wp-login.php. If user clicks on post link and post is in one of the restricted category - bam, gets redirected to wp-login.php (that's the auth_redirect)

    /* restricted category array can be term_ID 9, or slug "blue-cheese", or name "Stinky Cheeses" */
    add_action( 'template_redirect', 'user_has_access_check', 1 );
    function user_has_access_check() {
    
    	/* Check if in restricted categories.*/
    	if ( in_category( array( 9, 'blue-cheese','Stinky Cheeses' ) ) ) {
    
    		/* If user isn't logged in redirect to login page */
    		if ( !is_user_logged_in() )
    			auth_redirect();
    	}
    }

    If it is only 2 or 3 posts per month it might be better marking them as restricted one by one. This allows you greater flexibility meaning you could mark pages, posts etc outside of the category.

    I can recommend an extremely lightweight plugin that allows you to
    (a) manage roles - create a role called member/vip etc
    (b) manage access based on roles etc

    The plugin is by Justin Tadlock - the guy behind theme hybrid etc
    http://wordpress.org/extend/plugins/members/
    you can select on a post by post basis (as you write it you protect it) it doesn't get simpler than this :wink:

    Let Me know?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.