Community Support Forums — WordPress® ( Users Helping Users ) — 2012-01-16T18:18:59-05:00 http://www.primothemes.com/forums/feed.php?f=36&t=171 2012-01-16T18:18:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=60735#p60735 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by lmllewellyn — January 16th, 2012, 6:18 pm


]]>
2012-01-16T13:31:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=60705#p60705 <![CDATA[Re: Limit the number of members...]]>

Statistics: Posted by peeld — January 16th, 2012, 1:31 pm


]]>
2012-01-16T13:05:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=60701#p60701 <![CDATA[Re: Limit the number of members...]]> http://wordpress.org/extend/plugins/exec-php/

Statistics: Posted by Jason Caldwell — January 16th, 2012, 1:05 pm


]]>
2012-01-16T13:01:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=60700#p60700 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by peeld — January 16th, 2012, 1:01 pm


]]>
2012-01-14T20:58:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=60524#p60524 <![CDATA[Re: Limit the number of members...]]> Thanks for the follow-ups.
I just tested this again. I can confirm that this code does work as expected.
Jason Caldwell wrote:
lmllewellyn wrote:Thanks for this code. How would I limit the number of people with a certain custom capability. Is this also possible?
Something like this perhaps.
Code:
<?php
global $wpdb
;
$ccap = "music";
if(
count($wpdb->get_results("SELECT `user_id` as `ID` FROM `".$wpdb->usermeta."` WHERE `meta_key` = '".$wpdb->prefix."capabilities' AND `meta_value` LIKE '%\"access_s2member_ccap_".esc_sql($ccap)."\"%'")) >= 10)
    {
?>
        Sorry, we are no longer accepting Membership signups.
<?php
    
}
else
    {
?>
        [s2Member-PayPal-Button .. /]
<?php
    
}
?>

Statistics: Posted by Jason Caldwell — January 14th, 2012, 8:58 pm


]]>
2012-01-11T15:20:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=60275#p60275 <![CDATA[Re: Limit the number of members...]]>

Statistics: Posted by peeld — January 11th, 2012, 3:20 pm


]]>
2012-01-05T19:14:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=59816#p59816 <![CDATA[Re: Limit the number of members...]]>

Statistics: Posted by peeld — January 5th, 2012, 7:14 pm


]]>
2012-01-05T17:45:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=59803#p59803 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by lmllewellyn — January 5th, 2012, 5:45 pm


]]>
2012-01-05T01:20:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=59733#p59733 <![CDATA[Re: Limit the number of members...]]>
lmllewellyn wrote:
Thanks for this code. How would I limit the number of people with a certain custom capability. Is this also possible?
Something like this perhaps.
Code:
<?php
global $wpdb
;
$ccap = "music";
if(
count($wpdb->get_results("SELECT `user_id` as `ID` FROM `".$wpdb->usermeta."` WHERE `meta_key` = '".$wpdb->prefix."capabilities' AND `meta_value` LIKE '%\"access_s2member_ccap_".esc_sql($ccap)."\"%'")) >= 10)
    {
?>
        Sorry, we are no longer accepting Membership signups.
<?php
    
}
else
    {
?>
        [s2Member-PayPal-Button .. /]
<?php
    
}
?>

Statistics: Posted by Jason Caldwell — January 5th, 2012, 1:20 am


]]>
2012-01-04T11:38:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=59643#p59643 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by lmllewellyn — January 4th, 2012, 11:38 am


]]>
2011-09-20T18:19:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=38809#p38809 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by antseo — September 20th, 2011, 6:19 pm


]]>
2011-09-20T18:13:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=38805#p38805 <![CDATA[Re: Limit the number of members...]]> Thanks for the votes on this feature.

Nothing integrated into s2Member in this regard yet. For now, I'll provide a code sample that you might find useful. In order to use this, you will need to have the PHP Execution plugin installed first, so that PHP tags are parsed in your Posts/Pages.

Code:
<?php
if 
(count (get_users ("role=s2member_level1")) >= 10)
    {
?>
        Sorry, we are no longer accepting Membership signups.
<?php
    
} else {
?>
        [s2Member-PayPal-Button .. /]
<?php
    
}
?>
* See also: http://codex.wordpress.org/Function_Reference/get_users
Other Roles include: subscriber, s2member_level1, s2member_level2, etc.

Statistics: Posted by Jason Caldwell — September 20th, 2011, 6:13 pm


]]>
2011-09-18T01:18:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=38602#p38602 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by antseo — September 18th, 2011, 1:18 am


]]>
2011-09-17T21:36:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=38595#p38595 <![CDATA[Re: Limit the number of members...]]>
Thanks,
Lisa

Statistics: Posted by lmllewellyn — September 17th, 2011, 9:36 pm


]]>
2010-06-23T20:16:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=1133#p1133 <![CDATA[Re: Limit the number of members...]]> Statistics: Posted by Jason Caldwell — June 23rd, 2010, 8:16 pm


]]>
2010-06-02T04:06:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=676#p676 <![CDATA[Re: Limit the number of members...]]> http://www.primothemes.com/support/

Statistics: Posted by Elizabeth — June 2nd, 2010, 4:06 am


]]>
2010-05-30T00:15:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=171&p=647#p647 <![CDATA[Limit the number of members...]]>
Cheers - Ryan

Statistics: Posted by ryannagy — May 30th, 2010, 12:15 am


]]>