Giving it a try, I notice...
a) I see a limit on the PMs being displayed; but there isn't anything that actually limits the users number of PM's, right?
b) No instructions to add the $config['tital_pm'] variable to the config file.
c) There are three $i = 1;'s in viewmessages.php (only one would be needed, I would think)
d) The group of excessive SELECT fields seems unnecessary when all you are doing is a numrows.