<!--- >
1. Enter utoken
2. See prepopulated form
3. Fill in info, sign up
< --->
<var C = GLOBAL.Def.Style.color>
<tag.unit_css>
<style type="text/css">
##sign_up .unit { display:block; margin-bottom:0.2em; overflow:auto; overflow-x:hidden; overflow-y:hidden; }
##sign_up .unit .label { display:block; float:left; padding-top:4px; width:26%; font-weight:normal; font-size:0.8em; text-align:right; }
##sign_up .unit .content { display:block; margin-left:27%; }
##sign_up .unit input { width:234px; }
##sign_up .unit input, ##sign_up .unit select { padding:3px; }
</style>
<if isDefined("get.flavor") AND get.flavor NEQ "">
<if get.flavor EQ "snowseats">
<tag.qz_sign_up_flavor_snowseats>
<break>
</if>
</if>
<ensure variable="get.utoken" value="">
<var _utoken_ok = 0>
<ensure variable="get.coppa_mode" value="0">
<var _code_type = "invitation">
<if reFindNoCase("[a-z_]+-[a-z0-9]{3}-[a-z0-9]{4}",get.utoken) GT 0>
<var _code_type = "icode">
<var _code = get.utoken>
<var _u = listFirst(_code,"-")>
<var _c = replace(_code,_u & "-","")>
<tag.i
q='/icode@#_u#.utoken:"#_c#"'
t='get.test'
p=''
i=''>
<if isdefined("return.recordcount") AND return.recordcount GT 0>
<var User_Code = return>
<var _utoken_ok = 1>
</if>
<elseif reFindNoCase("^[a-z0-9]{2}-[a-z0-9]{5}$",get.utoken) GT 0>
<var _code_type = "seat">
<tag.iqtpi_house function="get_active_seat_by_code" utoken="#get.utoken#">
<var User_Seat = return>
<var _utoken_ok = 1>
<else>
<tag.i
q='/invitation'
t='get.count'
p='{
"where": "invitation.utoken = ''#escapeSingleQuotes(get.utoken)#''"
}'
i=''>
<if return GT 0>
<var _utoken_ok = 1>
</if>
</if>
<if _utoken_ok NEQ 1>
<div align="center">
<div align="left" style="width:420px;">
<tag.roundeddiv color="#GLOBAL.Def.Style.color.back_accent#">
<div align="left" class="noverflow" style="padding:7px; margin-bottom:5px;">
<div>
<h4 style="margin-bottom:1em; padding-bottom:2px; border-bottom:1px solid #GLOBAL.Def.Style.color.pri#;">Your invite code</h4>
<div><form method="get" enctype="application/x-www-form-urlencoded" action="#GLOBAL.Def.Nav.a#/Sign_Up">
<input type="hidden" name="x" value="" style="display:none;">
<if trim(get.utoken) NEQ "">
<b>It doesn't work!</b>
<br><br>
Please try entering that invitation code again.
<else>
Please enter your iqtpi invitation code.
</if>
<p class="noverflow" style="font-size:1.64em;">
<span style="display:block; float:left; width:4em; margin-left:0.5em;"><b>Code:</b></span>
<span style="display:block; margin-left:4.64em;"><input id="utoken" name="utoken" style="width:8em;"></span>
</p>
<p align="right">
<input type="submit" value="Use Invitation Code >" style="cursor:pointer; font-weight:bold;">
</p>
</form></div>
</div>
</div>
</tag.roundeddiv>
</div>
</div>
<tag.jquery>
<script type="text/javascript">
$(document).ready(function() {
$('##utoken').focus();
});
</script>
<BREAK>
</if>
<!---
The sign up page
--->
<if client_id GT 1>
<!--- you are logged in already! redirect. --->
<if so_slash_string NEQ "">
<goto url="http://#this_domain#/?&signed_up=1">
</if>
<BREAK>
</if>
<var _prepopulate = 0>
<if reFindNoCase("[a-z_]+-[a-z0-9]{3}-[a-z0-9]{4}",get.utoken) GT 0>
<var Q = User_Code>
<elseif _code_type EQ "seat">
<var _prepopulate = 0>
<else>
<tag.i
q='/invitation'
t='get.query'
p='{
"where": "invitation.utoken = ''#escapeSingleQuotes(get.utoken)#''",
"maxrows": 1
}'
i=''>
<var Q = return>
<var _prepopulate = 1>
</if>
<var _coppa_ok = 1>
<div align="center">
<div align="left" style="width:480px;">
<if _code_type EQ "seat" OR (isDefined("Q.recordcount") AND Q.recordcount GT 0)>
<tag.roundedDiv color="#GLOBAL.Def.Style.Color.alert#">
<div style="padding:7px; color:#C.text#;">
<tag.fico i="tick" linkback="off" style="height:1em;">
Using invitation code <b>#get.utoken#</b>
</div>
</tag.roundedDiv>
<div style="height:7px;"> </div>
<if _prepopulate EQ 1>
<var _new_state = Q.state_protected>
<var _new_school = Q.school_protected>
<var _new_gutitle = "">
<if isValidGutitle(Q.invite_desiredgutitle_protected) EQ 1>
<var _new_gutitle = Q.invite_desiredgutitle_protected>
</if>
</if>
</if>
<if get.coppa_mode EQ 1>
<ensure variable="get.parentemail_protected" value="">
<if isValidEmail(get.parentemail_protected) EQ 1>
<var _coppa_ok = 1>
<tag.roundedDiv color="#GLOBAL.Def.Style.Color.back_accent#">
<div style="padding:7px;">
<tag.fico i="exclamation" linkback="off" style="height:1em;">
<b>This step is for parents only</b>
<br> Your email: <b>#escapeMarkup(get.parentemail_protected)#</b>
</div>
</tag.roundedDiv>
<div style="height:7px;"> </div>
<else>
<var _coppa_ok = 0>
<tag.roundedDiv color="#GLOBAL.Def.Style.Color.back_accent#">
<div style="padding:7px;">
<tag.fico i="exclamation" linkback="off" style="height:1em;">
<b>Your parent or guardian must complete this step</b>
<p>
Our records show that you are under the age of 13. Please ask your parent
or guardian to enter your information for you.
</p>
<form method="get" enctype="application/x-www-form-urlencoded" style="display:inline;">
<input type="hidden" style="display:none;" name="x" value="">
<input type="hidden" style="display:none;" name="s1_override" value="1">
<input type="hidden" style="display:none;" name="s1" value="Sign_Up">
<input type="hidden" style="display:none;" name="utoken" value="#get.utoken#">
<input type="hidden" style="display:none;" name="coppa_mode" value="1">
<div align="right" style="padding:5px;">
<b>Parent Email:</b>
<input type="text" name="parentemail_protected">
<input type="submit" value="Save & Continue" class="gorgeous_borders" style="cursor:pointer;">
</div>
</form>
</div>
</tag.roundedDiv>
<div style="height:7px;"> </div>
</if>
</if>
<if _coppa_ok EQ 1>
<tag.roundedDiv color="#GLOBAL.Def.Style.Color.pri_light#">
<div style="padding:7px; color:#C.text#;">
<if get.coppa_mode EQ 1>
<h3 style="border-bottom:1px solid #GLOBAL.Def.Style.color.pri#; padding-bottom:2px;">Enter your child's information</h3>
<else>
<h3 style="border-bottom:1px solid #GLOBAL.Def.Style.color.pri#; padding-bottom:2px;">Create an iqtpi account</h3>
</if>
<div id="sign_up">
<postform id="sign_up_form">
<var fillInEmail = 1>
<var fillInPassword = 1>
<postsuccess>
<goto url="http://#this_domain#/?&signed_up=1">
<BREAK>
</postsuccess>
<postfail>
<hr style="display:none;"><div style="display:none;"><small> </small></div>
<div class="sp_fail">
<if post_captcha_status EQ 2>
You didn't type the text in the image properly - here's a new one.
<else>
Invalid account information - please try again.
</if>
</div>
<div style="display:none;"><small> </small></div><hr style="display:none;">
<div> </div>
</postfail>
<postneutral>
<div class="unit">
<if get.coppa_mode EQ 1>
<b class="label">Child's Name:</b>
<else>
<b class="label">Full Name:</b>
</if>
<div class="content">
<var val = "">
<if isdefined("post.n1_name")><var val = post.n1_name></if>
<input name="1_name" id="1_name" value="#val#">
</div>
</div>
<div style="height:7px;"><small><small><small> </small></small></small></div>
<div class="unit">
<if get.coppa_mode EQ 1>
<b class="label">Child's Email:</b>
<else>
<b class="label">Email Address:</b>
</if>
<div class="content">
<var val = "">
<if isdefined("post.n1_potentialemail_protected")><var val = post.n1_potentialemail_protected></if>
<input name="1_potentialemail_protected" id="1_potentialemail_protected" value="#val#">
</div>
</div>
<div style="height:7px;"><small><small><small> </small></small></small></div>
<div class="unit">
<b class="label">New Username:</b>
<div class="content">
<var val = "">
<if isdefined("post.n1_gutitle")><var val = post.n1_gutitle><elseif isdefined("_new_gutitle")><var val = trim(lcase(_new_gutitle))></if>
<input name="1_gutitle" id="1_gutitle" value="#val#">
<span class="gutitle_graph" style="display:none;"></span>
</div>
</div>
<div style="height:7px;"><small><small><small> </small></small></small></div>
<div class="unit">
<b class="label">New Password:</b>
<div class="content">
<var val = "">
<if isdefined("post.n1_password") AND fillInPassword EQ 1><var val = post.n1_password></if>
<input type="password" name="1_password" id="1_password" value="#val#">
</div>
</div>
<div style="height:7px;"><small><small><small> </small></small></small></div>
<div class="unit">
<b class="label">Date of Birth:</b>
<ensure variable="POST.n1_dob_month_protected" value="0">
<ensure variable="POST.n1_dob_day_protected" value="0">
<ensure variable="POST.n1_dob_year_protected" value="0">
<div class="content">
<!--- month --->
<var _curr_month = POST.n1_dob_month_protected>
<select id="dob_month" name="1_dob_month_protected">
<option value="0">Month:</option>
<option value="1" <if _curr_month EQ 1> selected </if>>Jan</option>
<option value="2" <if _curr_month EQ 2> selected </if>>Feb</option>
<option value="3" <if _curr_month EQ 3> selected </if>>Mar</option>
<option value="4" <if _curr_month EQ 4> selected </if>>Apr</option>
<option value="5" <if _curr_month EQ 5> selected </if>>May</option>
<option value="6" <if _curr_month EQ 6> selected </if>>Jun</option>
<option value="7" <if _curr_month EQ 7> selected </if>>Jul</option>
<option value="8" <if _curr_month EQ 8> selected </if>>Aug</option>
<option value="9" <if _curr_month EQ 9> selected </if>>Sep</option>
<option value="10" <if _curr_month EQ 10> selected </if>>Oct</option>
<option value="11" <if _curr_month EQ 11> selected </if>>Nov</option>
<option value="12" <if _curr_month EQ 12> selected </if>>Dec</option>
</select>
<!--- day --->
<var _curr_day = POST.n1_dob_day_protected>
<select id="dob_day" name="1_dob_day_protected">
<option value="0">Day:</option>
<loop from="1" to="31" index="i">
<option value="#i#" <if _curr_day EQ i> selected </if>>#i#</option>
</loop>
</select>
<!--- year --->
<var _curr_year = POST.n1_dob_year_protected>
<select id="dob_year" name="1_dob_year_protected">
<option value="0">Year:</option>
<var _now_year = year(now())>
<var i = _now_year>
<loop condition="i GT _now_year-100">
<option value="#i#" <if _curr_year EQ i> selected </if>>#i#</option>
<var i = i - 1>
</loop>
</select>
</div>
</div>
<div style="height:7px;"><small><small><small> </small></small></small></div>
<div class="unit">
<div style="overflow:visible; overflow-x:visible; overflow-y:visible;">
<b class="label">Human Test:</b>
<div class="content">
<captcha chars="6" width="240" height="70">
<div style="width:86%; margin-top:0.12em;"><small><small>
Help us fight spam! Please enter the text you see
in the image.
</small></small></div>
</div>
</div>
</div>
<div> </div>
<input type="hidden" name="1_posttype" value="insert" style="display:none;">
<input type="hidden" name="1_orb" value="user" style="display:none;">
<input type="hidden" name="1_accounttype" value="" style="display:none;">
<div style="margin-bottom:0.3em;">
<div align="right">
<input class="sign_up_submit_btn" type="submit" name="1_submit" value="Save & Continue >" style="cursor:pointer;">
</div>
</div>
<div> </div>
<div> </div>
<tag.jquery>
<tag.i>
<script type="text/javascript">
$(document).ready(function() {
makeGutitleField($('##1_gutitle')[0]);
$('##1_name,##1_gutitle,##1_password,##so_captcha').each(function() {
if (jQuery.trim($(this).val()) == '') {
$(this).focus();
return false;
}
});
$('##1_gutitle').bind('keyup change', function() {
gutitle_graph();
});
$('##sign_up_form').submit(function() {
if (jQuery.trim($('##1_name').val()) == '') {
alert('Please enter your full name.');
$('##1_name').focus();
return false;
}
else if (isValidEmail(jQuery.trim($('##1_potentialemail_protected').val())) !== true) {
alert('Please enter your email address.');
$('##1_potentialemail_protected').val('');
$('##1_potentialemail_protected').focus();
return false;
}
else if (GUTITLE_OK == 0) {
if (jQuery.trim($('##1_gutitle').val()) == '') {
alert('Please choose a new username.');
$('##1_gutitle').focus();
return false;
}
else {
alert('That username is taken.\n\nPlease choose a new username.');
$('##1_gutitle').select();
return false;
}
}
else if (jQuery.trim($('##1_password').val()).length < 4) {
alert('Your new password must contain at least four characters.');
$('##1_password').val('');
$('##1_password').focus();
return false;
}
});
});
GUTITLE_OK = 0;
GUTITLE_AJAX_NUM = 0;
function gutitle_graph() {
var _v = jQuery.trim($('##1_gutitle').val());
if (_v == '') {
$('.gutitle_graph').hide();
}
else {
GUTITLE_AJAX_NUM = GUTITLE_AJAX_NUM + 1;
$('.gutitle_graph').html('<tag.ajax_loader_gif style="height:1em;">');
$('.gutitle_graph').show();
$.get('http://' + document.domain + '/?&check_gutitle=1&gutitle=' + encodeURIComponent(_v) + '&orb=user&id=0&gutitle_ajax_num=' + GUTITLE_AJAX_NUM, function(data) {
var _s = this.url.split('=');
var _num = _s[_s.length-1]-0;
if (_num == GUTITLE_AJAX_NUM) {
GUTITLE_OK = 0;
var _answer = jQuery.trim(data);
$('.gutitle_graph').hide();
var _current_val = jQuery.trim($('##1_gutitle').val());
if (_current_val !== '') {
if (_answer == '1' && _current_val.length > 3) {
$('.gutitle_graph').html('<tag.fico i="tick" linkback="off" style="height:1em;"> Ok');
$('.gutitle_graph').show();
GUTITLE_OK = 1;
}
else {
$('.gutitle_graph').html('<tag.fico i="cross" linkback="off" style="height:1em;"> Taken');
$('.gutitle_graph').show();
}
}
}
});
}
}
function isValidEmail(str) {
var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(str)) {
return false;
}
else {
return true;
}
}
</script>
<input type="hidden" style="display:none;" name="is_sign_up_form" value="1">
<input type="hidden" style="display:none;" name="1_invite_utoken_protected" value="#get.utoken#">
<if isdefined("_new_state")>
<input type="hidden" style="display:none;" name="1_state_protected" value="#_new_state#">
</if>
<if isdefined("_new_school")>
<input type="hidden" style="display:none;" name="1_school_protected" value="#_new_school#">
</if>
<if get.coppa_mode EQ 1>
<input type="hidden" style="display:none;" name="1_parentemail_protected" value="#get.parentemail_protected#">
</if>
<input type="hidden" style="display:none;" name="1_key_answer_protected_unsignedint" value="5">
<input type="hidden" style="display:none;" name="1_key_content_protected_unsignedint" value="5">
<input type="hidden" style="display:none;" name="1_key_profilepic_protected_unsignedint" value="5">
</postneutral>
</postform>
</div>
</div>
</tag.roundedDiv>
</if>
</div>
</div>