<?php
/************************************************************************
- * MXChange v0.2.1 Start: 03/22/2004 *
- * =============== Last change: 06/28/2004 *
+ * Mailer v0.2.1-FINAL Start: 03/22/2004 *
+ * =================== Last change: 06/28/2004 *
* *
* -------------------------------------------------------------------- *
* File : ext-sponsor.php *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Sponsorenbereich *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
* 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();
+} // END - if
// Version number
-$EXT_VERSION = "0.0";
+setThisExtensionVersion('0.0.0');
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0'));
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0");
+// This extension is in development (non-productive)
+enableExtensionProductive(false);
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installtion 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
+ //
+ // SQL commands to run
+ //
// Try to make it depend on repair
- $EXT_UPDATE_DEPENDS = "repair";
+ addExtensionDependency('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 DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
-points_used DOUBLE(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";
+ addDropTableSql('sponsor_data');
+ addCreateTableSql('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` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`last_online` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`last_change` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`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 '".(getOneDay()*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) NULL DEFAULT NULL,
+`last_payment` FLOAT(7,2) UNSIGNED NOT NULL DEFAULT 0.00,
+`last_currency` VARCHAR(255) NOT NULL DEFAULT '€',
+PRIMARY KEY (`id`),
+UNIQUE (`hash`),
+INDEX (`refid`),
+INDEX (`email`)",
+ 'Main sponsor data');
//
// 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";
+ addDropTableSql('sponsor_orders');
+ addCreateTableSql('sponsor_orders', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`regid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`payment_id` 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` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`pay_done` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+PRIMARY KEY (`id`),
+INDEX (`payment_id`),
+INDEX (`regid`),
+INDEX (`admin_id`),
+INDEX (`sponsor_id`)",
+ 'Sponsor orders table');
//
// 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 DOUBLE(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";
+ addDropTableSql('sponsor_paytypes');
+ addCreateTableSql('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`)",
+ 'Sponsor payment types');
//
// 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";
+ addDropTableSql('sponsor_action_convert');
+ addCreateTableSql('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',
+PRIMARY KEY (`id`),
+INDEX (`ext_name`)",
+ 'Points to action convertion data');
//
// 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) NOT NULL DEFAULT '',
-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";
+ addDropTableSql('sponsor_menu');
+ addCreateTableSql('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,
+PRIMARY KEY (`id`)
+UNIQUE `action_what` (`action`, `what`),
+UNIQUE (`what`),
+INDEX (`action`)",
+ 'Sponsor menu');
//
// 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";
+ addDropTableSql('sponsor_registry');
+ addCreateTableSql('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` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`ext_name`),
+INDEX (`admin_id`)",
+ 'Sponsor action registry');
//
// 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";
+ addDropTableSql('sponsor_urls');
+ addCreateTableSql('sponsor_urls', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsor_id` 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',
+PRIMARY KEY (`id`),
+INDEX (`sponsor_id`)",
+ 'URLs from all sponsors');
//
// 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) NOT NULL DEFAULT '468',
-height INT(7) 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";
+ addDropTableSql('sponsor_banner');
+ addCreateTableSql('sponsor_banner', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsor_id` 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',
+PRIMARY KEY (`id`),
+INDEX (`sponsor_id`)",
+ 'Banners from all sponsors');
//
// 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 DOUBLE(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";
+ addDropTableSql('sponsor_campaigns');
+ addCreateTableSql('sponsor_campaigns', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`campaign_name` VARCHAR(255) NOT NULL DEFAULT '',
+`campaign_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`campaign_start` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`campaign_end` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`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` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`locked_reason` TINYTEXT,
+`locked_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
+PRIMARY KEY (`id`),
+INDEX (`admin_id`),
+INDEX (`sponsor_id`)",
+ 'Sponsor campaigns');
//
// 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";
+ addDropTableSql('sponsor_campaign_assigns');
+ addCreateTableSql('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,
+PRIMARY KEY (`id`),
+INDEX (`bannerid`),
+INDEX (`urlid`),
+INDEX (`campaignid`)",
+ 'Campaign+Banner+URL connection data');
//
// 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";
+ addDropTableSql('sponsor_admin_data');
+ addCreateTableSql('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`)",
+ 'Allowed data to display to the admin');
//
// 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";
+ addDropTableSql('sponsor_display_data');
+ addCreateTableSql('sponsor_display_data', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`data_row` VARCHAR(255) NOT NULL DEFAULT '',
+`display` ENUM('Y','N') NOT NULL DEFAULT 'N',
+PRIMARY KEY (`id`),
+INDEX (`sponsor_id`)",
+ 'Data sponsors allowed to see');
//
// 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_payment','N')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_admin_data` (`data_row`, `display`) VALUES ('last_currency','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().",NOW())");
+ 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 ('Standard-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','sponsor_contct','Sponsor kontaktieren','Kontaktieren Sie Sponsoren komfortabel über dieses {?TITLE?}.', 7);
+ addAdminMenuSql('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich über sicht anzeigen darf und welche nicht.', 8);
+ addAdminMenuSql('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 9);
+ addAdminMenuSql('sponsor','list_sponsor_campaigns','Kampagnen...','Management aller von Ihren Sponsoren eingerichteten Kampagnen.', 10);
+ addAdminMenuSql('sponsor','list_sponsor_urls','URL-Management','Management (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11);
+ addAdminMenuSql('sponsor','list_sponsor_banner','Banner-Management','Management (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', 2);
+ addGuestMenuSql('sponsor', 'sponsor_reg', 'Anmeldung', 1);
+ addGuestMenuSql('sponsor', 'sponsor_login', 'Einloggen', 2);
+ addGuestMenuSql('sponsor', 'sponsor_infos', 'Infos/Preise', 3);
+ addGuestMenuSql('sponsor', 'sponsor_agb', 'AGBs', 4);
//
// Member menu
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort) VALUES ('main','sponsor','Unsere Sponsoren', 8)";
+ addMemberMenuSql('main', 'sponsor_list', 'Unsere Sponsoren', 8);
+ addMemberMenuSql('main', 'sponsor_reg', 'Sponsor werden', 9);
//
// 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','Referral-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-Management', 'N', 4);
+ addSponsorMenuSql('main', 'list_banner', 'Banner-Management', '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 DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '100.00000'";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD sponsor_min_points DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '1000.00000'";
+ addConfigAddSql('sponsor_ref_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000');
+ addConfigAddSql('sponsor_min_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1000.00000');
+ //
+ // Register module
+ //
+ addModuleSql('sponsor', 'Y', 'Y', 'N', 'N');
+ addModuleSql('sponsor_confirm', 'Y', 'Y', 'N', 'N');
+ addModuleSql('sponsor_ref', 'Y', 'Y', 'N', 'N');
- // 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;
+ // Update name, if not yet set
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Sponsorbereich' WHERE `module`='sponsor' AND `title`='' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Sponsor-Bestätigung' WHERE `module`='sponsor_confirm' AND `title`='' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Sponsor-Referallink' WHERE `module`='sponsor_ref' AND `title`='' LIMIT 1");
+ 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 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ addDropTableSql('sponsor_data');
+ addDropTableSql('sponsor_orders');
+ addDropTableSql('sponsor_action_convert');
+ addDropTableSql('sponsor_paytypes');
+ addDropTableSql('sponsor_menu');
+ addDropTableSql('sponsor_registry');
+ addDropTableSql('sponsor_urls');
+ addDropTableSql('sponsor_banner');
+ addDropTableSql('sponsor_campaigns');
+ addDropTableSql('sponsor_campaign_assigns');
+ addDropTableSql('sponsor_admin_data');
+ addDropTableSql('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` IN('sponsor_list','sponsor_reg')");
+ 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 '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'");
+ 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'");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `admin_only`='N', `mem_only`='N' WHERE `module` IN ('sponsor','sponsor_confirm','sponsor_ref') LIMIT 3");
+ break;
-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;
+ 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'");
+ 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'");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='Y' WHERE `module` IN ('sponsor','sponsor_confirm','sponsor_ref') LIMIT 3");
+ break;
+
+ case 'update': // Update an extension
+ switch (getCurrentExtensionVersion()) {
+ case '0.0.1': // SQL queries for v0.0.1
+ addExtensionSql('');
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.1": // SQL queries for v0.0.1
- $SQLs[] = "";
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes('');
+ break;
+ } // END - switch
+ break;
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "";
+ case 'modify': // When the extension got modified
break;
- }
- break;
-default: // Do stuff when extension is loaded
- break;
-}
+ case 'test': // For testing purposes
+ break;
-// Language file prefix
-$EXT_LANG_PREFIX = "sponsor";
+ case 'init': // Do stuff when extension is initialized
+ break;
+
+ default: // Unknown extension mode
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+ break;
+} // END - switch
-//
+// [EOF]
?>