<h3>Under Construction</h3>
<p>
Oh no! We're working on the new page feature. Please try this again in 24 hours.
</p>
<tag.smp_pagebtn val="Back to SmallerPage" slash="home">
<BREAK>
<var C = GLOBAL.Def.Style.color>
<ensure variable="get.pagetype" value="">
<fake_person><if so_slash_string NEQ "">
<goto url="http://#this_domain#/">
<break>
</if></fake_person>
<!--- accept posts from smp_dashboard's "write on..." format --->
<if isDefined("POST.n1_title")>
<if NOT ( isDefined("post_N.n1.status") AND isNumeric(post_N.n1.status) AND post_N.n1.status GT 1 )>
<!--- bad post - rdr. --->
<goto url="http://#this_domain#/">
<BREAK>
<else>
<!--- figure out what site to put it on --->
<var _Site = QueryNew('id')>
<ensure variable="POST.site_gutitle" value="#GLOBAL.Def.Client_Sites.gutitle#">
<if POST.site_gutitle NEQ "-profile-">
<set j="/site-#POST.site_gutitle#.pages">
<var _Site = set>
</set>
</if>
<var _ttl = "">
<var _tbl = "sp">
<var _idnum = post_N.n1.status>
<!--- for now i don't like blank titles. --->
<if trim(replacemarkup(POST.n1_title)) EQ "">
<delete orb="#_tbl#" where="#_tbl#.id = #_idnum#">
<if return NEQ "pants">
<if listFindNoCase(GLOBAL.Def.Client.iqtpi_protected,"sp_init_myfirstpage","|#CHR(10)#") EQ 0>
<!--- they're still on their first page... --->
<goto url="http://#this_domain#/spinit_firstpage">
<else>
<goto url="http://#this_domain#/">
</if>
</if>
<BREAK>
</if>
<!--- handle "very first page" case --->
<if listFindNoCase(GLOBAL.Def.Client.iqtpi_protected,"sp_init_myfirstpage","|#CHR(10)#") EQ 0>
<var _newi = GLOBAL.Def.Client.iqtpi_protected & CHR(10) & "|sp_init_myfirstpage|">
<update orb="user" iqtpi_protected="#_newi#" where="user.id = #client_id#">
</if>
<!--- "add" page (actually, update it) --->
<update orb="#_tbl#" where="#_tbl#.id = #_idnum#"
site_id="631"
user_key_id="1"
pagetype=""
commentkey_unsignedint="1"
showmypic_unsignedint="1">
<if _Site.recordcount GT 0>
<var _sttl = "/site-#_Site.id#">
<if _Site.title NEQ "">
<var _sttl = escapeMarkup(_Site.title)>
<elseif _Site.gutitle NEQ "">
<var _sttl = lcase(escapeMarkup(_Site.gutitle))>
</if>
<!--- append to site pages --->
<var _new = _Site.pages & CHR(10) & "|/sp-#_idnum#|">
<update orb="site" where="site.id = #_Site.id#"
pages="#_new#"
sp_edit_datetime="#now()#">
<!--- "new page" bulliten --->
<tag.bull
j='/#_tbl#-#_idnum#,/site-#_Site.id#'
title='#client_name# - new page'
body='<a href="/#client_id#">#escapeMarkup(client_name)#</a> wrote on <a href="/j:/site-#_Site.id#">#_sttl#</a>'
type='new_page_writeon'>
<!--- ping! --->
<!--- ping to friends/followers of client --->
<if GLOBAL.Def.Followers.total + GLOBAL.Def.Friends.total GT 0>
<tag.ping function="post"
type="new_page"
jstr="/user-#client_id#"
users_intList="#GLOBAL.Def.Friends.intList#,#GLOBAL.Def.Followers.intList#"
message="#escapeMarkup(client_name)# added a page to their app (#_sttl#)"
send_email="1"
user_whereclause_append=""
email_href="http://#lcase(escapeMarkup(_Site.gutitle))#.smallerpage.com/j:/#_tbl#-#_idnum#"
email_from="aRobot@smallerpage.com"
age_bypass="1"
emailoptout_tag="new_page">
</if>
<if return NEQ "pants">
<goto url="http://smallerpage.com/j:/#_tbl#-#_idnum#?&function=created">
</if>
<elseif POST.site_gutitle EQ "-profile-">
<!--- "new page" bulliten --->
<tag.bull
j='/#_tbl#-#_idnum#'
title='#client_name# - new page'
body='<a href="/#client_id#">#escapeMarkup(client_name)#</a> wrote on their profile'
type='new_page_writeon'>
<!--- ping! --->
<!--- ping to friends/followers of client --->
<if GLOBAL.Def.Followers.total + GLOBAL.Def.Friends.total GT 0>
<tag.ping function="post"
type="new_page"
jstr="/user-#client_id#"
users_intList="#GLOBAL.Def.Friends.intList#,#GLOBAL.Def.Followers.intList#"
message="#escapeMarkup(client_name)# added a new page (to their SmallerPage Profile)"
send_email="1"
user_whereclause_append=""
email_href="http://smallerpage.com/#client_id#"
email_from="aRobot@smallerpage.com"
age_bypass="1"
emailoptout_tag="new_page">
</if>
<if return NEQ "pants">
<goto url="http://smallerpage.com/#client_id#">
</if>
</if>
</if>
<BREAK>
</if>
<!--- no post - rdr. --->
<goto url="http://#this_domain#/">
<BREAK>