Joelie > qi_single_user
 

Undefined Variable

The variable S1 was not found in GET on line 9.

 
<!--- NOTE THAT QI SINGLE ROUTINES MUST INCLUDE THE LAYOUT. --->

<!---
User profile addresses are like:
iqtpi.com/[idstr]
--->


<var _idstr = get.s1>
<var _retrieved_user_id = 0>

<set j="/user-#_idstr#.sites.dob_datetime.goodquestions.badquestions">
<setempty>
<tag.qi_layout title="User Not Found">
<h3>User Not Found</h3>
<p>
iqtpi could not find a user for <b>#_idstr#</b>.
</p>
<p>
<a href="http://#this_domain#/People">Find Other Users</a>
|
<a href="http://#this_domain#/">iqtpi home</a>
</p>
</tag.qi_layout>
</setempty>
<setcrawl>

<var _retrieved_user_id = set.id>

<tag.set_format orb="user"> <var D = return>

<if set.id EQ client_id>
<var Soc = StructNew()>
<var Soc.Friends = GLOBAL.Def.Friends>
<var Soc.Following = GLOBAL.Def.Following>
<var Soc.Followers = GLOBAL.Def.Followers>
<else>
<tag.qi_get_social_data user_id="#set.id#">
<var Soc = return>
</if>


<var _update = 0>
<set orb="user" select="user.id" where="user.id = #set.id#" maxrows="1" keylev="UPDATE"><setcrawl><var _update = 1></setcrawl></set>

<tag.qi_layout title="#D.title# | iqtpi">
<div class="noverflow">

