-switch ($EXT_LOAD_MODE)
-{
- case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_refs`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_refs` (
-`id` BIGINT(20) UNSIGNED NOT NULL auto_increment,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0,
-`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`refback` float(4,1) NOT NULL DEFAULT 0.0,
-`points` FLOAT( 20,5) DEFAULT 0.00000 NOT NULL,
-PRIMARY KEY (`id`),
-UNIQUE `user_refid` (`userid`,`level`,`refid`),
-KEY (`level`),
-KEY (`refid`)
-) ENGINE={!_TABLE_TYPE!} COMMENT='User Referals With Refback'");
- ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','refback','Ref-Back einstellen',4,'N','N')");
+switch (getExtensionMode()) {
+ case 'setup': // Do stuff when installation is running
+ // Member menu
+ addMemberMenuSql('main', 'refback', 'Refback einstellen', 4);
+ addMemberMenuSql('main', 'reflist', 'Ref-Übersicht', 5);
+
+ // Execute this special file on registration
+ addIncludeToPool('extension', 'inc/fixes/fix_refsystem.php');