<fake_person>
(login required) <break>
</fake_person>
<if GLOBAL.Def.did_finish_vbi EQ 0>
<tag.qa_vbi>
<BREAK>
</if>
<if GLOBAL.Def.did_finish_agetype EQ 0>
<tag.qa_agetype>
<BREAK>
</if>
<if isdefined("POST.soLoginEmail")>
<!---
They just logged in.
--->
<!--- do magic tracking/counting stuff --->
<tag.iqtpi_sitelogin title="iqtpi" idstr="iqtpi" id="#site_id#">
<var _ret = return>
<!--- show login ad --->
<div style="position:relative; font-size:0.72em; padding-bottom:3px; margin-top:-0.72em;">
This <a href="http://#this_domain#/j:/site-iqtpi">iqtpi</a> login is brought to you by
</div>
<tag.qad site_id="#site_id#" site_title="#site_title#">
<BREAK>
</if>
<var _answer_count = 0>
<set orb="answer" select="count(answer.id) AS idcount" where="answer.user_id = #client_id#"><setcrawl>
<var _answer_count = set.idcount>
</setcrawl></set>
<if _answer_count EQ 0>
<!--- simplified dashboard that prompts you to answer a few basic questions. --->
<div class="noverflow" style="margin-bottom:-1em; margin-right:-3px;">
<div style="float:left; width:180px; font-size:0.72em; border-right:1px solid #GLOBAL.Def.Style.color.g5#;">
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Questions/Suggested">Pick a Question ></a></h4>
<div class="content" style="padding-right:1em;">
There are <a href="http://#this_domain#/Questions/Suggested">lots of questions</a>
<br>on iqtpi.
<p>
After you answer a question, iqtpi will show you answers from other users.
</p>
</div>
</div>
</div>
<div style="margin-left:210px;">
<tag.qa_dashboard_suggest answer_count="#_answer_count#">
</div>
</div>
<BREAK>
</if>
<var _goodquestions_count = 0>
<if GLOBAL.Def.good.intList NEQ "" AND GLOBAL.Def.good.intList NEQ "0">
<var _goodquestions_count = listLen(GLOBAL.Def.good.intList)>
</if>
<var _friendquestions_count = 0>
<if GLOBAL.Def.Friends.total + GLOBAL.Def.Following.total GT 0>
<var _fgq = "0">
<set j="/user#GLOBAL.Def.Friends.jstr##GLOBAL.Def.Following.jstr#.goodquestions">
<setcrawl>
<var _gq = reReplace(set.goodquestions,"[^0-9\|]","","all")>
<loop list="#_gq#" delimiters="|" index="num">
<if isNumeric(num) AND listFind(_fgq,num) EQ 0>
<var _fgq = _fgq & "," & num>
</if>
</loop>
</setcrawl>
</set>
<var _fgq = replace(_fgq,"0,","")>
<var _friendquestions_count = listLen(_fgq)>
</if>
<var _question_count = 0>
<set orb="question" select="count(question.id) AS idcount" where="question.userid_unsignedint = #client_id#"><setcrawl>
<var _question_count = set.idcount>
</setcrawl></set>
<!--- give questions to me! mwahaha! --->
<if _question_count GT 0 AND client_id NEQ 7>
<set orb="question" select="count(question.id) AS idcount" where="question.user_id = #client_id#">
<setcrawl>
<if set.idcount GT 0>
<update orb="question" where="question.user_id = #client_id#"
giveto_unsignedint="7">
</if>
</setcrawl>
</set>
<elseif client_id EQ 7>
<set orb="question" select="count(question.id) AS idcount" where="question.giveto_unsignedint = #client_id#">
<setcrawl>
<if set.idcount GT 0>
<h2>Questions were given to Steve:</h2>
<set orb="question" select="question.id,question.title,question.user_id" where="question.giveto_unsignedint = #client_id#">
<dump var="#set#">
</set>
</if>
</setcrawl>
</set>
</if>
<var _q = GLOBAL.Def._q>
<var _a = GLOBAL.Def._a>
<div class="noverflow">
<!--- right side: for the postings --->
<div style="float:right; width:160px; font-size:0.72em; z-index:2;">
<!--- ping! --->
<tag.ping function="count">
<var _pings = return>
<if _pings GT 0>
<div class="idea" id="pings">
<h4 class="heading" style="border-top-color:#GLOBAL.Def.Style.color.pri#;"><a href="http://#this_domain#/">Notifications</a></h4>
<div class="content neat_links" style="padding-top:0px;">
<tag.ping function="get">
<var P = return>
<var _color_list = "sec,ter,qua,pri">
<var _counter = 1>
<loop query="P">
<var _jstr = replace(P.name,"|","","all")>
<div id="ping-#P.id#" class="ping"><a href="http://#this_domain#/j:#_jstr#" style="<if P.read_unsignedint NEQ 1>font-weight:bold; </if>border-top-color:#GLOBAL.Def.Style.color[listGetAt(_color_list,_counter)]#;">#escapeMarkup(P.title)#</a><span style="display:none;">#escapeMarkup(P.body)#</span></div>
<var _counter = _counter + 1>
<if _counter GT 4>
<var _counter = 1>
</if>
</loop>
</div>
</div>
</if>
<if GLOBAL.Def.Friends.total + GLOBAL.Def.Following.total GT 2 AND _answer_count GT 2>
<!--- quick answer: timely questions --->
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Questions/Browse">Timely Questions <tag.fico i="clock" linkback="off" style="height:0.88em; border-width:0px;" border="0"></a></h4>
<div class="content neat_links" style="padding-top:0px;">
<var _timely_questions_intList = "0">
<set orb="#_a.orb#" select="#_a.orb#.questionid_unsignedint" where="#_a.orb#.user_id = #client_id# AND #_a.orb#.istimely_unsignedint = 1 AND #_a.where#"
groupby="#_a.orb#.questionid_unsignedint">
<setcrawl>
<var _timely_questions_intList = _timely_questions_intList & "," & set.questionid_unsignedint>
</setcrawl>
</set>
<set orb="#_q.orb#" select="#_q.select#" where="#_q.orb#.id IN (#_timely_questions_intList#) AND #_q.where#">
<var TQ = set>
</set>
<if TQ.recordcount EQ 0>
<div style="padding-top:3px;">
Timely questions are the kind of questions you want to answer frequently. When you
answer timely questions, they appear here in a special place on your dashboard.
</div>
<p>
Look for the <tag.fico i="clock" linkback="off" style="height:0.88em;"> clock icon
to spot timely questions.
</p>
<else>
<loop query="TQ">
<var _answer_type = "text">
<if TQ.name EQ "|/answertype-autocomplete|">
<var _answer_type = "autocomplete">
<elseif TQ.name EQ "|/answertype-multiple_choice|">
<var _answer_type = "multiple_choice">
</if>
<div id="question-#TQ.id#" class="question">
<a id="answer:question-#TQ.id#" class="answer_question answertype_#_answer_type#"
href="http://#this_domain#/qa_service?&function=answer&j=/question-#TQ.id#">#escapeMarkup(TQ.title)#</a>
<span style="display:none;">#escapeMarkup(TQ.title)#</span>
</div>
</loop>
</if>
</div>
</div>
<if GLOBAL.Def.Friends.total GT 0>
<!--- uncommon questions between me and my friends --->
<tag.qa_q mode="friend_suggest_inverse" friends_jstr="#GLOBAL.Def.Friends.jstr#" output="0"
suggest_random="1" maxrows="7">
<var Q = return>
<if Q.recordcount GT 0>
<div class="idea">
<h4 class="heading" style="border-top-color:#GLOBAL.Def.Style.color.pri#;"><a href="http://#this_domain#/#client_id#/Friends">Ask Your Friends</a></h4>
<div class="content neat_links" style="padding-top:0px;">
<loop query="Q">
<div id="question-#Q.id#" class="question">
<a title="Ask your friends this question" class="reasker<if Q.istimely_unsignedint EQ 1> is_timely</if>" href="http://#this_domain#/?&reask=both">
<if Q.istimely_unsignedint EQ 1>
<tag.fico i="clock" linkback="off" style="height:0.88em;" title="This is a timely question.">
</if>
#escapeMarkup(Q.title)#
</a><span style="display:none;">#escapeMarkup(Q.title)#</span><span style="display:none;">#Q.id#</span>
</div>
</loop>
</div>
</div>
</if>
</if>
</if>
</div>
<!--- left side: for making the gets --->
<div style="float:left; width:160px; font-size:0.72em; border-right:1px solid #GLOBAL.Def.Style.color.g4#; padding-bottom:10000px; margin-bottom:-10000px; z-index:1;">
<!--- sites --->
<div class="no_options">
<var _site_idstrs = "">
<loop list="#GLOBAL.Def.Client.sites#" delimiters="|" index="i">
<if isNumeric(i) OR isValidGutitle(i) EQ 1>
<var _site_idstrs = _site_idstrs & "-" & i>
</if>
</loop>
<if _site_idstrs NEQ "">
<set j="/site#_site_idstrs#">
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Sites/Trusted">Trusted Sites</a></h4>
<div class="content neat_links" style="padding-top:0px;">
<var _counter = 1>
<loop list="#_site_idstrs#" delimiters="-" index="i"><setcrawl><if set.id EQ i OR set.gutitle EQ i>
<tag.set_format orb="iqtpi"> <var D = return>
<var _href = "http://#this_domain#/j:/site-#D.idstr#?&sts=Login">
<a href="#_href#" style="display:block; padding:5px; padding-left:3px; border-top:0px solid white; text-decoration:none;">
<img src="../file:/site-#D.idstr#?&picwidth=32" border="0" style="width:0.88em; max-height:0.88em;">
#D.title#
</a>
<var _counter = _counter + 1>
<break></if></setcrawl></loop>
</div>
</div>
</set>
<div> </div>
</if>
</div>
<!--- fff --->
<!---
<div class="no_options">
<if GLOBAL.Def.Friends.total + GLOBAL.Def.Following.total EQ 0>
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Sites/Trusted">People on iqtpi</a></h4>
<div class="content" style="padding-right:7px;">
<a href="http://#this_domain#/People/All">Find someone</a> interesting
on iqtpi and <i>Follow</i> them.
</div>
</div>
<div> </div>
<else>
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Sites/Trusted">People You Know</a></h4>
<div class="content neat_links" style="padding-top:0px;">
<set j="/user#GLOBAL.Def.Friends.jstr##GLOBAL.Def.Following.jstr#.iqtpi_agetype" maxrows="64">
<setcrawl>
<tag.set_format orb="user"><var DD = return>
<div class="ppl profile_ok<if set.iqtpi_agetype NEQ "kid"> message_ok</if>"><a href="http://#this_domain#/#DD.idstr#">#DD.title#</a></div>
</setcrawl>
</set>
</div>
</div>
<div> </div>
</if>
</div>
--->
<!--- your questions --->
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Questions">Your Questions</a></h4>
<div class="content" style="padding-right:7px;">
<if _goodquestions_count EQ 1>
You answered
<br><a href="http://#this_domain#/Questions/Questions_You_Answered">one question</a>.
<elseif _goodquestions_count GT 1>
You answered
<br><a href="http://#this_domain#/Questions/Questions_You_Answered">#_goodquestions_count# questions</a>.
<else>
<!--- this should never happen --->
<a href="http://#this_domain#/Questions">You have not answered any questions yet</a>.
</if>
<if _friendquestions_count GT 0>
<p>
<if _friendquestions_count EQ 1>
Your friends answered
<br><a href="http://#this_domain#/Questions/Questions_Friends_Answered">one question</a>.
<elseif _friendquestions_count GT 1>
You friends answered
<br><a href="http://#this_domain#/Questions/Questions_Friends_Answered">#_friendquestions_count# questions</a>.
</if>
</p>
</if>
<!---
<p>
<a href="http://#this_domain#/Questions">Find More Questions</a>
</p>
--->
<p>
<a href="http://#this_domain#/New_Question">Create a Question</a>
</p>
</div>
</div>
<!--- new questions --->
<div class="idea">
<h4 class="heading"><a href="http://#this_domain#/Questions">More Questions</a></h4>
<div class="content">
<div id="dashboard_new_questions" class="<if _answer_count EQ 0> wax</if>">
<if _answer_count GT 2>
<var _suggest_random = 1>
<else>
<var _suggest_random = 0>
</if>
<tag.qa_q mode="suggest" format="short" maxrows="2" suggest_random="#_suggest_random#">
</div>
<if return.recordcount EQ 0>
<p>
No more questions!
</p>
<p>
<a href="http://#this_domain#/New_Question">Create a Question ></a>
</p>
<elseif _answer_count EQ 0>
<!---
<p>
<a href="http://#this_domain#/Questions/Suggested">More Questions...</a>
</p>
--->
<div> </div>
<div> </div>
<div style="font-size:0.88em;">
(If you don't like any of these questions, you can <a href="http://#this_domain#/New_Question">create your own</a>)
</div>
</if>
</div>
</div>
<!---
<IF client_id EQ 7 OR client_gutitle EQ "k_bob" OR client_id EQ 777 OR left(client_name,5) EQ "Test ">
<!--- iqtpi more --->
<div> </div>
<div align="left">
<a href="http://#this_domain#/More"><img src="http://#this_domain#/file:/image-iqtpi_more_main" border="0" style="width:43px;"></a>
</div>
</IF>
--->
</div>
<!--- q/a flow --->
<div style="margin-left:176px; margin-right:220px; z-index:0;">
<div><tag.qa_q mode="feed" make_me_want_to_answer="1" show_similar_answers="1"
maxrows="7" one_at_a_time="1"
max_answers="2"
answer_user_ids="#GLOBAL.Def.Friends.intList#,#GLOBAL.Def.Following.intList#,#client_id#"></div>
<if return.recordcount EQ 0>
<div class="delete_on_question_prepend">
<h4>It's a Slow News Day.</h4>
<p>
Why's that?
</p>
<ul>
<var _flw = GLOBAL.Def.Following.total + GLOBAL.Def.Friends.total>
<if _flw EQ 0>
<li style="margin-bottom:0.64em;">You are not following anyone. <a href="http://#this_domain#/People">Find someone to follow</a>
and you'll see their recent answers here.</li>
<elseif _flw LTE 3>
<li style="margin-bottom:0.64em;">You are only following <if _flw EQ 1>one person<else>#_flw# people</if> on iqtpi. <a href="http://#this_domain#/People">Find more people to follow</a>
and you'll see their recent answers here.</li>
<else>
<li style="margin-bottom:0.64em;">None of the people you follow have answered a question recently.</li>
</if>
<li style="margin-bottom:0.64em;">You have not answered any questions recently. <a href="http://#this_domain#/Questions/One_At_a_Time">Answer a question</a>
today!</li>
</ul>
</div>
<elseif GLOBAL.Def.Following.total + GLOBAL.Def.Friends.total EQ 0>
<div class="delete_on_question_prepend gorgeous_borders" style="margin-left:0em; padding:7px;">
<h4 style="margin-bottom:0.36em;">This is Your Question/Answer Flow.</h4>
<div style="padding:3px;">
If you want to see answers from other users, you need to
<b>follow</b> them on iqtpi.
<p align="right" style="padding-right:0.36em;">
<a href="http://#this_domain#/People" class="wax"><b>Find Someone You Know ></b></a>
</p>
</div>
</div>
<else>
<style type="text/css">
.dashboard_friend_suggest .question_closer { display:none !important; }
</style>
<div class="delete_on_question_prepend" style="margin-left:0em;">
<div> </div>
<h4 style="padding:3px; margin-bottom:0.36em; background:#GLOBAL.Def.Style.color.text#; color:#GLOBAL.Def.Style.color.back_accent#;">Questions Your Friends Answered</h4>
<div style="padding:3px;">
<var _who_answered = "">
<set j="/user#GLOBAL.Def.Friends.jstr##GLOBAL.Def.Following.jstr#" maxrows="7">
<setcrawl>
<if set.currentrow EQ 1>
<elseif set.currentrow EQ set.recordcount>
<var _who_answered = _who_answered & " and ">
<else>
<var _who_answered = _who_answered & ", ">
</if>
<tag.set_format orb="user"> <var DD = return>
<var _who_answered = _who_answered & '<a href="http://#this_domain#/#DD.idstr#">#DD.title#</a>'>
</setcrawl>
</set>
<p style="margin-top:0px; font-size:0.72em;">#_who_answered# answered these questions. <if _answer_count LT 3><br>Answer a question to
see what other people said.</if></p>
<div class="dashboard_friend_suggest" style="margin-left:1.64em;">
<tag.qa_q mode="friend_suggest" format="happy" maxrows="2" suggest_random="1">
</div>
</div>
</div>
</if>
</div>
</div>
<tag.qa_dashboard_script answer_count="#_answer_count#">