2012-08-27, 05:07 PM
This user has been denied support.
So I think that this won't be implemented in 1.6.x series and 1.8 final version would take too much time for something important like this.The current user pruning options/settings has very limited options which doesn't allow us to exclude certain usergroups from being pruned, for example if you have a premium/paid usergroup on your forum and you selected a criteria to prune users with 0 posts, then, if anyone from the premium group has made no posts (i.e. zero posts), then, unfortunately, he will be pruned too. Refer to this thread of mine for more info or if you have any doubts.
So, to avoid all these, we are going to make a CORE edit to the pruning task file. The user pruning task file is located in:
./inc/tasks/userpruning.php
Open it and find a line something like this:
if($usergroup['canmodcp'] == 1 || $usergroup['cancp'] == 1 || $usergroup['issupermod'] == 1 || $usergroup['isbannedgroup'] == 1)
Now, replace above line of code with:
if($usergroup['canmodcp'] == 1 || $usergroup['cancp'] == 1 || $usergroup['issupermod'] == 1 || $usergroup['isbannedgroup'] == 1 || in_array($usergroup['gid'],array('8')))
In above new code, by default, I have added one usergroup, namely usergroup #8 from being pruned/deleted. You can disallow pruning of users of multiple usergroup in the below fashion, for example:
if($usergroup['canmodcp'] == 1 || $usergroup['cancp'] == 1 || $usergroup['issupermod'] == 1 || $usergroup['isbannedgroup'] == 1 || in_array($usergroup['gid'],array('8','10','11')))
So the above code will save users of usergroup #8, 10 and 11, for example, from being pruned.
This can be used until we have an official new feature for this.
Note, this is tested on localhost by me for multiple times and it worked as it should. This tutorial is provided 'as is' without any guarantees. Backup your database before trying anything.
Thank you.