useragent_match function for smarty