<var C = GLOBAL.Def.Style.color>
<ensure variable="att.is_embed" value="0"><!--- 1, if embedded in something like /routine-spf_club_secretstory_unlock --->
<ensure variable="get.share_type" value="">
<if get.share_type NEQ "email" AND get.share_type NEQ "social">
<if att.is_embed NEQ 1>
<h3>Share This Page</h3>
<div style="line-height:1.32em; padding-bottom:7px;">
<p>
How would you like to share the <b>#listLast(replaceNoCase(get.url,"http://fentriss.com/",""),"/")#</b> page?
</p>
</div>
</if>
<div>
<a href="http://#this_domain#/#so_slash_string#?&share_type=email&url=#urlEncodedFormat(get.url)#<if isDefined("get.j")>&j=#urlEncodedFormat(get.j)#</if>" class="spf_btn" style="padding:7px; border-radius:7px; text-decoration:none;">Share Via Email</a>
<a href="http://#this_domain#/#so_slash_string#?&share_type=social&url=#urlEncodedFormat(get.url)#<if isDefined("get.j")>&j=#urlEncodedFormat(get.j)#</if>" class="spf_btn" style="padding:7px; border-radius:7px; text-decoration:none;">Share With Twitter, Facebook, etc.</a>
</div>
<BREAK>
</if>
<!--- record share in .spf_share_protected --->
<real_person><if isDefined("get.j") AND reFindNoCase("^/?([a-z]+(_[a-z]+)*)-([0-9]+)$",get.j) EQ 1>
<if listFindNoCase(GLOBAL.Def.Client.spf_share_protected,get.j,"|#CHR(10)#") EQ 0>
<var _new = "|#get.j#|">
<loop list="#GLOBAL.Def.Client.spf_share_protected#" index="x" delimiters="|#CHR(10)#">
<var _new = _new & CHR(10) & "|#x#|">
</loop>
<update orb="user" spf_share_protected="#_new#" where="user.id = #client_id#">
</if>
</if></real_person>
<if get.share_type EQ "social">
<if att.is_embed NEQ 1><h4>Tweet It</h4></if>
<div style="margin-left:1em;">
<div style="float:left;">
<a href="http://twitter.com/share" class="twitter-share-button" data-text="##clubsteveusa" data-count="horizontal" data-via="stevefentriss" data-url="#get.url#">Tweet</a>
</div>
<div style="float:left; margin-left:1.2em;">
<g:plusone href="#get.url#"></g:plusone>
</div>
<div style="float:left;">
<fb:like href="#get.url#" send="false" layout="button_count" width="120" show_faces="false" font="tahoma"></fb:like>
</div>
</div>
<div> </div>
<div> </div>
<div> </div>
<div style="line-height:1.32em;">
<p>
Use the Twitter Tweet button, Google +1 button and Facebook Like buttons
to share <b>#listLast(replaceNoCase(get.url,"http://fentriss.com/",""),"/")#</b> with friends.
</p>
<if att.is_embed EQ 1>
<p align="right" style="margin-right:2em;">
<a href="http://#this_domain#/#so_slash_string#<if isDefined("get.j")>?&j=#urlEncodedFormat(get.j)#</if>" class="spf_btn" style="padding:7px; border-radius:7px; text-decoration:none;">Finished With This</a>
</p>
<else>
<p align="right" style="margin-right:2em;">
<a href="#get.url#" class="spf_btn" style="padding:7px; border-radius:7px; text-decoration:none;">Finished With This</a>
</p>
</if>
</div>
<!--- google plus one --->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!--- twitter tweet --->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<!--- facebook like --->
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js##xfbml=1"></script>
<BREAK>
</if>
<if isDefined("get.sent") AND get.sent EQ 1>
<div style="margin:1em;">
<ensure variable="get.emails" value="">
<var _emails = makeValidEmailList(get.emails)>
<ensure variable="get.name" value="">
<var _name = escapeMarkup(get.name)>
<ensure variable="get.myemail" value="">
<var _myemail = listFirst(makeValidEmailList(get.myemail))>
<if _name NEQ "">
<h4><tag.fico i="tick" linkback="off" style="height:0.88em;"> Okay #listFirst(_name,' ')#!</h4>
<else>
<h4><tag.fico i="tick" linkback="off" style="height:0.88em;"> Success!</h4>
</if>
<if _emails NEQ "">
<p>
You shared <b>#escapeMarkup(get.url)#</b> with:
</p>
<ul>
<loop list="#_emails#" index="x">
<li>#x#</li>
</loop>
</ul>
</if>
<if _myemail NEQ "">
<p>
We sent you an email at #_myemail# to confirm this.
</p>
</if>
<div align="left" style="margin-right:2em; padding-top:7px;">
<a href="#escapeDoubleQuotes(get.url)#" class="spf_btn" style="padding:7px; border-radius:7px; text-decoration:none;"><b>Back to Your Page ></b></a>
</div>
<div> </div>
</div>
</div> <BREAK>
</if>
<var _name = "">
<var _emails = "">
<var _myemail = "">
<if isDefined("POST.emails")>
<var _emails = makeValidEmailList(POST.emails)>
</if>
<var _my_email_okay = 0>
<real_person>
<var _myemail = client_email>
<var _my_email_okay = 1>
</real_person>
<fake_person>
<if isDefined("POST.myemail") AND isValidEmail(POST.myemail) EQ 1>
<var _myemail = listFirst(makeValidEmailList(POST.myemail))>
<var _my_email_okay = 1>
</if>
</fake_person>
<if isDefined("POST.name")>
<var _name = trim(escapeMarkup(POST.name))>
</if>
<if _emails NEQ "" AND _name NEQ "" AND _myemail NEQ "" AND post_captcha_status EQ 1 AND _my_email_okay EQ 1>
<email bcc="steve@fentriss.com" from="steve" to="#_emails#" subject="#_name# Wants You to see a Fentriss.com Page">Hey There!
#_name# wants you to see a page on Steve Fentriss' official website.
Here's the page:
#escapeMarkup(get.url)#
Who is Steve Fentriss? He's an American artist based in Ypsilanti, Michigan. You can hear Steve's music for free right now on Fentriss.com - check it out!
Enjoy,
- Steve Fentriss' Magic Email Machine
--</email>
<email bcc="steve@fentriss.com" from="steve" to="#_myemail#" subject="You Shared a Fentriss.com Page">Hello #_name#!
You shared the following Fentriss.com page today:
#escapeMarkup(get.url)#
Thanks for spreading the word! Thanks to you, more and more people will be able to enjoy Fentriss.com.
Keep up the good work,
- Steve Fentriss' Magic Email Machine
--</email>
<if randRange(1,2) NEQ "pants">
<if att.is_embed EQ 1>
<!--- go to current page --->
<var _url = "http://#this_domain#/#so_slash_string#?">
<if isDefined("get.j")>
<var _url = _url & "&j=#urlEncodedFormat(get.j)#">
</if>
<goto url="#_url#">
<else>
<!--- go to confirmation message --->
<goto url="http://#this_domain#/#so_slash_string#?&sent=1&share_type=email&emails=#urlEncodedFormat(_emails)#&name=#urlEncodedFormat(_name)#&myemail=#urlEncodedFormat(_myemail)#&url=#urlEncodedFormat(get.url)#">
</if>
<BREAK>
</if>
<else>
<if att.is_embed NEQ 1>
<small><div>#replaceNoCase(get.url,"http://fentriss.com/","")#</div></small>
<div> </div>
</if>
<div style="margin-left:7px; border-left:1px solid #C.g3#; padding-left:7px;">
<if isDefined("POST.emails") AND _emails EQ "">
<div style="border:2px solid red; padding:7px; border-radius:7px;">
<b>You need to enter at least one valid email address.</b>
</div>
<div> </div>
<elseif isDefined("POST.name") AND _name EQ "">
<div style="border:2px solid red; padding:7px; border-radius:7px;">
<b>You did not enter your name. Please try again.</b>
</div>
<div> </div>
<elseif isDefined("POST.myemail") AND _myemail EQ "">
<div style="border:2px solid red; padding:7px; border-radius:7px;">
<b>You did not provide a valid email address for your email. Please try again.</b>
</div>
<div> </div>
<elseif post_captcha_status EQ 2>
<div style="border:2px solid red; padding:7px; border-radius:7px;">
<b>You didn't type the text in the image properly - here's a new one.</b>
</div>
<div> </div>
</if>
<postform>
<if att.is_embed NEQ 1><h4>Email It</h4></if>
<div style="margin-left:1em;">
<div>
Friends' Email Addresses:
<div style="padding:3px;">
<textarea style="width:80%; height:4em;" name="emails" id="emails" class="<if NOT isDefined("POST.emails")>select_this</if>"><if isDefined("POST.emails")>#escapeMarkup(POST.emails)#<elseif client_id GT 1>#escapeMarkup(GLOBAL.Def.Client.emails_protected)#</if></textarea>
<div style="padding-top:2px; color:#C.g3#;"><small>
Enter up to fifty email addresses. Separate each address with a comma, or put each address
on a separate line.
</small></div>
</div>
</div>
<div> </div>
<div>
Your Name:
<div style="padding:3px;">
<input style="width:80%;" name="name" id="name" value="<if isDefined("POST.name")>#escapeDoubleQuotes(escapeMarkup(POST.name))#<elseif client_id GT 1>#escapeDoubleQuotes(escapeMarkup(client_name))#</if>">
<div style="padding-top:2px; color:#C.g3#;"><small>
This is just so your friends know who is emailing them.
</small></div>
</div>
</div>
<div> </div>
<div>
Your Email:
<div style="padding:3px;">
<input style="width:80%;" name="myemail" id="myemail" value="<if isDefined("POST.myemail")>#escapeDoubleQuotes(escapeMarkup(POST.myemail))#<elseif client_id GT 1>#escapeDoubleQuotes(escapeMarkup(client_email))#</if>">
<div style="padding-top:2px; color:#C.g3#;"><small>
We'll send you a confirmation email.
</small></div>
</div>
</div>
<div> </div>
<div>
Human test:
<div style="padding:3px;">
<captcha width="280">
</div>
</div>
<div> </div>
<div align="left">
<input type="submit" value="<if att.is_embed EQ 1>Share This<else>Share This Page</if>" style="cursor:pointer;" class="spf_btn">
</div>
</div>
<div> </div>
<div> </div>
</postform>
</if>