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™
<?php
if (count (get_users ("role=s2member_level1")) >= 10)
{
?>
Sorry, we are no longer accepting Membership signups.
<?php
} else {
?>
[s2Member-PayPal-Button .. /]
<?php
}
?>
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?
<?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
}
?>
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: Select all
<?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
}
?>
Return to Common Questions/Problems/Tips
Users browsing this forum: No registered users and 1 guest