latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

registration submission & verification hooks?

Home Forums Community Forum registration submission & verification hooks?

This topic contains 1 reply, has 2 voices. Last updated by  Jason (Lead Developer) 4 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Feb 28th, 2012 at 1:18 am #6638
Lan
Username: bigrice

Hello expert,
I want to add a user registration verification code after the user clicks the “register” or “log-in” button. That is: the user can only register as level 0 user when he is eligible, meaning his name and birthday match the existing database table records.

Here is my code snippets that I put in s2-hacks.php. Please lend me a hand if I’m wrong. Thank you very much in advance!!!

add_action (“signup_hidden_fields”,”ml_member_verify” );

function ml_member_verify() {
global $wpdb;

$first_name=$_POST[“ws_plugin__s2member_custom_reg_field_last_name”];
$last_name=$_POST[“ws_plugin__s2member_custom_reg_field_last_name”];
$birthday = $_POST[“ws_plugin__s2member_custom_reg_field_birthday”];

$sql = “SELECT DISTINCT wp_dbt_sponsor.wp_user_id FROM wp_dbt_sponsor_receiver WHERE TRIM( wp_dbt_sponsor_receiver.first_name ) = ‘”.$first_name.”‘ AND TRIM( wp_dbt_sponsor_receiver.last_name ) = ‘”.$last_name.”‘ AND TRIM(wp_dbt_sponsor_receiver.birthday) = ‘”.$birthday.”‘”;
$sponsor = $wpdb->get_results($sql);
if ($sponsor)
{
//echo print_r($sponsor);
foreach ($sponsor as $s)
{
echo “you membership level is : “.
define(S2MEMBER_CURRENT_USER_ACCESS_LEVEL=0);
}
} else {
echo “you are not eligible to register as a member”;
}
?>

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Feb 28th, 2012 at 2:15 am #6647
Staff Member

Hi there. Thanks for your inquiry.

I’m very sorry, but we cannot assist with custom coding.
Please read our Support Policy for further details in this regard. Again, I’m very sorry.
s2Member® » Support Policy » Fine Lines

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.