Announcement

Collapse
No announcement yet.

Hide avatar for guest - Code check

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Hide avatar for guest - Code check

    vB4 has the following code in postbit_legacy for displaying avatars:
    Code:
                <vb:if condition="$show['avatar']">
                <a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
                    <img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                </a>
                </vb:if>
    If I wanted to hide avatars for guests, would the following be a good way to implement it (added code in Red)

    Code:
                <vb:if condition="$show['avatar'][COLOR=Red] AND $show['member'][/COLOR]" >
                <a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
                    <img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                </a>
                </vb:if>

  • #2
    Try it and see if it works.

    Comment


    • #3
      Yeah it did cheers. Was looking at a whole lot of conditionals and then realised that a simple addition as per the above would do the same thing.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X