avatar

NAML documentation   Watch a video
   Usages of this macro
... in user.naml
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<macro name="avatar" requires="user" parameters="size,group,border_class">
    <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
. name="image_url">
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_banned
Binary
Namespace: UserNamespace
>
            <then.default_avatar_url
Binary
Namespace: UserNamespace
Parameters: size
 size="[n.size/]"/>
            <else.avatar_url
Binary
Namespace: UserNamespace
Parameters: size
 size="[n.size/]"/>
        </n.if.is_banned>
    </n.set_var.>
    <n.remove_spaces_between_tags
Macro
Parameters: text
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_empty
Binary
Namespace: BasicNamespace
Parameters: value
.group>
            <then>
                <a href="[n.url
Macro
Requires: user
Parameters: filter, index_record
/]" rel="nofollow" title="[t]View profile of [t.author.name
Binary
Namespace: UserNamespace
Parameters: truncate
/][/t]" class="nowrap no-decoration">
                    <img class="avatar [n.avatar_border
Macro
Parameters: class
.border_class/]" src="[n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='image_url'/]" height="[n.avatar_pixels
Macro
Parameters: size
.size/]" width="[n.avatar_pixels
Macro
Parameters: size
.size/]" alt="[n.name
Binary
Namespace: UserNamespace
Parameters: truncate
/]" title="[n.name
Binary
Namespace: UserNamespace
Parameters: truncate
/]"/>
                    <img src="/images/online.png" class="online[n.search_id
Binary
Namespace: UserNamespace
/] online invisible" title="[t
Macro
]User is online[/t]" alt="online"/>
                </a>
            </then>
            <else>
                <n.put_in_head
Binary
Namespace: HtmlNamespace
Parameters: in_head
.>
                    <script type="text/javascript">
                        var avatarBorder = "<n.avatar_border
Macro
Parameters: class
.border_class/>";
                        var userIsOnline = "<t
Macro
>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
Macro
Requires: user
Parameters: filter, index_record
/]" rel="nofollow" title="[t]View profile of [t.author.name
Binary
Namespace: UserNamespace
Parameters: truncate
/][/t]" class="nowrap no-decoration">
                        <script type="text/javascript">
                            Nabble.createAvatar(window.hasAvatar<n.group/>, '<n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='image_url'/>', '<n.search_id
Binary
Namespace: UserNamespace
/>', '<n.size/>');
                        </script>
                    </a>
                </span>
            </else>
        </n.if.is_empty.group>
    </n.remove_spaces_between_tags.>
 
    <n.call_later
Binary
Namespace: NabbleNamespace
Parameters: param, value
 param="visitorOnline"/>
    <n.call_later
Binary
Namespace: NabbleNamespace
Parameters: param, value
 value="[n.search_id
Binary
Namespace: UserNamespace
/]" param="avatarOnline"/>
</macro>