.id
4521
.gutitle
bn_bull
.title
bn_bull
.file
.extension
.name
|/routinetype-utility|
.user_id
7
.notes
.body
<!--- >

Posts /bull records (Bullitens) - kind of like Pings, but public.
So, one bulliten can be seen by many users.

/bull records are very simple:
.name ( use att.j - jstr tags, passed in as comma delim list, stored as |#CHR(10)# delim list)
.title (text - "Steve Fentriss: page update")
.body (html with LOCAL HREFs - '<a href="/fentriss">Steve Fentriss</a> added a <a href="/j:/photo-123">new photo</a>')
.notes ( use att.type - stored like |my_tag| )
.uname
.stitle
.giveto_unsignedint ( certain bullitens should be given to associated users )

Pseudo variables in .body html
[-pw-] (picwidth)

More about .body html:
It won't be escapeMarkup()'d - it will be noScript()'d. So,
escape things like client_name on POST.

< --->

<ensure variable="att.action" value="INSERT">
<ensure variable="att.is_proxy" value="0">



<if att.action EQ "POST" OR att.action EQ "INSERT">
<return 0>
<if client_id LTE 1><break></if>
<var _bull_user_key_id = 1>
<!---<if NOT ( isDefined("GLOBAL.Def.Client.published_unsignedint") AND GLOBAL.Def.Client.published_unsignedint EQ 1 )>
<var _bull_user_key_id = 0>
<!--- this way, the unpublished user can still see it - little do they know
that other's can't (yet) --->
</if>--->
<!--- The default action is to insert. --->
<ensure variable="att.title" value="#client_name# - Bulliten">
<ensure variable="att.body" value="<a href=""/#client_id#"">#escapeMarkup(client_name)#</a> posted a new bulliten on <a href=""/j:/site-#site_id#"">#escapeMarkup(site_title)#</a>">
<ensure variable="att.j" value="">
<ensure variable="att.type" value="">

<ensure variable="att.giveto_unsignedint" value="0">

<ensure variable="att.uballoon_b" value="">
<ensure variable="att.uname_b" value="">

<var _jstrs = "">
<loop list="#att.j#" index="x">
<var x = trim(x)>
<var _jstrs = _jstrs & CHR(10) & "|#x#|">
</loop>

<var att.type = "|#gutitleFormat(att.type)#|">

<insert
orb="bull"
user_key_id="#_bull_user_key_id#"
name="#_jstrs#"
title="#att.title#"
body="#att.body#"
notes="#att.type#"
uname="#client_name#"
uballoon="#GLOBAL.Def.Client.balloon#"
uballoon_b="#att.uballoon_b#"
uname_b="#att.uname_b#"
stitle="#site_title#"
giveto_unsignedint="#att.giveto_unsignedint#">
<return return>
</if>




<if att.action EQ "DELETE">
<return 1>
<ensure variable="att.j">
<ensure variable="att.type" value="">
<ensure variable="att.user_id" value="#client_id#">
<if trim(att.j) NEQ "">
<var _w = "bull.user_id IN (#att.user_id#) AND ( ">
<var _or = "">
<loop list="#att.j#" index="x">
<var x = trim(x)>
<var _w = _w & " #_or# bull.name LIKE('%|#x#|%') ">
<var _or = " OR ">
</loop>
<var _w = _w & " ) ">
<if isValidGutitle(att.type) EQ 1>
<var _w = _w & " AND bull.notes = '|#trim(att.type)#|'">
</if>
<delete orb="bull" where="#_w#" is_proxy="#att.is_proxy#">
</if>
</if>



<if att.action EQ "output">

<var C = GLOBAL.Def.Style.color>

<var _imgStyle = "opacity:0.84; filter:alpha(opacity=84);">

<ensure variable="GLOBAL.Def.Client.so_lastupdated" value="#dateFormat(now(),'short')#">

<ensure variable="att.set" value="#QueryNew('id')#">
<ensure variable="att.row" value="1">

<var Q = QueryNew(att.set.columnlist)>
<var QueryAddRow(Q)>
<loop list="#att.set.columnlist#" index="x">
<var QuerySetCell(Q,x,att.set[x][att.row])>
</loop>

<ensure variable="att.show_details" value="1">
<ensure variable="att.no_pic" value="0">




<var _type = Q.notes>
<var _jstr = listFirst(Q.name,"|#CHR(10)#")>
<var _jstr_b = listLast(Q.name,"|#CHR(10)#")>

<var _balloon = Q.uballoon>
<var _color = "blue">
<if listLen(Q.uballoon,'/') EQ 2>
<var _balloon = listFirst(Q.uballoon,'/')>
<var _color = listLast(Q.uballoon,'/')>
</if>

<var _balloon_b = Q.uballoon_b>
<var _color_b = "blue">
<if listLen(Q.uballoon_b,'/') EQ 2>
<var _balloon_b = listFirst(Q.uballoon_b,'/')>
<var _color_b = listLast(Q.uballoon_b,'/')>
</if>

<!--- headline --->
<var _headline = "(empty)">
<if isDefined("Q.body") AND Q.body NEQ "">
<var _headline = Q.body>
<var _headline = noJavascript(_headline)>
<var _headline = replace(_headline,"[-pw-]",24,"all")>
</if>
<var _headline = '<small><div>#_headline#</div></small>'>

<!--- details --->
<var _details_delete = "">
<if Q.user_id EQ client_id AND ( findNoCase("edit",Q.notes) GT 0 OR findNoCase("delete",Q.notes) GT 0 )>
<var _details_delete = ' &nbsp;(<a href="http://#this_domain#/delete_bulliten?&bull_id=#Q.id#" style="color:##999;">delete</a>)'>
</if>
<var _details = '<small><small><div style="padding:3px; padding-left:1px; color:##777;">#timeAgo(Q.so_dateinserted)# #_details_delete#</div></small></small>'>
<var _details_clear = '<small><small><div style="padding:3px; padding-left:1px; color:##777; clear:both;">#timeAgo(Q.so_dateinserted)# #_details_delete#</div></small></small>'>

<var bullDiv = '<div class="bull" style="clear:both; padding:3px">'>
<var _bullDiv = '<small><div style="clear:both;">&nbsp;</div></small></div>'>

<ensure variable="caller._badWords_regex" value="abcdefgz">



<if reFindNoCase("#caller._badWords_regex#",_headline) GT 0> <break> </if>

<var _upw = 32>


<if _type EQ "|update|">

<!--- status update --->

#bullDiv#

<ensure variable="att.no_link" value="0">

<if att.show_details NEQ 0>
<small><small><div style="padding-bottom:4px;">
<if Q.user_id EQ client_id>
<a href="http://#this_domain#/#Q.user_id#">You</a>
<else>
<a href="http://#this_domain#/#Q.user_id#">#escapeMarkup(Q.uname)#</a>
</if>
posted an update
</div></small></small>
<div style="margin-left:0.64em;">
</if>

<!--- user pic --->
<var _ml = ""> <!--- padding-left:4px; --->
<if att.no_pic NEQ 1>
<div style="float:left; width:#_upw#px;">
<a href="http://#this_domain#/#Q.user_id#"><tag.balloon picwidth="#_upw#" color="#_color#" bg="#_balloon#"></a>
</div>
<var _ml = "margin-left:#_upw+6#px;">
</if>
<small><div style="#_ml#">
<if att.no_link NEQ 1><a title="<if att.show_details NEQ 0>#timeAgo(Q.so_dateinserted)#</if>" class="buttonish buttonish_small" style="color:#C.text# !important;" href="http://#this_domain#/#Q.user_id#"></if>
#replaceMarkup(_headline)#
<if att.no_link NEQ 1></a></if>
</div></small>

<if att.show_details NEQ 0>
</div>
</if>

#_bullDiv#



<elseif _type EQ "|write_to_friend|">

<!--- writing to a friend on their profile --->

#bullDiv#

<ensure variable="att.no_link" value="0">

<if att.show_details NEQ 0>
<small><small><div style="padding-bottom:4px;">
<if Q.user_id EQ client_id>
<a href="http://#this_domain#/#Q.user_id#">You</a>
<else>
<a href="http://#this_domain#/#Q.user_id#">#escapeMarkup(Q.uname)#</a>
</if>
wrote to
<if Q.giveto_unsignedint EQ client_id>
<a href="http://#this_domain#/#Q.giveto_unsignedint#">You</a>
<else>
<a href="http://#this_domain#/#Q.giveto_unsignedint#">#escapeMarkup(Q.uname_b)#</a>
</if>
</div></small></small>
<div style="margin-left:0.64em;">
</if>

<!--- user pic --->
<var _ml = "">
<if att.no_pic NEQ 1>
<div style="float:left; width:#_upw#px;">
<a href="http://#this_domain#/#Q.user_id#"><tag.balloon picwidth="#_upw#" color="#_color#" bg="#_balloon#"></a>
</div>
<var _ml = "margin-left:#_upw+6#px;">
</if>
<small><div style="#_ml#">
<if att.no_link NEQ 1><a title="<if att.show_details NEQ 0>#timeAgo(Q.so_dateinserted)#</if>" class="buttonish buttonish_small" style="color:#C.text# !important;" href="http://#this_domain#/#Q.giveto_unsignedint#"></if>
<!--- target user pic --->
<var _upw_b = 24>
<var _mr = "">
<if att.no_pic NEQ 1>
<div style="float:right; width:#_upw_b#px;">
<tag.balloon picwidth="#_upw_b#" color="#_color_b#" bg="#_balloon_b#">
</div>
<var _mr = "margin-right:#_upw_b+18#px;">
</if>
<div style="#_mr#">
#replaceMarkup(_headline)#
</div>
<if att.no_pic NEQ 1> <small><small><small><small><div style="clear:right; height:1px;">&nbsp;</div></small></small></small></small> </if>
<if att.no_link NEQ 1></a></if>
</div></small>

<if att.show_details NEQ 0>
</div>
</if>

#_bullDiv#



<elseif _type EQ "|media_comment|">

<!--- media comment --->

<set j="#_jstr#" maxrows="1">
<setcrawl>

<if NOT isDefined("GLOBAL.Media_Def")>
<tag.bn_media_def>
<var GLOBAL.Media_Def = return>
</if>

<var Model = GLOBAL.Media_Def.Tbls[set.tbl]>

#bullDiv#

<ensure variable="att.no_link" value="0">

<if att.show_details NEQ 0>
<small><small><div style="padding-bottom:4px;">
<if Q.user_id EQ client_id>
<a href="http://#this_domain#/#Q.user_id#">You</a>
<else>
<a href="http://#this_domain#/#Q.user_id#">#escapeMarkup(Q.uname)#</a>
</if>
commented on
<if Q.giveto_unsignedint EQ client_id>
your
<elseif Q.user_id EQ Q.giveto_unsignedint>
their
<else>
<var _fnames = "/user-#Q.giveto_unsignedint#'s">
<if Q.uname_b NEQ "">
<var _fnames = escapeMarkup(listFirst(Q.uname_b,' '))>
<if right(_fnames,1) EQ "s">
<var _fnames = _fnames & "'">
<else>
<var _fnames = _fnames & "'s">
</if>
</if>
<a href="http://#this_domain#/#Q.giveto_unsignedint#" style="color:#C.text#;">#_fnames#</a>
</if>
<if listFind(GLOBAL.Def.Friends.intList,set.user_id) GT 0>
<a href="http://#this_domain#/j:#_jstr#">#Model.singular#</a>
<else>
#Model.singular#
</if>
</div></small></small>
<div style="margin-left:0.64em;">
</if>

<!--- user pic --->
<var _ml = "">
<if att.no_pic NEQ 1>
<div style="float:left; width:#_upw#px;">
<a href="http://#this_domain#/#Q.user_id#"><tag.balloon picwidth="#_upw#" color="#_color#" bg="#_balloon#"></a>
</div>
<var _ml = "margin-left:#_upw+6#px;">
</if>
<div style="#_ml#">
<small><div><if att.no_link NEQ 1><a title="<if att.show_details NEQ 0>#timeAgo(Q.so_dateinserted)#</if>" class="buttonish buttonish_small" style="color:#C.text# !important;" href="http://#this_domain#/j:#_jstr#"></if>
<!--- media icon --->
<var _mr = "">
<if att.no_link NEQ 1>
<div style="float:right; width:16px;">
<tag.fico i="#Model.fico#" linkback="off">
</div>
<var _mr = "margin-right:24px;">
</if>
<div style="">
#replaceMarkup(_headline)#
</div>
<if att.no_pic NEQ 1> <small><small><small><small><div style="clear:right; height:1px;">&nbsp;</div></small></small></small></small> </if>
<if att.no_link NEQ 1></a></if></small></div>
</div>

<if att.show_details NEQ 0>
</div>
</if>

#_bullDiv#

</setcrawl>
</set>





<elseif left(_type,5) EQ "|new_">

<!--- new media --->

<var _tbl = replace(listLast(_type,"_"),"|","")>

<if NOT isDefined("GLOBAL.Media_Def")>
<tag.bn_media_def>
<var GLOBAL.Media_Def = return>
</if>

<var Model = GLOBAL.Media_Def.Tbls[_tbl]>

#bullDiv#

<!--- add logo to headline --->
<var _headline = "(empty)">
<if isDefined("Q.body") AND Q.body NEQ "">
<var _headline = Q.body>
<var _headline = noJavascript(_headline)>
<var _headline = replace(_headline,"[-pw-]",24,"all")>
</if>
<tag.fico i="#Model.fico#" linkback="off" output="0" style="height:0.88em;">
<var _fico = return>
<var _headline = _headline & " &nbsp;#_fico#">
<var _headline = '<small><div>#_headline#</div></small>'>

#_headline#
<if att.show_details NEQ 0>#_details#</if>

#_bullDiv#




<else>

<!--- default --->

#bullDiv#

#_headline#
<if att.show_details NEQ 0>#_details#</if>

#_bullDiv#


</if>

</if>
 
.sum_double
0.00
.producttype
.productincludes
.physical_unsignedint
0
.isprotected_unsignedint
0
.overridesiteheader_unsignedint
0