]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-payout.php
New naming convention applied to many functions, see #118 for details
[mailer.git] / inc / extensions / ext-payout.php
index 1d8bccaa403e9eec5b6c2c02b741ddb83d785a9a..f050ce94897535c8c4430f1862d1d3aaa050f862 100644 (file)
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }
 
 // Version of this extension
-EXT_SET_VERSION("0.3.8");
+EXT_SET_VERSION('0.3.8');
 
-// Version history array (add more with , "0.1" and so on)
-EXT_SET_VER_HISTORY(array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8"));
+// Version history array (add more with , '0.1.0' and so on)
+EXT_SET_VER_HISTORY(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8'));
 
 switch ($EXT_LOAD_MODE)
 {
-case "register": // Do stuff when installation 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
        ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`");
        ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_payouts` (
@@ -79,7 +79,7 @@ PRIMARY KEY(id)
        ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','payout','Auszahlungen','N','N','11')");
        break;
 
-case "remove": // Do stuff when removing extension
+case 'remove': // Do stuff when removing extension
        // SQL commands to run
        ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`");
        ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_payout_types`");
@@ -87,25 +87,25 @@ case "remove": // Do stuff when removing extension
        ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='payout'");
        break;
 
-case "activate": // Do stuff when admin activates this extension
+case 'activate': // Do stuff when admin activates this extension
        // SQL commands to run
        ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='payout' LIMIT 1");
        break;
 
-case "deactivate": // Do stuff when admin deactivates this extension
+case 'deactivate': // Do stuff when admin deactivates this extension
        // SQL commands to run
        ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='payout' LIMIT 1");
        break;
 
-case "update": // Update an extension
+case 'update': // Update an extension
        switch ($EXT_VER)
        {
-       case "0.1.2": // SQL queries for v0.1.2
+       case '0.1.2': // SQL queries for v0.1.2
                ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('payouts', NULL, 'Auszahlungsmanagement','Management der Auszahlungsarten.','8')");
                ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='payouts', `title`='Einstellungen' WHERE `action`='setup' AND `what`='config_payouts' LIMIT 1");
                break;
 
-       case "0.1.3": // SQL queries for v0.1.3
+       case '0.1.3': // SQL queries for v0.1.3
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD from_account VARCHAR(255) NOT NULL DEFAULT ''");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD from_pass VARCHAR(255) NOT NULL DEFAULT ''");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD engine_url VARCHAR(255) NOT NULL DEFAULT ''");
@@ -114,136 +114,136 @@ case "update": // Update an extension
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD pass_enc ENUM('md5','base64','none') NOT NULL DEFAULT 'md5'");
                break;
 
-       case "0.1.4": // SQL queries for v0.1.4
+       case '0.1.4': // SQL queries for v0.1.4
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD password VARCHAR(255) NOT NULL DEFAULT ''");
                break;
 
-       case "0.1.5": // SQL queries for v0.1.5
+       case '0.1.5': // SQL queries for v0.1.5
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD target_url LONGTEXT NOT NULL");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD banner_url LONGTEXT NOT NULL");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD link_text VARCHAR(30) NOT NULL DEFAULT ''");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD allow_url ENUM('Y','N') NOT NULL DEFAULT 'N'");
                break;
 
-       case "0.1.6": // SQL queries for v0.1.6
+       case '0.1.6': // SQL queries for v0.1.6
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` CHANGE pass_enc pass_enc ENUM('md5','base64','xxx') NOT NULL DEFAULT 'xxx'");
                break;
 
-       case "0.1.8": // SQL queries for v0.1.8
+       case '0.1.8': // SQL queries for v0.1.8
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Auflistung der Auszahlungen ausgelagert in Template <em>member_payout.tpl</em>.");
                break;
 
-       case "0.1.9": // SQL queries for v0.1.9
+       case '0.1.9': // SQL queries for v0.1.9
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
                break;
 
-       case "0.2.0": // SQL queries for v0.2.0
+       case '0.2.0': // SQL queries for v0.2.0
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("5 Nachkommastellen implementiert.");
                break;
 
-       case "0.2.1": // SQL queries for v0.2.1
+       case '0.2.1': // SQL queries for v0.2.1
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` CHANGE payout_total payout_total FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` CHANGE rate rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
 
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Problem mit Speicherung der Einstellungen beseitigt.");
 
-       case "0.2.2": // SQL queries for v0.2.2
+       case '0.2.2': // SQL queries for v0.2.2
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Buttons aus Aufgabenauflisten ausgelagert");
                break;
 
-       case "0.2.3": // SQL queries for v0.2.3
+       case '0.2.3': // SQL queries for v0.2.3
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
                break;
 
-       case "0.2.4": // SQL queries for v0.2.4
+       case '0.2.4': // SQL queries for v0.2.4
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Ausgabe der Auszahlungsm&ouml;glichkeiten im Mitgliedsbereich repariert.");
                break;
 
-       case "0.2.5": // SQL queries for v0.2.5
+       case '0.2.5': // SQL queries for v0.2.5
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Seit <a href=\"#\">Patch 340</a> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
                break;
 
-       case "0.2.6": // SQL queries for v0.2.6
+       case '0.2.6': // SQL queries for v0.2.6
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
                break;
 
-       case "0.2.7": // SQL queries for v0.2.7
+       case '0.2.7': // SQL queries for v0.2.7
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
-       case "0.2.8": // SQL queries for v0.2.8
+       case '0.2.8': // SQL queries for v0.2.8
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Work-Arount-L&ouml;sung zu tempor&auml;ren Problemen mit der Task-ID eingebaut.");
                break;
 
-       case "0.2.9": // SQL queries for v0.2.9
+       case '0.2.9': // SQL queries for v0.2.9
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Nachricht an Admin bei Auszahlungsanfrage wird endlich versendet.");
                break;
 
-       case "0.3.0": // SQL queries for v0.3.0
+       case '0.3.0': // SQL queries for v0.3.0
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
                break;
 
-       case "0.3.1": // SQL queries for v0.3.1
+       case '0.3.1': // SQL queries for v0.3.1
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Fehler in Auszahlungsfunktion beseitigt, wenn Umrechnungsrate ungleich 1 eingestellt ist.");
                break;
 
-       case "0.3.2": // SQL queries for v0.3.2
+       case '0.3.2': // SQL queries for v0.3.2
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
                break;
 
-       case "0.3.3": // SQL queries for v0.3.3
+       case '0.3.3': // SQL queries for v0.3.3
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Vorbereitung auf die neue Mediendaten v0.0.4.");
                break;
 
-       case "0.3.4": // SQL queries for v0.3.4
+       case '0.3.4': // SQL queries for v0.3.4
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Anzahl zu &uuml;berweisende {!POINTS!} m&uuml;ssen immer gr&ouml;sser 0 sein, ansonsten bricht das Script mit einer Fehlermeldung an das Mitglied ab.");
                break;
 
-       case "0.3.5": // SQL queries for v0.3.5
+       case '0.3.5': // SQL queries for v0.3.5
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Sicherheitsupdate f&uuml;r die Include-Befehle.");
                break;
 
-       case "0.3.6": // SQL queries for v0.3.6
+       case '0.3.6': // SQL queries for v0.3.6
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
                break;
 
-       case "0.3.7": // SQL queries for v0.3.7
-               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (what='' OR `what` IS NULL) LIMIT 1");
+       case '0.3.7': // SQL queries for v0.3.7
+               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (`what`='' OR `what` IS NULL) LIMIT 1");
 
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Verwaltung nach Management umgestellt.");
                break;
 
-       case "0.3.8": // SQL queries for v0.3.8
+       case '0.3.8': // SQL queries for v0.3.8
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
                break;
        }
        break;
 
-case "modify": // When the extension got modified
+case 'modify': // When the extension got modified
        break;
 
-case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+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