Log in

View Full Version : How to Hide avatars from guests?


punchbowl
12-09-2006, 10:27 AM
It involves using conditionals and editing the postbit - that much I know!

:tired:

Rich
12-09-2006, 12:10 PM
In your postbit or postbit_legacy template find:

<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>

Change to:

<if condition="$bbuserinfo['userid'] == 0">
<td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="clear.gif" alt="$post[username]" border="0" width="1" height="1" /></a></td>
<else />
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
</if>

That will show guests a chear image that is 1 pixel by 1 pixel. All others will see the users avatar if enabled.

punchbowl
12-09-2006, 01:52 PM
Thanks - educational too. Will probably go with that but any reason why the 1x1gif is needed there at all?

<if condition="$bbuserinfo['userid'] == 0">
<td class="alt2">&nbsp;</td>
<else />
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
</if>