Hi
This part of query order subselect's result by number of reports. I suggest you to don't delete this code and find out why your mysql doesn't see subselect's results.
These fields 'offenceC', 'illegalC', 'spamC' are results of subselect. When you quoted them, you will get order by string :) not by field.