possible to filter out posts?

Ladegro

Member
Hi,

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?
 

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:
Code:
$('.message').not('.staff').not('.quickReply').animate({opacity: 0.2});
This one will just remove the posts with the XenForo xfFadeUp() animation:
Code:
$('.message').not('.staff').not('.quickReply').xfFadeUp(XenForo.speed.normal);
Video showing both being triggered here on this site (obviously no backend changes were done)...

 

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?
 

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).
 
Top