]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_network_types.php
Fixed also usage of previously renamed fields as they must be the same
[mailer.git] / inc / modules / admin / what-config_network_types.php
index f6af185807b7978fab4f46dca6912330c47205d5..df245ec0f358293a38b70021cb0d095e617550b4 100644 (file)
@@ -44,18 +44,18 @@ 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?
+// Is there a network selected?
 if (isGetRequestElementSet('network_id')) {
        // Set current network id
        setCurrentNetworkId(getRequestElement('network_id'));
@@ -64,39 +64,43 @@ if (isGetRequestElementSet('network_id')) {
        if (isGetRequestElementSet('network_type_id')) {
                // Load data for given network
                $result = SQL_QUERY_ESC('SELECT
-       t.`network_id`,
-       t.`network_type_id`,
-       t.`network_type_handler`,
-       t.`network_type_reload_time_unit`,
-       d.`network_active`,
+       `t`.`network_id`,
+       `t`.`network_type_id`,
+       `t`.`network_type_handler`,
+       `t`.`network_type_reload_time_unit`,
+       `d`.`network_active`,
        NULL AS `network_data_id`,
        NULL AS `network_max_reload_time`,
        NULL AS `network_min_waiting_time`,
+       NULL AS `network_max_waiting_time`,
+       NULL AS `network_min_remain_budget`,
        NULL AS `network_min_remain_clicks`,
        NULL AS `network_min_payment`,
-       NULL AS `network_allow_erotic`
+       NULL AS `network_allow_erotic`,
+       NULL AS `network_media_size`,
+       NULL AS `network_media_output`
 FROM
-       `{?_MYSQL_PREFIX?}_network_types` AS t
+       `{?_MYSQL_PREFIX?}_network_types` AS `t`
 INNER JOIN
-       `{?_MYSQL_PREFIX?}_network_data` AS d
+       `{?_MYSQL_PREFIX?}_network_data` AS `d`
 ON
        d.network_id=t.network_id
 WHERE
-       t.`network_id`=%s AND
-       t.`network_type_id`=%s
+       `t`.`network_id`=%s AND
+       `t`.`network_type_id`=%s
 LIMIT 1',
                        array(
                                bigintval(getRequestElement('network_id')),
                                bigintval(getRequestElement('network_type_id'))
                        ), __FUNCTION__, __LINE__);
 
-               // Do we have a record?
+               // Is there a record?
                if (SQL_NUMROWS($result) == 1) {
                        // Load it
                        $content = SQL_FETCHARRAY($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;
@@ -107,11 +111,15 @@ LIMIT 1',
        `network_data_id`,
        `network_max_reload_time`,
        `network_min_waiting_time`,
+       `network_max_waiting_time`,
+       `network_min_remain_budget`,
        `network_min_remain_clicks`,
        `network_min_payment`,
-       `network_allow_erotic`
+       `network_allow_erotic`,
+       `network_media_size`,
+       `network_media_output`
 FROM
-       `{?_MYSQL_PREFIX?}_network_types_config`
+       `{?_MYSQL_PREFIX?}_network_handler_config`
 WHERE
        `network_id`=%s AND
        `network_type_id`=%s
@@ -140,7 +148,7 @@ LIMIT 1',
                        $content['network_max_reload_time']  = createTimeSelections($content['network_max_reload_time'], 'network_max_reload_time', 'WDhms');
 
                        // Load template
-                       loadTemplate($templateName, false, $content);
+                       loadTemplate($templateName, FALSE, $content);
 
                        // Abort here
                        return;
@@ -169,7 +177,7 @@ ORDER BY
                        bigintval(getRequestElement('network_id'))
                ), __FUNCTION__, __LINE__);
 
-       // Do we have entries left?
+       // Are there entries left?
        if (!SQL_HASZERONUMS($result)) {
                // Init row output
                $OUT = '';
@@ -181,11 +189,15 @@ ORDER BY
        `network_data_id`,
        `network_max_reload_time`,
        `network_min_waiting_time`,
+       `network_max_waiting_time`,
+       `network_min_remain_budget`,
        `network_min_remain_clicks`,
        `network_min_payment`,
-       `network_allow_erotic`
+       `network_allow_erotic`,
+       `network_media_size`,
+       `network_media_output`
 FROM
-       `{?_MYSQL_PREFIX?}_network_types_config`
+       `{?_MYSQL_PREFIX?}_network_handler_config`
 WHERE
        `network_id`=%s AND
        `network_type_id`=%s
@@ -195,23 +207,23 @@ LIMIT 1',
                                        bigintval($content['network_type_id'])
                                ), __FUNCTION__, __LINE__);
 
-                       // Do we have an entry?
+                       // Is there an entry?
                        if (SQL_NUMROWS($result_config) == 1) {
                                // Load this data as well
                                $content = merge_array($content, SQL_FETCHARRAY($result_config));
 
                                // Add it with extra template
-                               $content['network_type_config_content'] = loadTemplate('admin_show_config_network_type', true, $content);
+                               $content['network_type_config_content'] = loadTemplate('admin_show_config_network_type', TRUE, $content);
                        } else {
                                // No configuration found, so display form
-                               $content['network_type_config_content'] = loadTemplate('admin_add_config_network_type', true, $content);
+                               $content['network_type_config_content'] = loadTemplate('admin_add_config_network_type', TRUE, $content);
                        }
 
                        // Free result
                        SQL_FREERESULT($result_config);
 
                        // Load row template
-                       $OUT .= loadTemplate('admin_config_network_types_row', true, $content);
+                       $OUT .= loadTemplate('admin_config_network_types_row', TRUE, $content);
                } // END - while
 
                // Prepare array for main template
@@ -221,7 +233,7 @@ LIMIT 1',
                );
 
                // Load main template
-               loadTemplate('admin_config_network_types', false, $content);
+               loadTemplate('admin_config_network_types', FALSE, $content);
        } else {
                // No entries found
                displayMessage('{%message,ADMIN_CONFIG_NETWORK_HANDLER_TYPES_404=' . bigintval(getRequestElement('network_id')) . '%}');
@@ -231,7 +243,16 @@ LIMIT 1',
        SQL_FREERESULT($result);
 } else {
        // Generate network list for this script
-       outputHtml(generateAdminNetworkList());
+       $OUT = generateAdminNetworkList(FALSE, TRUE, FALSE);
+
+       // Is it not empty?
+       if (!empty($OUT)) {
+               // Output it
+               outputHtml($OUT);
+       } else {
+               // Nothing configured yet
+               displayMessage('{--ADMIN_NETWORK_QUERY_API_404--}');
+       }
 }
 
 // [EOF]