Log in with iqtpi
Joelie   New...

qi_dashboard

By Steve Fentriss  (2198 Entries) | 47 days ago
 
Code
tag.
qi_dashboard
 
<fake_person>
(login required) <break>
</fake_person>


<if isdefined("get.kalkalash")>
<goto url="http://#this_domain#/#get.kalkalash#">
<BREAK>
<elseif isdefined("POST.soLoginEmail")>
<!---
They just logged in. Count and redirect.
--->
<if isdefined("get.site")>
<goto url="http://#this_domain#/?&site=#get.site#">
<else>
<goto url="http://#this_domain#/">
</if>
<BREAK>
</if>


<var C = GLOBAL.Def.Client>





<!--- RED TAPE --->

<!--- welcome --->
<if find("|init_welcome|",GLOBAL.Def.CLIENT.iqtpi_protected) EQ 0>
<!--- init welcome --->
<tag.qi_init_welcome>
<BREAK>
</if>

<!--- very basic info --->
<if GLOBAL.Def.did_finish_vbi NEQ 1>
<tag.qi_vbi>
<BREAK>
</if>





<!--- /// THE DASHBOARD /// --->
<div class="noverflow" style="margin-top:-2em; padding-top:2em; z-index:1;">

<var _show_feed = 1>
<if trim(GLOBAL.Def.Client.goodquestions) EQ "" AND GLOBAL.Def.Following.total EQ 0 AND GLOBAL.Def.Friends.total EQ 0>
<var _show_feed = 0>
</if>

<div style="float:right; width:204px; font-size:0.86em;">

<!--- sites --->
<div class="no_options">
<var _site_idstrs = "">
<loop list="#C.sites#" delimiters="|" index="i">
<if isNumeric(i) OR isValidGutitle(i) EQ 1>
<var _site_idstrs = _site_idstrs & "-" & i>
</if>
</loop>
<if _site_idstrs EQ "">
<!---
<h3>Welcome to iqtpi.</h3>
<p>
You're ready to explore. Enjoy!
</p>
--->
<if isdefined("get.site") AND (isNumeric(get.site) OR isValidGutitle(get.site) EQ 1)>
<div>
<tag.qi_dashboard_get_site>
</div>
</if>
<else>
<if isdefined("get.site") AND (isNumeric(get.site) OR isValidGutitle(get.site) EQ 1)>
<tag.qi_dashboard_get_site>
</if>
<set j="/site#_site_idstrs#">
<div class="idea">
<h4>Trusted Sites</h4>
<div style="margin-left:1em;" class="neat_links">
<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:7px;<if _counter EQ 1> border-top:0px solid white;</if>">
<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>&nbsp;</div>
</if>
</div>

<if _show_feed EQ 0>
<!--- show some questions to get started --->
<div style="font-size:0.86em;">
<tag.iquestions mode="neutral" format="short" maxrows="4"
hoverable="1">
<div align="left"><small>
<a href="http://#this_domain#/Questions/Browse">More Questions...</a>
</small></div>
</div>
<div>&nbsp;</div>
<else>
<!--- do the ideas --->
<var _max_ideas = 3>
<var _idea_count = 0>

<!--- questions --->
<if _idea_count LT _max_ideas AND GLOBAL.Def.Client.goodquestions EQ "">
<div class="idea">
<h4 style="padding:3px; border-bottom:1px solid ##999;">Gotta Know!</h4>
<div class="content"><small>
Add some <a href="http://#this_domain#/Questions/Browse">questions</a> to your
"gotta know" list. When you log into iqtpi, you'll see your friends' answers to these questions.
</small></div>
</div>
<div>&nbsp;</div>
<var _idea_count = _idea_count + 1>
</if>

