.id
3768
.gutitle
qz_new
.title
qz_new
.file
.extension
.name
|/routinetype-page|
.user_id
7
.notes
.body
<var C = GLOBAL.Def.Style.color>

<if isDefined("get.subscribe") AND isValidGutitle(get.subscribe) EQ 1>
<tag.i
q='/table'
t='post.subscribe'
p='{
"table": "#get.subscribe#",
"method": "get"
}'
i=''>
<tag.iqtpi_get_client fresh="1">
</if>


<var _tables = "-blog_post">
<var _tables_restrict = "-blog_post-photo-audio-video">
<loop list="#GLOBAL.Def.Client.tables#" index="x" delimiters="|#CHR(10)#"><if x NEQ "answer" AND listFindNoCase(_tables,x,'-') EQ 0>
<var _tables = _tables & "-" & x>
<var _tables_restrict = _tables_restrict & "-" & x>
</if></loop>

<!--- let's put those in alphabetical order. --->
<var _tables_as_array = listToArray(_tables,'-')>
<var arraySort(_tables_as_array,'textnocase','asc')>
<var _tables = '-' & arrayToList(_tables_as_array,'-')>
<var _tables_restrict_as_array = listToArray(_tables_restrict,'-')>
<var arraySort(_tables_restrict_as_array,'textnocase','asc')>
<var _tables_restrict = '-' & arrayToList(_tables_restrict_as_array,'-')>



<var _tbl_already_selected = 0>
<ensure variable="get.s2" value="">
<if listFindNoCase(_tables_restrict,get.s2,"-") EQ 0 OR isValidGutitle(get.s2) NEQ 1 OR get.s2 EQ "user">
<var get.s2 = "text">
<else>
<var _tbl_already_selected = 1>
</if>


<style type="text/css">
.radio_container, .fake_radio_container { position:relative; padding:2px; padding-bottom:3px; cursor:pointer; overflow:auto; overflow-x:hidden; overflow-y:hidden; }
.radio_left { float:left; }
.radio_right { display:block; margin-left:2.1em; padding-top:0.2em; }
</style>


<postform>

<postsuccess>
<var _tbl = POST.n1_orb>
<var _idnum = POST_N.n1.status>
<var _ukid = POST.n1_user_key_id>
<var _content_iqtpi_age_num_double = POST.n1_iqtpi_age_num_double>

<update orb="user" where="user.id = #client_id#"
last_iqtpi_post_datetime="#now()#">


<var _price = 2>
<var _txt = _tbl>
<set j="/table-#_tbl#.qprice_unsignedint">
<setcrawl>
<if trim(set.notes) NEQ "">
<var _txt = set.notes>
</if>
<if set.qprice_unsignedint GT _price>
<var _price = set.qprice_unsignedint>
</if>
</setcrawl>
</set>
<!--- transact --->
<tag.qcash function="txn"
title="Created a new #_txt#"
name="/table-#_tbl#"
notes="On #dateFormat(now(),'full')#, #client_name# added a record to the /#_tbl# table"
sum_double="#0-_price#"
body="create"
with_unsignedint="777"
with="iqtpi">
<if NOT ( isNumeric(return) AND return GT 0 )>
<h4>#return#</h4>
<p>
<a href="http://#this_domain#/New/#_tbl#">Back</a>
</p>
<break>
</if>

<if _ukid EQ 1 OR _tbl EQ "table">
<var _ping_ulist = "#GLOBAL.Def.Friends.intList#,#GLOBAL.Def.Followers.intList#">
<elseif _ukid EQ 0>
<var _ping_ulist = "0">
<elseif _ukid LTE 5>
<var _ping_ulist = "#GLOBAL.Def.Friends.intList#,#GLOBAL.Def.Followers.intList#">
<else>
<var _ping_ulist = "#GLOBAL.Def.Friends.intList#">
</if>

<if _ping_ulist NEQ "0">
<!--- refine ping ulist: don't tell people about tables they don't have! --->
<var _new_ping_ulist = "0">
<set orb="user" select="user.id" where="user.id IN (#_ping_ulist#) AND user.tables LIKE ('%|#_tbl#|%')" maxrows="#listLen(_ping_ulist)+5#">
<setcrawl>
<var _new_ping_ulist = _new_ping_ulist & "," & set.id>
</setcrawl>
</set>
<var _ping_ulist = _new_ping_ulist>
<if _ping_ulist NEQ "0">
<!--- ping! --->
<var _tbl_name = _tbl>
<set j="/table-#_tbl#">
<if trim(set.notes) NEQ "">
<var _tbl_name = set.notes>
</if>
</set>
<var _p = StructNew()>
<var _p.notes = "#client_name# created a new #_tbl_name#">
<var _p.name = "/#_tbl#-#_idnum#">
<var _p.body = "create">
<var _p.user_id_list = "#_ping_ulist#">
<var _p.content_iqtpi_age_num_double = _content_iqtpi_age_num_double>
<var _p.send_email = 1>
<var _p.email_subject = "#client_name# created a new #_tbl_name#">
<tag.i
q='/ping'
t='post.insert'
p='#_p#'
i=''>
</if>
</if>


