(Multiple changes)

(1) Several variables changed to lowercase.  (2) Several variables (that
are no longer in use) removed.  (3) Several queries changed to prepares.
(4) Stats fixed for user's posts.  (5)