From: Roland Häder Date: Wed, 16 Jan 2013 04:14:03 +0000 (+0000) Subject: Extension ext-network continued X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b0dabab25084e67689015614bd2a9f91b608b27a;p=mailer.git Extension ext-network continued - Added advertising network "Forced-Lose" - Column 'network_api_config_site_id' now allows NULL - Introduced function displayErrorMessage() - TODOs.txt updated --- diff --git a/inc/extensions/network/mode-setup.php b/inc/extensions/network/mode-setup.php index 9fc329efcd..bb2aa060e0 100644 --- a/inc/extensions/network/mode-setup.php +++ b/inc/extensions/network/mode-setup.php @@ -177,7 +177,7 @@ addCreateTableSql('network_api_config', " `network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_api_affiliate_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `network_api_password` VARCHAR(255) NOT NULL DEFAULT '', -`network_api_site_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`network_api_site_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL, `network_api_active` ENUM('Y','N') NOT NULL DEFAULT 'Y', `network_api_referral_link` VARCHAR(255) NULL DEFAULT NULL, `network_api_referral_button` VARCHAR(255) NULL DEFAULT NULL, @@ -377,7 +377,8 @@ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_data` (`network_short_na ('earn4webbis', 'Earn4Webbis', 'http://www.earn4webbis.net/index.php?seite=anmeldung&ref=Quix0r', '|', '|', 'GET', 'ISO-8859-1', 'N', 500, 'Y'), ('erotic_promotion', 'Erotic-Promotion', 'http://erotic-promotion.eu?ref=167', '|', '|', 'GET', 'WINDOWS-1252', 'N', 200, 'Y'), ('lose_ads', 'LoseAds', 'http://www.loseads.eu/index.php?seite=anmeldung&ref=Quix0r', '|', '|', 'GET', 'ISO-8859-1', 'N', 100, 'Y'), -('kueko_net', 'Kueko-Net', 'http://www.kueko-net.de/?seite=content/anmeldung&ref=589', '|', '|', 'GET', 'WINDOWS-1252', 'N', 150, 'Y')"); +('kueko_net', 'Kueko-Net', 'http://www.kueko-net.de/?seite=content/anmeldung&ref=589', '|', '|', 'GET', 'WINDOWS-1252', 'N', 150, 'Y'), +('forced_lose', 'Forced-Lose', 'http://www.forced-lose.de/?rid=3155', '|', '|', 'GET', 'UTF-8', 'N', 1000, 'Y')"); // Network type handlers - A3H addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id`, `network_id`, `network_type_handler`, `network_type_api_url`, `network_type_click_url`, `network_type_banner_url`, `network_type_reload_time_unit`, `network_text_encoding`) VALUES @@ -494,12 +495,12 @@ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id // Network type handlers - AdCocktail addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id`, `network_id`, `network_type_handler`, `network_type_api_url`, `network_type_click_url`, `network_type_banner_url`, `network_type_reload_time_unit`, `network_text_encoding`) VALUES -(12, 4, 'textmail', 'http://www.adcocktail.com/sc/kas/kas_pm.php', 'http://pm.adcocktail.com/pm.php?uid=%UID%&wid=%CID%&wsid=%SID%', NULL, 'h', 'NONE'), -(13, 4, 'forced_banner', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'h', 'NONE'), -(479, 4, 'traffic', 'http://www.adcocktail.com/sc/kas/kas_tt.php', 'http://tt.adcocktail.com/tt.php?uid=%UID%&wid=%CID%&wsid=%SID%', NULL, 'h', 'NONE'), -(480, 4, 'forced_button', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'h', 'NONE'), -(481, 4, 'forced_half_banner', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'h', 'NONE'), -(482, 4, 'forced_skyscraper', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%CID%&wsid=%SID%', 'h', 'NONE')"); +(12, 4, 'textmail', 'http://www.adcocktail.com/sc/kas/kas_pm.php', 'http://pm.adcocktail.com/pm.php?uid=%UID%&wid=%BID%&wsid=%SID%', NULL, 'h', 'NONE'), +(13, 4, 'forced_banner', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'h', 'NONE'), +(479, 4, 'traffic', 'http://www.adcocktail.com/sc/kas/kas_tt.php', 'http://tt.adcocktail.com/tt.php?uid=%UID%&wid=%BID%&wsid=%SID%', NULL, 'h', 'NONE'), +(480, 4, 'forced_button', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'h', 'NONE'), +(481, 4, 'forced_half_banner', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'h', 'NONE'), +(482, 4, 'forced_skyscraper', 'http://www.adcocktail.com/sc/kas/kas_fk.php', 'http://fk.adcocktail.com/fk_k.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'http://fk.adcocktail.com/fk_v.php?uid=%UID%&wid=%BID%&wsid=%SID%', 'h', 'NONE')"); // Network type handlers - AdConvention addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id`, `network_id`, `network_type_handler`, `network_type_api_url`, `network_type_click_url`, `network_type_banner_url`, `network_type_reload_time_unit`, `network_text_encoding`) VALUES @@ -919,6 +920,16 @@ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id (439, 42, 'popup', 'http://www.eu-ads.de/interface/api_2.php', 'http://www.eu-ads.de/codes/popup.php?id=%UID%&bid=%CID%&aid=%SID%&trackid=%TID%&vc=%VPC%', NULL, 'h', 'NONE'), (440, 42, 'textmail', 'http://www.eu-ads.de/interface/api_2.php', 'http://www.eu-ads.de/codes/paidmail.php?id=%UID%&bid=%CID%&aid=%SID%&trackid=%TID%&vc=%VPC%', NULL, 'h', 'NONE')"); +// Network type handlers - Forced-Lose +addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id`, `network_id`, `network_type_handler`, `network_type_api_url`, `network_type_click_url`, `network_type_banner_url`, `network_type_reload_time_unit`, `network_text_encoding`) VALUES +(802, 66, 'popup', 'http://www.forced-lose.de/sc/kas/kas_pu.php', 'http://pm.forced-lose.de/sc/popup.php?id=%UID%&bid=%BID%&aid=%SID%', NULL, 'h', 'NONE'), +(803, 66, 'traffic', 'http://www.forced-lose.de/sc/kas/kas_tt.php', 'http://tt.forced-lose.de/sc/tt.php?id=%UID%&bid=%BID%&aid=%SID%', NULL, 'h', 'NONE'), +(804, 66, 'textmail', 'http://www.forced-lose.de/sc/kas/kas_pm.php', 'http://pm.forced-lose.de/sc/pm.php?id=%UID%&bid=%BID%&aid=%SID%', NULL, 'h', 'NONE'), +(805, 66, 'forced_banner', 'http://www.forced-lose.de/sc/kas/kas_fk.php', 'http://fk.forced-lose.de/sc/fk_k.php?id=%UID%&bid=%BID%&aid=%SID%', 'http://fk.forced-lose.de/sc/fk_v.php?id=%UID%&bid=%BID%&aid=%SID%', 'h', 'NONE'), +(806, 66, 'forced_button', 'http://www.forced-lose.de/sc/kas/kas_fk.php', 'http://fk.forced-lose.de/sc/fk_k.php?id=%UID%&bid=%BID%&aid=%SID%', 'http://fk.forced-lose.de/sc/fk_v.php?id=%UID%&bid=%BID%&aid=%SID%', 'h', 'NONE'), +(807, 66, 'forced_half_banner', 'http://www.forced-lose.de/sc/kas/kas_fk.php', 'http://fk.forced-lose.de/sc/fk_k.php?id=%UID%&bid=%BID%&aid=%SID%', 'http://fk.forced-lose.de/sc/fk_v.php?id=%UID%&bid=%BID%&aid=%SID%', 'h', 'NONE'), +(808, 66, 'forced_skyscraper', 'http://www.forced-lose.de/sc/kas/kas_fk.php', 'http://fk.forced-lose.de/sc/fk_k.php?id=%UID%&bid=%BID%&aid=%SID%', 'http://fk.forced-lose.de/sc/fk_v.php?id=%UID%&bid=%BID%&aid=%SID%', 'h', 'NONE')"); + // Network type handlers - FuCoExSponsor.net addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id`, `network_id`, `network_type_handler`, `network_type_api_url`, `network_type_click_url`, `network_type_banner_url`, `network_type_reload_time_unit`, `network_text_encoding`) VALUES (273, 29, 'banner_click', 'http://fucoexsponsor.net/int/get.php', 'http://fucoexsponsor.net/kamp/ziel.php?uid=%UID%&bid=%BID%&sid=%SID%&subid=%TID%&vc=%VPC%&v1=%V1%&v2=%V2%', 'http://fucoexsponsor.net/kamp/b_view.php?uid=%UID%&bid=%BID%&sid=%SID%&subid=%TID%&vc=%VPC%', 'h', 'NONE'), @@ -4395,6 +4406,50 @@ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`networ (42, 440, 'reload', 'reload', NULL), (42, 440, 'reward', 'verguetung', NULL)"); +// Request parameters per type handler - Forced-Lose +addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`, `network_type_id`, `network_request_param_key`, `network_request_param_value`, `network_request_param_default`) VALUES +(66, 802, 'affiliate_id', 'u_id', NULL), +(66, 802, 'password', 'k_pass', NULL), +(66, 802, 'reward', 'k_v', NULL), +(66, 802, 'remain_clicks', 'k_rest', NULL), +(66, 802, 'maximum_stay', 'k_mamax', NULL), +(66, 802, 'extra', 'u_mode', 'on'), +(66, 803, 'affiliate_id', 'u_id', NULL), +(66, 803, 'password', 'k_pass', NULL), +(66, 803, 'reward', 'k_v', NULL), +(66, 803, 'remain_clicks', 'k_rest', NULL), +(66, 803, 'extra', 'u_mode', 'on'), +(66, 804, 'affiliate_id', 'u_id', NULL), +(66, 804, 'password', 'k_pass', NULL), +(66, 804, 'reward', 'k_v', NULL), +(66, 804, 'remain_clicks', 'k_rest', NULL), +(66, 804, 'maximum_stay', 'k_mamax', NULL), +(66, 804, 'extra', 'u_mode', 'on'), +(66, 805, 'affiliate_id', 'u_id', NULL), +(66, 805, 'password', 'k_pass', NULL), +(66, 805, 'reward', 'k_v', NULL), +(66, 805, 'remain_clicks', 'k_rest', NULL), +(66, 805, 'size', 'b_f', '468'), +(66, 805, 'extra', 'u_mode', 'on'), +(66, 806, 'affiliate_id', 'u_id', NULL), +(66, 806, 'password', 'k_pass', NULL), +(66, 806, 'reward', 'k_v', NULL), +(66, 806, 'remain_clicks', 'k_rest', NULL), +(66, 806, 'size', 'b_f', '88'), +(66, 806, 'extra', 'u_mode', 'on'), +(66, 807, 'affiliate_id', 'u_id', NULL), +(66, 807, 'password', 'k_pass', NULL), +(66, 807, 'reward', 'k_v', NULL), +(66, 807, 'remain_clicks', 'k_rest', NULL), +(66, 807, 'size', 'b_f', '234'), +(66, 807, 'extra', 'u_mode', 'on'), +(66, 808, 'affiliate_id', 'u_id', NULL), +(66, 808, 'password', 'k_pass', NULL), +(66, 808, 'reward', 'k_v', NULL), +(66, 808, 'remain_clicks', 'k_rest', NULL), +(66, 808, 'size', 'b_f', '120'), +(66, 808, 'extra', 'u_mode', 'on')"); + // Request parameters per type handler - FuCoExSponsor.net addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_request_params` (`network_id`, `network_type_id`, `network_request_param_key`, `network_request_param_value`, `network_request_param_default`) VALUES (29, 273, 'extra', 'art', 'bannerklick'), @@ -9655,6 +9710,58 @@ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_array_translation` (`net (62, 763, 6, 5), (62, 763, 10, 6)"); +// API array elements - Forced-Lose +addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_array_translation` (`network_id`, `network_type_id`, `network_array_index`, `network_array_sort`) VALUES +(66, 802, 1, 1), +(66, 802, 2, 2), +(66, 802, 4, 3), +(66, 802, 15, 4), +(66, 802, 5, 5), +(66, 802, 6, 6), +(66, 802, 10, 7), +(66, 803, 1, 1), +(66, 803, 2, 2), +(66, 803, 4, 3), +(66, 803, 7, 4), +(66, 803, 5, 5), +(66, 803, 6, 6), +(66, 804, 1, 1), +(66, 804, 2, 2), +(66, 804, 4, 3), +(66, 804, 13, 4), +(66, 804, 9, 5), +(66, 804, 5, 6), +(66, 804, 6, 7), +(66, 804, 10, 8), +(66, 805, 1, 1), +(66, 805, 2, 2), +(66, 805, 4, 3), +(66, 805, 7, 4), +(66, 805, 5, 5), +(66, 805, 6, 6), +(66, 805, 10, 7), +(66, 806, 1, 1), +(66, 806, 2, 2), +(66, 806, 4, 3), +(66, 806, 7, 4), +(66, 806, 5, 5), +(66, 806, 6, 6), +(66, 806, 10, 7), +(66, 807, 1, 1), +(66, 807, 2, 2), +(66, 807, 4, 3), +(66, 807, 7, 4), +(66, 807, 5, 5), +(66, 807, 6, 6), +(66, 807, 10, 7), +(66, 808, 1, 1), +(66, 808, 2, 2), +(66, 808, 4, 3), +(66, 808, 7, 4), +(66, 808, 5, 5), +(66, 808, 6, 6), +(66, 808, 10, 7)"); + // API array elements - FuCoExSponsor.net addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_array_translation` (`network_id`, `network_type_id`, `network_array_index`, `network_array_sort`) VALUES (29, 273, 7, 1), diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index 54db0a1d26..b8fe2467b9 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -206,7 +206,7 @@ function isNetworkRequestElementValid ($key, $networkTypeId, $networkId) { // Is there cache? if (!isset($GLOBALS[__FUNCTION__][$networkId][$networkTypeId][$key])) { // Does it exist? - $GLOBALS[__FUNCTION__][$networkId][$networkTypeId][$key] = (countSumTotalData(bigintval($networkId), 'network_request_params', 'network_id', 'network_request_param_id', 'network_id', TRUE, sprintf(" AND `network_type_id`=%s AND `network_request_param_key`='%s'", bigintval($networkTypeId), SQL_ESCAPE($key))) == 1); + $GLOBALS[__FUNCTION__][$networkId][$networkTypeId][$key] = (countSumTotalData(bigintval($networkId), 'network_request_params', 'network_request_param_id', 'network_id', TRUE, sprintf(" AND `network_type_id`=%s AND `network_request_param_key`='%s'", bigintval($networkTypeId), SQL_ESCAPE($key))) == 1); } // END - if // Return result @@ -713,7 +713,7 @@ ORDER BY } } else { // Nothing selected - $content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}'); + $content = displayErrorMessage('{--ADMIN_ENTRIES_404--}'); } // Free the result @@ -759,7 +759,7 @@ ORDER BY $content = generateSelectionBoxFromArray($rows, 'network_type', 'network_type_id'); } else { // Nothing selected - $content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}'); + $content = displayErrorMessage('{--ADMIN_ENTRIES_404--}'); } // Free the result @@ -806,7 +806,7 @@ ORDER BY $content = generateSelectionBoxFromArray($rows, 'network_type', 'network_type_id', '', '_title'); } else { // Nothing selected - $content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}'); + $content = displayErrorMessage('{--ADMIN_ENTRIES_404--}'); } // Free the result @@ -1819,7 +1819,7 @@ function doAdminNetworkProcessAddNetwork () { // We can say here, the form is sent, so check if the network is already added if (isNetworkNameValid(postRequestElement('network_short_name'))) { // Already there - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ALREADY_ADDED=' . postRequestElement('network_short_name') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_ALREADY_ADDED=' . postRequestElement('network_short_name') . '%}'); return FALSE; } // END - if @@ -1835,7 +1835,7 @@ function doAdminNetworkProcessAddNetwork () { loadTemplate('admin_network_added', FALSE, postRequestArray()); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_DATA_NOT_ADDED=' . postRequestElement('network_short_name') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_DATA_NOT_ADDED=' . postRequestElement('network_short_name') . '%}'); } } @@ -1873,7 +1873,7 @@ function doAdminNetworkProcessHandleNetworks () { $GLOBALS['network_display'] = FALSE; } else { // Nothing selected/found - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_FOUND--}'); + displayErrorMessage('{--ADMIN_NETWORK_NOTHING_FOUND--}'); } } // END - if } @@ -1931,7 +1931,7 @@ function doAdminNetworkProcessHandleNetworkTypes () { $GLOBALS['network_display'] = FALSE; } else { // Nothing selected/found - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_FOUND--}'); + displayErrorMessage('{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_FOUND--}'); } } // END - if } @@ -1995,7 +1995,7 @@ function doAdminNetworkProcessHandleRequestParams () { $GLOBALS['network_display'] = FALSE; } else { // Nothing selected/found - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}'); + displayErrorMessage('{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}'); } } // END - if } @@ -2042,7 +2042,7 @@ function doAdminNetworkProcessChangeNetworks () { displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}'); } else { // Nothing changed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_CHANGED--}'); + displayErrorMessage('{--ADMIN_NETWORK_NOTHING_CHANGED--}'); } } // END - if } @@ -2069,7 +2069,7 @@ function doAdminNetworkProcessRemoveNetworks () { displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}'); } else { // Nothing removed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_REMOVED--}'); + displayErrorMessage('{--ADMIN_NETWORK_NOTHING_REMOVED--}'); } } // END - if } @@ -2079,7 +2079,7 @@ function doAdminNetworkProcessAddNetworkType () { // Is the network type handle already used with given network? if (isNetworkTypeHandleValid(postRequestElement('network_type_handler'), getRequestElement('network_id'))) { // Already added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_TYPE_HANDLER_ALREADY_ADDED=' . postRequestElement('network_type_handler') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_ALREADY_ADDED=' . postRequestElement('network_type_handler') . '%}'); // ... so abort here return FALSE; @@ -2109,7 +2109,7 @@ function doAdminNetworkProcessAddNetworkType () { loadTemplate('admin_network_type_added', FALSE, postRequestArray()); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_TYPE_HANDLER_NOT_ADDED=' . postRequestElement('network_type_handler') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_NOT_ADDED=' . postRequestElement('network_type_handler') . '%}'); } } @@ -2161,7 +2161,7 @@ function doAdminNetworkProcessChangeHandlerTypes () { displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_UPDATED=' . $updated . '%}'); } else { // Nothing changed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_CHANGED--}'); + displayErrorMessage('{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_CHANGED--}'); } } // END - if } @@ -2214,7 +2214,7 @@ function doAdminNetworkProcessChangeRequestParams () { displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_UPDATED=' . $updated . '%}'); } else { // Nothing changed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED--}'); + displayErrorMessage('{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED--}'); } } // END - if } @@ -2267,7 +2267,7 @@ function doAdminNetworkProcessChangeArrayTranslation () { displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_UPDATED=' . $updated . '%}'); } else { // Nothing changed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_CHANGED--}'); + displayErrorMessage('{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_CHANGED--}'); } } // END - if } @@ -2294,7 +2294,7 @@ function doAdminNetworkProcessRemoveNetworkTypes () { displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_REMOVED=' . $removed . '%}'); } else { // Nothing removed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_REMOVED--}'); + displayErrorMessage('{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_REMOVED--}'); } } // END - if } @@ -2321,7 +2321,7 @@ function doAdminNetworkProcessRemoveNetworkRequestParams () { displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_REMOVED=' . $removed . '%}'); } else { // Nothing removed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED--}'); + displayErrorMessage('{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED--}'); } } // END - if } @@ -2348,7 +2348,7 @@ function doAdminNetworkProcessRemoveNetworkArrayTranslation () { displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_REMOVED=' . $removed . '%}'); } else { // Nothing removed - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_REMOVED--}'); + displayErrorMessage('{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_REMOVED--}'); } } // END - if } @@ -2358,7 +2358,7 @@ function doAdminNetworkProcessAddRequestParam () { // Is the request parameter already used with given network? if (isNetworkRequestElementValid(postRequestElement('network_request_param_key'), postRequestElement('network_type_id'), getRequestElement('network_id'))) { // Already added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_request_param_key') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_request_param_key') . '%}'); // ... so abort here return FALSE; @@ -2382,7 +2382,7 @@ function doAdminNetworkProcessAddRequestParam () { loadTemplate('admin_network_request_param_added', FALSE, postRequestArray()); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED=' . postRequestElement('network_request_param_key') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED=' . postRequestElement('network_request_param_key') . '%}'); } } @@ -2391,7 +2391,7 @@ function doAdminNetworkProcessAddNetworkArrayTranslation () { // Is the request parameter already used with given network? if (isNetworkArrayTranslationValid(postRequestElement('network_array_index'), postRequestElement('network_type_id'), getRequestElement('network_id'))) { // Already added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED=' . postRequestElement('network_array_index') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED=' . postRequestElement('network_array_index') . '%}'); // ... so abort here return FALSE; @@ -2419,7 +2419,7 @@ function doAdminNetworkProcessAddNetworkArrayTranslation () { loadTemplate('admin_network_array_translation_added', FALSE, postRequestArray()); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED=' . postRequestElement('network_array_index') . '%}'); + displayErrorMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED=' . postRequestElement('network_array_index') . '%}'); } } @@ -2482,7 +2482,7 @@ function doAdminNetworkProcessHandleArrayTranslations () { $GLOBALS['network_display'] = FALSE; } else { // Nothing selected/found - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}'); + displayErrorMessage('{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}'); } } // END - if } @@ -2493,7 +2493,7 @@ function doAdminNetworkProcessNetworkApiConfig () { setPostRequestElement('network_id', bigintval(getRequestElement('network_id'))); // NULL empty values - foreach (array('network_api_referral_button', 'network_api_visual_pay_check') as $key) { + foreach (array('network_api_site_id', 'network_api_referral_button', 'network_api_visual_pay_check') as $key) { // Is it set? if (!isPostRequestElementSet($key)) { // Remove empty value to get a NULL for an optional entry @@ -2519,7 +2519,7 @@ function doAdminNetworkProcessNetworkApiConfig () { displayMessage('{--ADMIN_CONFIG_NETWORK_API_SAVED--}'); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_API_NOT_SAVED--}'); + displayErrorMessage('{--ADMIN_CONFIG_NETWORK_API_NOT_SAVED--}'); } } @@ -2597,7 +2597,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = TRUE, $co displayMessage('{%message,ADMIN_CONFIG_NETWORK_HANDLER_TYPE_ALL_HANDLER_SAVED=' . bigintval($numRows) . '%}'); } else { // Nothing has been saved - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}'); + displayErrorMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}'); } } else { // Get SQL query for new entry @@ -2614,7 +2614,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = TRUE, $co displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}'); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}'); + displayErrorMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}'); } } else { // Return amount of affected rows (1 or 2) @@ -2693,7 +2693,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = TRUE, $c displayMessage('{%message,ADMIN_CONFIG_NETWORK_HANDLER_TYPE_ALL_HANDLER_SAVED=' . bigintval($numRows) . '%}'); } else { // Nothing has been saved - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}'); + displayErrorMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}'); } } else { // Get SQL query for new entry @@ -2710,7 +2710,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = TRUE, $c displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}'); } else { // Not added - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}'); + displayErrorMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}'); } } else { // Return amount of affected rows (1 or 2) diff --git a/inc/libs/payout_functions.php b/inc/libs/payout_functions.php index 1447dda5b4..aaadcc95d6 100644 --- a/inc/libs/payout_functions.php +++ b/inc/libs/payout_functions.php @@ -77,14 +77,14 @@ ORDER BY loadTemplate('member_payout_list', TRUE, $OUT); } else { // No payout types setup so far - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_PAYOUT_SETUP_INCOMPLETE--}'); + displayErrorMessage('{--MEMBER_PAYOUT_SETUP_INCOMPLETE--}'); } // Free memory SQL_FREERESULT($result); } else { // Points is empty - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_PAYOUT_NO_POINTS_ENTERED--}'); + displayErrorMessage('{--MEMBER_PAYOUT_NO_POINTS_ENTERED--}'); } } diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 9cb78e56e0..8e0abb3736 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -215,7 +215,7 @@ if (!isAdminRegistered()) { } } else { // Something went wrong here... - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_LOGOUT_FAILED--}'); + displayErrorMessage('{--ADMIN_LOGOUT_FAILED--}'); // Add fatal message addFatalMessage(__FILE__, __LINE__, '{--CANNOT_UNREG_SESS--}'); diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index 391420ca70..97ac60bd9a 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -123,7 +123,7 @@ if (getRequestElement('userid') == 'all') { } } else { // User not found - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); } } else { // Output selection form with all confirmed user accounts listed diff --git a/inc/modules/admin/what-del_user.php b/inc/modules/admin/what-del_user.php index ba011d5f5e..733bb7f0e9 100644 --- a/inc/modules/admin/what-del_user.php +++ b/inc/modules/admin/what-del_user.php @@ -54,7 +54,7 @@ if ((isFormSent()) || ((isFormSent('delete')) && (isPostRequestElementSet('reaso displayMessage('{--ADMIN_DELETE_COMPLETED--}'); } else { // Account does not exists! - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); } } elseif (isPostRequestElementSet('no')) { // Do not delete him... @@ -75,7 +75,7 @@ if ((isFormSent()) || ((isFormSent('delete')) && (isPostRequestElementSet('reaso loadTemplate('admin_delete_user', FALSE, $content); } else { // Account does not exists! - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}'); } } diff --git a/inc/modules/admin/what-edit_user.php b/inc/modules/admin/what-edit_user.php index 05602f4958..d359747501 100644 --- a/inc/modules/admin/what-edit_user.php +++ b/inc/modules/admin/what-edit_user.php @@ -126,7 +126,7 @@ LIMIT 1", } } else { // Account does not exists! - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); } // Free the result diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php index 6f516c0f45..f4c804f6e6 100644 --- a/inc/modules/admin/what-list_bonus.php +++ b/inc/modules/admin/what-list_bonus.php @@ -129,7 +129,7 @@ ORDER BY $content['withdraw_form'] = loadTemplate('admin_list_bonus_form', TRUE); } else { // Display message "no manual withdraw possible" - $content['withdraw_form'] = loadTemplate('admin_settings_unsaved', TRUE, '{--ADMIN_BONUS_ALREADY_WITHDRAW--}'); + $content['withdraw_form'] = displayErrorMessage('{--ADMIN_BONUS_ALREADY_WITHDRAW--}', TRUE); } // Prepare constant for timemark diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php index 2d8588f8e2..d2f9d6e6ac 100644 --- a/inc/modules/admin/what-list_payouts.php +++ b/inc/modules/admin/what-list_payouts.php @@ -164,7 +164,7 @@ LIMIT 1", } } else { // Cannot load payout id - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_PAYOUT_FAILED_OBTAIN_PAYOUT_ID--}'); + displayErrorMessage('{--ADMIN_PAYOUT_FAILED_OBTAIN_PAYOUT_ID--}'); } } else { // Prepare content diff --git a/inc/modules/admin/what-lock_user.php b/inc/modules/admin/what-lock_user.php index d750d2e5ca..5239adb73a 100644 --- a/inc/modules/admin/what-lock_user.php +++ b/inc/modules/admin/what-lock_user.php @@ -148,7 +148,7 @@ LIMIT 1", loadTemplate('admin_lock_user', FALSE, $content); } else { // Account does not exists! - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}'); } } @@ -159,14 +159,14 @@ LIMIT 1", } elseif ($isActive) { // An action was performed... if (!empty($message)) { - loadTemplate('admin_settings_unsaved', FALSE, $message); + displayErrorMessage($message); } else { displayMessage('{--ADMIN_USER_UPDATED--}'); } } } else { // Account does not exists! - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')), '%}'); } } else { // List all users diff --git a/inc/modules/admin/what-sub_points.php b/inc/modules/admin/what-sub_points.php index d4d8123412..04e46e5388 100644 --- a/inc/modules/admin/what-sub_points.php +++ b/inc/modules/admin/what-sub_points.php @@ -112,7 +112,7 @@ if (getRequestElement('userid') == 'all') { } } else { // User not found - loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); } } else { // Output selection form with all confirmed user accounts listed diff --git a/inc/modules/admin/what-updates.php b/inc/modules/admin/what-updates.php index 89df15eea1..2491ec6932 100644 --- a/inc/modules/admin/what-updates.php +++ b/inc/modules/admin/what-updates.php @@ -74,7 +74,7 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($ // Is a newer version available? if (empty($ONLINE['version'])) { // Disconnected? - loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')'); + displayErrorMessage('{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')'); } elseif (($ONLINE['version'] != getFullVersion()) || ($ONLINE['revision'] > getCurrentRepositoryRevision())) { // New full-version available (all previous released patches are included in this version!) $ONLINE['changed'] = generateDateTime($ONLINE['changed'], 2); diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index 2741f949f2..4c91c6f5ef 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -105,7 +105,7 @@ if ($isValid === TRUE) { } else { // Is there already submit the form? if (isPostRequestElementSet('nickname')) { - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_NICKNAME_IS_INVALID--}'); + displayErrorMessage('{--MEMBER_NICKNAME_IS_INVALID--}'); } // END - if // Load Template diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 3d0fca10ab..c8fcdb516c 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -183,27 +183,27 @@ switch ($mode) { displayMessage('
{--MEMBER_TRANSFER_COMPLETED--}' . '
{--MEMBER_TRANSFER_CONTINUE_OVERVIEW--}
'); } elseif ($valid_code === FALSE) { // Invalid Touring code! - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_CODE--}'); + displayErrorMessage('{--MEMBER_TRANSFER_INVALID_CODE--}'); unsetPostRequestElement('ok'); } elseif ($valid_pass === FALSE) { // Wrong password entered - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_PASSWORD--}'); + displayErrorMessage('{--MEMBER_TRANSFER_INVALID_PASSWORD--}'); unsetPostRequestElement('ok'); } elseif ($valid_amount === FALSE) { // Too much points entered - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_POINTS--}'); + displayErrorMessage('{--MEMBER_TRANSFER_INVALID_POINTS--}'); unsetPostRequestElement('ok'); } elseif ($valid_reason === FALSE) { // No transfer reason entered - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_REASON--}'); + displayErrorMessage('{--MEMBER_TRANSFER_INVALID_REASON--}'); unsetPostRequestElement('ok'); } elseif ($valid_recipient === FALSE) { // No recipient selected - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_RECIPIENT--}'); + displayErrorMessage('{--MEMBER_TRANSFER_INVALID_RECIPIENT--}'); unsetPostRequestElement('ok'); } elseif ($valid_data === FALSE) { // No recipient/sender selected - loadTemplate('admin_settings_unsaved', FALSE, '{--MEMBER_TRANSFER_INVALID_DATA--}'); + displayErrorMessage('{--MEMBER_TRANSFER_INVALID_DATA--}'); unsetPostRequestElement('ok'); } diff --git a/inc/template-functions.php b/inc/template-functions.php index 668f63f767..3bd31a9dc4 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -1948,6 +1948,12 @@ function displayMessage ($message, $return = FALSE) { return loadTemplate('admin_settings_saved', $return, $message); } +// Displays given error message in admin_settings_saved template +function displayErrorMessage ($message, $return = FALSE) { + // Load the template + return loadTemplate('admin_settings_unsaved', $return, $message); +} + // Generates a selection box for (maybe) given gender function generateGenderSelectionBox ($selectedGender = '', $fieldName = 'gender') { // Start the HTML code