Update template.php

Change "!(" to "not (" in SQL statement, line 425