<if _tbl EQ "site">
<!--- create home routine and go to content --->
<var _did = 0>
<set j="/#_tbl#-#_idnum#.iqtpi_age_num_double">
<setcrawl>
<var _did = 1>
<insert orb="routine" title="#set.title#" user_key_id="#set.user_key_id#" iqtpi_age_num_double="#set.iqtpi_age_num_double#">
<var _rid = return>
<if isNumeric(_rid) AND _rid GT 1>
<update orb="#_tbl#" where="#_tbl#.id = #_idnum#"
soloroutineid_unsignedint="#_rid#">
</if>
</setcrawl>
</set>
<if _did NEQ "pants">
<goto url="http://iqtpi.com/j:/#_tbl#-#_idnum#?&edit_mode=1">
</if>
<elseif _tbl EQ "table">
<!--- update qprice and force user_key_id=1 --->
<update orb="#_tbl#" where="#_tbl#.id = #_idnum#" qprice_unsignedint="5" user_key_id="1">
<var _ukid = 1>
<!--- update client ici and go to content --->
<tag.ici function="ensure" user_id="#client_id#">
<tag.ici function="update" user_id="#client_id#">
<if return NEQ "pants">
<if isDefined("get.back_to_dashboard") AND get.back_to_dashboard EQ 1>
<goto url="http://iqtpi.com/">
<else>
<goto url="http://iqtpi.com/j:/#_tbl#-#_idnum#?&edit_mode=1">
</if>
</if>
<else>
<!--- update client ici and go to content --->
<tag.ici function="ensure" user_id="#client_id#">
<tag.ici function="update" user_id="#client_id#">
<if return NEQ "pants">
<if isDefined("get.back_to_dashboard") AND get.back_to_dashboard EQ 1>
<goto url="http://iqtpi.com/">
<else>
<goto url="http://iqtpi.com/j:/#_tbl#-#_idnum#?&edit_mode=1">
</if>
</if>
</if>
<break>
</postsuccess>


<div align="center" style="padding:2em; min-height:8em; padding-top:1em;">

<div align="left" style="width:600px;">

<postfail>
<div style="padding:7px; margin-bottom:7px; background:red; color:white;">
<h3>Upload Error - Please Try Again.</h3>
<p>
Are you uploading a file that's larger than 250MB?
</p>
</div>
</postfail>


<tag.qcash function="acct">
<var Acct = return>

<tag.q_graphics>
<var Qg = return>

<h3>What do you want to create?</h3>

<div align="center" style="padding-bottom:5px; font-size:0.72em;">

<!---
<select name="1_orb" id="1_orb">
<if _tbl_already_selected EQ 1>
<set j="/table-#get.s2#">
<setcrawl>
<option value="#get.s2#" selected>#escapeMarkup(set.notes)#</option>
</setcrawl>
<setempty>
<option value="#get.s2#" selected>#get.s2#</option>
</setempty>
</set>
</if>
<set j="/table#_tables#.qprice_unsignedint">
<var _counter = 1>
<loop list="#_tables#" index="x" delimiters="-"><if (_tbl_already_selected EQ 0 OR x NEQ get.s2 ) AND x NEQ "answer" AND x NEQ "user"><setcrawl><if set.gutitle EQ x>
<var _price = 2>
<if set.qprice_unsignedint GT _price>
<var _price = set.qprice_unsignedint>
</if>
<option style="padding-left:19px; background:url(http://#this_domain#/file:/table-#x#?&f2=table-7&picwidth=16); background-repeat:no-repeat; background-position:0px 2px;" value="#x#"<if _tbl_already_selected EQ 0 AND _counter EQ 1> selected</if>>#escapeMarkup(set.notes)# &nbsp;-q#numberFormat(_price)#</option>
<var _counter = _counter + 1>
<break></if></setcrawl></if></loop>
</set>
<if _tbl_already_selected EQ 0 AND _tables EQ "">
<option value="text" selected>Blog Post</option>
<var _tbl_already_selected = 1>
</if>
<option value="-customize-tables-">Customize Tables...</option>
</select>
--->

<div align="left" style="width:400px; border-top:1px solid #C.pri#; margin-right:5em;">

