Avatars without Gravatar
  • Can I have user accounts without Gravatar? We have two users, my wife and me, whose avatars I would like to host on our server. Can I do it while keeping Gravatar support for other users?
  • You could use an if-else in the comments.tpl that verifies if the comment author is admin and his/her username is your name or the name of your wife.
  • I changed the avatar to a standard file.

    <div id="main">
            {entry_block}
            {entry}
                {include file=entry-default.tpl}
            {comment_block}
            <ol id="comments">
            {comment}
                <li id="{$id}" {$loggedin|notempty:"class=\"comment-admin\""}>
                    <img class="alignright" src="http://www.mysite.de/images/ava.png" alt="Avatar for {$name}" title="Avatar for {$name}" width="48" height="48" />
                    <strong class='comment-name'>
                    {*
                        using this tag combo, the name is displayed as a link only
                        if user entered a URL.
                       
                        Syntax is quite intuitive:
                        "if $url is not empty, show $name between a tags,
                        else default fallback on displaying plain $name"
                       
                    *}
                    {$url|notempty:"<a href=\"$url\" title=\"Permalink to $name's comment\">$name</a>"|default:$name}
                    </strong>
                   
                    {include file=shared:commentadminctrls.tpl} {* this shows edit/delete links*}
                   
                    <p class="small">
                    <a href="{$entryid|link:comments_link}#{$id}">{$date|date_format:"%A, %B %e, %Y - %H:%M:%S"}</a>
                    </p>

    How would I hove to change the code to get another avatar as admin?
  • Flatpress isn't a multi-user environment.I don't know if there is a var to catch the name,  but if one is there you can identify the current logged in user.

  • when user is loggedin:

    {$flatpress.user.userid} and {$flatpress.user.email}
  • I must tell I cannot use either answer yet, sorry. Currently, I know almost nothing about tpl file syntax. LTB’s code is nice, but I don’t understand how it keeps up Gravatar support for normal users, and even don’t see the way how to extend it for two special users. So, could you show me the way as for a newbie, please?

In this Discussion