-$EXT_VERSION = "0.0";
-
-// Auto-set extension version
-if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
-
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0");
-
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`";
- $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` (
-`id` bigint(20) NOT NULL auto_increment,
-`userid` bigint(20) NOT NULL DEFAULT 0,
-`level` smallint(6) NOT NULL DEFAULT 0,
-`refid` bigint(20) 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=MyISAM COMMENT='User Referals With Refback'";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','refback','Ref-Back/Ref-Übersicht',4,'N','N')";
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='refback' LIMIT 1";
- break;
-
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.1": // SQL queries for v0.0.1
- $SQLs[] = "";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "";
+setThisExtensionVersion('0.0.4');
+
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0','0.0.1', '0.0.2', '0.0.3', '0.0.4'));
+
+switch (getExtensionMode()) {
+ case 'register': // Do stuff when installation is running
+ // Member menu
+ addMemberMenuSql('main', 'refback', 'Refback einstellen', 4);
+
+ // Execute this special file on registration
+ addIncludeToPool('extension', 'inc/fix_refsystem.php');