and have a look through ./includes/template.php to see how the variables are assigned, where you will see S_ROW_COUNT will be useful.
(Note, this is just from a quick look at the code myself, I haven't tried this.)
The Knowledge Base contains solutions to many common problems! How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions