<var o = caller.o>
<var Q = att.Q>
<var Q2 = att.Q2>
<var OUT = caller.OUT>
<var DISP = caller.DISP>
<if GLOBAL.SP.site_is_franchise NEQ 1>
<goto url="http://smallerpage.com/new_site?#OUT.trans#">
<BREAK>
</if>
<fake_person>
<h3>Create a SmallerPage Site<if site_id NEQ 340> on #OUT.site_title#</if></h3>#OUT.after_header#
<!--- pic --->
<div class="media_frame">
<img src="http://#this_domain#/?&f=routine-#this_id#&picwidth=#GLOBAL.sp_picwidth#" border="0">
</div>
<div> </div>
<p>
<b>You're about to make a new website!</b>
</p>
<div style="display:none;"> </div>
<div style="margin-left:2.5em; margin-right:0.7em;">
<div class="sp_box sp_box_2">
<b>New SmallerPage Users: </b>
<br>Is this your very first time<if site_id NEQ 340> here<else> at SmallerPage</if>? You'll need to
create an account so the site can remember you next time.
<div><small> </small></div>
<div align="right">
<a href="http://#this_domain#/sign_up"><b>Sign Up for SmallerPage<if site_id NEQ 340> on #OUT.site_title#</if></b></a>
<a href="http://#this_domain#/sign_up"><tag.fico i="plus" style="height:1em;" linkback="off"></a>
</div>
<div><small> </small></div>
</div>
</div>
#OUT.clr#
<div><small>Did you already sign up? You can just
<a href="http://#this_domain#/login">log in</a> with your current
email and SmallerPage password.
</small></div>
<div> </div>
<BREAK>
</fake_person>
<!--- how many sites does the user have? --->
<var sitecount = 0>
<set orb="site" select="count(site.id) AS idcount" where="site.user_id = #client_id# AND site.generator = 'smaller'" maxrows="1">
<var sitecount = set.idcount>
</set>
<if sitecount EQ 0>
<var GLOBAL.no_foot = 1>
</if>
<!--- ask a few dumb questions ... --->
<ensure variable="get.category" value="">
<var _color_test = "">
<ensure variable="get.color" value=""><var _color_test = _color_test & get.color><var get.color = colorNameToHex(get.color)>
<ensure variable="get.bgcolor" value=""><var _color_test = _color_test & get.bgcolor><var get.bgcolor = colorNameToHex(get.bgcolor)>
<ensure variable="get.action" value="">
<if listFind(GLOBAL.sp_cats,get.category) EQ 0 OR get.action EQ "category">
<!--- aha! first you need a category. --->
<div align="center" style="border-bottom:1px solid ##3372ff; margin-left:-9px; margin-right:-9px; margin-top:-9px; padding:7px; border-top-width:0px;" class="sweetbox">
<div> </div>
<h3 style="margin:0px;">What Kind of Site?</h3>
<div> </div>
</div>
<div> </div>
<div> </div>
<form method="get" enctype="application/x-www-urlencoded">
<input type="hidden" style="display:none;" name="x" value="">
<input type="hidden" style="display:none;" name="color" value="#escapeDoubleQuotes(get.color)#">
<input type="hidden" style="display:none;" name="bgcolor" value="#escapeDoubleQuotes(get.bgcolor)#">
<div align="center" class="bigr" id="category_container" style="font-size:1.2em; padding:5px;">
<select name="category" style="font-size:1em;">
<option>(Choose a Category) </option>
<loop list="#GLOBAL.sp_cats#" index="i">
<option value="#i#">#i#</option>
</loop>
</select>
</div>
<div> </div>
<div> </div>
<div align="center" style="padding:5px;">
<input type="submit" value="Save & Continue" style="font-size:1.36em; cursor:pointer;">
</div>
</form>
<div> </div>
<div> </div>
<div> </div>
<BREAK>
</if>
<if _color_test EQ "" OR get.action EQ "color">
<!--- got category - pick colors! --->
<div style="padding:7px; background:##f5f5ff; margin-left:-9px; margin-right:-9px; margin-top:-9px;"><small>#OUT.icon_tick# <b>Site Category:</b> #get.category#</small></div>
<div align="center" style="border-bottom:1px solid ##3372ff; border-top:1px solid ##3372ff; margin-left:-9px; margin-right:-9px; margin-top:0px; padding:7px; border-top-color:##999; border-bottom-color:##999;" class="sweetbox strict_bgcolor_example">
<div> </div>
<h3 style="margin:0px;"><span class="color_example">Next - What Colors?</span></h3>
<div> </div>
</div>
<div> </div>
<form method="get" enctype="application/x-www-urlencoded">
<input type="hidden" style="display:none;" name="x" value="">
<input type="hidden" style="display:none;" name="category" value="#escapeDoubleQuotes(escapeMarkup(get.category))#">
<div><b>Main Color:</b></div>
<div style="margin-left:1em; padding:3px;">
<input name="color" id="1_color" value="#escapeDoubleQuotes(get.color)#">
<div style="margin-top:0.2em;"><small>
This color will be used for links, borders, and other highlights.
</small></div>
</div>
<div> </div>
<div><b>Background Color:</b></div>
<div style="margin-left:1em; padding:3px;">
<input name="bgcolor" id="1_bgcolor" value="#escapeDoubleQuotes(get.color)#">
<div style="margin-top:0.2em;"><small>
This color will be displayed behind each of your site's pages.
</small></div>
</div>
<div> </div>
<div align="center" style="padding:5px;">
<input type="submit" value="Save & Continue" style="font-size:1.36em; cursor:pointer;">
</div>
<div> </div>
</form>
<div> </div>
<div> </div>
<tag.jquery plugins="colorpicker">
<BREAK>
</if>
<postform>
<var it_worked = 0>
<if isdefined("POST.new_gutitle")>
<if isValidGutitle(POST.new_gutitle) EQ 1>
<var _v = trim(lcase(POST.new_gutitle))>
<var _meta = '<ta' & 'g.sp_meta>'>
<if trim(get.color) EQ "" OR get.color EQ "##">
<var get.color = "blue">
</if>
<insert orb="site"
gutitle="#_v#"
user_key_id="1"
routineid_unsignedint="2627"
headerhtml="#_meta#"
generator="smaller"
color="#get.color#"
bgcolor="#get.bgcolor#"
publish="not"
categories="#get.category#"
homepage="first"
><!--- emails_protected="#_email_test#"--->
<var idnum = return>
<if isNumeric(idnum) AND idnum GT 1>
<var it_worked = 1>
<var _url = "http://#_v#.smallerpage.com/pages?&site_created=1&soTransfer=#urlEncodedFormat(client_cookie)#">
<goto url="#_url#">
</if>
</if>
</if>
<if it_worked NEQ 1>
<!--- got category and emails - now let's make the site! --->
<div style="padding:7px; background:##f5f5ff; margin-left:-9px; margin-right:-9px; margin-top:-9px;"><small>#OUT.icon_tick# <b>Site Category:</b> #get.category#</small></div>
<div style="padding:7px; background:##f5f5ff; margin-left:-9px; margin-right:-9px; margin-top:0px; border-top:1px solid ##ccc;"><small>#OUT.icon_tick# <b>Colors:</b>
<span style="padding:1px; background:white; color:#escapeMarkup(get.color)#; border:1px solid #escapeMarkup(get.color)#;"><b>#get.color#</b></span>
<span style="padding:1px; background:#escapeMarkup(get.bgcolor)#; color:white; border:1px solid ##ccc;"><b>#get.bgcolor#</b></span>
(<a href="http://smallerpage.com/new_site?&category=#get.category#&color=#urlEncodedFormat(get.color)#&bgcolor=#urlEncodedFormat(get.bgcolor)#&action=colors">change</a>)</small></div>
<div align="center" style="border-bottom:1px solid ##3372ff; border-top:1px solid ##3372ff; margin-left:-9px; margin-right:-9px; margin-top:0px; padding:7px;" class="sweetbox">
<div> </div>
<h3 style="margin:0px;">Choose a URL</h3>
<div> </div>
</div>
<if isdefined("POST.new_gutitle")>
#OUT.clr#
<div class="sp_fail">
<h3>Invalid URL</h3>#OUT.after_header#
<p>
The SmallerPage URL you entered has invalid characters,
or is already in use. Please try again.
</p>
</div>
#OUT.clr#
</if>
<div> </div>
<div class="unit">
<div><b>Last Step - Choose a SmallerPage URL:</b></div>
<div class="pop">
<div><input name="new_gutitle" id="site-0:gutitle" class="gutitle_field focusme" style="width:7em;">.smallerpage.com</div>
</div>
</div>#OUT.clr#
#OUT.clr#
<div align="center">
<input type="submit" value="Create SmallerPage Site" style="cursor:pointer; font-size:1.36em;">
</div>#OUT.clr#
#OUT.clr#
</if>
</postform>