Add some functions to custompage.class.php