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™

How do I restrict a plugin from non-paid users?

s2Member Plugin. A Membership plugin for WordPress®.

How do I restrict a plugin from non-paid users?

Postby Rock Sexton » June 20th, 2011, 5:33 pm

I just installed PHPFreeChat onto my wordpress blog. I have the latest s2Member running as well. I do not want non-paying members of my site being able to access it. How would I go about this? The chat program itself only has a basic setting of whether registered or non-registered users can use it.
User avatar
Rock Sexton
Registered User
Registered User
 
Posts: 5
Joined: June 19, 2011

Re: How do I restrict a plugin from non-paid users?

Postby Cristián Lávaque » June 20th, 2011, 10:33 pm

You could wrap the code that outputs the chat, with a conditional that checks the requirement you want to set. WP Admin -> s2Member -> API / Scripting -> Using Advanced Conditionals
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: How do I restrict a plugin from non-paid users?

Postby Rock Sexton » June 20th, 2011, 11:17 pm

Cristián Lávaque wrote:You could wrap the code that outputs the chat, with a conditional that checks the requirement you want to set. WP Admin -> s2Member -> API / Scripting -> Using Advanced Conditionals


Hmmm ... I'm such a novice ... I see the code I want to use

<?php if (current_user_can("access_s2member_level1")){ ?>
Some content for Members who are logged in with an s2Member Level >= 1.
<?php } else { ?>
Some public content.
<?php } ?>


and the chat program's shortcode is [chat-lite]

.... so then how do I "wrap" it to make it work?
User avatar
Rock Sexton
Registered User
Registered User
 
Posts: 5
Joined: June 19, 2011

Re: How do I restrict a plugin from non-paid users?

Postby Rock Sexton » June 20th, 2011, 11:56 pm

Think I got it finally. Cool beans.
User avatar
Rock Sexton
Registered User
Registered User
 
Posts: 5
Joined: June 19, 2011

Re: How do I restrict a plugin from non-paid users?

Postby Cristián Lávaque » June 21st, 2011, 10:11 am

Cool. :)

Oh, I didn't know the chat used shortcode, I guess you could try the shortcode conditinoals then, see if they work together. WP Admin -> s2Member -> API / Scripting -> Using Simple Conditionals
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 0 guests

cron