PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Comments/commenting for members only

s2Member Plugin. A Membership plugin for WordPress®.

Comments/commenting for members only

Postby cjmilcom » July 7th, 2010, 3:49 am

Hi - I'm looking for a way to allow non-members to VIEW comments (in the post, in the sidebar widgets, etc,), but I want them to JOIN as a member before they can submit comments.

We'll be using Free Subscribers (Level #0) as we don't have paid membership levels.

I've searched your documentation, forums and hooks and I just can't find a way to do this with s2 - and I would LOVE to do this with s2!

Any ideas?

regards,

Charlie
User avatar
cjmilcom
Registered User
Registered User
 
Posts: 1
Joined: July 7, 2010

Re: Comments/commenting for members only

Postby Jason Caldwell » July 8th, 2010, 5:32 am

Hi Charlie. Thanks for your inquiry.

This will require integration with your WordPress theme.

  • In your theme directory, find the comments.php file.
  • In your comments.php file, find the section of code that builds the comment form.
  • Wrap your comment form with some Advanced Conditionals.

    You'll end up with something like this:
Code: Select all
<?php if(is_user_logged_in() && current_user_can("access_s2member_level1")){ ?>

    // display the comment form that came with your theme.

<?php } else { ?>

    You must be logged in as a Member before you can leave a Comment.

<?php } ?>
Further documention on Advanced Conditionals, is available in your WP Dashboard, under:
s2Member -> API Scripting -> Advanced Conditionals
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron