Protected Content

OK so I'm getting the hang of this - a little.

I have created a shortcode of 'consultant' for protected content. I've placed [consultant] onto that page with the intention that if a visitor clicks on the link that takes them to that page they'll recieve a message that they need to login. All i'm getting is a 404 error, page not found.

I think I may have conflicting rules regarding that page, any ideas where to look?

  • imbadash
    • Flash Drive

    My lack of knowledge in this arena may be making my questions difficult to understand.

    I'm creating a place where consultants for our company can access forms/videos etc... for training and download. It will be free to them. From what I've seen they can logon with an invite code allowing them to pay $0 for access to the content. Am I understanding that correctly?

    So how do I build the registration page to allow them access to the site with $0?

  • Philip John
    • DEV MAN’s Apprentice

    From what I've seen they can logon with an invite code allowing them to pay $0 for access to the content. Am I understanding that correctly?

    Hmm kind of.

    You can create different levels to control access. Then you create subscriptions that organise those levels. Those subscriptions can be free or paid for. Additionally, you can provide coupon codes to offer discounts if you wish.

    You might find these two article useful in understanding how it all works:
    https://premium.wpmudev.org/blog/drip-feed-your-content-with-the-wpmu-dev-membership-plugin/
    https://premium.wpmudev.org/blog/create-a-simple-tutorial-site-with-the-wpmu-dev-membership-plugin/

    Phil

  • imbadash
    • Flash Drive

    Cool, everything you've given is super helpful. I'm also understanding a lot more than before what everything means as I see how it's working.

    This may be unrelated, but while working on the WordPress blog and creating pages for the Membership to work all my WP functions just disappeared, i've logged back in and restarted my computer. i'm not sure what happened. All i can see is the Dashboard button, but it does nothing when i click on it, but the Membership button and all it's functions are there.

    what the heck happened? i can't see my plugins, pages, nothing...

  • Jonathan
    • The Incredible Code Injector

    Delete the membership plugin from you plugin folders / or just rename it to membership1. This will deactivate the membership plugin... and you should be able to gain admin access. What setting did you use? you shouldn't be able to lock yourself out if you're admin. Perhaps a bug?

    Jonathan

    Edit: Barry the developer answered below.

  • imbadash
    • Flash Drive

    I created a bogus membership using my personal email address, somehow it's blocking my admin access, not sure what to do i tried deactivating the new membership I created but that didn't help. is there a way to delete memberships?

    I see what I did but not sure how to fix it.

  • Barry
    • DEV MAN’s Mascot

    the problem is i can't logon to my wp blog now, it's blocked all my access with my admin as well as my bogus membership

    You don't need to login to wp to access the database - you can get to it via your cpanel (if you are on cpanel) and phpmyadmin (assuming your host is running that).

  • Barry
    • DEV MAN’s Mascot

    This is what you (or someone else) need to do:
    1. login to your database with phpmyadmin if you have it.
    2. Find your admin user, get the user_id for it - probably 1.
    3. Go to the wp_usermeta table and look for the options wp_capabilities and wp_user_level
    4. Set the wp_user_level line to 0.
    5. Set the wp_capabilities line to
    a:1:{s:13:"administrator";s:1:"1";}
    6. Remove the membershipincludes/plugins/integrated.wproles.php file
    7. Should now be able to login to your WP blog.

  • Barry
    • DEV MAN’s Mascot

    @imbadash - you'll need to send us your server details and login details on that contact form david gave you - you need to do the database side of things to get back in, and as you say you don't have phpmyadmin - then it's gonna be difficult.

    What server are you on? which host? what software do you use to manage and backup your databases?

  • Barry
    • DEV MAN’s Mascot

    Hey, David will probably suggest this, but can you FTP into your server and delete the membership directory completely. This should let you back into your WP site, but we'll need to get access to your database in order to allow membership to be re-enabled.

  • imbadash
    • Flash Drive

    OK i've learned more in the last day about this stuff that i never knew i didn't know!

    I've deleted the Membership plugin from the FTP file, i'm back into my site. i've reinstalled the membership plugin but it's not working the same, it's not giving me the dashboard controls like it did before. so i dan't configure it, what now?

  • imbadash
    • Flash Drive

    OK i'm still having issues. I'm getting this error when downloading and activating the Membership plugin:

    Fatal error: Call to undefined method WP_User::WP_User() in /home/content/53/7538153/html/qhsaz.com/wp-content/plugins/membership/membershipincludes/classes/class.membership.php on line 23

    Then I can't logon to my site anymore, and when i type in the url for my site or the url for where i log on from i get the same error showing up.

  • Jonathan
    • The Incredible Code Injector

    @jmurphy444

    You need to update your membership plugin to this temp https://premium.wpmudev.org/forums/topic/new-directory-plugin-version-20-beta as membership doesn't work with wordpress 3.2, but the membership beta 2 does.

    This is due to wordpress 3.2 dropping support for php 4 branch http://codex.wordpress.org/Version_3.2
    And wordpress not adherring to standard practice and having a class named function call the construct to maintain compatibility.

    So,
    in class.membership.php line 23
    Copy over this line
    parent::WP_User( $id, $name );
    with this
    parent::__construct( $id, $name );

    That will fix your errors, but it is better to install the beta 2 version because that also has a few other bug fixes.

    Hope that solves your issue,
    Jonathan

  • DavidM
    • DEV MAN’s Mascot

    Thanks for clarifying that Jonathan. The release version of the plugin has just been updated with said changes as well, so updating the plugin should remedy the 3.2 compatibility issue.

    @imbadash, the latest update of the Membership plugin should resolve that last error, though the issue with your admin account will continue until you make the edit in your database mentioned by Barry.

    Here's a quick rehash of that:
    1. login to your database with phpmyadmin if you have it.
    2. Find your admin user, get the user_id for it - probably 1.
    3. Go to the wp_usermeta table and look for the options wp_capabilities and wp_user_level
    4. Set the wp_user_level line to 0.
    5. Set the wp_capabilities line to
    a:1:{s:13:"administrator";s:1:"1";}

    As before, if you could provide us with database access, we'll take a look at getting that done for you. Just let us know.

    Thanks,
    David

  • imbadash
    • Flash Drive

    when i look at wp_m_membership_relationships - there are 3
    1=free subscriptions
    2=free subscriptions
    3=admin

    But my logon is actually under 1 not 3 from what i remember before i got locked out.not sure if that makes any difference but i'm changing the user level to '0' and it's having no effect.

  • Jonathan
    • The Incredible Code Injector

    @imbadash,

    If you can log in as admin then...
    I don't know if this still apply's, as I don't know how the membership menu handles who can/can't see it, but if I recall it has something to do with a master admin, you can define yourself as membership master admin by adding this to your wp-config.php file
    define( 'MEMBERSHIP_MASTER_ADMIN', 'admin');

    admin is your username.

    Could a developer please confirm if the above should work?

    I guess there is no harm in trying - if it doesn't work, just remove the
    define( 'MEMBERSHIP_MASTER_ADMIN', 'yourusername'); and it will revert back to the default admin found in the membership/includes/membership-config.php

    Oh, and the beta 2 is no longer recommended upgrade, membership plugin has been updated to 2.0.7 :slight_smile:
    https://premium.wpmudev.org/project/membership
    Jonathan

  • imbadash
    • Flash Drive

    OK i' think i've done this correctly. when i 'unzipped' the 2.0.7 update in FTP it prompted where to place and overwrite files so i chose the plugins/membership/ folder as instructed. I'm still getting this error,

    Fatal error: Call to undefined method WP_User::WP_User() in /home/content/53/7538153/html/qhsaz.com/wp-content/plugins/membership/membershipincludes/classes/class.membership.php on line 23

    Am i missing a step?

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    As we haven't heard back from you we're going to assume the problem
    was sorted out and mark this ticket as resolved.

    If it wasn't resolved, or you have any more questions related to this
    thread please feel free to post them below and tick the 'Mark as Not
    Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, thanks for using the forums, and for being a member of WPMU
    DEV, it's a pleasure to help you out and we look forward to being of
    assistance in the future.

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.