<div style="float:left; width:140px;">
<if _update EQ 0>
<var _label = "Profile Picture">
<else>
<var _label = "Change Profile Picture">
</if>
<tag.jfield picwidth="140" j="/user-#set.id#.file" so_lastupdated="#set.so_lastupdated#"
update="#_update#" label="#_label#">
<if set.id EQ client_id AND listFindNoCase("jpg,png,gif",set.extension) EQ 0>
<!--- show profile pic instructions --->
<div id="profile_picture_before" style="cursor:pointer;">
<div>&nbsp;</div>
<tag.roundedDiv color="##ffa">
<div style="padding:7px;">
Upload a profile picture! It's so easy!
</div>
</tag.roundedDiv>
</div>
<div id="profile_picture_after" style="display:none;">
<div>&nbsp;</div>
<tag.roundedDiv color="##ccf">
<div style="padding:7px;"><small><small>
Okay, here's how to change your profile picture.
At any time, simply click on the picture. Pretty cool, eh?
</small></small></div>
<div align="right" style="padding:7px;"><small><small>
(<a href="##" id="profile_picture_after_link">Finished With This</a>)
</small></small></div>
</tag.roundedDiv>
</div>
<!---
<!--- show profile pic instructions if client already made whiteboard. --->
<set j="/whiteboard@#set.id#" maxrows="1">
<setcrawl><if NOT isdefined("get.new_whiteboard")>
<div id="profile_picture_before" style="cursor:pointer;">
<div>&nbsp;</div>
<tag.roundedDiv color="##ffa">
<div style="padding:7px;">
Upload a profile picture! It's so easy!
</div>
</tag.roundedDiv>
</div>
<div id="profile_picture_after" style="display:none;">
<div>&nbsp;</div>
<tag.roundedDiv color="##ccf">
<div style="padding:7px;"><small><small>
Okay, here's how to change your profile picture.
At any time, simply click on the picture. Pretty cool, eh?
</small></small></div>
<div align="right" style="padding:7px;"><small><small>
(<a href="##" id="profile_picture_after_link">Finished With This</a>)
</small></small></div>
</tag.roundedDiv>
</div>
</if></setcrawl>
</set>
--->
<else>
<div class="neat_links" style="margin-top:7px;">
<a href="http://#this_domain#/Compose?&u=#D.idstr#">Message</a>
</div>
<if client_id LTE 1>
<div style="padding-top:7px;"><small><small>
(<a href="http://#this_domain#/">Log in</a> to connect
with this person)
</small></small></div>
<elseif set.id NEQ client_id>
<var _social_color_A = '##ffc'>
<var _social_color_B = '##efd'>
<var _social_color_C = '##eee'>
<var _social_color_D = '##def'>
<var _social_A = '<div style="padding-bottom:5px;"><img border="0" style="max-height: 0.88em;" src="http://#this_domain#/get_7o_file.cfm?&path=icons/Fugue/icons/cross.png">
You are not following #D.title#.
</div><a class="manual_add_user" href="http://#this_domain#/j_service?&j=/user-#D.idstr#&j_function=add_user">Follow #D.title#</a> to
get things started.'>
<var _social_B = '<div style="padding-bottom:5px;"><img border="0" style="max-height: 0.88em;" src="http://#this_domain#/get_7o_file.cfm?&path=icons/Fugue/icons/plus.png">
#D.title# is following you.
</div><a class="manual_add_user" href="http://#this_domain#/j_service?&j=/user-#D.idstr#&j_function=add_user">Follow #D.title#</a> and
we''ll say you''re friends on the internet.'>
<var _social_C = '<div style="padding-bottom:5px;"><img border="0" style="max-height: 0.88em;" src="http://#this_domain#/get_7o_file.cfm?&path=icons/Fugue/icons/plus.png">
You are following #D.title#.
</div><a class="manual_remove_user" href="http://#this_domain#/j_service?&j=/user-#D.idstr#&j_function=remove_user">Unfollow #D.title#</a>
and it''ll be like nothing ever happened.'>
<var _social_D = '<div style="padding-bottom:5px;"><img border="0" style="max-height: 0.88em;" src="http://#this_domain#/get_7o_file.cfm?&path=icons/Fugue/icons/tick.png">
You and #D.title# are friends on the internet.
</div><a class="manual_remove_user" href="http://#this_domain#/j_service?&j=/user-#D.idstr#&j_function=remove_user">Unfollow #D.title#</a>
to remove them as a friend.'>
<if listFind("#GLOBAL.Def.Friends.intList#,#GLOBAL.Def.Following.intList#,#GLOBAL.Def.Followers.intList#",set.id) EQ 0>
<var _social_curr = _social_A>
<var _social_next = _social_C>
<var _social_color_curr = _social_color_A>
<var _social_color_next = _social_color_C>
<elseif listFind("#GLOBAL.Def.Friends.intList#",set.id) EQ 0 AND listFind("#GLOBAL.Def.Followers.intList#",set.id) GT 0>
<var _social_curr = _social_B>
<var _social_next = _social_D>
<var _social_color_curr = _social_color_B>
<var _social_color_next = _social_color_D>
<elseif listFind("#GLOBAL.Def.Friends.intList#",set.id) EQ 0 AND listFind("#GLOBAL.Def.Following.intList#",set.id) GT 0>
<var _social_curr = _social_C>
<var _social_next = _social_A>
<var _social_color_curr = _social_color_C>
<var _social_color_next = _social_color_A>
<elseif listFind("#GLOBAL.Def.Friends.intList#",set.id) GT 0>
<var _social_curr = _social_D>
<var _social_next = _social_B>
<var _social_color_curr = _social_color_D>
<var _social_color_next = _social_color_B>
<else>
<!--- this should never happen. --->
<var _social_curr = _social_A>
<var _social_next = _social_C>
<var _social_color_curr = _social_color_A>
<var _social_color_next = _social_color_C>
</if>
<div align="right" id="social_container" style="font-size:0.64em;">
<!---
<tag.roundedDiv color="#_social_color_curr#">
<div id="social">
#_social_curr#
</div>
</tag.roundedDiv>
--->
<div id="social" style="border-top:1px solid ##999; padding:3px; opacity:0.32; filter:alpha(opacity=32);">
#_social_curr#
</div>
</div>
</if>
</if>
</div>

<div style="margin-left:160px; position:relative;">

<h2>#D.title#</h2>

<try>
<div style="position:absolute; right:0px; top:0px;"><small><small>
Born #year(set.dob_datetime)#.
</small></small></div>
<catch>
</catch>
</try>

<var _news_count = 0>
<set orb="n" select="count(n.id) AS idcount" where="n.user_id = #set.id#">
<setcrawl><var _news_count = set.idcount></setcrawl>
</set>
<var _site_count = 0>
<if trim(replace(set.sites,"|","","all")) NEQ ""><var _site_count = 1></if>

<!---
Because the idstr is contained in get.s1,
we can use get.s2 to drive the tabs.
--->
<var _tabs = "Questions,Answers">
<if _site_count GT 0>
<var _tabs = _tabs & "," & "Sites">
</if>
<if _news_count GT 0>
<var _tabs = _tabs & "," & "News">
</if>

