]> git.mxchange.org Git - mailer.git/blob - inc/extensions/ext-network.php
TODOs.txt updated, notice in README.txt updated which GNU GPL version (2) we are...
[mailer.git] / inc / extensions / ext-network.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 12/18/2008 *
4  * ===================                          Last change: 11/01/2009 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-network.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Generic (sponsor) network connection extension   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Allgemeine Werbenetzwerk-Erweiterung             *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * @TODO Ad-Magnet: Layer(klick?). Layerviews.Skybannerklick/-view,     *
21  * @TODO Ad-Magnet: Banner-View, Textlink-Klick/-View. Page-Peel        *
22  * @TODO ADCocktail: Traffic, BIDausKAS???                              *
23  * @TODO Ads4.de: Traffic                                               *
24  * @TODO Ads4Webbis: Traffic                                            *
25  * @TODO Ads4World: Traffic                                             *
26  * -------------------------------------------------------------------- *
27  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
28  * For more information visit: http://www.mxchange.org                  *
29  *                                                                      *
30  * This program is free software; you can redistribute it and/or modify *
31  * it under the terms of the GNU General Public License as published by *
32  * the Free Software Foundation; either version 2 of the License, or    *
33  * (at your option) any later version.                                  *
34  *                                                                      *
35  * This program is distributed in the hope that it will be useful,      *
36  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
37  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
38  * GNU General Public License for more details.                         *
39  *                                                                      *
40  * You should have received a copy of the GNU General Public License    *
41  * along with this program; if not, write to the Free Software          *
42  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
43  * MA  02110-1301  USA                                                  *
44  ************************************************************************/
45
46 // Some security stuff...
47 if (!defined('__SECURITY')) {
48         die();
49 } // END - if
50
51 // Version number
52 setThisExtensionVersion('0.0');
53
54 // Version history array (add more with , '0.1.0' and so on)
55 setExtensionVersionHistory(array('0.0'));
56
57 // This extension is in development (non-productive)
58 enableExtensionProductive(false);
59
60 switch (getExtensionMode()) {
61         case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
62                 // Main table which hold
63                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_data`');
64                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_data` (
65 `network_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
66 `network_short_name` VARCHAR(50) NOT NULL DEFAULT '',
67 `network_title` VARCHAR(255) NOT NULL DEFAULT '',
68 `network_reflink` VARCHAR(255) NOT NULL DEFAULT '',
69 `network_data_seperator` CHAR(4) NOT NULL DEFAULT '|',
70 `network_row_seperator` CHAR(4) NOT NULL DEFAULT '|',
71 `network_request_type` ENUM('GET','POST') NOT NULL DEFAULT 'GET',
72 `network_charset` VARCHAR(20) NOT NULL DEFAULT 'UTF-8',
73 UNIQUE (`network_short_name`),
74 PRIMARY KEY (`network_id`)
75 ) TYPE={?_TABLE_TYPE?} COMMENT='Network data'");
76
77                 // Types the network provider is supporting (e.g. Forced-Banner and so on)
78                 // @TODO network_type_handle is an internal name and needs documentation
79                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types`');
80                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_types` (
81 `network_type_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
82 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
83 `network_type_handle` VARCHAR(255) NOT NULL DEFAULT '',
84 `network_type_api_url` VARCHAR(255) NOT NULL DEFAULT '',
85 `network_type_click_url` VARCHAR(255) NOT NULL DEFAULT '',
86 `network_type_banner_url` VARCHAR(255) NOT NULL DEFAULT '',
87 `network_param_default` VARCHAR(255) NULL DEFAULT NULL,
88 UNIQUE `provider_type` (`network_id`,`network_type_handle`),
89 PRIMARY KEY (`network_type_id`)
90 ) TYPE={?_TABLE_TYPE?} COMMENT='Types provideable by networks'");
91
92                 // HTTP parameters (names) for URLs
93                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_request_params`');
94                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_request_params` (
95 `network_param_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
96 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
97 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
98 `request_param_key` VARCHAR(10) NOT NULL DEFAULT 'invalid',
99 `request_param_value` VARCHAR(10) NOT NULL DEFAULT 'invalid',
100 `request_param_default` VARCHAR(10) NULL DEFAULT NULL,
101 UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`request_param_key`),
102 UNIQUE `provider_type_value` (`network_id`,`network_type_id`,`request_param_value`),
103 PRIMARY KEY (`network_param_id`)
104 ) TYPE={?_TABLE_TYPE?} COMMENT='Request parameters for GET/POST request'");
105
106                 // Error status codes
107                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_type_codes`');
108                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_type_codes` (
109 `network_type_code_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
110 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
111 `network_type_code_value` VARCHAR(50) NOT NULL DEFAULT '',
112 `network_type_code_type` VARCHAR(100) NOT NULL DEFAULT 'INVALID_TYPE',
113 UNIQUE `code_type` (`network_type_code_value`,`network_type_id`),
114 INDEX (`network_type_id`),
115 PRIMARY KEY (`network_type_code_id`)
116 ) TYPE={?_TABLE_TYPE?} COMMENT='Error codes for all types'");
117
118                 // Code types (internal table)
119                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_codes`');
120                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_codes` (
121 `network_code_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
122 `network_code` VARCHAR(100) NOT NULL DEFAULT 'INVALID_CODE',
123 UNIQUE (`network_code`),
124 PRIMARY KEY (`network_code_id`)
125 ) TYPE={?_TABLE_TYPE?} COMMENT='Error types, generic data, DO NOT ALTER!'");
126
127                 // Valid translation keys (we hate hard-coded arrays, you see?)
128                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_translations`');
129                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_translations` (
130 `network_translate_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
131 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
132 `network_translation` VARCHAR(100) NOT NULL DEFAULT '',
133 UNIQUE `type_trans` (`network_type_id`,`network_translation`),
134 PRIMARY KEY (`network_translate_id`)
135 ) TYPE={?_TABLE_TYPE?} COMMENT='Translations for array keys, generic data, DO NOT ALTER!'");
136
137                 // Array-Element translation tables per type/provider
138                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_array_translation`');
139                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_array_translation` (
140 `network_translate_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
141 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
142 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
143 `network_array_key` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
144 `network_translation` VARCHAR(100) NOT NULL DEFAULT '',
145 UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_array_key`),
146 UNIQUE `provider_type_trans` (`network_id`,`network_type_id`,`network_translation`),
147 PRIMARY KEY (`network_translate_id`)
148 ) TYPE={?_TABLE_TYPE?} COMMENT='Cache for all queried APIs'");
149
150                 // Data from the webmaster (you!)
151                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`');
152                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_config` (
153 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
154 `network_affiliate_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
155 `network_api_password` VARCHAR(255) NOT NULL DEFAULT '',
156 `network_site_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
157 `network_query_amount` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
158 UNIQUE `network_affiliate` (`network_id`,`network_affiliate_id`),
159 UNIQUE `affiliate_site` (`network_affiliate_id`,`network_site_id`),
160 PRIMARY KEY (`network_id`)
161 ) TYPE={?_TABLE_TYPE?} COMMENT='Configuration data from the webmaster (you!)'");
162
163                 // Configuration data for e.g. reload-time
164                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types_config`');
165                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_types_config` (
166 `network_data_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
167 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
168 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
169 `max_reload_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
170 `min_waiting_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
171 `min_remain_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
172 `min_payment` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
173 `allow_erotic` VARCHAR(10) NOT NULL DEFAULT '',
174 UNIQUE `provider_type` (`network_id`,`network_type_id`),
175 PRIMARY KEY (`network_data_id`)
176 ) TYPE={?_TABLE_TYPE?} COMMENT='Configuration data for every type (e.g. reload-time)'");
177
178                 // Cache for queried APIs. Re-check depends on config
179                 // `network_cache_refresh` in seconds or if set to zero, full day
180                 // divided by query amount.
181                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_cache`');
182                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_cache` (
183 `network_cache_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
184 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
185 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
186 `network_cache_data` MEDIUMBLOB,
187 `network_cache_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
188 UNIQUE `provider_type` (`network_id`,`network_type_id`),
189 PRIMARY KEY (`network_cache_id`)
190 ) TYPE={?_TABLE_TYPE?} COMMENT='Cache for all queried APIs'");
191
192                 // Reload locks for several types
193                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_reloads`');
194                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_network_reloads` (
195 `network_reload_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
196 `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
197 `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
198 `network_reload_lock` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
199 `network_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
200 UNIQUE `provider_type` (`network_id`,`network_type_id`),
201 PRIMARY KEY (`network_reload_id`)
202 ) TYPE={?_TABLE_TYPE?} COMMENT='Reload locks'");
203
204                 // Insert error code types
205                 // - Affiliate id or interface password wrong
206                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('AFF_ID_PASS_WRONG')");
207                 // - Webmaster's site id is not assigned (invalid, different affiliate id)
208                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('SITE_ID_NOT_ASSIGNED')");
209                 // - Webmaster's site id is locked
210                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('SITE_ID_LOCKED')");
211                 // - General error in interface data
212                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('INTERFACE_DATA_ERROR')");
213                 // - Request amount depleted
214                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('REQUESTS_DEPLETED')");
215                 // - No campaigns found for given criteria (but maybe there are with more widen criteria)
216                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('NO_CAMPAIGNS_FOUND')");
217                 // - No campaigns found with allowed interface output (but there are maybe non-interface campaigns)
218                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('NO_CAMPAIGNS_FOUND_INTERFACE')");
219                 // - Webmaster's site id is not unlocked for choosen type
220                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('SITE_ID_NOT_ALLOWED_TYPE')");
221                 // - Request parameters incomplete
222                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_codes` (`network_code`) VALUES ('REQUEST_PARAMS_INCOMPLETE')");
223
224                 // Sponsor networks
225                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_data` (`network_short_name`, `network_title`, `network_reflink`, `network_data_seperator`, `network_row_seperator`, `network_request_type`, `network_charset`) VALUES ('yoomedia', 'Yoo!Media Solutions', 'http://www.yoomedia.de?ref=1715', '|', '|', 'GET', 'WINDOWS-1252')");
226
227                 // Network type handlers - Yoo!Media (Please use http://www.yoomedia.de?ref=1715 for signing up)
228                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_id`,`network_type_handle`,`network_type_api_url`,`network_type_click_url`,`network_type_banner_url`) VALUES (1, 'banner', 'http://www.yoomedia.de/interface_2.0/out_banner.php', 'http://www.yoomedia.de/code/z-bannerklf.php?id=%ID%&sid=%SID%', 'http://www.yoomedia.de/code/z-banner.php?id=%ID%&sid=%SID%&bid=%BID%'),
229 (1, 'surfbar', 'http://www.yoomedia.de/interface_2.0/out_sbanner.php', 'http://www.yoomedia.de/code/s-bannerklf.php?id=%ID%&sid=%SID%', 'http://www.yoomedia.de/code/s-banner.php?id=%ID%&sid=%SID%&bid=%BID%'),
230 (1, 'focredbanner', 'http://www.yoomedia.de/interface_2.0/out_fbanner.php', 'http://www.yoomedia.de/code/f-bannerklf.php?id=%ID%&sid=%SID%', 'http://www.yoomedia.de/code/f-banner.php?id=%ID%&sid=%SID%&bid=%BID%'),
231 (1, 'textlink', 'http://www.yoomedia.de/interface_2.0/out_textlink.php', 'http://www.yoomedia.de/code/t-textlink.php?id=%ID%&sid=%SID%', ''),
232 (1, 'layer', 'http://www.yoomedia.de/interface_2.0/out_layer.php', 'http://www.yoomedia.de/code/l-layer.php?id=%ID%&sid=%SID%', ''),
233 (1, 'popup', 'http://www.yoomedia.de/interface_2.0/out_popup.php', 'http://www.yoomedia.de/code/p-popup.php?id=%ID%&sid=%SID%', ''),
234 (1, 'popdown', 'http://www.yoomedia.de/interface_2.0/out_popdown.php', 'http://www.yoomedia.de/code/p-popdown.php?id=%ID%&sid=%SID%', ''),
235 (1, 'textmail', 'http://www.yoomedia.de/interface_2.0/out_textmail.php', 'http://www.yoomedia.de/code/t-mail.php?id=%ID%&sid=%SID%', ''),
236 (1, 'htmlmail', 'http://www.yoomedia.de/interface_2.0/out_htmlmail.php', 'http://www.yoomedia.de/code/h-mail.php?id=%ID%&sid=%SID%', ''),
237 (1, 'lead', 'http://www.yoomedia.de/interface_2.0/out_lead.php', 'http://www.yoomedia.de/code/lead.php?id=%ID%&sid=%SID%', ''),
238 (1, 'pagepeel', 'http://www.yoomedia.de/interface_2.0/out_pagepeel.php', 'http://www.yoomedia.de/code/p-peel.php?id=%ID%&sid=%SID%', '')");
239
240                 // Request parameters per type handler - Yoo!Media
241                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 1, 'id', 'id'),
242 (1, 1, 'sid', 'sid'),
243 (1, 1, 'password', 'pw'),
244 (1, 1, 'reload', 'reload'),
245 (1, 1, 'remain', 'uebrig'),
246 (1, 1, 'reward', 'verguetung'),
247 (1, 1, 'size', 'size'),
248 (1, 1, 'erotic', 'erotik')");
249                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 3, 'id', 'id'),
250 (1, 3, 'sid', 'sid'),
251 (1, 3, 'password', 'pw'),
252 (1, 3, 'reload', 'reload'),
253 (1, 3, 'min_stay', 'ma'),
254 (1, 3, 'remain', 'uebrig'),
255 (1, 3, 'reward', 'verguetung'),
256 (1, 3, 'size', 'size'),
257 (1, 3, 'erotic', 'erotik')");
258                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 9, 'id', 'id'),
259 (1, 9, 'sid', 'sid'),
260 (1, 9, 'password', 'pw'),
261 (1, 9, 'reload', 'reload'),
262 (1, 9, 'min_stay', 'ma'),
263 (1, 9, 'remain', 'uebrig'),
264 (1, 9, 'reward', 'verguetung'),
265 (1, 9, 'erotic', 'erotik')");
266                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 5, 'id', 'id'),
267 (1, 5, 'sid', 'sid'),
268 (1, 5, 'password', 'pw'),
269 (1, 5, 'reload', 'reload'),
270 (1, 5, 'remain', 'uebrig'),
271 (1, 5, 'reward', 'verguetung'),
272 (1, 5, 'erotic', 'erotik')");
273                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 10, 'id', 'id'),
274 (1, 10, 'sid', 'sid'),
275 (1, 10, 'password', 'pw'),
276 (1, 10, 'reload', 'reload'),
277 (1, 10, 'remain', 'uebrig'),
278 (1, 10, 'reward', 'verguetung'),
279 (1, 10, 'erotic', 'erotik')");
280                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 11, 'id', 'id'),
281 (1, 11, 'sid', 'sid'),
282 (1, 11, 'password', 'pw'),
283 (1, 11, 'reload', 'reload'),
284 (1, 11, 'remain', 'uebrig'),
285 (1, 11, 'reward', 'verguetung'),
286 (1, 11, 'erotic', 'erotik')");
287                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 7, 'id', 'id'),
288 (1, 7, 'sid', 'sid'),
289 (1, 7, 'password', 'pw'),
290 (1, 7, 'reload', 'reload'),
291 (1, 7, 'min_stay', 'ma'),
292 (1, 7, 'remain', 'uebrig'),
293 (1, 7, 'reward', 'verguetung'),
294 (1, 7, 'erotic', 'erotik')");
295                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 6, 'id', 'id'),
296 (1, 6, 'sid', 'sid'),
297 (1, 6, 'password', 'pw'),
298 (1, 6, 'reload', 'reload'),
299 (1, 6, 'min_stay', 'ma'),
300 (1, 6, 'remain', 'uebrig'),
301 (1, 6, 'reward', 'verguetung'),
302 (1, 6, 'erotic', 'erotik')");
303                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 2, 'id', 'id'),
304 (1, 2, 'sid', 'sid'),
305 (1, 2, 'password', 'pw'),
306 (1, 2, 'reload', 'reload'),
307 (1, 2, 'remain', 'uebrig'),
308 (1, 2, 'reward', 'verguetung'),
309 (1, 2, 'size', 'size'),
310 (1, 2, 'erotic', 'erotik')");
311                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 4, 'id', 'id'),
312 (1, 4, 'sid', 'sid'),
313 (1, 4, 'password', 'pw'),
314 (1, 4, 'reload', 'reload'),
315 (1, 4, 'remain', 'uebrig'),
316 (1, 4, 'reward', 'verguetung'),
317 (1, 4, 'erotic', 'erotik')");
318                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`,`network_type_id`,`request_param_key`,`request_param_value`) VALUES (1, 8, 'id', 'id'),
319 (1, 8, 'sid', 'sid'),
320 (1, 8, 'password', 'pw'),
321 (1, 8, 'reload', 'reload'),
322 (1, 8, 'min_stay', 'ma'),
323 (1, 8, 'remain', 'uebrig'),
324 (1, 8, 'reward', 'verguetung'),
325 (1, 8, 'erotic', 'erotik')");
326
327                 // Admin menu entries
328                 addAdminMenuSql('network',NULL,'Werbenetzwerke','Verwalten Sie hier Werbenetzwerke (API-Anbindung), versenden Sie deren Mails, oder &uuml;bernehmen Sie deren Textlinks und vieles mehr. <strong>VORSICHT:</strong> Das Einrichten von weiteren Werbenetzwerken ist nicht leicht, daf&uuml;r aber sehr flexibel! Sollte ein Netzwerk fehlen, so melden Sie dies bitte <a href="http://forum.mxchange.org/topic-462.html" target="_blank" title="Direktlink zum Forum">im Forum</a>!',4);
329                 addAdminMenuSql('network','config_networks','API-Daten','Stellen Sie Ihre Affiliate- Webseiten-Id und API-Passwort ein. Diese erhalten Sie zu &uuml;ber 99% aus dem jeweiligen Zugangsbereich des Anbieters. Sollten Sie bei einem Netzwerk noch nicht angemeldet sein, verwenden Sie bitte meinen Referal-Link.',1);
330                 addAdminMenuSql('network','config_network_types','Werbearten','Stellen Sie hier Reload-Zeiten, Mindestauffenthalt und so weiter pro Werbeart und Werbenetzwerk ein. Es werden sonst Standart-Werte (Mimimumwerte: 0, Maximumwerte: sehr gross, Erotik: aus) angenommen, die Sie meistens nicht wollen.',2);
331                 addAdminMenuSql('network','query_networks','APIs abfragen','Fragt alle eingestellten APIs ab. Die Ergebnisse werden dann f&uuml;r einen einstellbaren Zeitraum gecacht und nicht erneut angefordert.',3);
332                 addAdminMenuSql('network','config_network','Einstellungen','Stellen Sie generelle Einstellungen ein, die f&uuml;r alle Werbenetzwerke gelten, wie z.B. Cache-Erneuerungsinterval. Generell sind aber die Einstellungen in Ordnung, da z.B. sonst Ihre freien Abfragen beim Werbenetzwerk sich zu schnell abbauen.',4);
333                 addAdminMenuSql('network','list_network_reloads','Reload-Sperren','Listen oder l&ouml;schen Sie hier Reload-Sperren. <strong>Vorsicht:</strong> Die hier gespeicherten Reload-Sperren sind vom jeweiligen Werbenetzwerk &uuml;bernommen. Eventuell verdienen Sie nichts, wenn Sie z.B. eine Mail innerhalb der Reload-Sperre erneut versenden.',5);
334                 addAdminMenuSql('network','list_networks','Auflisten/Verwalten','<strong>Experten-Einstellungen!</strong> Hier &auml;ndern Sie die Einstellungen an den Grunddaten (Stammdaten) des jeweiligen Werbenetzwerks ab. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten m&ouml;chten.',6);
335                 addAdminMenuSql('network','list_network_types','Werbearten','<strong>Experten-Einstellungen!</strong> Hier &auml;ndern Sie die Einstellungen zu den Werbearten pro Werbenetzwerken. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten m&ouml;chten.',7);
336                 addAdminMenuSql('network','list_network_params','Abfrageparameter','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Abfrageparameter (wie sie genannt werden m&uuml;ssen, um das API-Script korrekt aufrufen zu k&ouml;nnen) ein, pro Werbenetzwerk. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten m&ouml;chten.',8);
337                 addAdminMenuSql('network','list_network_code_types','R&uuml;ckgabewerte','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die R&uuml;ckgabewerte ein, die im Falle eines Fehlers pro API-Script kommen k&ouml;nnen. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten m&ouml;chten.',9);
338                 addAdminMenuSql('network','list_network_codes','Fehlercodes','<strong>Experten-Einstellungen!</strong> Hier stellen Sie die Namen von Fehlercodes ein, die Scripte zur&uuml;ckliefern k&ouml;nnen. <strong>Dies sind INTERNE Daten und sollten nur vom Entwicklerteam angepasst werden.</strong> Stellen Sie an diesen Einstellungen bitte nichts um. Sie sollten hier generell nichts einstellen und <a href="http://forum.mxchange.org/forum-43.html" target="_blank" title="Direktlink zum Forum">im Forum</a> um Hilfe fragen, wenn Sie selber ein Werbenetzwerk einrichten m&ouml;chten.',10);
339
340                 // Configuration entries
341                 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `network_cache_refresh` BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (60 * 15) . '');
342                 break;
343
344         case 'remove': // Do stuff when removing extension
345                 // SQL commands to run
346                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_data`');
347                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types`');
348                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_request_params`');
349                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_type_codes`');
350                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_translations`');
351                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_array_translation`');
352                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_config`');
353                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_types_config`');
354                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_cache`');
355                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_network_reloads`');
356
357                 // Admin menu
358                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='network'");
359                 break;
360
361         case 'activate': // Do stuff when admin activates this extension
362                 // SQL commands to run
363                 break;
364
365         case 'deactivate': // Do stuff when admin deactivates this extension
366                 // SQL commands to run
367                 break;
368
369         case 'update': // Update an extension
370                 switch (getCurrentExtensionVersion()) {
371                         case '0.0.1': // SQL queries for v0.0.1
372                                 addExtensionSql('');
373
374                                 // Update notes (these will be set as task text!)
375                                 setExtensionUpdateNotes('');
376                                 break;
377                 } // END - switch
378                 break;
379
380         case 'modify': // When the extension got modified
381                 break;
382
383         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
384                 break;
385
386         case 'init': // Do stuff when extension is initialized
387                 break;
388
389         default: // Unknown extension mode
390                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
391                 break;
392 } // END - switch
393
394 // [EOF]
395 ?>