XF 1.5 Cron to add users to a group

Pixel Squad Ltd

Active member
Is there a cron to add users to a group when they have >0 warning points, and remove them when it returns back to 0?

I can see we can add a user to a specific group when they're warned and remove them when the warning has expired, but I currently have a few users with warning points and I want to put them all in a specific usergroup which changes the colour of their username, but I can't seem to put them all in at once. I have checked to see if I can find a cron that I can run that will add them in after the warning, but I can't find one/

Is there one? If not, can someone help me create one?

Regards,
Carl
 
You could do this with a warning action at 1 point to add them to the group while at/above the points threshold. However, that won't change anything for users above that point already. Change that for these users would require an add-on (though likely not a huge one if you do the warning action as well).
 
A cron task would still require custom code and actually wouldn't be efficient anyway. The warning action approach would do exactly what you want and will trigger changes instantly (when the points are expired). The only caveat would really be the existing users. If it's only a few users, you could make a note of when their points are due to expire and add/remove the group manually. If it's a large number of users, it's more difficult though it may be doable through some manual work and DB manipulation (though this is never going to be an approach we'd really recommend).
 
A cron task would still require custom code and actually wouldn't be efficient anyway. The warning action approach would do exactly what you want and will trigger changes instantly (when the points are expired). The only caveat would really be the existing users. If it's only a few users, you could make a note of when their points are due to expire and add/remove the group manually. If it's a large number of users, it's more difficult though it may be doable through some manual work and DB manipulation (though this is never going to be an approach we'd really recommend).
Thanks a lot for your help, Mike. I will just leave it as it is, and wait for the players with current warnings to expire. They will be added to the group if they receive future warnings anyway.

Thanks again.
 
Top Bottom