]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-newsletter.php
Unsupported extensions removed, several rewrites to extension handling, 'yoomedia...
[mailer.git] / inc / extensions / ext-newsletter.php
index f82a4989b678ff96c56e5124c06b980fa6458e56..b23a58c42ddb84931ac7ad4e0ba57156b7ba26f3 100644 (file)
@@ -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,7 +48,7 @@ $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[] = "";
        break;
@@ -74,15 +73,15 @@ case "update": // Update an extension
        switch ($EXT_VER)
        {
        case "0.0.1": // SQL queries for v0.0.1
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('newsletter', NULL, 'Newsletter', 'Einstellungen am Newsletter, Newsletter versenden, Abbestellungen auflisten usw.', 3)";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('newsletter', 'list_newsletter', 'Abbestellungen', 'Alle Abbestellungen auflisten und bearbeiten.', 2)";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('newsletter', 'config_newsletter', 'Einstellungen', 'Gebühr zum Abbestellen des Newsletters usw. sind hier einstellbar.', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, Abbestellungen auflisten usw.', 3)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','list_newsletter','Abbestellungen','Alle Abbestellungen auflisten und bearbeiten.', 2)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','config_newsletter','Einstellungen','Gebühr zum Abbestellen des Newsletters usw. sind hier einstellbar.', 3)";
                $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET action='newsletter', what='send_newsletter', title='Versenden', sort='1' WHERE what='newsletter' LIMIT 1";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, visible, locked, sort) VALUES ('main', 'newsletter', 'Newsletter-Empfang', 'N', 'Y', 10)";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','newsletter','Newsletter-Empfang','N','Y', 10)";
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD nl_charge FLOAT(10,2) UNSIGNED NOT NULL DEFAULT '5.00'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_receive ENUM('Y', 'N') NOT NULL DEFAULT 'Y'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_until VARCHAR(10) NOT NULL DEFAULT '0'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_timespan VARCHAR(10) NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_receive ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_until VARCHAR(10) NOT NULL DEFAULT 0";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD nl_timespan VARCHAR(10) NOT NULL DEFAULT 0";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Vor der eigentlichen Freigabe dieser Erweiterungen habe ich sie versehendlich im Archiv mit auf den Server hochgeladen. Diese Version fügt die bereits angekündigte Funktionalitäten, wie zum Beispiel das Einstellen der Abschaltgebühr.";
@@ -134,7 +133,6 @@ case "update": // Update an extension
                break;
 
        case "0.1.1": // SQL queries for v0.1.1
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP nl_currency";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "W&auml;hrung auf die Erweiterung <A href=\"#\"><STRONG>ext-other.zip</STRONG></A> verlagert. Bitte auch diese aktualisieren.";
@@ -148,10 +146,6 @@ case "update": // Update an extension
        break;
 
 default: // Do stuff when extension is loaded
-       $dummy = LOAD_CONFIG();
-       $_CONFIG = merge_array($_CONFIG, $dummy);
-       unset($dummy);
-
        // URL ends which are used to indentify the end of an URL or email link
        // Don't use these chars in links... ;-)
        //
@@ -164,10 +158,10 @@ default: // Do stuff when extension is loaded
 
        // Valid email chars (without @, or do you want to have another @ inside your email addy?)
        $VALID_EMAIL_CHARS = array(
-               'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
-               't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-               'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',   '-', '.', '_', '0', '1',
-               '2', '3', '4', '5', '6', '7', '8', '9'
+               'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
+               't','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
+               'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_','0','1',
+               '2','3','4','5','6','7','8','9'
        );
 
        if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
@@ -178,11 +172,5 @@ default: // Do stuff when extension is loaded
        break;
 }
 
-// Language file prefix
-$EXT_LANG_PREFIX = "newsletter";
-
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
 //
 ?>