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

possible to filter out posts?

Discussion in 'General XenForo Discussion and Feedback' started by Ladegro, Jul 3, 2012.

  1. Ladegro

    Ladegro Member


    Heading towards purchasing my 2nd XenForo license, but wanted to know if the following would be possible;

    We want to have an option to filter out certain posts by users who belong to certain groups.
    So, say I have a group "Staff", and I'm a staff member browsing a busy thread, it would be great if I'd had the possibility to switch to "view staff-only posts", to reveal those posts that matter to me.

    Would that be hard to do?
  2. digitalpoint

    digitalpoint Well-Known Member

    If your example is what you are actually trying to do (just make stuff from staff more visible), it would be really simple since XenForo already tags posts from staff with a CSS class. This means a simple jQuery command can already do it without needing to build anything complex.

    For example, this JavaScript code will fade out all non-staff member posts to make staff more visible:
    $('.message').not('.staff').not('.quickReply').animate({opacity: 0.2});
    This one will just remove the posts with the XenForo xfFadeUp() animation:
    Video showing both being triggered here on this site (obviously no backend changes were done)...

  3. Ladegro

    Ladegro Member

    That would be exactly what we want, but

    1. is this only for staff, or can it be applied to *any* group?
    2. how do you trigger this, can it be put behind a button?
  4. digitalpoint

    digitalpoint Well-Known Member

    Well it would only work for staff without making backend changes since that's the only people XenForo tags with a CSS class already.

    It probably wouldn't be too hard to make an addon that added a CSS class based on usergroup so you could do the same thing based on any usergroup.

    And yes... you could trigger it with a button or link since it's just a bit of JavaScript code (given in previous post).

Share This Page