1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 If member is in usergroup x - show visual cue to mods / admins *only*

Discussion in 'Styling and Customization Questions' started by CyclingTribe, Nov 13, 2014.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    I've created a usergroup and manually added a select group of members into it.

    I'd like mods / admins to be able to visually identify this group by, for example, a change of avatar background colour or some text string under their username (please don't suggest a custom usergroup title - you cannot wrap conditionals around them!).

    However, I don't want anyone else to see this visual cue.

    How do I write a conditional that says ...

    <if person viewing is a moderator or administrator ... and ... person posting is in usergroup X>
    Do this different thing
    <else>
    Do the usual thing
    <end>

    Any help appreciated. (y)

    Cheers,
    Shaun :D
     
    Last edited: Nov 13, 2014
  2. Brogan

    Brogan XenForo Moderator Staff Member

    I do it like this:
    upload_2014-11-13_14-26-58.png

    Which results in this:
    upload_2014-11-13_14-27-50.png

    Note the small + to the left of the user title.

    I do that in three places:
    upload_2014-11-13_14-29-32.png
     
    AlexT and CyclingTribe like this.
  3. CyclingTribe

    CyclingTribe Well-Known Member

    I've never played with template modifications before - I'll give it a try - many thanks. (y)

    Cheers,
    Shaun :D
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You could just edit the template directly.

    I just prefer to attach mine to TMs.
     
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Just to check ... the is_admin and is_moderator refers to the viewer, right - the person to whom the change will be rendered?

    And the ... ismemberof, $user, 21 - refers to the poster who's avatar/message is being rendered?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, exactly.
     
    CyclingTribe likes this.
  7. CyclingTribe

    CyclingTribe Well-Known Member

    Great stuff - I'll have a mess with it tonight. Thanks for the speedy reply. (y)
     
  8. CyclingTribe

    CyclingTribe Well-Known Member

    Worked like a charm - thanks. (y)
     

Share This Page