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

XF 1.4 Adding 'Moderator' Tag In Post Bit ONLY In Moderating Section?

Discussion in 'Styling and Customization Questions' started by SectionEighty, Jan 22, 2015.

  1. SectionEighty

    SectionEighty Member

    I wanted to write custom text in the post bit for people who are section moderators ONLY when they're posting in the section where they moderate.

    To break this down:
    - Say I have 3 forums on my site - Music, Sports, Off Topic
    - User 'ABC' is a moderator in the Music section.
    - When ABC posts in the music section, 'Moderator' shows up in his post bit. However, when he posts in the sports section, the moderator tag no longer shows up.

    Any way to do this?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    A quick and dirty way of doing it would be by editing the message_user_info template and using a conditional statement utilising the user id and the forum node ID.

    For example:
    <xen:if is="{$user.user_id} == x AND {$forum.node_id} == y">
    You can even use an array if there is more than one user/forum.
    SectionEighty likes this.
  3. SectionEighty

    SectionEighty Member

    Thanks Brogan, I'll give this a shot.

    Before I proceed though, is there a better way checking the user permissions based on the forum in which the post is displayed in?

Share This Page