Page 1 of 1

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

PostPosted: June 20th, 2011, 5:33 pm
by Rock Sexton
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.

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

PostPosted: June 20th, 2011, 10:33 pm
by Cristián Lávaque
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

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

PostPosted: June 20th, 2011, 11:17 pm
by Rock Sexton
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?

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

PostPosted: June 20th, 2011, 11:56 pm
by Rock Sexton
Think I got it finally. Cool beans.

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

PostPosted: June 21st, 2011, 10:11 am
by Cristián Lávaque
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