Fix pager smarty function