Statistics: Posted by peeld — January 16th, 2012, 1:31 pm
Statistics: Posted by Jason Caldwell — January 16th, 2012, 1:05 pm
Jason Caldwell wrote:Something like this perhaps.lmllewellyn wrote:Thanks for this code. How would I limit the number of people with a certain custom capability. Is this also possible?
- 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
Statistics: Posted by peeld — January 11th, 2012, 3:20 pm
Statistics: Posted by peeld — January 5th, 2012, 7:14 pm
<?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
<?php
if (count (get_users ("role=s2member_level1")) >= 10)
{
?>
Sorry, we are no longer accepting Membership signups.
<?php
} else {
?>
[s2Member-PayPal-Button .. /]
<?php
}
?>
Statistics: Posted by Jason Caldwell — September 20th, 2011, 6:13 pm
Statistics: Posted by lmllewellyn — September 17th, 2011, 9:36 pm
Statistics: Posted by Elizabeth — June 2nd, 2010, 4:06 am
Statistics: Posted by ryannagy — May 30th, 2010, 12:15 am