Thanks for doing this.
I see a problem with this patch.
In each of the if statements, you get a new $postsarr value.
For example,
-----------
if (!empty($data->reset_forum_single)) {
....
$postsarr = ...
...
}
If the value of $postsarr is set in the first if statment and you are calling it again in another if statment, the first values get removed. You need to be merging them so that you have all the values from all the if statements.
The way it is now, only the values from the last if statement is retained. The rest gets lost. Hope l am making sense to you.
See patch against 1.9 attached