X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-yoomedia.php;h=f2e9be2ef8a1f657f9321709e30c7db25f8b9c6b;hb=5150d830f669eaf05b1c57354dafe124ae35c8b5;hp=f406c3522d48e31283067067148ec6cd5888c28c;hpb=a846d847b39b17912f5255eb448402707a328682;p=mailer.git diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index f406c3522d..f2e9be2ef8 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -15,12 +15,10 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -44,10 +42,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0'); +setThisExtensionVersion('0.0.0'); -// Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0')); +// Version history array (add more with , '0.0.1' and so on) +setExtensionVersionHistory(array('0.0.0')); // Keep this extension always active! setExtensionAlwaysActive('Y'); @@ -56,40 +54,40 @@ setExtensionAlwaysActive('Y'); // @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'setup': // Do stuff when installation is running // SQL commands to run - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_sid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_passwd` VARCHAR(255) NOT NULL DEFAULT ''"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_erotic_allowed` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_tm_max_reload` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(24 * 8).""); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_tm_min_wait` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_tm_clicks_remain` INT(7) UNSIGNED NOT NULL DEFAULT 1000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_tm_min_pay` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_requests_total` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `yoomedia_requests_remain` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200"); + addConfigAddSql('yoomedia_id', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); + addConfigAddSql('yoomedia_sid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); + addConfigAddSql('yoomedia_passwd', "VARCHAR(255) NOT NULL DEFAULT ''"); + addConfigAddSql('yoomedia_erotic_allowed', 'TINYINT(2) UNSIGNED NOT NULL DEFAULT 0' ) ; + addConfigAddSql('yoomedia_tm_max_reload', 'SMALLINT(6) UNSIGNED NOT NULL DEFAULT ' . (24 * 8)); + addConfigAddSql('yoomedia_tm_min_wait', 'SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60'); + addConfigAddSql('yoomedia_tm_clicks_remain', 'INT(7) UNSIGNED NOT NULL DEFAULT 1000'); + addConfigAddSql('yoomedia_tm_min_pay', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000'); + addConfigAddSql('yoomedia_requests_total', 'SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200'); + addConfigAddSql('yoomedia_requests_remain', 'SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200'); // Admin menu - 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); + 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 - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`"); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_yoomedia_reload` ( + addDropTableSql('yoomedia_reload'); + addCreateTableSql('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, `y_reload` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0, `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'"); +UNIQUE INDEX `y_type` (`type`, `y_id`)", + 'Reload lock reminder for Yoo!Media campaigns'); break; case 'remove': // Do stuff when removing extension // SQL commands to run 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`"); + addDropTableSql('yoomedia_reload'); break; case 'activate': // Do stuff when admin activates this extension @@ -101,21 +99,20 @@ UNIQUE `y_type` (`type`,`y_id`) break; case 'update': // Update an extension - switch (getCurrentExtensionVersion()) - { + switch (getCurrentExtensionVersion()) { case '0.0.1': // SQL queries for v0.0.1 addExtensionSql(''); // Update notes (these will be set as task text!) setExtensionUpdateNotes(''); break; - } + } // END - switch 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. + case 'test': // For testing purposes break; case 'init': // Do stuff when extension is initialized @@ -148,9 +145,9 @@ UNIQUE `y_type` (`type`,`y_id`) break; default: // Unknown extension mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); + reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch // [EOF] ?>