<if _tbl_already_selected EQ 1>
<set j="/table-#get.s2#.qprice_unsignedint">
<setcrawl>
<var _price = 2>
<if set.qprice_unsignedint GT _price>
<var _price = set.qprice_unsignedint>
</if>
<div class="radio_container">
<input name="1_orb" type="radio" value="#get.s2#" class="radio radio_left" checked><span class="radio_right"> <img src="http://#this_domain#/file:/table-#get.s2#?&f2=table-7&picwidth=16" border="0" style="height:0.88em;"> <span class="table_txt">#escapeMarkup(set.notes)#</span> &nbsp;(#Qg.sign##numberFormat(_price)#)</span>
</div>
</setcrawl>
<setempty>
<div class="radio_container">
<input name="1_orb" type="radio" value="#get.s2#" class="radio radio_left" checked><span class="radio_right"> <img src="http://#this_domain#/file:/table-7?&picwidth=16" border="0" style="height:0.88em;"> <span class="table_txt">#escapeMarkup(get.s2)#</span> &nbsp;(#Qg.sign#2)</span>
</div>
</setempty>
</set>
</if>
<set j="/table#_tables#.qprice_unsignedint">
<var _counter = 1>
<loop list="#_tables#" index="x" delimiters="-"><if (_tbl_already_selected EQ 0 OR x NEQ get.s2 ) AND x NEQ "answer" AND x NEQ "user"><setcrawl><if set.gutitle EQ x>
<var _price = 2>
<if set.qprice_unsignedint GT _price>
<var _price = set.qprice_unsignedint>
</if>
<div class="radio_container">
<input name="1_orb" type="radio" value="#set.gutitle#" class="radio radio_left"<if _tbl_already_selected EQ 0 AND _counter EQ 1> checked</if>><span class="radio_right"> <img src="http://#this_domain#/file:/table-#x#?&f2=table-7&picwidth=16" border="0" style="height:0.88em;"> <span class="table_txt">#escapeMarkup(set.notes)#</span> &nbsp;(#Qg.sign##numberFormat(_price)#)</span>
</div>
<var _counter = _counter + 1>
<break></if></setcrawl></if></loop>
</set>
<if _tbl_already_selected EQ 0 AND _tables EQ "">
<div class="radio_container">
<input name="1_orb" type="radio" value="#get.s2#" class="radio radio_left" checked><span class="radio_right"> <img src="http://#this_domain#/file:/table-text?&f2=table-7&picwidth=16" border="0" style="height:0.88em;"> <span class="table_txt">Blog Post</span> &nbsp;(#Qg.sign#3)</span>
</div>
<var _tbl_already_selected = 1>
</if>
<div class="fake_radio_container" style="cursor:text;">
&nbsp; &nbsp;+&nbsp; <a href="http://#this_domain#/Tables">More...</a>
</div>
<div style="padding-top:2px; margin-top:11px; border-top:1px dashed #C.g4#;">
<span>
You have <b>#Qg.sign##numberFormat(round(Acct.sum_double))#</b>
</span>
</div>

</div>

</div>

<!---
is called

<input id="1_title" name="1_title" value="" autocomplete="off">
--->

<div style="height:11px;">&nbsp;</div>

<div class="unit">
<div class="unit_left">
&nbsp;
</div>
<div class="unit_right" align="right">
<input type="submit" id="submit_btn" value="Create This" style="cursor:pointer; font-size:1.2em; border-width:2px;" class="gorgeous_borders">
</div>
</div>


<if GLOBAL.Def.iqtpi_age_num GT 1>
<div style="height:11px;">&nbsp;</div>
<div class="unit">
<div class="unit_left">
&nbsp;
</div>
<div class="unit_right" align="right">
<select id="1_iqtpi_age_num_double" name="1_iqtpi_age_num_double">
<if GLOBAL.Def.iqtpi_age_num GT 2>
<option value="3" selected>Grown Ups and Way Grown Ups Only</option>
</if>
<option value="2"<if GLOBAL.Def.iqtpi_age_num EQ 2> selected</if>>Suitable for Teens and Older</option>
<option value="1">Safe for All Ages</option>
</select>
</div>
</div>
<else>
<input type="hidden" style="display:none;" name="1_iqtpi_age_num_double" value="1">
</if>

<div id="user_key_id_container">
<div style="height:11px;">&nbsp;</div>

<div class="unit">
<div class="unit_left">
&nbsp;
</div>
<div class="unit_right" align="right">
<select name="1_user_key_id" id="1_user_key_id">
<option value="1" selected>Everyone can see this</option>
<option value="5">Friends and followers can see this</option>
<option value="9">Only friends can see this</option>
<option value="0">Only I can see this (private)</option>
</select>
<div class="unit_note" id="explain_user_key_id">
<if _tbl_already_selected EQ 1 AND get.s2 EQ "table">
Tables must be public.
</if>
</div>
</div>
</div>
</div>


</div>

</div>

<input type="hidden" style="display:none;" name="1_posttype" value="INSERT">

</postform>


<tag.jquery>
<script type="text/javascript">
$(document).ready(function() {
activate_radio_containers();

$('.radio').bind('change', function() {
change_submit_btn_text();
});

change_submit_btn_text();
});

function change_submit_btn_text() {
_the_text = '';
_the_val = '';
$('.radio').each(function() {
if (this.checked) {
_the_val = $(this).val();
_the_text = $(this).parents('.radio_container:first').find('.table_txt').text();
return false;
}
});
$('##submit_btn').val('Create This ' + _the_text);
if (_the_val == 'table') {
$('##1_user_key_id').val('1');
$('##explain_user_key_id').html('Tables must be public.');
}
else {
$('##explain_user_key_id').html('');
}
}
</script>
 
.sum_double
0.00
.producttype
.productincludes
.physical_unsignedint
0
.isprotected_unsignedint
0
.overridesiteheader_unsignedint
0