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

Staff Post Indicator [Deleted]

Discussion in 'Template Modifications' started by Russ, Aug 14, 2012.

  1. Russ

    Russ Well-Known Member

    Russ submitted a new resource:

    Staff Post Indicator (version 1.0) - Gives "New Post" function for all staff posts"

    Read more about this resource...
     
    Eagle, erich37 and RobinHood like this.
  2. RobinHood

    RobinHood Well-Known Member

    This is awesome Russ:)

    As someone who likes to keep the postbit as clean as possible around the avatar area, this is perfect for having a mod/admin indicator on the post, without a permanent marker in the avatar region.

    Can you the admin label change to reflect moderator posts too by using $message.is_mod with a matching class?
     
  3. Russ

    Russ Well-Known Member

    Would you want admins to have they're own label and mods to have theirs too such as "Mod New Post"

    EDIT:

    Try this for the replacement of that code instead:

    Code:
            <xen:if is="{$message.isNew} AND !{$message.is_admin} OR !{$message.is_moderator}"><strong class="newIndicator"><span></span>{xen:phrase new}</strong></xen:if>
    <xen:if is="{$message.is_admin} AND {$message.isNew}">
    <strong class="snewIndicator"><span></span>New Admin Post</strong>
    </xen:if>
    <xen:if is="{$message.is_admin} AND !{$message.isNew}">
    <strong class="snewIndicator"><span></span>Admin Post</strong>
    </xen:if>
    <xen:if is="{$message.is_moderator} AND {$message.isNew}">
    <strong class="snewIndicator"><span></span>New Mod Post</strong>
    </xen:if>
    <xen:if is="{$message.is_moderator} AND !{$message.isNew}">
    <strong class="snewIndicator"><span></span>Mod Post</strong>
    </xen:if>
    
    If you wanted to style moderators label differently simply change the class name on the moderator conditionals "snewIndicator" to like "mnewIndicator", copy and paste the existing CSS code and change the css accordingly.
     
    RobinHood likes this.
  4. RobinHood

    RobinHood Well-Known Member

    That's brilliant Russ, thanks,

    I edited that slightly to the following so that if a user is and admin and a mod it will only display the admin tag.

    Code:
    <xen:if is="{$message.isNew} AND !{$message.is_admin}"><strong class="newIndicator"><span></span>{xen:phrase new}</strong></xen:if>
    <xen:if is="{$message.is_admin} AND {$message.isNew}">
    <strong class="adminNewIndicator"><span></span>New Admin Post</strong>
    </xen:if>
    <xen:if is="{$message.is_admin} AND !{$message.isNew}">
    <strong class="adminNewIndicator"><span></span>Admin Post</strong>
    </xen:if>
     
    <xen:if is="{$message.is_moderator} AND !{$message.is_admin} AND {$message.isNew}">
    <strong class="modnewIndicator"><span></span>New Mod Post</strong>
    </xen:if>
    <xen:if is="{$message.is_moderator} AND !{$message.is_admin} AND !{$message.isNew}">
    <strong class="modNewIndicator"><span></span>Mod Post</strong>
    </xen:if>
    mod admin.PNG

    Do you know how I could alter criteria so that it will check if a user is a mod in the forum the post is being made in?

    So if the mod is posting in a forum they moderate, the marker will appear. But if it's another forum there will be no marker.

    So something along the lines of this, but I'm not sure what the right criteria is:

    Code:
    <xen:if is="{$moderator.is_modOfThisNode} AND !{$message.is_admin} AND {$message.isNew}">
    <strong class="modnewIndicator"><span></span>New Mod Post</strong>
    </xen:if>
     
    Russ likes this.
  5. Russ

    Russ Well-Known Member


    I don't think the default conditionals can do this but you can check out:

    http://xenforo.com/community/threads/check-if-a-user-can-moderate-forum.26596/

    Looks like he came up with a mod and a conditional to help. I'd have to toy with it for a bit however I'm off to work.
     
    RobinHood likes this.
  6. RobinHood

    RobinHood Well-Known Member

    Nice one, I'll take a peek, thanks :)
     
  7. intradox

    intradox Well-Known Member

    Is there a way to check for a specific user group? I admin a forum for an indie game but would like to highlight on developer posts and not admins. So for example user group with an id of 7
     
  8. Russ

    Russ Well-Known Member

    intradox likes this.
  9. Russ

    Russ Well-Known Member

    Just in case you needed help with it still this should work for you (y)
    Code:
    <xen:if is="{$message.isNew} AND !{xen:helper ismemberof, $message, 7}"><strong class="newIndicator"><span></span>{xen:phrase new}</strong></xen:if>
    <xen:if is="{xen:helper ismemberof, $message, 7} AND {$message.isNew}">
    <strong class="snewIndicator"><span></span>New Dev Post</strong>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $message, 7} AND !{$message.isNew}">
    <strong class="snewIndicator"><span></span>Dev Post</strong>
    </xen:if>
    
     
    Eagle, intradox and Sylar like this.
  10. intradox

    intradox Well-Known Member

    Worked perfectly. Thanks a lot :)
     
  11. Lawless Baron

    Lawless Baron Member

    Is there a code where we can put an image in the background of the post?
     
  12. intradox

    intradox Well-Known Member

    You can specify a new class and then add a custom image or colors. I simply added to Extra.css a class of .DevPost and the necessary styling i needed.
     
  13. Lawless Baron

    Lawless Baron Member

    sorry im not a coding wiz what would the line simply begin with <img= ?
     
  14. intradox

    intradox Well-Known Member

    For ...
    Code:
    <strong class="snewIndicator"><span></span>Dev Post</strong>
    Add a class such as .devIndicator
    Code:
    <strong class="snewIndicator devIndicator"><span></span>Dev Post</strong>
    Then in Extra.css add the .devIndicator class and specify something like
    background: url('img_url') no-repeat;

    Something along those lines will let you customize the indicator.
     
  15. xIsabel38

    xIsabel38 Well-Known Member

    I must be the only idiot with this problem but in the installation instructions it says to open EXTRA.CSS and I did that, but then it says to go into the Template Message and replace some additional code. My problem is what is the "Template Message"? There's no such .css file called Template Message.css or Template_Message.css that I could find.

    Little clarification for the un-technically advanced please!
     
  16. Russ

    Russ Well-Known Member

    :)

    There is a template called "message" not a css but a standard HTML template.
     
  17. xIsabel38

    xIsabel38 Well-Known Member

    haha thanks. I told you I was dumb.

    Alright now I read through this page and there is a lot of changes and modified versions and basically all sorts of different styles. So which one should I use? Should I use this one:
    Code:
    <xen:if is="{$message.isNew} AND !{xen:helper ismemberof, $message, 7}"><strong class="newIndicator"><span></span>{xen:phrase new}</strong></xen:if>
    <xen:if is="{xen:helper ismemberof, $message, 7} AND {$message.isNew}">
    <strong class="snewIndicator"><span></span>New Dev Post</strong>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $message, 7} AND !{$message.isNew}">
    <strong class="snewIndicator"><span></span>Dev Post</strong>
    </xen:if>
     
  18. Russ

    Russ Well-Known Member

    My description will tell you what my version does:

    1. If message is new and not an admin display "New"
    2. If message is from an admin and is new display "New Admin Post"
    3. If message is from an admin and is not new display "Admin Post"

    Because of XF's great system in place you can do quite a few things with it as listed through the thread. But if you stick with strictly my edits... you'll get those results above.
     
    Shelley likes this.
  19. xIsabel38

    xIsabel38 Well-Known Member

    Thanks Russ!
     
    Russ likes this.
  20. Shelley

    Shelley Well-Known Member

    Keep meaning to install this. Def going to do this today. Thanks again Russ. :)
     
    Russ likes this.

Share This Page