X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_network_api.php;h=7c336a5ece58046e5795a6deb88014bd8fac2543;hb=095f5ab59b539834d2c67e5d409d01820e10d8be;hp=60a1931cfcc3a81ebd8f5c8a2fe16b1b899f5d48;hpb=ba764b4060d3d82fc59e1bd72f68d0a4bb51f723;p=mailer.git diff --git a/inc/modules/admin/what-config_network_api.php b/inc/modules/admin/what-config_network_api.php index 60a1931cfc..7c336a5ece 100644 --- a/inc/modules/admin/what-config_network_api.php +++ b/inc/modules/admin/what-config_network_api.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -44,81 +44,102 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { addYouAreHereLink('admin', __FILE__); // By default we should display list/add new forms -$GLOBALS['network_display'] = true; +$GLOBALS['network_display'] = TRUE; // Handle form here doNetworkHandleForm(); // Display forms? -if ($GLOBALS['network_display'] === false) { +if ($GLOBALS['network_display'] === FALSE) { // Abort here return; } // END - if -// Do we have a network selected? -if (isGetRequestElementSet('network')) { +// Is there a network selected? +if (isGetRequestElementSet('network_id')) { // Check all networks that doesn't have a configuration entry - $result = SQL_QUERY_ESC('SELECT + $result = sqlQueryEscaped('SELECT `network_id`, `network_short_name`, `network_title`, `network_reflink`, - NULL AS `network_affiliate_id`, + `network_query_amount`, + `network_active`, + NULL AS `network_api_affiliate_id`, NULL AS `network_api_password`, - NULL AS `network_site_id`, - NULL AS `network_query_amount`, - NULL AS `network_api_active` + NULL AS `network_api_site_id`, + NULL AS `network_api_active`, + NULL AS `network_api_referral_link`, + NULL AS `network_api_referral_button`, + NULL AS `network_api_remaining_requests`, + NULL AS `network_api_visual_pay_check` FROM `{?_MYSQL_PREFIX?}_network_data` WHERE `network_id`=%s LIMIT 1', array( - bigintval(getRequestElement('network')) + bigintval(getRequestElement('network_id')) ), __FILE__, __LINE__); - // Do we have an entry? - if (SQL_NUMROWS($result) == 1) { + // Is there an entry? + if (sqlNumRows($result) == 1) { // Load data - $content = SQL_FETCHARRAY($result); + $content = sqlFetchArray($result); + + // Is the network active? + if (($content['network_active'] == 'N') && (!isAdminsExpertWarningEnabled()) && (!isDebugModeEnabled())) { + // Not active + displayMessage('{--ADMIN_NETWORK_NOT_ACTIVE--}'); + return; + } // END - if // Query for config table - $result_config = SQL_QUERY_ESC('SELECT - `network_affiliate_id`, + $result_config = sqlQueryEscaped('SELECT + `network_api_affiliate_id`, `network_api_password`, - `network_site_id`, - `network_query_amount`, - `network_api_active` + `network_api_site_id`, + `network_api_active`, + `network_api_referral_link`, + `network_api_referral_button`, + `network_api_remaining_requests`, + `network_api_visual_pay_check` FROM `{?_MYSQL_PREFIX?}_network_api_config` WHERE `network_id`=%s LIMIT 1', array( - bigintval(getRequestElement('network')) + bigintval(getRequestElement('network_id')) ), __FUNCTION__, __LINE__); - // Do we have an entry? - if (SQL_NUMROWS($result_config) == 1) { + // Is there an entry? + if (sqlNumRows($result_config) == 1) { // Load entries - $content = merge_array($content, SQL_FETCHARRAY($result_config)); + $content = merge_array($content, sqlFetchArray($result_config)); } // END - if // Free result - SQL_FREERESULT($result_config); + sqlFreeResult($result_config); - // Load main template - loadTemplate('admin_config_network_api', false, $content); + // Load main template (for "add" and "edit") + loadTemplate('admin_config_network_api', FALSE, $content); } else { // Please setup some networks first displayMessage('{--ADMIN_NETWORK_DATA_MISSING--}'); } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); } else { // Generate network list for this script - outputHtml(generateAdminNetworkList()); + $OUT = generateAdminNetworkList(TRUE); + + // Is it not empty? + if (!empty($OUT)) { + // Output it + outputHtml($OUT); + } // END - if } // [EOF]