Fixes #321 threadsperpage negative value SQL error

#321
Fixes #321 postsperpage negative value SQL error

#321
Merge pull request #1042 from PirataNervo/fix-321

Fixes #321 threadsperpage/postsperpage negative value SQL error