From ef9dfab121f1d8929ce8cd4bf9aedaa968212b50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Sep 2011 21:38:37 +0000 Subject: [PATCH] Extension ext-network continued: - Adding/listing of v-check parameters added - V-check parameters added for all supported networks (more will follow!) - Function fooParamKey() renamed to fooParameterKey(), we don't shortcut things - TODOs.txt updated --- .gitattributes | 6 + DOCS/TODOs.txt | 2 +- inc/extensions/ext-network.php | 109 ++++++++++- inc/language/network_de.php | 37 +++- inc/libs/network_functions.php | 183 ++++++++++++++++-- .../admin/what-list_network_vcheck_params.php | 119 ++++++++++++ .../admin/admin_add_network_request_param.tpl | 10 +- .../admin/admin_add_network_vcheck_param.tpl | 44 +++++ ...dmin_delete_network_request_params_row.tpl | 2 +- .../admin_export_network_vcheck_params.tpl | 17 ++ .../admin_list_network_request_params_row.tpl | 2 +- .../admin_list_network_vcheck_params.tpl | 38 ++++ .../admin_list_network_vcheck_params_row.tpl | 14 ++ .../admin_network_vcheck_param_added.tpl | 14 ++ 14 files changed, 569 insertions(+), 28 deletions(-) create mode 100644 inc/modules/admin/what-list_network_vcheck_params.php create mode 100644 templates/de/html/admin/admin_add_network_vcheck_param.tpl create mode 100644 templates/de/html/admin/admin_export_network_vcheck_params.tpl create mode 100644 templates/de/html/admin/admin_list_network_vcheck_params.tpl create mode 100644 templates/de/html/admin/admin_list_network_vcheck_params_row.tpl create mode 100644 templates/de/html/admin/admin_network_vcheck_param_added.tpl diff --git a/.gitattributes b/.gitattributes index 86bde5e3ce..f3fc871ce3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -546,6 +546,7 @@ inc/modules/admin/what-list_network_array_translation.php svneol=native#text/pla inc/modules/admin/what-list_network_params.php svneol=native#text/plain inc/modules/admin/what-list_network_request_params.php svneol=native#text/plain inc/modules/admin/what-list_network_types.php svneol=native#text/plain +inc/modules/admin/what-list_network_vcheck_params.php svneol=native#text/plain inc/modules/admin/what-list_networks.php svneol=native#text/plain inc/modules/admin/what-list_nickname.php svneol=native#text/plain inc/modules/admin/what-list_notifications.php svneol=native#text/plain @@ -1056,6 +1057,7 @@ templates/de/html/admin/admin_add_network_array_translation.tpl svneol=native#te templates/de/html/admin/admin_add_network_params.tpl svneol=native#text/plain templates/de/html/admin/admin_add_network_request_param.tpl svneol=native#text/plain templates/de/html/admin/admin_add_network_type.tpl svneol=native#text/plain +templates/de/html/admin/admin_add_network_vcheck_param.tpl svneol=native#text/plain templates/de/html/admin/admin_add_payment.tpl svneol=native#text/plain templates/de/html/admin/admin_add_payout.tpl svneol=native#text/plain templates/de/html/admin/admin_add_points.tpl svneol=native#text/plain @@ -1260,6 +1262,7 @@ templates/de/html/admin/admin_export_network_array_translation.tpl svneol=native templates/de/html/admin/admin_export_network_data.tpl svneol=native#text/plain templates/de/html/admin/admin_export_network_request_params.tpl svneol=native#text/plain templates/de/html/admin/admin_export_network_types.tpl svneol=native#text/plain +templates/de/html/admin/admin_export_network_vcheck_params.tpl svneol=native#text/plain templates/de/html/admin/admin_extension_notes.tpl svneol=native#text/plain templates/de/html/admin/admin_extension_reg_form.tpl svneol=native#text/plain templates/de/html/admin/admin_extension_sql_row.tpl svneol=native#text/plain @@ -1351,6 +1354,8 @@ templates/de/html/admin/admin_list_network_request_params.tpl svneol=native#text templates/de/html/admin/admin_list_network_request_params_row.tpl svneol=native#text/plain templates/de/html/admin/admin_list_network_types.tpl svneol=native#text/plain templates/de/html/admin/admin_list_network_types_row.tpl svneol=native#text/plain +templates/de/html/admin/admin_list_network_vcheck_params.tpl svneol=native#text/plain +templates/de/html/admin/admin_list_network_vcheck_params_row.tpl svneol=native#text/plain templates/de/html/admin/admin_list_networks.tpl svneol=native#text/plain templates/de/html/admin/admin_list_networks_row.tpl svneol=native#text/plain templates/de/html/admin/admin_list_notify_emails.tpl svneol=native#text/plain @@ -1452,6 +1457,7 @@ templates/de/html/admin/admin_network_api_translation_added.tpl svneol=native#te templates/de/html/admin/admin_network_array_translation_added.tpl svneol=native#text/plain templates/de/html/admin/admin_network_request_param_added.tpl svneol=native#text/plain templates/de/html/admin/admin_network_type_added.tpl svneol=native#text/plain +templates/de/html/admin/admin_network_vcheck_param_added.tpl svneol=native#text/plain templates/de/html/admin/admin_newsletter.tpl svneol=native#text/plain templates/de/html/admin/admin_newsletter_nohtml.tpl svneol=native#text/plain templates/de/html/admin/admin_next_link.tpl svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index d7336d6721..86955b69d6 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -72,6 +72,7 @@ ./inc/libs/doubler_functions.php:44:// @TODO Lame description ./inc/libs/doubler_functions.php:93: // @TODO Can't this be moved into EL? ./inc/libs/mailid_functions.php:47: // @TODO Rewrite this to a dynamic include or so +./inc/libs/network_functions.php:978: // @TODO Implement this function ./inc/libs/rallye_functions.php:705:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId() ./inc/libs/rallye_functions.php:770: $EXPIRE = 3; // @TODO The hard-coded value... ./inc/libs/rallye_functions.php:856:// @TODO Please document this function @@ -195,7 +196,6 @@ ./mailid_top.php:18: * @TODO Merge this script with mailid.php * ./mailid_top.php:196: // @TODO Rewrite this to a filter ./mailid_top.php:231: // @TODO Rewrite these blocks to filter -./network-vcheck.php:57:// @TODO Add processing of request here ./view.php:71: // @TODO No banner found, output some default banner ./templates/de/html/admin/admin_add_country.tpl:23: ./templates/de/html/admin/admin_config_other.tpl:79: diff --git a/inc/extensions/ext-network.php b/inc/extensions/ext-network.php index 481cb141d5..20a82f834e 100644 --- a/inc/extensions/ext-network.php +++ b/inc/extensions/ext-network.php @@ -116,8 +116,8 @@ UNIQUE INDEX `provider_type` (`network_id`,`network_type_handler`)", `network_request_param_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`network_request_param_key` VARCHAR(20) NOT NULL DEFAULT 'invalid', -`network_request_param_value` VARCHAR(20) NOT NULL DEFAULT 'invalid', +`network_request_param_key` VARCHAR(50) NOT NULL DEFAULT 'invalid', +`network_request_param_value` VARCHAR(50) NOT NULL DEFAULT 'invalid', `network_request_param_default` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`network_request_param_id`), UNIQUE INDEX `provider_type_key` (`network_id`,`network_type_id`,`network_request_param_key`), @@ -129,9 +129,9 @@ UNIQUE INDEX `provider_type_value` (`network_id`,`network_type_id`,`network_requ addCreateTableSql('network_vcheck_params', " `network_vcheck_param_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`network_vcheck_param_key` VARCHAR(20) NOT NULL DEFAULT 'invalid', -`network_vcheck_param_value` VARCHAR(20) NOT NULL DEFAULT 'invalid', -`network_vcheck_param_default` VARCHAR(20) NULL DEFAULT NULL, +`network_vcheck_param_key` VARCHAR(50) NOT NULL DEFAULT 'invalid', +`network_vcheck_param_value` VARCHAR(50) NOT NULL DEFAULT 'invalid', +`network_vcheck_param_default` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`network_vcheck_param_id`), UNIQUE INDEX `provider_key` (`network_id`, `network_vcheck_param_key`), UNIQUE INDEX `provider_value` (`network_id`, `network_vcheck_param_value`)", @@ -4593,6 +4593,105 @@ UNIQUE INDEX `provider_type` (`network_id`,`network_type_id`)", (35, 356, 6, 5), (35, 356, 10, 6)"); + // Vcheck request parameters - AdConvention + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(30, 'network_key', 'pass', NULL), +(30, 'payment', 'verguetung', NULL), +(30, 'remote_address', 'ip', NULL), +(30, 'sid', 'kampagnenid', NULL), +(30, 'type', 'werbeart', NULL), +(30, 'network_name', 'sponsor', NULL), +(30, 'extra_value1', 'v1', NULL), +(30, 'extra_value2', 'v2', NULL)"); + + // Vcheck request parameters - adgain.de + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(33, 'network_key', 'pass', NULL), +(33, 'payment', 'verguetung', NULL), +(33, 'remote_address', 'ip', NULL), +(33, 'campaign_id', 'kampagnenid', NULL), +(33, 'type', 'werbeart', NULL), +(33, 'network_name', 'sponsor', NULL), +(33, 'extra_value1', 'v1', NULL), +(33, 'extra_value2', 'v2', NULL)"); + + // Vcheck request parameters - ADkracher + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(34, 'network_key', 'pass', NULL), +(34, 'payment', 'verguetung', NULL), +(34, 'remote_address', 'ip', NULL), +(34, 'campaign_id', 'kampagnenid', NULL), +(34, 'type', 'werbeart', NULL), +(34, 'network_name', 'sponsor', NULL), +(34, 'extra_value1', 'v1', NULL), +(34, 'extra_value2', 'v2', NULL)"); + + // Vcheck request parameters - Admono.de + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(36, 'sid', 'sid', '%sid%'), +(36, 'type', 'werbeart', '%werbeart%'), +(36, 'remote_address', 'ip', '%ip%'), +(36, 'status', 'status', '%status%'), +(36, 'reason', 'grund', '%grund%'), +(36, 'campaign_id', 'kid', '%kampagnenid%'), +(36, 'extra_value1', 'var1', NULL), +(36, 'extra_value2', 'var2', NULL)"); + + // Vcheck request parameters - AllAds4You + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(10, 'sid', 'sid', '%sid%'), +(10, 'type', 'werbeart', '%werbeart%'), +(10, 'remote_address', 'ip', '%ip%'), +(10, 'status', 'status', '%status%'), +(10, 'reason', 'grund', '%grund%'), +(10, 'campaign_id', 'kid', '%kampagnenid%'), +(10, 'extra_value1', 'var1', NULL), +(10, 'extra_value2', 'var2', NULL)"); + + // Vcheck request parameters - FuCoExSponsor.net + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(29, 'network_key', 'pass', NULL), +(29, 'payment', 'verguetung', NULL), +(29, 'remote_address', 'ip', NULL), +(29, 'campaign_id', 'kampagnenid', NULL), +(29, 'type', 'werbeart', NULL), +(29, 'network_name', 'sponsor', NULL), +(29, 'extra_value1', 'v1', NULL), +(29, 'extra_value2', 'v2', NULL)"); + + // Vcheck request parameters - GigaPromo.de + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(14, 'type', 'wart', '#wart#'), +(14, 'campaign_id', 'kid', '#bid#'), +(14, 'remote_address', 'ip', '#ip#'), +(14, 'payment', 'pay', '#pay#'), +(14, 'extra_value1', 'var1', NULL), +(14, 'extra_value2', 'var2', NULL), +(14, 'extra_value3', 'var3', NULL), +(14, 'extra_value4', 'var4', NULL)"); + + // Vcheck request parameters - mega-ad.de + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(17, 'sid', 'sid', '%sid%'), +(17, 'type', 'werbeart', '%werbeart%'), +(17, 'remote_address', 'ip', '%ip%'), +(17, 'status', 'status', '%status%'), +(17, 'reason', 'grund', '%grund%'), +(17, 'campaign_id', 'kid', '%kampagnenid%'), +(17, 'extra_value1', 'var1', NULL), +(17, 'extra_value2', 'var2', NULL)"); + + // Vcheck request parameters - VIPads + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES +(27, 'network_key', 'pass', NULL), +(27, 'payment', 'verguetung', NULL), +(27, 'remote_address', 'ip', NULL), +(27, 'campaign_id', 'kampagnenid', NULL), +(27, 'type', 'werbeart', NULL), +(27, 'network_name', 'sponsor', NULL), +(27, 'extra_value1', 'v1', NULL), +(27, 'extra_value2', 'v2', NULL)"); + // API array elements - Admono.de addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_array_translation` (`network_id`,`network_type_id`,`network_array_index`,`sort`) VALUES (36, 357, 1, 1), diff --git a/inc/language/network_de.php b/inc/language/network_de.php index 0ed7ddaf29..28d3ccab1e 100644 --- a/inc/language/network_de.php +++ b/inc/language/network_de.php @@ -64,10 +64,12 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED' => "Der Abfrageparameter %s wurde nicht hinzugefügt.", 'ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED' => "Es wurden keine Änderungen an den Abfrageparametern ausgeführt.", 'ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED' => "Es wurden keine Abfrageparameter gelöscht.", + 'ADMIN_NETWORK_VCHECK_PARAMETER_ALREADY_ADDED' => "Ein VCheck-Abfrageparameter %s existiert bereits.", 'ADMIN_NETWORK_ARRAY_TRANSLATION_404' => "Es wurden keine Übersetzungen zum Antwort-Array zum Werbenetzwerk %s gefunden.", 'ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED' => "Die Array-Element-Übersetzung %s wurde nicht hinzugefügt.", 'ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED' => "Eine Array-Element-Übersetzung %s existiert bereits.", 'ADMIN_NETWORK_HANDLER_TYPE_HANDLER_ALREADY_CONFIGURED' => "Kann Daten des ausgewählten Werbeart-Handlers nicht hinzufügen, da bereits Daten vorhanden sind. Haben Sie das Formular ein zweites Mal versendet?", + 'ADMIN_NETWORK_VCHECK_PARAMETER_404' => "Es wurden keine VCheck-Abfrageparameter für das Werbenetzwerk %s gefunden.", // - Form titles 'ADMIN_ADD_NETWORK_TITLE' => "Neues Werbenetzwerk hinzufügen - Allgemeine Daten", 'ADMIN_EDIT_NETWORK_DATA_TITLE' => "Werbenetzwerk editieren - Allgemeine Daten", @@ -82,12 +84,14 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_TITLE' => "Abfrageparameter auflisten und verwalten", 'ADMIN_NETWORK_REQUEST_PARAMETER_EDIT_TITLE' => "Abfrageparameter editieren", 'ADMIN_NETWORK_REQUEST_PARAMETER_DELETE_TITLE' => "Abfrageparameter löschen", + 'ADMIN_NETWORK_VCHECK_PARAMETER_LIST_TITLE' => "VCheck-Abfrageparameter auflisten und verwalten", 'ADMIN_ADD_NETWORK_ARRAY_TRANSLATION_TITLE' => "Werbenetzwerk verwalten - Neues API-Arrayelement hinzufügen", 'ADMIN_LIST_NETWORK_ARRAY_TRANSLATION_TITLE' => "API-Arrayelemente auflisten und verwalten", 'ADMIN_ADD_CONFIG_NETWORK_HANDLER_TYPE_TITLE' => "Werbeart-Handler einrichten - {%%pipe,translateNetworkTypeHandler=%s%%}", 'ADMIN_SHOW_CONFIG_NETWORK_HANDLER_TYPE_TITLE' => "Eingerichteter Werbeart-Handler - {%%pipe,translateNetworkTypeHandler=%s%%}", 'ADMIN_CONFIG_NETWORK_HANDLER_TYPES_TITLE' => "Werbeart-Handler einrichten", 'ADMIN_EDIT_CONFIG_NETWORK_HANDLER_TYPE_TITLE' => "Werbeart-Handler ändern - {%%pipe,translateNetworkTypeHandler=%s%%}", + 'ADMIN_ADD_NETWORK_VCHECK_PARAMETER_TITLE' => "Werbenetzwerk verwalten - Neuen VCheck-Parameter hinzufügen", // - Link titles 'ADMIN_NETWORK_API_CONFIG_LINK_TITLE' => "Weiter zur API-Konfiguration", 'ADMIN_NETWORK_TYPE_HANDLER_CONFIG_LINK_TITLE' => "Weiter zur Werbart-Handler-Konfiguration", @@ -112,10 +116,12 @@ addMessages(array( 'ADMIN_ADD_CONFIG_NETWORK_HANDLER_TYPE_FORM_SUBMIT' => "Werbeart-Handlerdaten hinzufügen", 'ADMIN_EDIT_CONFIG_NETWORK_HANDLER_TYPE_SUBMIT' => "Konfiguration ändern", 'ADMIN_EDIT_CONFIG_NETWORK_HANDLER_TYPE_FORM_SUBMIT' => "Werbeart-Handler ändern", + 'ADMIN_ADD_NETWORK_VCHECK_PARAMETER_SUBMIT' => "VCheck-Parameter hinzufügen", // - Success titles 'ADMIN_NETWORK_ADDED_TITLE' => "Allgemeine Werbenetzwerkdaten hinzugefügt", 'ADMIN_NETWORK_TYPE_HANDLER_ADDED_TITLE' => "Werbeart-Handler hinzugefügt", 'ADMIN_NETWORK_REQUEST_PARAM_ADDED_TITLE' => "Abfrageparameter hinzugefügt", + 'ADMIN_NETWORK_VCHECK_PARAM_ADDED_TITLE' => "VCheck-Abfrageparameter hinzugefügt", 'ADMIN_NETWORK_ARRAY_TRANSLATION_ADDED_TITLE' => "Array-Element-Übersetzung hinzugefügt", // - Success nots 'ADMIN_NETWORK_UPDATED' => "Es wurden %s Einträge in den allgemeinen Daten aktualisiert.", @@ -132,6 +138,7 @@ addMessages(array( 'ADMIN_NETWORK_TYPE_HANDLER_LIST_NOTE' => "Seien Sie mit dem Löschen und Editieren von Werbeart-Handlern sehr vorsichtig. Sie sollten hierzu Rücksprache im Forum halten. Dokumentation zu den Platzhaltern (%FOO%, %BAR% usw.) finden Sie in der Dokumentation DOCs/de/network/README.txt.", 'ADMIN_ADD_NETWORK_REQUEST_PARAMETER_NOTE' => "Fügen Sie hier weitere Abfrageparameter dem ausgwählten Werbenetzwerk hinzu. Geben Sie keine Werte an, wie z.B. 5 Sekunden oder 30 Mails, geben Sie bei Abfrageparameter den GET- bzw. POST-Parameternamen an.", 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_NOTE' => "Seien Sie mit dem Löschen und Editieren von Abfrageparameter sehr vorsichtig. Sie sollten hierzu Rücksprache im Forum halten. Dokumentation zu den Abfragenamen (%FOO%, %BAR% usw.) finden Sie in der Dokumentation DOCs/de/network/README.txt.", + 'ADMIN_NETWORK_VCHECK_PARAMETER_LIST_NOTE' => "Seien Sie mit dem Löschen und Editieren von VCheck-Abfrageparameter sehr vorsichtig. Sie sollten hierzu Rücksprache im Forum halten.", 'ADMIN_ADD_NETWORK_ARRAY_TRANSLATION_NOTE' => "Fügen Sie hier weitere Array-Element-Übersetzungen zu dem ausgewählten Netzwerk und Werbeart-Handler ein.", 'ADMIN_LIST_NETWORK_ARRAY_TRANSLATION_NOTE' => "Seien Sie mit dem Editieren bzw. Löschen von Array-Elementen sehr vorsichtig, die API-Abfrage köntte unerwartete Ergebnisse bzw. Fehler zurückliefern.", 'ADMIN_NETWORK_REQUIRE_ID_CARD_NOTE' => "Unter {--ADMIN_NETWORK_REQUIRE_ID_CARD--} ist das durch den Webnetzwerkbetreiber Verlangen einer Kopie des Personalausweises bzw. Gewerbescheins zu verstehen. Mehr dazu erfahen Sie im Forum.", @@ -139,6 +146,7 @@ addMessages(array( 'ADMIN_CONFIG_NETWORK_HANDLER_TYPES_NOTE' => "Für jede Werbeart sind unterschiedliche Reloadsperren, Mindestauffenthalte und mehr einstellbar. Damit ist es möglich, dass Sie z.B. für Forced-Banner eine kürzere/längere Reloadsperre eingeben können als für Paidmails.", 'ADMIN_ADD_CONFIG_NETWORK_HANDLER_TYPE_FORM_NOTE' => "Bitte beachten Sie, dass es sich beim Feld {--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_ALLOW_EROTIC--} um ein frei eingebares Feld handelt. Den genauen Wert entnehmen Sie bitte derzeit aus Ihrem Affiliate-Bereich, da dieser nicht bei allen Werbenetzwerken einheitlich ist. Sollte das Werbenetzwerk Ihnen einen Wert nicht angeben, so lassen Sie das entsprechende Feld einfach leer. Stellen Sie unter {--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_MAX_RELOAD_TIME--} nur Werte ein, die auch vom Werbenetzwerk unterstützt werden. Die meisten werden zwar Stunden anbieten, es sollen aber auch Werbenetzwerke mit anderen Reloadsperreinheiten als Stunden unsterstützt werden. Später bei der API-Abfrage wird der eingestellte Wert auf die angezeigte Zeiteinheit umgerechnet und gekürzt.", 'ADMIN_EDIT_CONFIG_NETWORK_HANDLER_TYPE_FORM_NOTE' => "{--ADMIN_ADD_CONFIG_NETWORK_HANDLER_TYPE_FORM_NOTE--}", + 'ADMIN_ADD_NETWORK_VCHECK_PARAMETER_NOTE' => "Fügen Sie hier weitere VCheck-Abfrageparameter dem ausgewählten Werbenetzwerk hinzu, falls dieses den Vergütungscheck unterstützt, anderfalls fügen Sie einfach keine VCheck-Parameter hinzu.", // - Other messages 'ADMIN_NETWORK_REQUEST_PARAMETER_LIST_LIMITED_TO_TYPE' => "Es wurden nur die Abfrageparameter des ausgewählten Werbeart-Handlers angezeigt.", 'ADMIN_LIST_NETWORK_ARRAY_TRANSLATION_LIMITED_TO_TYPE' => "Es wurden nur die Array-Element-Übersetzungen des ausgewählten Werbeart-Handlers angezeigt.", @@ -196,10 +204,11 @@ addMessages(array( 'ADMIN_NETWORK_TYPE_HANDLER_BANNER_URL' => "Banner-URL der Werbeart:", 'ADMIN_NETWORK_TYPE_HANDLER_RELOAD_TIME_UNIT' => "Zeiteinheit für Reloadsperre:", // - API request parameter - 'ADMIN_SELECT_NETWORK_HANDLER_TYPE' => "Werbeart-Handler auswählen", - 'ADMIN_NETWORK_REQUEST_PARAMETER_KEY' => "Abfragename", - 'ADMIN_NETWORK_REQUEST_PARAMETER_VALUE' => "Abfrageparameter", - 'ADMIN_NETWORK_REQUEST_PARAMETER_DEFAULT' => "Ausgangswert", + 'ADMIN_SELECT_NETWORK_HANDLER_TYPE' => "Werbeart-Handler auswählen:", + 'ADMIN_NETWORK_REQUEST_PARAMETER_KEY' => "Abfragename:", + 'ADMIN_NETWORK_REQUEST_PARAMETER_VALUE' => "Abfrageparameter:", + 'ADMIN_NETWORK_REQUEST_PARAMETER_DEFAULT' => "Ausgangswert:", + // - API request parameter keys 'ADMIN_NETWORK_REQUEST_PARAMETER_ID' => "Affiliate-/Publisher-Id", 'ADMIN_NETWORK_REQUEST_PARAMETER_SID' => "Webseiten-Id", 'ADMIN_NETWORK_REQUEST_PARAMETER_HASH' => "Webseiten-Hash", @@ -215,6 +224,24 @@ addMessages(array( 'ADMIN_NETWORK_REQUEST_PARAMETER_EROTIC' => "Erotik erlaubt", 'ADMIN_NETWORK_REQUEST_PARAMETER_EXTRA' => "Extra-Parameter", 'ADMIN_NETWORK_REQUEST_PARAMETER_COUNTRY' => "Ländercode", + // - Vcheck request parameter + 'ADMIN_NETWORK_VCHECK_PARAMETER_KEY' => "Abfragename:", + 'ADMIN_NETWORK_VCHECK_PARAMETER_VALUE' => "Abfrageparameter:", + 'ADMIN_NETWORK_VCHECK_PARAMETER_DEFAULT' => "Ausgangswert:", + // - Vcheck request parameter keys + 'ADMIN_NETWORK_VCHECK_PARAMETER_NETWORK_KEY' => "Zugangsschlüssel", + 'ADMIN_NETWORK_VCHECK_PARAMETER_PAYMENT' => "Vergütung (Wert)", + 'ADMIN_NETWORK_VCHECK_PARAMETER_REMOTE_ADDRESS' => "IP-Nummer", + 'ADMIN_NETWORK_VCHECK_PARAMETER_CAMPAIGN_ID' => "Kampagnen-Id", + 'ADMIN_NETWORK_VCHECK_PARAMETER_TYPE' => "Werbeart", + 'ADMIN_NETWORK_VCHECK_PARAMETER_NETWORK_NAME' => "Name d. Werbenetzwerks", + 'ADMIN_NETWORK_VCHECK_PARAMETER_EXTRA_VALUE1' => "Zusatzparameter 1", + 'ADMIN_NETWORK_VCHECK_PARAMETER_EXTRA_VALUE2' => "Zusatzparameter 2", + 'ADMIN_NETWORK_VCHECK_PARAMETER_EXTRA_VALUE3' => "Zusatzparameter 3", + 'ADMIN_NETWORK_VCHECK_PARAMETER_EXTRA_VALUE4' => "Zusatzparameter 4", + 'ADMIN_NETWORK_VCHECK_PARAMETER_SID' => "Seiten-Id", + 'ADMIN_NETWORK_VCHECK_PARAMETER_STATUS' => "Status der Vergütung", + 'ADMIN_NETWORK_VCHECK_PARAMETER_REASON' => "Grund des Fehlers", // - API array index translation 'ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX' => "Neuen Array-Index eintragen", 'ADMIN_NETWORK_ARRAY_TRANSLATION_INDEX_TRANSLATION' => "Index-Übersetzung auswählen", @@ -257,6 +284,8 @@ addMessages(array( 'ADMIN_EXPORT_NETWORK_HANDLER_TYPES_TITLE' => "Tabellenexport - Werbeart-Handlerdaten", 'ADMIN_EXPORT_NETWORK_REQUEST_PARAMS_LINK' => "Abfrageparameter des aktuell angezeigten Werbenetzwerkes exportieren", 'ADMIN_EXPORT_NETWORK_REQUEST_PARAMS_TITLE' => "Tabellenexport - Abfrage-Parameter", + 'ADMIN_EXPORT_NETWORK_VCHECK_PARAMS_LINK' => "VCheck-Abfrageparameter des aktuell angezeigten Werbenetzwerkes exportieren", + 'ADMIN_EXPORT_NETWORK_VCHECK_PARAMS_TITLE' => "Tabellenexport - VCheck-Abfrageparameter", 'ADMIN_EXPORT_NETWORK_ARRAY_TRANSLATION_LINK' => "Antwort-Array-Elemente des aktuell angezeigten Werbenetzwerkes exportieren", 'ADMIN_EXPORT_NETWORK_ARRAY_TRANSLATION_TITLE' => "Tabellenexport - Arrayfeldübersetzungen", // Error codes diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index 1dad40cf32..d90c329cae 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -168,6 +168,25 @@ function isNetworkRequestElementValid ($key, $type, $networkId) { return $isValid; } +// Checks wether the given vcheck request parameter is already used (valid) +function isNetworkVcheckElementValid ($key, $networkId) { + // Query for it + $result = SQL_QUERY_ESC("SELECT `network_vcheck_param_id` FROM `{?_MYSQL_PREFIX?}_network_vcheck_params` WHERE `network_id`=%s AND `network_vcheck_param_key`='%s' LIMIT 1", + array( + $networkId, + $key + ), __FUNCTION__, __LINE__); + + // Does it exist? + $isValid = (SQL_NUMROWS($result) == 1); + + // Free result + SQL_FREERESULT($result); + + // Return result + return $isValid; +} + // Checks wether the given network API array translation function isNetworkArrayTranslationValid ($key, $type, $networkId) { // Query for it @@ -651,7 +670,7 @@ function generateNetworkTypesAvailableOptions ($defaultType = NULL) { return $GLOBALS[__FUNCTION__][$defaultType]; } -// Generates an options list (somewhat getter) ofr request keys +// Generates an options list (somewhat getter) for request keys function generateNetworkRequestKeyOptions () { // Is it cached? if (!isset($GLOBALS[__FUNCTION__])) { @@ -679,7 +698,41 @@ function generateNetworkRequestKeyOptions () { '', '', '', $GLOBALS['network_request_params_disabled'], - 'translateNetworkRequestParamKey' + 'translateNetworkRequestParameterKey' + ); + } // END - if + + // Return content + return $GLOBALS[__FUNCTION__]; +} + +// Generates an options list for vcheck request keys +function generateNetworkVcheckKeyOptions () { + // Is it cached? + if (!isset($GLOBALS[__FUNCTION__])) { + // Generate and cache it + $GLOBALS[__FUNCTION__] = generateOptionList( + '/ARRAY/', + array( + 'network_key', + 'sid', + 'payment', + 'remote_address', + 'campaign_id', + 'status', + 'reason', + 'type', + 'network_name', + 'extra_value1', + 'extra_value2', + 'extra_value3', + 'extra_value4', + ), + array(), + '', + '', '', + $GLOBALS['network_vcheck_params_disabled'], + 'translateNetworkVcheckParameterKey' ); } // END - if @@ -789,7 +842,7 @@ function translateNetworkRequestType ($type) { } // Translates request parameter -function translateNetworkRequestParamKey ($param) { +function translateNetworkRequestParameterKey ($param) { // Generate id $messageId = 'ADMIN_NETWORK_REQUEST_PARAMETER_' . strtoupper($param) . ''; @@ -803,6 +856,21 @@ function translateNetworkRequestParamKey ($param) { return '{--' . $messageId . '--}'; } +// Translates vheck request parameter +function translateNetworkVcheckParameterKey ($param) { + // Generate id + $messageId = 'ADMIN_NETWORK_VCHECK_PARAMETER_' . strtoupper($param) . ''; + + // Is the message id there? + if (!isMessageIdValid($messageId)) { + // Not valid param + debug_report_bug(__FUNCTION__, __LINE__, 'param=' . $param . ' is invalid.'); + } // END - if + + // Return message id + return '{--' . $messageId . '--}'; +} + // Translates API index function translateNetworkApiIndex ($index) { // Do we have cache? @@ -1393,6 +1461,42 @@ function doAdminNetworkProcessAddRequestParam () { } } +// Adds a vheck request parameter to given network +function doAdminNetworkProcessAddVcheckParam () { + // Is the request parameter already used with given network? + if (isNetworkVcheckElementValid(postRequestElement('network_vcheck_param_key'), getRequestElement('network_id'))) { + // Already added + loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_VCHECK_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_vcheck_param_key') . '%}'); + + // ... so abort here + return false; + } // END - if + + // Remove the 'ok' part + unsetPostRequestElement('ok'); + + // Add id + setPostRequestElement('network_id', bigintval(getRequestElement('network_id'))); + + // Is network_vcheck_param_default set? + if (postRequestElement('network_vcheck_param_default') == '') { + // Remove empty value to get a NULL for an optional entry + unsetPostRequestElement('network_vcheck_param_default'); + } // END - if + + // Add the whole vcheck to database + SQL_QUERY(getInsertSqlFromArray(postRequestArray(), 'network_vcheck_params'), __FUNCTION__, __LINE__); + + // Output message + if (!SQL_HASZEROAFFECTED()) { + // Successfully added + loadTemplate('admin_network_vcheck_param_added', false, postRequestArray()); + } else { + // Not added + loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_VCHECK_PARAMETER_NOT_ADDED=' . postRequestElement('network_vcheck_param_key') . '%}'); + } +} + // Adds a API response array entry function doAdminNetworkProcessAddNetworkArrayTranslation () { // Is the request parameter already used with given network? @@ -1704,13 +1808,15 @@ function doAdminNetworkProcessExport () { // Init table with all valid what->table entries $validExports = array( // General network data - 'list_networks' => 'network_data', + 'list_networks' => 'data', // Network type handler - 'list_network_types' => 'network_types', + 'list_network_types' => 'types', // Network request parameter - 'list_network_request_params' => 'network_request_params', + 'list_network_request_params' => 'request_params', + // Vcheck request parameter + 'list_network_vcheck_params' => 'vcheck_params', // Network API response array index translation - 'list_network_array_translation' => 'network_array_translation', + 'list_network_array_translation' => 'array_translation', ); // Is the 'what' key valid? @@ -1742,7 +1848,7 @@ function doAdminNetworkProcessExport () { } // Exports (and displays) the table 'network_data' -function doAdminNetworkExportNetworkData () { +function doAdminNetworkExportData () { // Query for all networks $result = SQL_QUERY('SELECT `network_short_name`, @@ -1791,7 +1897,7 @@ ORDER BY } // Exports (and displays) the table 'network_types' -function doAdminNetworkExportNetworkTypes () { +function doAdminNetworkExportTypes () { // 'network_id' must be set if (!isGetRequestElementSet('network_id')) { // Only network handlers of one network will be exported per time @@ -1854,7 +1960,7 @@ ORDER BY } // Exports (and displays) the table 'network_request_params' -function doAdminNetworkExportNetworkRequestParams () { +function doAdminNetworkExportRequestParams () { // 'network_id' must be set if (!isGetRequestElementSet('network_id')) { // Only network request parameters of one network will be exported per time @@ -1911,8 +2017,63 @@ ORDER BY loadTemplate('admin_export_network_request_params', false, $SQL); } +// Exports (and displays) the table 'network_vcheck_params' +function doAdminNetworkExportVcheckParams () { + // 'network_id' must be set + if (!isGetRequestElementSet('network_id')) { + // Only network vcheck parameters of one network will be exported per time + debug_report_bug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.'); + } // END - if + + // Get all network types of given network + $result = SQL_QUERY_ESC('SELECT + `network_id`, + `network_vcheck_param_key`, + `network_vcheck_param_value`, + `network_vcheck_param_default` +FROM + `{?_MYSQL_PREFIX?}_network_vcheck_params` +WHERE + `network_id`=%s +ORDER BY + `network_vcheck_param_id` ASC', + array( + bigintval(getRequestElement('network_id')) + ), __FUNCTION__, __LINE__); + + // Start an empty SQL query + $SQL = "INSERT INTO `{?_MYSQL_PREFIX?}_network_vcheck_params` (`network_id`,`network_vcheck_param_key`,`network_vcheck_param_value`,`network_vcheck_param_default`) VALUES\n"; + + // Load all entries + while ($content = SQL_FETCHARRAY($result)) { + // Add row + $SQL .= '(' . + $content['network_id'] . ", '" . + $content['network_vcheck_param_key'] . "', '" . + $content['network_vcheck_param_value'] . "', "; + + // Is the column NULL? + if (is_null($content['network_vcheck_param_default'])) { + // Column is NULL + $SQL .= "NULL),\n"; + } else { + // Column is set + $SQL .= "'" . $content['network_vcheck_param_default'] . "'),\n"; + } + } // END - while + + // Remove last commata and close braces + $SQL = substr($SQL, 0, -2); + + // Free result + SQL_FREERESULT($result); + + // Output the SQL query + loadTemplate('admin_export_network_vcheck_params', false, $SQL); +} + // Exports (and displays) the table 'network_array_translation' -function doAdminNetworkExportNetworkArrayTranslation () { +function doAdminNetworkExportArrayTranslation () { // 'network_id' must be set if (!isGetRequestElementSet('network_id')) { // Only network API array index translations of one network will be exported per time diff --git a/inc/modules/admin/what-list_network_vcheck_params.php b/inc/modules/admin/what-list_network_vcheck_params.php new file mode 100644 index 0000000000..b0347f8e36 --- /dev/null +++ b/inc/modules/admin/what-list_network_vcheck_params.php @@ -0,0 +1,119 @@ + diff --git a/templates/de/html/admin/admin_add_network_request_param.tpl b/templates/de/html/admin/admin_add_network_request_param.tpl index 6fc8f5d946..3c8b406c67 100644 --- a/templates/de/html/admin/admin_add_network_request_param.tpl +++ b/templates/de/html/admin/admin_add_network_request_param.tpl @@ -10,7 +10,7 @@ - {--ADMIN_SELECT_NETWORK_HANDLER_TYPE--}: + {--ADMIN_SELECT_NETWORK_HANDLER_TYPE--} {%pipe,generateNetworkRequestKeyOptions%} @@ -26,13 +26,13 @@ - {--ADMIN_NETWORK_REQUEST_PARAMETER_VALUE--}: + {--ADMIN_NETWORK_REQUEST_PARAMETER_VALUE--} - + - {--ADMIN_NETWORK_REQUEST_PARAMETER_DEFAULT--}: + {--ADMIN_NETWORK_REQUEST_PARAMETER_DEFAULT--} diff --git a/templates/de/html/admin/admin_add_network_vcheck_param.tpl b/templates/de/html/admin/admin_add_network_vcheck_param.tpl new file mode 100644 index 0000000000..929171ec16 --- /dev/null +++ b/templates/de/html/admin/admin_add_network_vcheck_param.tpl @@ -0,0 +1,44 @@ +
+
+ + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_ADD_NETWORK_VCHECK_PARAMETER_TITLE--} + +
{--ADMIN_NETWORK_VCHECK_PARAMETER_KEY--} + +
{--ADMIN_NETWORK_VCHECK_PARAMETER_VALUE--} + +
{--ADMIN_NETWORK_VCHECK_PARAMETER_DEFAULT--} + +
+
+
+ +
+ {--ADMIN_ADD_NETWORK_VCHECK_PARAMETER_NOTE--} +
diff --git a/templates/de/html/admin/admin_delete_network_request_params_row.tpl b/templates/de/html/admin/admin_delete_network_request_params_row.tpl index 83736bbfc8..4174743a2b 100644 --- a/templates/de/html/admin/admin_delete_network_request_params_row.tpl +++ b/templates/de/html/admin/admin_delete_network_request_params_row.tpl @@ -8,7 +8,7 @@ {--ADMIN_NETWORK_REQUEST_PARAMETER_KEY--}: - {%pipe,translateNetworkRequestParamKey=$content[network_request_param_key]%} + {%pipe,translateNetworkRequestParameterKey=$content[network_request_param_key]%} diff --git a/templates/de/html/admin/admin_export_network_vcheck_params.tpl b/templates/de/html/admin/admin_export_network_vcheck_params.tpl new file mode 100644 index 0000000000..8fc2e3ad52 --- /dev/null +++ b/templates/de/html/admin/admin_export_network_vcheck_params.tpl @@ -0,0 +1,17 @@ +
+
+ +
+ {--ADMIN_EXPORT_NETWORK_VCHECK_PARAMS_TITLE--} +
+ +
+
$content
+
+ + + +
+
diff --git a/templates/de/html/admin/admin_list_network_request_params_row.tpl b/templates/de/html/admin/admin_list_network_request_params_row.tpl index 5784910524..0f215790bd 100644 --- a/templates/de/html/admin/admin_list_network_request_params_row.tpl +++ b/templates/de/html/admin/admin_list_network_request_params_row.tpl @@ -6,7 +6,7 @@ {%pipe,translateNetworkTypeHandler=$content[network_type_handler]%} - {%pipe,translateNetworkRequestParamKey=$content[network_request_param_key]%} + {%pipe,translateNetworkRequestParameterKey=$content[network_request_param_key]%} $content[network_request_param_value] diff --git a/templates/de/html/admin/admin_list_network_vcheck_params.tpl b/templates/de/html/admin/admin_list_network_vcheck_params.tpl new file mode 100644 index 0000000000..93b27c297a --- /dev/null +++ b/templates/de/html/admin/admin_list_network_vcheck_params.tpl @@ -0,0 +1,38 @@ +
+
+ + + + + + + + + + + $content + + + +
+
+ {--ADMIN_NETWORK_VCHECK_PARAMETER_LIST_TITLE--} +
+ +
{--ID_SELECT--}{--ADMIN_NETWORK_VCHECK_PARAMETER_KEY--}{--ADMIN_NETWORK_VCHECK_PARAMETER_VALUE--}{--ADMIN_NETWORK_VCHECK_PARAMETER_DEFAULT--}
+
+ + + +
+ {--ADMIN_NETWORK_VCHECK_PARAMETER_LIST_NOTE--} +
+
diff --git a/templates/de/html/admin/admin_list_network_vcheck_params_row.tpl b/templates/de/html/admin/admin_list_network_vcheck_params_row.tpl new file mode 100644 index 0000000000..5a2004d105 --- /dev/null +++ b/templates/de/html/admin/admin_list_network_vcheck_params_row.tpl @@ -0,0 +1,14 @@ + + + + + + {%pipe,translateNetworkVcheckParameterKey=$content[network_vcheck_param_key]%} + + + $content[network_vcheck_param_value] + + + $content[network_vcheck_param_default] + + diff --git a/templates/de/html/admin/admin_network_vcheck_param_added.tpl b/templates/de/html/admin/admin_network_vcheck_param_added.tpl new file mode 100644 index 0000000000..1feab3bf4c --- /dev/null +++ b/templates/de/html/admin/admin_network_vcheck_param_added.tpl @@ -0,0 +1,14 @@ +
+ +
+
+ {--ADMIN_NETWORK_VCHECK_PARAM_ADDED_TITLE--} +
+
+ Der VCheck-Abfrageparameter $content[network_vcheck_param_key]/$content[network_vcheck_param_value] + wurde soeben hinzugefügt. Sie sollten nun als nächstes die + API-Arrayelemente hinzufügen. +
+
+ +
-- 2.39.5