-$EXT_VERSION = "0.2.9";
-
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
-
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "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");
-
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installtion 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";
-
- // 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 '',
-KEY (userid),
-KEY (from_uid),
-PRIMARY KEY(id)
-) Type=MyISAM";
-
- // 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 '',
-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', '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)";
-
- // 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'";
-
- // Add row(s) to user's data
- $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."_config DROP transfer_max";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_age";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_timeout";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_balance";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_code";
- $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";
- 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";
- break;
-
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.2": // SQL queries for v0.0.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehler <FONT class=\"admin_failed\">Warning: Missing argument 2 for create_timestamp_from_selections() in ".PATH."inc/libs/pro_functions.php on line 227</FONT> behoben.";
- break;
-
- case "0.0.3": // SQL queries for v0.0.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Überflüssige unset()-Anweisungen aus der what-config_transfer.php entfernt. Dies wird bereits von der eigenen Funktion ADMIN_SAVE_SETTINGS() erledigt.";
- break;
-
- case "0.0.3": // SQL queries for v0.0.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
- 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'";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Link <I>Auflisten</LI> 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!";
- break;
-
- case "0.0.6": // SQL queries for v0.0.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.";
- break;
-
- case "0.0.7": // SQL queries for v0.0.7
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
- break;
-
- case "0.0.8": // SQL queries for v0.0.8
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Problem mit E in Transaktionsnummer beseitigt.";
- break;