user.naml

<macro name="user_header">
	<span style="white-space:nowrap;" id="nabble-user-header"></span>
	<script type="text/javascript">Nabble.userHeader();</script>
</macro>

<macro name="is_active" requires="user">
	<n.both>
		<condition1.not.is_banned/>
		<condition2.not.is_deactivated/>
	</n.both>
</macro>

<!-- user_tag_id fixes the tilde char (~) in anonymous names (e.g., "a123~Anon") -->
<macro name="user_tag_id" requires="user">
	<n.regex_replace_all. pattern='[^\w]' replacement='_'><n.id/></n.regex_replace_all.>
</macro>

<macro name="set_visitor_online_js">
	<n.param_loop. param="visitorOnline">
		<n.set_visitor_online/>
	</n.param_loop.>
</macro>

<macro name="avatar_online_js">
	<n.param_loop. param="avatarOnline">
		<n.if.author_is_online search_id="[n.current_parameter_value/]">
			<then>
				Nabble.online('<n.current_parameter_value/>');
			</then>
		</n.if.author_is_online>
	</n.param_loop.>
</macro>

<macro name="avatar" requires="user" parameters="size,group,border_class">
	<n.set_var. name="image_url">
		<n.if.is_banned>
			<then.default_avatar_url size="[n.size/]"/>
			<else.avatar_url size="[n.size/]"/>
		</n.if.is_banned>
	</n.set_var.>
	<n.remove_spaces_between_tags.>
		<n.if.is_empty.group>
			<then>
				<a href="[n.url/]" rel="nofollow" title="[t]View profile of [t.author.name/][/t]" class="nowrap no-decoration">
					<img class="avatar [n.avatar_border.border_class/]" src="[n.var name='image_url'/]" height="[n.avatar_pixels.size/]" width="[n.avatar_pixels.size/]" alt="[n.name/]" title="[n.name/]"/>
					<img src="/images/online.png" class="online[n.search_id/] online invisible" title="[t]User is online[/t]" alt="online"/>
				</a>
			</then>
			<else>
				<n.put_in_head.>
					<script type="text/javascript">
						var avatarBorder = "<n.avatar_border.border_class/>";
						var userIsOnline = "<t>User is online</t>";
<![CDATA[
						Nabble.createAvatar = function(showAvatar, url, id, size) {
							var dim = size == 'small'? 24 : 100;
							document.write("<img ");
							if (showAvatar || showAvatar == null)
								document.write("src='"+url+"' ");
							else
								document.write("src='/images/nop.gif' ");
							document.write("xsrc='"+url+"' ");
							document.write("width='"+dim+"' height='"+dim+"' class='"+avatarBorder+" avatar'/>");
							if (id)
								document.write('<img src="/images/online.png" class="online'+id+' online invisible" title="'+userIsOnline+'" alt="online"/>');
						};
]]>
					</script>
				</n.put_in_head.>
				<span class="avatar[n.group/]">
					<a href="[n.url/]" rel="nofollow" title="[t]View profile of [t.author.name/][/t]" class="nowrap no-decoration">
						<script type="text/javascript">
							Nabble.createAvatar(window.hasAvatar<n.group/>, '<n.var name='image_url'/>', '<n.search_id/>', '<n.size/>');
						</script>
					</a>
				</span>
			</else>
		</n.if.is_empty.group>
	</n.remove_spaces_between_tags.>

	<n.call_later param="visitorOnline"/>
	<n.call_later value="[n.search_id/]" param="avatarOnline"/>
</macro>

<macro name="avatar_border" dot_parameter="class">
	<n.default. to="light-border-color"><n.class/></n.default.>
</macro>

<macro name="avatar_pixels" dot_parameter="size">
	<n.if.equal value1="[n.size/]" value2="big">
		<then>100</then>
		<else>24</else>
	</n.if.equal>
</macro>

<macro name="post_count_value" requires="user">
	<n.page_user.node_count filter="[n.post_filter/]"/>
</macro>