Soft deleting threads in forums by users who get removed from a usergroup?

Ludachris

Well-known member
We have some forums where only certain usergroups are allowed to post threads. The problem is, some users are removed from those usergroups but their threads remain live in those forums. I'd like to figure out a way to soft delete those threads when the thread author is no longer in a usergroup with permissions to post new threads in a given forum. I'm not sure the best way to go about achieving this.

My first thought is to create a cron job that runs nightly and checks all the threads in specified nodes and does a check to see if the thread starter is in a usergroup array. If not, the thread gets soft deleted. Is there a better way to do it?
 
How often does this happen? The most efficient way would be targeting the usergroup change code and hooking into that to delete the threads on usergroup change. I'd imagine that would be less intensive than running a scheduled cron to check for something that may happen once every few weeks/months.
 
How often does this happen? The most efficient way would be targeting the usergroup change code and hooking into that to delete the threads on usergroup change. I'd imagine that would be less intensive than running a scheduled cron to check for something that may happen once every few weeks/months.
Not terribly often. Probably a few times per year. And it really only comes into play for a couple forums.
 
How does the user get removed from the usergroup?
Seems like that is the process to attach a script to - not a cron.

after that, the query is pretty simple.
get the thread id's from that user in that forum
update visibility status where id in that collection
 
Just a comment for your consideration - not a solution:

Removing posts mid-thread can make the residue harder to follow and read by those who still have access.
Removing entire threads (i.e. started by the exiting member) will remove all the responses - including some that others may still find useful. And it will affect their post counts etc., (if that's a sensitive matter to your members).
Removing posts still leaves any quotes by others of the post/s intact.

Significance depends on your forum content, nature, etc.
 
Just a comment for your consideration - not a solution:

Removing posts mid-thread can make the residue harder to follow and read by those who still have access.
Removing entire threads (i.e. started by the exiting member) will remove all the responses - including some that others may still find useful. And it will affect their post counts etc., (if that's a sensitive matter to your members).
Removing posts still leaves any quotes by others of the post/s intact.

Significance depends on your forum content, nature, etc.
It would be the threads in their entirety based on how I read it. I assumed it was advertising or commerce based where if they didn't keep up their subscription their thread is soft deleted so they don't receive the benefit of the PR until they re-subscribe.
 
Top Bottom