X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-transfer.php;h=a69fe2d0a0f52c235917c95ceb6e5258c8d1bf51;hb=43885129ac24cee5545a8a5ad51e90aa182fdf46;hp=26d94ba6c01b1b122ef1266c4891e2da1a685dc9;hpb=e1653405d28923c78b2e292125306ccf61138f24;p=mailer.git diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 26d94ba6c0..a69fe2d0a0 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -56,13 +56,13 @@ case "register": // Do stuff when installtion is running // Transfer from a member $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_in ( -id bigint(20) not null auto_increment, -userid bigint(20) not null default '0', -from_uid bigint(20) not null default '0', -points bigint(20) not null default '0', -reason varchar(255) not null default '', -time_trans varchar(14) not null default '0', -trans_id varchar(12) not null default '', +id BIGINT(20) NOT NULL AUTO_INCREMENT, +userid BIGINT(20) NOT NULL DEFAULT '0', +from_uid BIGINT(20) NOT NULL DEFAULT '0', +points BIGINT(20) NOT NULL DEFAULT '0', +reason VARCHAR(255) NOT NULL DEFAULT '', +time_trans VARCHAR(14) NOT NULL DEFAULT '0', +trans_id VARCHAR(12) NOT NULL DEFAULT '', KEY (userid), KEY (from_uid), PRIMARY KEY(id) @@ -70,20 +70,20 @@ PRIMARY KEY(id) // Transfers to a member $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_out ( -id bigint(20) not null auto_increment, -userid bigint(20) not null default '0', -to_uid bigint(20) not null default '0', -points bigint(20) not null default '0', -reason varchar(255) not null default '', -time_trans varchar(14) not null default '0', -trans_id varchar(12) not null default '', +id BIGINT(20) NOT NULL AUTO_INCREMENT, +userid BIGINT(20) NOT NULL DEFAULT '0', +to_uid BIGINT(20) NOT NULL DEFAULT '0', +points BIGINT(20) NOT NULL DEFAULT '0', +reason VARCHAR(255) NOT NULL DEFAULT '', +time_trans VARCHAR(14) NOT NULL DEFAULT '0', +trans_id VARCHAR(12) NOT NULL DEFAULT '', KEY (userid), KEY (to_uid), PRIMARY KEY(id) ) Type=MyISAM"; // Admin menu - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('transfer', '', '{!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', 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)"; @@ -92,14 +92,14 @@ PRIMARY KEY(id) $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) not null default '50'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age bigint(20) not null default '".(ONE_DAY*28)."'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout bigint(20) not null default '".ONE_DAY."'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance bigint(20) not null default '100'"; - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code bigint(20) not null default '5'"; + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_max BIGINT(20) NOT NULL DEFAULT '50'"; + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) NOT NULL DEFAULT '".(ONE_DAY*28)."'"; + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) NOT NULL DEFAULT '".ONE_DAY."'"; + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance BIGINT(20) NOT NULL DEFAULT '100'"; + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code BIGINT(20) 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 @@ -145,7 +145,7 @@ case "update": // Update an extension break; case "0.0.5": // SQL queries for v0.0.5 - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_transfer enum('Y', 'N') not null default 'Y'"; + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD ap_transfer ENUM('Y', 'N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Link Auflisten im Admin-Bereich hatte das eingeloggte Mitglied und nicht den eingeloggten Admin abgefragt. Automatisches Löschen von veraltete Einträgen kann unabhängig von der autopurge-Erweiterung de-/aktiviert werden. Bitte aktualisieren Sie auch die beiden Admin-Templates!"; @@ -171,7 +171,7 @@ case "update": // Update an extension $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt."; break; - case "0.1.0": // SQL queries for v0.1.0 + case "0.1.0": // SQL queries for v0.2.1 // Update notes (these will be set as task text!) $UPDATE_NOTES = "Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist."; break; @@ -237,9 +237,9 @@ case "update": // Update an extension break; case "0.2.3": // SQL queries for v0.2.3 - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', '', 'list_transfer')"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', '', 'del_transfer')"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('config', '', 'config_transfer')"; + $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', NULL, 'list_transfer')"; + $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('member', NULL, 'del_transfer')"; + $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu_las (la_id, la_action, la_what) VALUES ('config', NULL, 'config_transfer')"; // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin $EXT_UPDATE_DEPENDS = "sql_patches"; @@ -283,25 +283,14 @@ case "update": // Update an extension break; default: // Do stuff when extension is loaded - $DUMMY = LOAD_CONFIG("0"); - // Maximum of listed transfers for out- and in-transfers - $CONFIG['transfer_max'] = $DUMMY['transfer_max']; - // Age in seconds - $CONFIG['transfer_age'] = $DUMMY['transfer_age']; - // Lock timeout for member settings - $CONFIG['transfer_timeout'] = $DUMMY['transfer_timeout']; - // Balance after points transfer - $CONFIG['transfer_balance'] = $DUMMY['transfer_balance']; - // Length of touring code - $CONFIG['transfer_code'] = $DUMMY['transfer_code']; - // Length of touring code - $CONFIG['ap_transfer'] = $DUMMY['ap_transfer']; - unset($DUMMY); - - if ((defined('__DAILY_RESET')) && ($CONFIG['ap_transfer'] == 'Y')) + $dummy = LOAD_CONFIG(); + $_CONFIG = merge_array($_CONFIG, $dummy); + unset($dummy); + + if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['ap_transfer'] == "Y")) { // Automatically remove outdated or not displayed transactions - TRANSFER_AUTPPURGE($CONFIG['transfer_max'], $CONFIG['transfer_age']); + TRANSFER_AUTPPURGE($_CONFIG['transfer_max'], $_CONFIG['transfer_age']); } break; } @@ -309,7 +298,7 @@ default: // Do stuff when extension is loaded $EXT_LANG_PREFIX = "transfer"; // Extension is always active? -$EXT_ALWAYS_ACTIVE = 'N'; +$EXT_ALWAYS_ACTIVE = "N"; // ?>