<ensure variable="get.q" value="">
<ensure variable="get.pqtype" value="All">
<ensure variable="att.and" value="">
<ensure variable="att.max" value="">
<ensure variable="att.profile_link" value="1">
<ensure variable="att.style" value=""><!--- normal,small,pic --->
<ensure variable="att.lists" value="#structNew()#">
<if NOT isdefined("att.lists.short_list")>
<if NOT isdefined("GLOBAL.sp_people_result_lists")>
<tag.plist>
<var att.lists = return>
<var GLOBAL.sp_people_result_lists = att.lists>
<else>
<var att.lists = GLOBAL.sp_people_result_lists>
</if>
</if>
<var L = att.lists>
<ensure variable="att.priority" value="0"><var att.priority = makeValidIntList(att.priority)>
<var _trans = "">
<if client_id GT 1 AND (site_id NEQ 340 OR this_domain NEQ "smallerpage.com")>
<var _trans = "&soTransfer=#urlEncodedFormat(client_cookie)#">
</if>
<var _no_list = makeValidIntList("#L.short_list#,#L.big_list#,#L.no_list#")>
<var o = "user">
<var where = "#o#.site_id IN(340,214,22,7) AND #o#.id NOT IN (0#_no_list#,#client_id#)">
<var max = 15>
<var _max = 3>
<if get.pqtype EQ "Related">
<var _rel_list = "">
<set orb="plist" select="plist.id,plist.notes,plist.body" where="plist.user_id IN (#_no_list#)">
<setcrawl>
<var _combi = "#set.notes#,#set.body#">
<loop list="#_combi#" index="i">
<if listFind('#_rel_list#,#_no_list#',i) EQ 0>
<var _rel_list = "#_rel_list#,#i#">
</if>
</loop>
</setcrawl>
</set>
<var _rel_list = makeValidIntList(_rel_list)>
<var where = "#o#.id IN (0#_rel_list#)">
<var max = 30>
<var _max = 5>
</if>
<if trim(att.and) NEQ "">
<var where = where & " AND (#att.and#)">
</if>
<if isNumeric(att.max) AND att.max GT 0>
<var max = att.max><var _max = att.max>
</if>
<if att.priority NEQ 0>
<var where = where & " AND #o#.id NOT IN (#att.priority#)">
</if>
<var pqtypelist = "All,Related">
<small>
<div>
<if trim(att.and) EQ ""><div class="bobo">
<div><b>New People</b></div>
<div align="right" class="absr" style="min-width:12em;">
<if _no_list NEQ "" AND replace(_no_list,',','','all') NEQ 0>
<div align="right" class="absr">
<loop list="#pqtypelist#" index="i">
<if i NEQ "All"> | </if>
<if get.pqtype EQ i>
<span>#i#</span>
<else>
<a href="http://#this_domain#/#so_slash_string#?&pqtype=#i#">#i#</a>
</if>
</loop>
</div>
</if>
</div>
</div></if>
<div>
<div style="padding:2px;">
<var i = 1>
<!--- priority --->
<if att.priority NEQ 0>
<set orb="#o#" select="#o#.id,#o#.name,#o#.gutitle,#o#.extension" where="#o#.id IN (#att.priority#) AND #o#.id NOT IN(#_no_list#)" orderby="#o#.so_dateinserted DESC" maxrows="#max#">
<loop list="#att.priority#" index="x"><setcrawl><if set.id EQ x>
<var _title = "(anonymous)">
<var _idstr = set.id><if trim(set.gutitle) NEQ ""><var _idstr = trim(lcase(set.gutitle))><var _title = _idstr></if>
<if trim(set.name) NEQ ""><var _title = escapeMarkup(set.name)></if>
<var _src = "http://smallerpage.com/?&f=routine-2637">
<if listFindNoCase('jpg,png,gif',set.extension) GT 0><var _src = "http://smallerpage.com/?&f=user-#set.id#&f2=routine-2637"></if>
<div class="sp_result" style="clear:left; padding-top:0.36em;">
<div class="sp_result_left" style="float:left; width:24px; max-height:28px; overflow:hidden;">
<if att.profile_link NEQ 0><a title="#escapeDoubleQuotes(_title)#" href="http://smallerpage.com/#_idstr##_trans#"></if><img align="left" src="#_src#&picwidth=24" border="0" width="24" style="width:24px;"><if att.profile_link NEQ 0></a></if>
</div>
<div class="sp_result_right" style="margin-left:32px;">
<div class="sp_result_head">
<if att.profile_link NEQ 0><a title="#escapeDoubleQuotes(_title)#" href="http://smallerpage.com/#_idstr##_trans#"></if><b>#_title#</b><if att.profile_link NEQ 0></a></if>
</div>
<div class="sp_result_body"><small class="p_choices_icon"></small><small class="p_choices">
<loop list="Short,Big,No" index="ii">
<if ii NEQ "Short"> | </if>
<a href="http://#this_domain#/#so_slash_string#?&q=#urlEncodedFormat(get.q)#&#ii#=#set.id#">#ii#</a>
</loop>
</small></div>
</div>
</div>
<var i = i + 1>
</if></setcrawl></loop>
</set>
</if>
<!--- suggestions --->
<set orb="#o#" select="#o#.id,#o#.name,#o#.gutitle,#o#.extension" where="#where#" orderby="#o#.so_dateinserted DESC" maxrows="#max#">
<var i = 1>
<setcrawl><if i GT _max><break><elseif att.and NEQ "" OR set.recordcount LT 3 OR randRange(1,3) EQ 1>
<var _title = "(anonymous)">
<var _idstr = set.id><if trim(set.gutitle) NEQ ""><var _idstr = trim(lcase(set.gutitle))><var _title = _idstr></if>
<if trim(set.name) NEQ ""><var _title = escapeMarkup(set.name)></if>
<var _src = "http://smallerpage.com/?&f=routine-2637">
<if listFindNoCase('jpg,png,gif',set.extension) GT 0><var _src = "http://smallerpage.com/?&f=user-#set.id#&f2=routine-2637"></if>
<div class="sp_result" style="clear:left; padding-top:0.36em;">
<div class="sp_result_left" style="float:left; width:24px; max-height:28px; overflow:hidden;">
<if att.profile_link NEQ 0><a title="#escapeDoubleQuotes(_title)#" href="http://smallerpage.com/#_idstr##_trans#"></if><img align="left" src="#_src#&picwidth=24" border="0" width="24" style="width:24px;"><if att.profile_link NEQ 0></a></if>
</div>
<div class="sp_result_right" style="margin-left:32px;">
<div class="sp_result_head">
<if att.profile_link NEQ 0><a title="#escapeDoubleQuotes(_title)#" href="http://smallerpage.com/#_idstr##_trans#"></if><b>#_title#</b><if att.profile_link NEQ 0></a></if>
</div>
<div class="sp_result_body"><small class="p_choices_icon"></small><small class="p_choices">
<loop list="Short,Big,No" index="ii">
<if ii NEQ "Short"> | </if>
<a href="http://#this_domain#/#so_slash_string#?&q=#urlEncodedFormat(get.q)#&#ii#=#set.id#">#ii#</a>
</loop>
</small></div>
</div>
</div>
<var i = i + 1>
</if></setcrawl>
</set>
</div>
</div>
</div>
<div style="clear:left;"> </div>
</small>