]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_network_api.php
Some cleanups/improvements
[mailer.git] / inc / modules / admin / what-config_network_api.php
index 9f213a2a271de12ef7697e9aae87a0fefacb1d08..b2e4fe8facb330f024fa79e697b4e42ee4645a67 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -58,7 +58,7 @@ if ($GLOBALS['network_display'] === FALSE) {
 // 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`,
@@ -70,36 +70,40 @@ if (isGetRequestElementSet('network_id')) {
        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_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",
+LIMIT 1',
                array(
                        bigintval(getRequestElement('network_id'))
                ), __FILE__, __LINE__);
 
        // Is there an entry?
-       if (SQL_NUMROWS($result) == 1) {
+       if (sqlNumRows($result) == 1) {
                // Load data
-               $content = SQL_FETCHARRAY($result);
+               $content = sqlFetchArray($result);
 
                // Is the network active?
-               if ($content['network_active'] == 'N') {
+               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
+               $result_config = sqlQueryEscaped('SELECT
        `network_api_affiliate_id`,
        `network_api_password`,
        `network_api_site_id`,
        `network_api_active`,
        `network_api_referral_link`,
-       `network_api_referral_button`
+       `network_api_referral_button`,
+       `network_api_remaining_requests`,
+       `network_api_visual_pay_check`
 FROM
        `{?_MYSQL_PREFIX?}_network_api_config`
 WHERE
@@ -110,15 +114,15 @@ LIMIT 1',
                        ), __FUNCTION__, __LINE__);
 
                // Is there an entry?
-               if (SQL_NUMROWS($result_config) == 1) {
+               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
+               // Load main template (for "add" and "edit")
                loadTemplate('admin_config_network_api', FALSE, $content);
        } else {
                // Please setup some networks first
@@ -126,10 +130,16 @@ LIMIT 1',
        }
 
        // 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]