X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-newsletter.php;h=fc184a9be15f434f00ebd3a07f23305a42e65769;hb=5a95f6a1e45504f8bea3b2ffceacc167d5f45bbb;hp=9a65082a830377ff7d488e48d0e6b21c2c7b8749;hpb=1ebf518b9552f71ee95de6f4b80e6de3a27716d1;p=mailer.git diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 9a65082a83..fc184a9be1 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -75,10 +75,10 @@ switch (getExtensionMode()) { case 'update': // Update an extension switch (getCurrentExtensionVersion()) { case '0.0.1': // SQL queries for v0.0.1 - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, usw.', 3)"); - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','config_newsletter','Einstellungen','Einstellungen am Newsletter vornehmen.', 3)"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `action`='newsletter', `what`='send_newsletter', `title`='Versenden', `sort`='1' WHERE `what`='newsletter' LIMIT 1"); - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','newsletter','Newsletter-Empfang','N','Y', 10)"); + addAdminMenuSql('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, usw.', 3); + addAdminMenuSql('newsletter','config_newsletter','Einstellungen','Einstellungen am Newsletter vornehmen.', 3); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='newsletter' LIMIT 1"); + addMemberMenuSql('main','newsletter','Newsletter-Empfang','N','Y', 10); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `nl_receive` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Update notes (these will be set as task text!) @@ -145,7 +145,7 @@ switch (getExtensionMode()) { // - Main data table addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_data`"); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_data` ( -`nl_id` BIGINT(20) NOT NULL AUTO_INCREMENT, +`nl_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `nl_subject` VARCHAR(255) NOT NULL DEFAULT '{OPEN_CONFIG}nl_default_subject{CLOSE_CONFIG}', `nl_header_text` MEDIUMTEXT, `nl_footer_text` MEDIUMTEXT, @@ -155,17 +155,17 @@ switch (getExtensionMode()) { `nl_sent` ENUM('Y','N') NOT NULL DEFAULT 'N', `nl_expired` ENUM('Y','N') NOT NULL DEFAULT 'N', `nl_do_archive` ENUM('Y','N') NOT NULL DEFAULT 'Y', -`nl_recipients` BIGINT(20) NOT NULL DEFAULT 0, -`nl_received` BIGINT(20) NOT NULL DEFAULT 0, -`nl_total_clicks` BIGINT(20) NOT NULL DEFAULT 0, +`nl_recipients` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`nl_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`nl_total_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`nl_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='General newsletter data'"); // - Topics data table addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_topics`"); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_topics` ( -`nl_topic_id` BIGINT(20) NOT NULL AUTO_INCREMENT, -`nl_id` BIGINT(20) NOT NULL DEFAULT '0', +`nl_topic_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `nl_topic_title` VARCHAR(255) NOT NULL DEFAULT '', `nl_topic_text` MEDIUMTEXT, INDEX `newsletter_id` (`nl_id`), @@ -175,10 +175,10 @@ PRIMARY KEY (`nl_topic_id`) // - Sponsor orders data table addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_newsletter_orders`"); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_newsletter_orders` ( -`nl_order_id` BIGINT(20) NOT NULL AUTO_INCREMENT, -`nl_sponsor_id` BIGINT(20) NOT NULL DEFAULT 0, -`nl_id` BIGINT(20) NOT NULL DEFAULT 0, -`nl_topic_id` BIGINT(20) NOT NULL DEFAULT 0, +`nl_order_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`nl_sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`nl_topic_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `nl_order_placed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `nl_order_accepted` ENUM('Y','N') NOT NULL DEFAULT 'N', UNIQUE KEY `sponsor_nl_topic` (`nl_sponsor_id`,`nl_id`,`nl_topic_id`), @@ -187,15 +187,15 @@ PRIMARY KEY (`nl_order_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Newsletter orders'"); // Configuration - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_expire` BIGINT(20) NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 7).""); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive_expire` BIGINT(20) NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 14).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_expire` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 7).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive_expire` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 14).""); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_default_subject` VARCHAR(255) NOT NULL DEFAULT 'Newsletter vom {OPEN_CONFIG}CURRENT_DATE{CLOSE_CONFIG}'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_default_header` MEDIUMTEXT"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_default_footer` MEDIUMTEXT"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Admin menu - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', 'add_newsletter','Neuen erstellen','Legen Sie hier einen neuen Newsletter mit Betreff und Verfallsdatum an.', 1)"); + addAdminMenuSql('newsletter', 'add_newsletter','Neuen erstellen','Legen Sie hier einen neuen Newsletter mit Betreff und Verfallsdatum an.', 1); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Komplettüberarbeitung der Erweiterung, siehe neuer Beschreibungstext."); @@ -224,8 +224,8 @@ PRIMARY KEY (`nl_order_id`) $GLOBALS['valid_email_chars'] = array( 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s', 't','u','v','w','x','y','z','a','B','C','D','E','F','G','H','I','J','K','L', - 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_','0','1', - '2','3','4','5','6','7','8','9' + 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.','_',0,1, + 2,3,4,5,6,7,8,9 ); break;