]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-wernis.php
Cache class rewritten to better convention
[mailer.git] / inc / extensions / ext-wernis.php
index e9d2356dc1392f6f019d43ab963d6288e69d1cd5..81c15ab2c73b242fcc431103a59038903221f3d6 100644 (file)
@@ -53,10 +53,10 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_wernis";
        $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_wernis (
 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 wernis_account VARCHAR(255) NOT NULL DEFAULT '',
-wernis_amount DOUBLE(22,5) UNSIGNED NOT NULL DEFAULT '0.00000',
-wernis_timestamp VARCHAR(10) NOT NULL DEFAULT '0',
+wernis_amount FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+wernis_timestamp VARCHAR(10) NOT NULL DEFAULT 0,
 wernis_type ENUM('IN','OUT','FAILED') NOT NULL DEFAULT 'FAILED',
 wernis_api_message TINYTEXT,
 wernis_api_status VARCHAR(255) NULL DEFAULT NULL,
@@ -67,7 +67,7 @@ PRIMARY KEY(id)
        // Confiuration
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_id BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_md5 VARCHAR(32) NOT NULL DEFAULT ''";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_api_url VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_refid VARCHAR(6) NOT NULL DEFAULT ''";
@@ -97,12 +97,14 @@ case "remove": // Do stuff when removing extension
 
 case "activate": // Do stuff when admin activates this extension
        // SQL commands to run
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE what='wernis' LIMIT 1";
        $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='wernis' LIMIT 1";
        break;
 
 case "deactivate": // Do stuff when admin deactivates this extension
        // SQL commands to run
-       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='wernis' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='N', locked='Y' WHERE what='wernis' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='wernis' LIMIT 1";
        break;
 
 case "update": // Update an extension
@@ -111,8 +113,8 @@ case "update": // Update an extension
        case "0.0.1": // SQL queries for v0.0.1
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_factor DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_factor DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_factor FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_factor FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_withdraw_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD wernis_payout_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
@@ -135,9 +137,6 @@ default: // Do stuff when extension is loaded
        break;
 }
 
-// Language file prefix
-$EXT_LANG_PREFIX = "wernis";
-
 // Init array
 global $WERNIS;
 $WERNIS = array();