Report abuse

<mt:Ignore>
                            USERPIC MODULE
    This module is called to display a userpic for an author or commenter
    with an optional link to a profile for the user.  It can be called
    with the following options:
    
        size - specifies the height and width. Default is 36
        alt  - Specified the alt text. Default is 'user-pic'
        userpic_type -
                Provides a hint to select from typical formts. Recognized
                values are 'profile', 'commenter' and 'userlist'
</mt:Ignore>

<mt:Ignore>            DEFAULT USERPIC IMAGE                </mt:Ignore>
<mt:StaticWebPath cat="images/default-userpic-90.jpg" setvar="defaultpic">

<mt:Ignore>            DEFAULT USERPIC SIZE                 </mt:Ignore>
<mt:Var name="size" default="36" setvar="size">

<mt:Ignore>          DEFAULT IMAGE ATTRIBUTES               </mt:Ignore>
<mt:SetVarBlock name="attrstr">
    width="<mt:Var name="size">"
    height="<mt:Var name="size">"
    alt="<mt:Var name="alt" default="user-pic">"
</mt:SetVarBlock>

<mt:Ignore>            DEFAULT PROFILE URL                  </mt:Ignore>
<mt:Var name="profile_view_url" encode_html="1" setvar="href">


<mt:Ignore>
    USERPIC DISPLAY MODULE: This is the template that will be used to display
    the userpic, possibly linked if an href is given
</mt:Ignore>
<mt:SetVarTemplate name="userpic_display">

    <mt:SetVarBlock name="image">
        <img src="<$mt:Var name="src" default="$defaultpic"$>"
             <$mt:Var name="attrstr"$> />

        <mt:If tag="CommenterAuthIconURL">
            <span class="auth-icon">
                <img src="<$mt:CommenterAuthIconURL size="logo_small"$>"
                     alt="<$mt:CommenterAuthType$>"/>
            </span>
        </mt:If>
    </mt:SetVarBlock>

    <mt:If name="href">
        <a href="<$mt:Var name="href" trim="1">"><mt:Var name="image"></a>
    <mt:Else>
        <mt:Var name="image">
    </mt:If>

</mt:SetVarTemplate>


<mt:Ignore>
    DETERMINING THE IMAGE SRC AND LINK HREF ATTRIBUTES
</mt:Ignore>
<mt:If name="userpic_type" eq="profile">

    <$mt:AuthorUserpicURL setvar="src"$>

<mt:Else name="userpic_type" eq="commenter">

    <mt:CommenterUserpicURL setvar="src">

    <mt:IfCommenterIsAuthor>
        <mt:Ignore> Native MTCS user </mt:Ignore>
        <mt:SetVarBlock name="href"
                        append="1"><$mt:CommenterID$></mt:SetVarBlock>

    <mt:Else>
        <mt:If tag="CommenterID">
            <mt:Ignore> Authenticated user (OpenID, Vox, LJ, etc) </mt:Ignore>
            <mt:CommenterURL        setvar="href">

        <mt:Else>
            <mt:Ignore> Anonymous commenter </mt:Ignore>
            <mt:CommentURL          setvar="href">

        </mt:If>

    </mt:IfCommenterIsAuthor>

<mt:Else name="userpic_type" eq="userlist">
    <mt:AuthorUserpicURL setvar="src">
    <mt:SetVarBlock name="href"
                    append="1"><$mt:AuthorID$></mt:SetVarBlock>

<mt:Else>
    <mt:EntryAuthorUserpicURL setvar="src">
    <mt:SetVarBlock name="href"
                    append="1"><$mt:EntryAuthorID$></mt:SetVarBlock>
</mt:If>


<mt:Ignore>
    DISPLAY THE USERPIC
</mt:Ignore>
<div class="user-pic">
    <mt:Var name="userpic_display" trim="1" strip=" ">
</div>