* -------------------------------------------------------------------- *
* Kurzbeschreibung : Sponsorenbereich *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $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 - 2008 by Roland Haeder *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
- * This program is free software. You can redistribute it and/or modify *
+ * 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 *
- * the Free Software Foundation; either version 2 of the License. *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
- require($INC);
+ die();
}
// Version number
-$EXT_VERSION = "0.0";
-
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+setThisExtensionVersion('0.0');
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0");
+// Version history array (add more with , '0.1.0' and so on)
+setExtensionVersionHistory(array('0.0'));
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
- //
- // SQL commands to run
- //
- //if (EXT_IS_ACTIVE("repair"))
- //{
+switch (getExtensionMode()) {
+ case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+ //
+ // SQL commands to run
+ //
// Try to make it depend on repair
- $EXT_UPDATE_DEPENDS = "repair";
+ addExtensionUpdateDependency('repair');
//
// Sponsor data
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_data";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_data (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-company VARCHAR(255) NOT NULL DEFAULT '',
-position VARCHAR(255) NOT NULL DEFAULT '',
-tax_ident VARCHAR(255) NOT NULL DEFAULT '',
-gender ENUM('M','F','C') NOT NULL DEFAULT 'M',
-surname VARCHAR(255) NOT NULL DEFAULT '',
-family VARCHAR(255) NOT NULL DEFAULT '',
-street_nr1 VARCHAR(255) NOT NULL DEFAULT '',
-street_nr2 VARCHAR(255) NOT NULL DEFAULT '',
-zip VARCHAR(6) NOT NULL DEFAULT '',
-city VARCHAR(255) NOT NULL DEFAULT '',
-country CHAR(2) NOT NULL DEFAULT 'DE',
-phone VARCHAR(255) NOT NULL DEFAULT '',
-fax VARCHAR(255) NOT NULL DEFAULT '',
-cell VARCHAR(255) NOT NULL DEFAULT '',
-email VARCHAR(255) NOT NULL DEFAULT '',
-url VARCHAR(255) NOT NULL DEFAULT '',
-password VARCHAR(255) NOT NULL DEFAULT '',
-remote_addr VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
-sponsor_created VARCHAR(10) NOT NULL DEFAULT 0,
-last_online VARCHAR(10) NOT NULL DEFAULT 0,
-last_change VARCHAR(10) NOT NULL DEFAULT 0,
-status ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
-receive_warnings ENUM('Y','N') NOT NULL DEFAULT 'Y',
-warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."',
-points_amount FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-points_used FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-ref_count BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-hash VARCHAR(32) NOT NULL DEFAULT '',
-last_pay FLOAT(7,2) UNSIGNED NOT NULL DEFAULT '0.00',
-last_curr VARCHAR(255) NOT NULL DEFAULT '€',
-KEY(refid),
-KEY(email),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_data` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`company` VARCHAR(255) NOT NULL DEFAULT '',
+`position` VARCHAR(255) NOT NULL DEFAULT '',
+`tax_ident` VARCHAR(255) NOT NULL DEFAULT '',
+`gender` ENUM('M','F','C') NOT NULL DEFAULT 'M',
+`surname` VARCHAR(255) NOT NULL DEFAULT '',
+`family` VARCHAR(255) NOT NULL DEFAULT '',
+`street_nr1` VARCHAR(255) NOT NULL DEFAULT '',
+`street_nr2` VARCHAR(255) NOT NULL DEFAULT '',
+`zip` VARCHAR(6) NOT NULL DEFAULT '',
+`city` VARCHAR(255) NOT NULL DEFAULT '',
+`country` CHAR(2) NOT NULL DEFAULT 'DE',
+`phone` VARCHAR(255) NOT NULL DEFAULT '',
+`fax` VARCHAR(255) NOT NULL DEFAULT '',
+`cell` VARCHAR(255) NOT NULL DEFAULT '',
+`email` VARCHAR(255) NOT NULL DEFAULT '',
+`url` VARCHAR(255) NOT NULL DEFAULT '',
+`password` VARCHAR(255) NOT NULL DEFAULT '',
+`remote_addr` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+`sponsor_created` VARCHAR(10) NOT NULL DEFAULT 0,
+`last_online` VARCHAR(10) NOT NULL DEFAULT 0,
+`last_change` VARCHAR(10) NOT NULL DEFAULT 0,
+`status` ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
+`receive_warnings` ENUM('Y','N') NOT NULL DEFAULT 'Y',
+`warning_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*7)."',
+`points_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`points_used` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`ref_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`hash` VARCHAR(32) NOT NULL DEFAULT '',
+`last_pay` FLOAT(7,2) UNSIGNED NOT NULL DEFAULT '0.00',
+`last_curr` VARCHAR(255) NOT NULL DEFAULT '€',
+INDEX (`refid`),
+INDEX (`email`),
+UNIQUE KEY (`hash`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Sponsor orders
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_orders";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_orders (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-regid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-payid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-pay_count BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-pay_status ENUM('PENDING','PAYED','UNPAYED','DELETED') NOT NULL DEFAULT 'PENDING',
-pay_ordered VARCHAR(10) NOT NULL DEFAULT 0,
-pay_done VARCHAR(10) NOT NULL DEFAULT 0,
-KEY (payid),
-KEY (regid),
-KEY (aid),
-KEY (sponsorid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_orders` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`regid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`payid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`pay_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`pay_status` ENUM('PENDING','PAYED','UNPAYED','DELETED') NOT NULL DEFAULT 'PENDING',
+`pay_ordered` VARCHAR(10) NOT NULL DEFAULT 0,
+`pay_done` VARCHAR(10) NOT NULL DEFAULT 0,
+INDEX (`payid`),
+INDEX (`regid`),
+INDEX (`admin_id`),
+INDEX (`sponsorid`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Pay-types
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_paytypes";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_paytypes (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-pay_name VARCHAR(255) NOT NULL DEFAULT '',
-pay_rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-pay_min_count BIGINT(20) UNSIGNED NOT NULL DEFAULT 1,
-pay_currency VARCHAR(255) NOT NULL DEFAULT '€',
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_paytypes` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`pay_name` VARCHAR(255) NOT NULL DEFAULT '',
+`pay_rate` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`pay_min_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1,
+`pay_currency` VARCHAR(255) NOT NULL DEFAULT '€',
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Points-to-action converting
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_action_convert";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_action_convert (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor',
-conv_rate BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-conv_name VARCHAR(255) NOT NULL DEFAULT 'Mails',
-KEY (ext_name),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_action_convert` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
+`conv_rate` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`conv_name` VARCHAR(255) NOT NULL DEFAULT 'Mails',
+INDEX (`ext_name`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Sponsor menu system (default)
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_menu";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_menu (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-action VARCHAR(255) NOT NULL DEFAULT '',
-what VARCHAR(255) NULL DEFAULT NULL,
-title VARCHAR(255) NOT NULL DEFAULT '',
-active ENUM('Y','N') NOT NULL DEFAULT 'N',
-sort BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-KEY(what),
-KEY(action),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_menu` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`action` VARCHAR(255) NOT NULL DEFAULT '',
+`what` VARCHAR(255) NULL DEFAULT NULL,
+`title` VARCHAR(255) NOT NULL DEFAULT '',
+`active` ENUM('Y','N') NOT NULL DEFAULT 'N',
+`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+INDEX (`action`),
+UNIQUE KEY `action_what` (`action`,`what`),
+UNIQUE KEY (`what`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Registry for performable actions by your sponsors
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_registry";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_registry (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor',
-is_active ENUM('Y','N') NOT NULL DEFAULT 'N',
-stamp_added VARCHAR(10) NOT NULL DEFAULT 0,
-KEY(ext_name),
-KEY(aid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_registry` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
+`is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
+`stamp_added` VARCHAR(10) NOT NULL DEFAULT 0,
+INDEX (`ext_name`),
+INDEX (`admin_id`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// URLs from the sponsors
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_urls";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_urls (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-url VARCHAR(255) NOT NULL DEFAULT 'http://',
-title VARCHAR(255) NOT NULL DEFAULT '',
-clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
-KEY(sponsorid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_urls` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url` VARCHAR(255) NOT NULL DEFAULT 'http://',
+`title` VARCHAR(255) NOT NULL DEFAULT '',
+`clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+INDEX (`sponsorid`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Banners of any size from the sponsors
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_banner";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_banner (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-url VARCHAR(255) NOT NULL DEFAULT 'http://',
-alternate VARCHAR(255) NOT NULL DEFAULT '',
-width INT(7) UNSIGNED NOT NULL DEFAULT 468,
-height INT(7) UNSIGNED NOT NULL DEFAULT 60,
-views BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
-KEY(sponsorid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_banner` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url` VARCHAR(255) NOT NULL DEFAULT 'http://',
+`alternate` VARCHAR(255) NOT NULL DEFAULT '',
+`width` INT(7) UNSIGNED NOT NULL DEFAULT 468,
+`height` INT(7) UNSIGNED NOT NULL DEFAULT 60,
+`views` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+INDEX (`sponsorid`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Campaigns
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaigns";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_campaigns (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-campaign_name VARCHAR(255) NOT NULL DEFAULT '',
-campaign_start VARCHAR(10) NOT NULL DEFAULT 0,
-campaign_end VARCHAR(10) NOT NULL DEFAULT 0,
-campaign_amount FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-campaign_expired ENUM('Y','N') NOT NULL DEFAULT 'N',
-campaign_locked ENUM('Y','N') NOT NULL DEFAULT 'Y',
-campaign_ended VARCHAR(10) NOT NULL DEFAULT 0,
-locked_reason TINYBLOB,
-locked_timestamp VARCHAR(10) NOT NULL DEFAULT 0,
-status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
-KEY(aid),
-KEY(sponsorid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaigns` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`campaign_name` VARCHAR(255) NOT NULL DEFAULT '',
+`campaign_start` VARCHAR(10) NOT NULL DEFAULT 0,
+`campaign_end` VARCHAR(10) NOT NULL DEFAULT 0,
+`campaign_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+`campaign_expired` ENUM('Y','N') NOT NULL DEFAULT 'N',
+`campaign_locked` ENUM('Y','N') NOT NULL DEFAULT 'Y',
+`campaign_ended` VARCHAR(10) NOT NULL DEFAULT 0,
+`locked_reason` TINYTEXT,
+`locked_timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
+`status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+INDEX (`admin_id`),
+INDEX (`sponsorid`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Campaigns + URLs + Banner
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaign_assigns";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_campaign_assigns (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-campaignid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-urlid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-bannerid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-views BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-KEY(bannerid),
-KEY(urlid),
-KEY(campaignid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`campaignid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`urlid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`bannerid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`views` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+INDEX (`bannerid`),
+INDEX (`urlid`),
+INDEX (`campaignid`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Allowed data to display (administrative)
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_admin_data";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_admin_data (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-data_row VARCHAR(255) NOT NULL DEFAULT '',
-display ENUM('Y','N') NOT NULL DEFAULT 'N',
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_admin_data` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`data_row` VARCHAR(255) NOT NULL DEFAULT '',
+`display` ENUM('Y','N') NOT NULL DEFAULT 'N',
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Allowed data to display (sponsor-side)
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_display_data";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_display_data (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-data_row VARCHAR(255) NOT NULL DEFAULT '',
-display ENUM('Y','N') NOT NULL DEFAULT 'N',
-KEY(sponsorid),
-PRIMARY KEY(id)
-)TYPE=MyISAM";
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_display_data` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`data_row` VARCHAR(255) NOT NULL DEFAULT '',
+`display` ENUM('Y','N') NOT NULL DEFAULT 'N',
+INDEX (`sponsorid`),
+PRIMARY KEY (`id`)
+)TYPE={?_TABLE_TYPE?}");
//
// Default allowed data to display
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('id','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('company','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('position','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('tax_ident','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('gender','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('surname','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('family','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('street_nr1','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('street_nr2','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('zip','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('city','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('country','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('phone','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('fax','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('email','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('url','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('password','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('remote_addr','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('sponsor_created','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_online','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_change','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('status','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('receive_warnings','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('warning_interval','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('points_amount','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('points_used','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('refid','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('ref_count','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('hash','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_pay','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_curr','N')";
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('id','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('company','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('position','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('tax_ident','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('gender','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('surname','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('family','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('street_nr1','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('street_nr2','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('zip','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('city','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('country','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('phone','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('fax','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('email','Y')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('url','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('password','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('remote_addr','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('sponsor_created','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('last_online','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('last_change','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('status','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('receive_warnings','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('warning_interval','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('points_amount','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('points_used','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('refid','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('ref_count','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('hash','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('last_pay','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('last_curr','N')");
//
// Add default entries
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_registry (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N','".GET_ADMIN_ID(get_session('admin_login'))."','UNIX_TIMESTAMP()')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_action_convert (ext_name, conv_rate, conv_name) VALUES ('sponsor','10','Mails')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '€')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '€')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Power-Paket', 10, 2000.00000, '€')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Sponsor-Paket', 20, 4000.00000, '€')";
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_registry` (`ext_name`, `is_active`, `admin_id`, `stamp_added`) VALUES ('sponsor','N',".getCurrentAdminId().",UNIX_TIMESTAMP())");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_action_convert` (`ext_name`, `conv_rate`, `conv_name`) VALUES ('sponsor','10','Mails')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`,`pay_min_count`,`pay_rate`,`pay_currency`) VALUES ('Standart-Paket', 5, 1000.00000, '€')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`,`pay_min_count`,`pay_rate`,`pay_currency`) VALUES ('Spar-Paket', 1, 200.00000, '€')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`,`pay_min_count`,`pay_rate`,`pay_currency`) VALUES ('Power-Paket', 10, 2000.00000, '€')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`,`pay_min_count`,`pay_rate`,`pay_currency`) VALUES ('Sponsor-Paket', 20, 4000.00000, '€')");
//
// Admin menu
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor', NULL, 'Sponsorenbereich','Den Sponsorenbereich verwalten. Hier können Sie auch Sonderaktionen seperat deakvieren oder wieder aktivieren, Sponsorenaccounts verwalten usw.', 7)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','add_sponsor','Neuer Sponsor','Neues Sponsorenaccount hinzufügen.', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','unlock_sponsor','Sponsor freischalten','Sponsorenaccounts freigeben / sperren.', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor','Sponsoren auflisten','Listet alle verfügbaren Sponsorenaccounts auf.', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','edit_sponsor','Sponsor ändern','Sponsorenaccount ändern (Grundaten, nicht Freigabe!).', 4)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','lock_sponsor','Sponsor ent-/sperren','Sponsorenaccount sperren und entsperren.', 5)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','del_sponsor','Sponsor löschen','Sponsorenaccount löschen.', 6)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich über sicht anzeigen darf und welche nicht.', 7)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 8)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_menu','Sponsorenmenü','Das Sponsorenmenü kann hier geändert werden.', 9)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_campaigns','Kampagnen...','Verwaltung aller von Ihren Sponsoren eingerichteten Kampagnen.', 10)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_urls','URL-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_banner','Banner-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten Bannern.', 12)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_reg','Sponsor-Aktionen','Alle Sponsor-Aktionen auflisten und verwalten.', 13)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pay','Buchungspakete','Die Sponsoren können sich {!POINTS!}-Pakete kaufen. Hier können Sie diese verwalten.', 14)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_conv','{!POINTS!} umwandeln...','Mit den vom Sponsor gekauften {!POINTS!} kann er Aktionen buchen. Hier stellen Sie die Umrechnungsrate von {!POINTS!} nach Sponsoraktionen um. Beispiel: 1 {!POINTS!} = 10 Mails.', 15)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','config_sponsor','Einstellungen','Allgemeine Einstellungen am Sponsoring-System.', 16)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('repair','repr_sponsor','Sponsormenü','Gewichtung des Sponsormenüs reparieren.', 5)";
+ addAdminMenuSql('sponsor', NULL, 'Sponsorenbereich','Den Sponsorenbereich verwalten. Hier können Sie auch Sonderaktionen seperat deakvieren oder wieder aktivieren, Sponsorenaccounts verwalten usw.', 7);
+ addAdminMenuSql('sponsor','add_sponsor','Neuer Sponsor','Neues Sponsorenaccount hinzufügen.', 1);
+ addAdminMenuSql('sponsor','unlock_sponsor','Sponsor freischalten','Sponsorenaccounts freigeben / sperren.', 2);
+ addAdminMenuSql('sponsor','list_sponsor','Sponsoren auflisten','Listet alle verfügbaren Sponsorenaccounts auf.', 3);
+ addAdminMenuSql('sponsor','edit_sponsor','Sponsor ändern','Sponsorenaccount ändern (Grundaten, nicht Freigabe!).', 4);
+ addAdminMenuSql('sponsor','lock_sponsor','Sponsor ent-/sperren','Sponsorenaccount sperren und entsperren.', 5);
+ addAdminMenuSql('sponsor','del_sponsor','Sponsor löschen','Sponsorenaccount löschen.', 6);
+ addAdminMenuSql('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich über sicht anzeigen darf und welche nicht.', 7);
+ addAdminMenuSql('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 8);
+ addAdminMenuSql('sponsor','list_sponsor_menu','Sponsorenmenü','Das Sponsorenmenü kann hier geändert werden.', 9);
+ addAdminMenuSql('sponsor','list_sponsor_campaigns','Kampagnen...','Verwaltung aller von Ihren Sponsoren eingerichteten Kampagnen.', 10);
+ addAdminMenuSql('sponsor','list_sponsor_urls','URL-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11);
+ addAdminMenuSql('sponsor','list_sponsor_banner','Banner-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten Bannern.', 12);
+ addAdminMenuSql('sponsor','list_sponsor_reg','Sponsor-Aktionen','Alle Sponsor-Aktionen auflisten und verwalten.', 13);
+ addAdminMenuSql('sponsor','list_sponsor_pay','Buchungspakete','Die Sponsoren können sich {OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Pakete kaufen. Hier können Sie diese verwalten.', 14);
+ addAdminMenuSql('sponsor','list_sponsor_conv','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} umwandeln...','Mit den vom Sponsor gekauften {OPEN_CONFIG}POINTS{CLOSE_CONFIG} kann er Aktionen buchen. Hier stellen Sie die Umrechnungsrate von {OPEN_CONFIG}POINTS{CLOSE_CONFIG} nach Sponsoraktionen um. Beispiel: 1 {OPEN_CONFIG}POINTS{CLOSE_CONFIG} = 10 Mails.', 15);
+ addAdminMenuSql('sponsor','config_sponsor','Einstellungen','Allgemeine Einstellungen am Sponsoring-System.', 16);
+ addAdminMenuSql('repair','repr_sponsor','Sponsormenü','Gewichtung des Sponsormenüs reparieren.', 5);
//
// Menu system (still admin menu)
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_medit','Sponsor-Menü editieren','Hier können Sie das Sponsorenmenü verändern: Positionen verändern, Menütitel ändern usw.', 7)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_madd','Sponsor-Menü hinzufügen','Hier können Sie einen neuen Menüpunkt hinzufügen (falls Sie z.B. eigene Sponsoraktionen entwickelt haben oder welche versehendlich gelöscht haben.', 8)";
+ addAdminMenuSql('menu','sponsor_medit','Sponsor-Menü editieren','Hier können Sie das Sponsorenmenü verändern: Positionen verändern, Menütitel ändern usw.', 7);
+ addAdminMenuSql('menu','sponsor_madd','Sponsor-Menü hinzufügen','Hier können Sie einen neuen Menüpunkt hinzufügen (falls Sie z.B. eigene Sponsoraktionen entwickelt haben oder welche versehendlich gelöscht haben.', 8);
//
// Guest menu
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor', NULL, 'Sponsoren', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_login','Einloggen', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, sort) VALUES ('sponsor','sponsor_agb','AGBs', 4)";
+ addGuestMenuSql('sponsor', NULL, 'Sponsoren','N','Y', 2);
+ addGuestMenuSql('sponsor','sponsor_reg','Anmeldung','N','Y', 1);
+ addGuestMenuSql('sponsor','sponsor_login','Einloggen','N','Y', 2);
+ addGuestMenuSql('sponsor','sponsor_infos','Infos/Preise','N','Y', 3);
+ addGuestMenuSql('sponsor','sponsor_agb','AGBs','N','Y', 4);
//
// Member menu
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort) VALUES ('main','sponsor','Unsere Sponsoren', 8)";
+ addMemberMenuSql('main','sponsor','Unsere Sponsoren','N','Y',8);
//
// Add default menus to sponsor menu
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main', NULL, 'Hauptauswahl','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','welcome','Willkommen','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','account','Ihr Account','N', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','campaigns','Kampagnen','N', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','urls','URL-Verwaltung','N', 4)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','banner','Banner-Verwaltung','N', 5)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','settings','Einstellungen','N', 6)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','fillup','Konto auffüllen','N', 7)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','stats','Statistiken','N', 8)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','inquiry','Kontaktanfrage','N', 9)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','refid','Referal-Link','N', 10)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions','mail','Sponsor-Mail','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions','banner','Banner buchen','N', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions','text','Textlink buchen','N', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('logout', NULL, 'Ausloggen','N', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('logout','logout','Ausloggen','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('logout','guest','Zum Gastbereich','N', 2)";
+ addSponsorMenuSql('main', NULL, 'Hauptauswahl','N', 1);
+ addSponsorMenuSql('main','welcome','Willkommen','N', 1);
+ addSponsorMenuSql('main','account','Ihr Account','N', 2);
+ addSponsorMenuSql('main','campaigns','Kampagnen','N', 3);
+ addSponsorMenuSql('main','list_urls','URL-Verwaltung','N', 4);
+ addSponsorMenuSql('main','list_banner','Banner-Verwaltung','N', 5);
+ addSponsorMenuSql('main','settings','Einstellungen','N', 6);
+ addSponsorMenuSql('main','fillup','Konto auffüllen','N', 7);
+ addSponsorMenuSql('main','stats','Statistiken','N', 8);
+ addSponsorMenuSql('main','inquiry','Kontaktanfrage','N', 9);
+ addSponsorMenuSql('main','refid','Referal-Link','N', 10);
+ addSponsorMenuSql('actions', NULL, 'Sponsorenaktionen','N', 2);
+ addSponsorMenuSql('actions','mail','Sponsor-Mail','N', 1);
+ addSponsorMenuSql('actions','banner','Banner buchen','N', 2);
+ addSponsorMenuSql('actions','text','Textlink buchen','N', 3);
+ addSponsorMenuSql('logout', NULL, 'Ausloggen','N', 3);
+ addSponsorMenuSql('logout','logout','Ausloggen','N', 1);
+ addSponsorMenuSql('logout','guest','Zum Gastbereich','N', 2);
//
// General configuration stuff
//
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD sponsor_ref_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD sponsor_min_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1000.00000";
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `sponsor_ref_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `sponsor_min_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1000.00000");
+ break;
+
+ case 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`");
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd')");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='sponsor'");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='sponsor'");
+ break;
- // Load CSS file
- $EXT_CSS = "Y";
- //}
- // else
- //{
- // // Sponsor extension depends now on repair extension!
- // $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='sponsor' LIMIT 1";
- //}
- break;
+ case 'activate': // Do stuff when admin activates this extension
+ // SQL commands to run
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `action`='sponsor' LIMIT 4");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='sponsor' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_sponsor_menu` SET active='Y' WHERE active='N'");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_sponsor_registry` SET is_active='Y' WHERE is_active='N'");
+ break;
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_data";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_orders";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_action_convert";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_paytypes";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_menu";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_registry";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_urls";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_banner";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaigns";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaign_assigns";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_admin_data";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_display_data";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE action='sponsor' LIMIT 5";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='sponsor' LIMIT 1";
- break;
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `action`='sponsor' LIMIT 4");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='sponsor' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_sponsor_menu` SET active='N' WHERE active='Y'");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_sponsor_registry` SET is_active='N' WHERE is_active='Y'");
+ break;
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE action='sponsor' LIMIT 4";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='sponsor' LIMIT 1";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_menu SET active='Y' WHERE active='N'";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_registry SET is_active='Y' WHERE is_active='N'";
- break;
+ case 'update': // Update an extension
+ switch (getCurrentExtensionVersion()) {
+ case '0.0.1': // SQL queries for v0.0.1
+ addExtensionSql('');
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='N', locked='Y' WHERE action='sponsor' LIMIT 4";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='sponsor' LIMIT 1";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_menu SET active='N' WHERE active='Y'";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_registry SET is_active='N' WHERE is_active='Y'";
- break;
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes('');
+ break;
+ }
+ break;
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.1": // SQL queries for v0.0.1
- $SQLs[] = "";
+ case 'modify': // When the extension got modified
+ break;
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "";
+ case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
break;
- }
- break;
-default: // Do stuff when extension is loaded
- break;
+ case 'init': // Do stuff when extension is initialized
+ break;
+
+ default: // Unknown extension mode
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+ break;
}
-//
+// [EOF]
?>