$user_type = $_GET['user_type'];
$query = $_GET['action'];
if ((!ereg ("TypeB|TypeA", $user_type))&&($query == "register")){
echo <<<END
<div style="height:800px; width:100%; z-index:50; background-color:#FFF; position:absolute; text-align:center;">
<form method="GET" action="/wp-login.php">
<label>Choose Your User Type: </label>
<input name="action" type="hidden" value="register" />
<select name="user_type" id="user_type">
<option selected="selected" value="Please Choose">Please Select</option>
<option value="TypeA">TypeA</option>
<option value="TypeB">TypeB</option>
</select>
<input type="submit" value="Submit" />
</form>
</div>
END;
} else if (($user_type == "TypeB")||($user_type == "TypeA")) {
//The original code from said page goes here
}
$user_type = $_GET['user_type'];
echo "<p><input id='user_type_input' type='text' readonly='readonly' name='user_type_input' value='$user_type' />
<label for='user_type'>User Type</label><br><small>Note* This cannot be changed after registeration</small><br/>To change this user type <a href='/wp-login.php?action=register'>Click Here</a></p>";
if ($user_type == "typeA"){
echo <<<END
<label>User Type A Name</label><input name="userA_name" type="text" />
END;
} else if ($user_type == "typeB") {
echo <<<END
<label>User Type B Name</label><input name="userB_name" type="text" />
END;
}
$user_type = $_POST["user_type_input"]; //from hidden field above
if ($user_type == "typea"){
update_user_meta ($user_id, "user_type_name", $_POST['userA_name']);
} else if ($user_type == "typeb"){
update_user_meta ($user_id, "user_type", $_POST['userB_name']);
}
Statistics: Posted by cjay175 — January 24th, 2011, 2:00 am
if (!function_exists ("ws_plugin__s2member_custom_fields_configured_at_level"))
{
function ws_plugin__s2member_custom_fields_configured_at_level ($_level = "auto-detection")
{
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action ("ws_plugin__s2member_before_custom_fields_configured_at_level", get_defined_vars ());
unset ($__refs, $__v); /* Unset defined __refs, __v. */
/**/
$level = ($_level === "auto-detection") ? ws_plugin__s2member_user_access_level () : $_level;
if ($_level === "auto-detection" && $level < 0 && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($cookie = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"]))))
list ($level) = preg_split ("/\:/", $cookie, 3);
/**/
$level = (!is_numeric ($level) || $level < 0) ? 0 : $level; /* Always default to Level #0. */
/**/
if (is_numeric ($level) && $level >= 0 && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])
{
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
if ($field["levels"] === "all" || in_array ($level, preg_split ("/[;,]+/", preg_replace ("/[^0-9,]/", "", $field["levels"]))))
$configured[] = $field["id"]; /* Add this to the array. */
}
/**/
return apply_filters ("ws_plugin__s2member_custom_fields_configured_at_level", $configured, get_defined_vars ());
}
}
Statistics: Posted by cjay175 — January 23rd, 2011, 5:47 pm