X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-optimize.php;h=4f9f5b772c1cbc76adc4a434fbd987669d594199;hb=b0cde844dd14cfd237a2a690129f1e5aa9470c0a;hp=3eca7ee90c6b50f1335c30998a5817152e798e47;hpb=44c5b87eca387e02d33b4c0e728920aeca2a9840;p=mailer.git diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index 3eca7ee90c..4f9f5b772c 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -49,20 +48,20 @@ $EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0. switch ($EXT_LOAD_MODE) { -case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called) +case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_optimize_gain( - id BIGINT(20) NOT NULL AUTO_INCREMENT, + id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, gain decimal(10,3) NOT NULL DEFAULT '0.000', PRIMARY KEY(id) ) TYPE=MyISAM"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('misc', 'optimize', 'DB optimieren', 'Führen Sie dies ab und an aus, damit überflüssige Daten aus der Datenbank entfernt werden.', '5')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Daten aus der Datenbank entfernt werden.','5')"; break; case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_optimize_gain"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='optimize' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='optimize' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension @@ -110,14 +109,14 @@ case "update": // Update an extension } break; +case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. + break; + default: // Do stuff when extension is loaded break; } -// Language file prefix -$EXT_LANG_PREFIX = "optimize"; - -// Extension is always active? +// Keep this extension always active! $EXT_ALWAYS_ACTIVE = "Y"; //