X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-transfer.php;h=6b89ad4da8405ebd3e0c8506548fd11c3e349dcd;hb=ab92fb7241d00636b0eb940f147449758820cba1;hp=9b301b93b560dc3b48186673edc184848171f0a6;hpb=25886c9028a20682a100603df7e98c5c16ef83bd;p=mailer.git diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 9b301b93b5..6b89ad4da8 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -48,19 +48,19 @@ $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 +case "register": // Do stuff when installation is running // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_in"; - $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_out"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`"; // Transfer from a member - $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_in ( + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_transfers_in` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', -from_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', -points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', +userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +from_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, reason VARCHAR(255) NOT NULL DEFAULT '', -time_trans VARCHAR(14) NOT NULL DEFAULT '0', +time_trans VARCHAR(14) NOT NULL DEFAULT 0, trans_id VARCHAR(12) NOT NULL DEFAULT '', KEY (userid), KEY (from_uid), @@ -68,13 +68,13 @@ PRIMARY KEY(id) ) Type=MyISAM"; // Transfers to a member - $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_out ( + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_transfers_out` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', -to_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', -points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', +userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +to_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, reason VARCHAR(255) NOT NULL DEFAULT '', -time_trans VARCHAR(14) NOT NULL DEFAULT '0', +time_trans VARCHAR(14) NOT NULL DEFAULT 0, trans_id VARCHAR(12) NOT NULL DEFAULT '', KEY (userid), KEY (to_uid), @@ -82,42 +82,42 @@ PRIMARY KEY(id) ) Type=MyISAM"; // Admin menu - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('transfer', NULL, '{!POINTS!}-Transfer','Verwalten Sie hier die {!POINTS!}-Transaktionen zwischen Ihren Mitgliedern.', 7)"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('transfer','list_transfer','Auflisten','Hier bekommen Sie alle ein- und ausgehende Transaktionen aufgelistet.', 1)"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('transfer','config_transfer','Einstellungen','Stellen Sie ein, wie viele Transaktionen aufgelistet werden sollen und wie alt diese werden dürfen. Die evtl. installierte autopurge-Erweiterung kann dann automatisch die veralteten Transktionen löschen.', 2)"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('transfer','del_transfer','Manuell löschen','Hier können Sie - abgesehen von der automatischen Löschung - Transaktionen selber löschen. Bitte beachten Sie, dass immer aus- und eingehende Transaktionen gleichzeitig gelöscht werden.', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer', NULL, '{!POINTS!}-Transfer','Verwalten Sie hier die {!POINTS!}-Transaktionen zwischen Ihren Mitgliedern.', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','list_transfer','Auflisten','Hier bekommen Sie alle ein- und ausgehende Transaktionen aufgelistet.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','config_transfer','Einstellungen','Stellen Sie ein, wie viele Transaktionen aufgelistet werden sollen und wie alt diese werden dürfen. Die evtl. installierte autopurge-Erweiterung kann dann automatisch die veralteten Transktionen löschen.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','del_transfer','Manuell löschen','Hier können Sie - abgesehen von der automatischen Löschung - Transaktionen selber löschen. Bitte beachten Sie, dass immer aus- und eingehende Transaktionen gleichzeitig gelöscht werden.', 3)"; // Member menu - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, visible, locked, sort) VALUES ('main','transfer','{!POINTS!}-Transfer','Y','Y', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','transfer','{!POINTS!}-Transfer','Y','Y', 5)"; // Add config values - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(ONE_DAY*28)."'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".ONE_DAY."'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT '100'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT '5'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*28)."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('one_day')."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"; // Add row(s) to user's data - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_in"; - $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_out"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='transfer' LIMIT 4"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='transfer' LIMIT 1"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP opt_in"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='transfer' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='transfer' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP opt_in"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='transfer' 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='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='transfer' LIMIT 1"; break; case "update": // Update an extension @@ -125,7 +125,7 @@ case "update": // Update an extension { case "0.0.2": // SQL queries for v0.0.2 // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Fehler Warning: Missing argument 2 for create_timestamp_from_selections() in ".PATH."inc/libs/pro_functions.php on line 227 behoben."; + $UPDATE_NOTES = "Fehler