MyBB Community Forums

Full Version: Revolution Default Avatar Missing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the header template the call to pull up the "default avatar" doesn't work.

[attachment=33476]
Hi,

download and install plugin "Template Conditionals".

Go to ACP >> Templates & Styles >> Templates >> revolution Templates >> Header Templates and open "header_welcomeblock_member" to edit.

Search for:
<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: middle; margin-top:10px; border: 2px solid #000;" src="{$mybb->user['avatar']}" height="55" width="55"></a>

Replace whole line with:
<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: middle; margin-top:10px; border: 2px solid #000;" src="<if $mybb->user['avatar'] then>{$mybb->user['avatar']}<else>{$theme['imgdir']}/default_avatar.png</if>" height="55" width="55"></a>

Save changes and try it... Wink
(2015-01-11, 01:27 PM)SvePu Wrote: [ -> ]Hi,

download and install plugin "Template Conditionals".

Go to ACP >> Templates & Styles >> Templates >> revolution Templates >> Header Templates and open "header_welcomeblock_member" to edit.

Search for:

<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: middle; margin-top:10px; border: 2px solid #000;" src="{$mybb->user['avatar']}" height="55" width="55"></a>

Replace whole line with:

<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: middle; margin-top:10px; border: 2px solid #000;" src="<if $mybb->user['avatar'] then>{$mybb->user['avatar']}<else>{$theme['imgdir']}/default_avatar.png</if>" height="55" width="55"></a>

Save changes and try it... Wink


That didn't work. I even replaced the "else" url with a direct url to image to be sure after it didn't work with the code above.
It works for sure! - I've tested the code before posting. Wink

[attachment=33483]

If you want use the default myBB avatar from Settings use this replacement:
<a href="{$mybb->settings['bburl']}/usercp.php?action=avatar"><img class="panelavatar" style="vertical-align: middle; margin-top:10px; border: 2px solid #000;" src="<if $mybb->user['avatar'] then>{$mybb->user['avatar']}<else>{$mybb->settings['useravatar']}</if>" height="55" width="55"></a>

[attachment=33484]
None of the solutions so far works for me.

[attachment=33485]
Have you added the Template Conditionals plugin? You need that for the if else to work
(2015-01-12, 05:46 AM)Leefish Wrote: [ -> ]Have you added the Template Conditionals plugin?  You need that for the if else to work

No I am not familiar with that plugin. I assume I can find it in the 1.8 extends plugins page?
You were referred to it in an earlier post in this thread. It is by ZingaBurga and you wont find it on the plugins page - he doesnt upload here.

However, he is a respected developer and very competent. Link http://mybbhacks.zingaburga.com/showthread.php?tid=464
(2015-01-12, 03:40 PM)Leefish Wrote: [ -> ]You were referred to it in an earlier post in this thread. It is by ZingaBurga and you wont find it on the plugins page - he doesnt upload here.

However, he is a respected developer and very competent. Link   http://mybbhacks.zingaburga.com/showthread.php?tid=464

Well duh, how did I miss that? Working like a charm!