X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-yoomedia.php;h=d2a3217457a709514ba3e0789422f666c3358e4a;hp=48c9832afa85f5b8ff480a01bf47571ceab4f34b;hb=5d89789720c77e954b2eba28c00ec710dd28900d;hpb=1dd584090ba559372adb525fba74f46262c7308c diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 48c9832afa..d2a3217457 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -1,7 +1,7 @@ Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10)"); + addAdminMenuSql('setup','config_yoomedia','Yoo!Media Interface 2.0','Einstellungen zum Yoo!Media Interface 2.0, wie Affiliate-Id, Interface-Passwort und vieles mehr.',17); + addAdminMenuSql('email','list_yoomedia_tm','Yoo!Media Textmails','Listet Textmail-Buchungen über das Interface 2.0 von Yoo!Media nach Ihren eingestellten Kriterien auf. Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10); // Reload lock table - ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_yoomedia_reload`"); - ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_yoomedia_reload` ( + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`'); + addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_yoomedia_reload` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `type` VARCHAR(255) NOT NULL DEFAULT 'general', `y_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -81,13 +81,13 @@ switch ($EXT_LOAD_MODE) `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE `y_type` (`type`,`y_id`) -) TYPE={!_TABLE_TYPE!} COMMENT='Reload lock reminder for Yoo!Media campaigns'"); +) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Reload lock reminder for Yoo!Media campaigns'"); break; case 'remove': // Do stuff when removing extension // SQL commands to run - ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')"); - ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_yoomedia_reload`"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`'); break; case 'activate': // Do stuff when admin activates this extension @@ -99,38 +99,41 @@ UNIQUE `y_type` (`type`,`y_id`) break; case 'update': // Update an extension - switch ($EXT_VER) + switch (getCurrentExtensionVersion()) { case '0.0.1': // SQL queries for v0.0.1 - ADD_EXT_SQL(''); + addExtensionSql(''); // Update notes (these will be set as task text!) - EXT_SET_UPDATE_NOTES(''); + setExtensionUpdateNotes(''); break; } break; - case 'modify': // When the extension got modified - break; + 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. - break; + 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 - // The translation table - $GLOBALS['translation_tables']['yoomedia'] = array( - // Error messages - 'error_codes' => array( - 1 => 'wrong_pass', - 2 => 'wrong_sid', - 3 => 'website_locked', - 4 => 'api_data_error', - 5 => 'requests_depleted', - 6 => 'zero_result', - 10 => 'incomplete_request' - ), - // For text mails - 'textmail' => array( + case 'init': // Do stuff when extension is initialized + // The translation table + // @TODO Can this be moved into a database table? + $GLOBALS['translation_tables']['yoomedia'] = array( + // Error messages + 'error_codes' => array( + -999 => 'unknown_error', + 1 => 'wrong_pass', + 2 => 'wrong_sid', + 3 => 'website_locked', + 4 => 'api_data_error', + 5 => 'requests_depleted', + 6 => 'zero_result', + 7 => 'no_campaigns_with_interface', + 10 => 'incomplete_request' + ), + // For text mails + 'textmail' => array( 0 => 'id', 1 => 'name', 2 => 'reload', @@ -138,13 +141,14 @@ UNIQUE `y_type` (`type`,`y_id`) 4 => 'remain', 5 => 'pay', 6 => 'text' - ) - ); - break; -} + ) + ); + break; -// Keep this extension always active! -EXT_SET_ALWAYS_ACTIVE('Y'); + default: // Unknown extension mode + logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); + break; +} -// +// [EOF] ?>