<if trim(set.goodquestions) EQ "">
<ensure variable="get.s2" value="Answers">
<else>
<ensure variable="get.s2" value="#listFirst(_tabs)#">
</if>
<if listFindNoCase(_tabs,get.s2) EQ 0>
<var get.s2 = listFirst(_tabs)>
</if>
<div id="tabs">
<div id="tabs_head">
<loop list="#_tabs#" index="i">
<a href="http://#this_domain#/#get.s1#/#i#" class="<if get.s2 EQ i>selected</if>">#replace(i,'_',' ','all')#</a>
</loop>
</div>
<div id="tabs_body">

<if get.s2 EQ "Questions">
<tag.iqtpi_tab_questions idstr="#D.idstr#" set="#set#" set_format="#D#" soc="#Soc#">
<elseif get.s2 EQ "Answers">
<tag.iqtpi_tab_answers idstr="#D.idstr#" set="#set#" set_format="#D#" soc="#Soc#">
<elseif get.s2 EQ "News">
<tag.iqtpi_tab_news idstr="#D.idstr#" set="#set#" set_format="#D#" soc="#Soc#">
<elseif get.s2 EQ "Info">
<tag.iqtpi_tab_info idstr="#D.idstr#" set="#set#" set_format="#D#" soc="#Soc#">
<elseif get.s2 EQ "Sites">
<tag.iqtpi_tab_sites idstr="#D.idstr#" set="#set#" set_format="#D#" soc="#Soc#">
<elseif get.s2 EQ "Age_Ratings">
<tag.iqtpi_tab_age_ratings idstr="#D.idstr#" set="#set#" set_format="#D#" soc="#Soc#">
<else>
<!--- it's a wildcard! --->
<var _set = set>
<set j="/routine-iqtpi_tab_#get.s2#" maxrows="1">
<setcrawl>
<routine where="routine.id = #set.id#" idstr="#D.idstr#" set="#_set#" set_format="#D#" soc="#Soc#">
</setcrawl>
<setempty>
<h4>Tab Not Found</h4>
<p>
iqtpi can't find a routine to power the <b>#get.s2#</b>
tab (/routine-iqtpi_tab_#get.s2#).
</p>
<p>
The routine's developer may have removed the routine. Please
try another tab.
</p>
</setempty>
</set>
</if>

</div>
</div>

</div>

<tag.jquery>
<if _update EQ 1>
<tag.jfield_script_include>
<script type="text/javascript">
$(document).ready(function() {
$('##profile_picture_before').click(function() {
$(this).slideUp(240);
$('##profile_picture_after').slideDown(240);
return false;
});
$('##profile_picture_after_link').click(function() {
$('##profile_picture_after').fadeOut(480);
return false;
});
});
</script>
</if>
<if _retrieved_user_id NEQ 0>
<!--- THIS IS NOT FINISHED. --->
<script type="text/javascript">
function make_whiteboard_tab_flash() {

}
</script>
</if>
<if isdefined("_social_curr")>
<!--- manual add/remove --->
<script type="text/javascript">
$(document).ready(function() {
SOCIAL_SWITCH = 'curr';
assign_social_switch();

$('##social').hover(
function() {
$(this).css('opacity','1');
if (SOCIAL_SWITCH == 'curr') { $(this).css('background','#_social_color_curr#'); }
else { $(this).css('background','#_social_color_next#'); }
},
function() { $(this).css('opacity','0.32'); $(this).css('background','none'); }
);
});
function assign_social_switch() {
$('##social').find('a').click(function() {
$('##social_container').slideUp(240);
$.get(this.href, function(data) {
if (SOCIAL_SWITCH == 'curr') {
$('##social').html('#replace(escapeSingleQuotes(_social_next),CHR(10),"\#CHR(10)#","all")#');
change_social_color('#_social_color_next#');
SOCIAL_SWITCH = 'next';
$('##social_container').slideDown(180);
assign_social_switch();
}
else {
$('##social').html('#replace(escapeSingleQuotes(_social_curr),CHR(10),"\#CHR(10)#","all")#');
change_social_color('#_social_color_curr#');
SOCIAL_SWITCH = 'curr';
$('##social_container').slideDown(180);
assign_social_switch();
}
});
return false;
});
}
function change_social_color(hex) {
return true;
if (!hex) { var hex = '##eee'; }
$('##social_container').find('.round').find('div').css('background',hex);
$('##social_container').find('.round').find('b').css('background',hex);
}
</script>
</if>

</div>
</tag.qi_layout>

</setcrawl>
</set>