<!--- friends --->
<if _idea_count LT _max_ideas AND GLOBAL.Def.any_users EQ 0>
<div class="idea">
<h4 style="padding:3px; border-bottom:1px solid ##999;">Be Friendly</h4>
<div class="content"><small>
Find <a href="http://#this_domain#/People">people</a> on iqtpi. Send messages,
find friends and more. See what sites appeal to people you care about.
</small></div>
</div>
<div>&nbsp;</div>
<var _idea_count = _idea_count + 1>
<elseif _idea_count LT _max_ideas>
<div class="idea">
<h4 style="padding:3px; border-bottom:1px solid ##999;">Be Friendly</h4>
<div class="content"><small>
<ul style="margin-top:0.2em; margin-bottom:0.2em; margin-left:-1.08em;">
<li style="margin-bottom:0.36em;">
<var _all_iqtpi_users_count = 0>
<set select="count(user.id) AS idcount" orb="user" where="user.id > 1">
<setcrawl> <var _all_iqtpi_users_count = set.idcount> </setcrawl>
</set>
<a href="http://#this_domain#/People/All">#numberFormat(_all_iqtpi_users_count,"999,999,999,999")# people on iqtpi</a>
</li>
<if GLOBAL.Def.Friends.total GT 0>
<li style="margin-bottom:0.36em;">
<if GLOBAL.Def.Friends.total EQ 1>
<a href="http://#this_domain#/People/Friends">One Friend</a>
<else>
<a href="http://#this_domain#/People/Friends">#GLOBAL.Def.Friends.total# Friends</a>
</if>
</li>
</if>
<if GLOBAL.Def.Following.total GT 0>
<li style="margin-bottom:0.36em;">
<if GLOBAL.Def.Following.total EQ 1>
<a href="http://#this_domain#/People/Following">One Person You Follow</a>
<else>
<a href="http://#this_domain#/People/Following">#GLOBAL.Def.Following.total# People You Follow</a>
</if>
</li>
</if>
<if GLOBAL.Def.Followers.total GT 0>
<li style="margin-bottom:0.36em;">
<if GLOBAL.Def.Followers.total EQ 1>
<a href="http://#this_domain#/People/Followers">One Following You</a>
<else>
<a href="http://#this_domain#/People/Followers">#GLOBAL.Def.Followers.total# People Following You</a>
</if>
</li>
</if>
</ul>
</small></div>
</div>
<div>&nbsp;</div>
<var _idea_count = _idea_count + 1>
</if>

<!--- profile picture --->
<if _idea_count LT _max_ideas AND listFindNoCase("jpg,png,gif",GLOBAL.Def.Client.extension) EQ 0>
<div class="idea">
<h4 style="padding:3px; border-bottom:1px solid ##999;">Add a Profile Picture</h4>
<div class="content"><small>
<img src="http://#this_domain#/?&f=icon-2?&picwidth=32" border="0" style="height:0.88em;">
It's easy to <a href="http://#this_domain#/Profile">add a picture</a> to your
iqtpi profile.
</small></div>
</div>
<div>&nbsp;</div>
<var _idea_count = _idea_count + 1>
</if>

<!--- find sites --->
<if _idea_count LT _max_ideas AND GLOBAL.Def.any_sites EQ 0>
<div class="idea">
<h4 style="padding:3px; border-bottom:1px solid ##999;">Find Sites You Trust</h4>
<div class="content"><small>
Browse iqtpi's many user-created <a href="http://#this_domain#/Sites">sites</a>
to find sites that appeal to you. To add a site to your list of trusted
sites, click "Add Site".
</small></div>
</div>
<div>&nbsp;</div>
<var _idea_count = _idea_count + 1>
</if>

</if>

</div>

<div style="margin-right:240px;">
<if _show_feed EQ 1>
<var _questions_remaining = 10>
<var _min_dt = dateAdd("h",-12,now())>
<var _max_dt = dateAdd("h",12,now())>
<var _counter = 1>
<loop condition="_questions_remaining GT 0">
<loop list="good,neutral" index="mode">
<tag.iquestions mode="#mode#" maxrows="#_questions_remaining#" min_answers="1"
min_datetime="#_min_dt#"
max_datetime="#_max_dt#"
date_precision="h">
<var _questions_remaining = _questions_remaining - return.recordcount>
</loop>
<var _min_dt = dateAdd("h",-24,_min_dt)>
<var _max_dt = dateAdd("h",-24,_max_dt)>
<var _counter = _counter + 1>
<if _counter EQ 7>
<break>
</if>
</loop>
<if _questions_remaining EQ 10>
<tag.qi_dashboard_newbie_instructions>
</if>
<else>
<tag.qi_dashboard_newbie_instructions>
</if>
</div>

</div>
 
qi_dashboard is a page routine.
 
 
x
[]