Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / libs / network_functions.php
index 5794a6f219fcbbf09bae3aabd88ec92d06ee385e..f89979e68dc8e36e5f900a4003d438967c70bdaf 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -55,7 +55,7 @@ function detectNetworkProcessForm () {
        // 'do' must be provided in URL
        if (!isGetRequestElementSet('do')) {
                // Not provided!
-               debug_report_bug(__FUNCTION__, __LINE__, 'No "do" has been provided. Please fix your templates.');
+               reportBug(__FUNCTION__, __LINE__, 'No "do" has been provided. Please fix your templates.');
        } // END - if
 
        // Default is invalid
@@ -76,13 +76,13 @@ function detectNetworkProcessForm () {
        // Has the form being detected?
        if ($GLOBALS['network_form_name'] == 'invalid') {
                // Not supported
-               debug_report_bug(__FUNCTION__, __LINE__, 'POST form could not be detected.');
+               reportBug(__FUNCTION__, __LINE__, 'POST form could not be detected.');
        } // END - if
 }
 
 // Handle a (maybe) sent form here
 function doNetworkHandleForm () {
-       // Do we have a form sent?
+       // Is there a form sent?
        if (countRequestPost() > 0) {
                // Detect sent POST form
                detectNetworkProcessForm();
@@ -103,14 +103,17 @@ function doAdminNetworkProcessForm () {
        // Is the function valid?
        if (!function_exists($functionName)) {
                // Invalid function name
-               debug_report_bug(__FUNCTION__, __LINE__, 'Invalid do ' . getRequestElement('do') . ', function ' . $functionName .' does not exist.', false);
+               reportBug(__FUNCTION__, __LINE__, 'Invalid do ' . getRequestElement('do') . ', function ' . $functionName .' does not exist.', false);
        } // END - if
 
+       // Init global arrays
+       $GLOBALS['network_types_disabled'] = array();
+
        // Call-back the method handling our request
        call_user_func($functionName);
 }
 
-// Checks wether the (short) network name is already used (valid)
+// Checks whether the (short) network name is already used (valid)
 function isNetworkNameValid ($name) {
        // Query for it
        $result = SQL_QUERY_ESC("SELECT `network_id` FROM `{?_MYSQL_PREFIX?}_network_data` WHERE `network_short_name`='%s' LIMIT 1",
@@ -126,7 +129,7 @@ function isNetworkNameValid ($name) {
        return $isValid;
 }
 
-// Checks wether the given network type is already used (valid)
+// Checks whether the given network type is already used (valid)
 function isNetworkTypeHandleValid ($type, $networkId) {
        // Query for it
        $result = SQL_QUERY_ESC("SELECT `network_type_id` FROM `{?_MYSQL_PREFIX?}_network_types` WHERE `network_id`=%s AND `network_type_handler`='%s' LIMIT 1",
@@ -145,7 +148,7 @@ function isNetworkTypeHandleValid ($type, $networkId) {
        return $isValid;
 }
 
-// Checks wether the given network request parameter is already used (valid)
+// Checks whether the given network request parameter is already used (valid)
 function isNetworkRequestElementValid ($key, $type, $networkId) {
        // Query for it
        $result = SQL_QUERY_ESC("SELECT `network_request_param_id` FROM `{?_MYSQL_PREFIX?}_network_request_params` WHERE `network_id`=%s AND `network_type_id`=%s AND `network_request_param_key`='%s' LIMIT 1",
@@ -165,7 +168,26 @@ function isNetworkRequestElementValid ($key, $type, $networkId) {
        return $isValid;
 }
 
-// Checks wether the given network API array translation
+// Checks whether 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 whether the given network API array translation
 function isNetworkArrayTranslationValid ($key, $type, $networkId) {
        // Query for it
        $result = SQL_QUERY_ESC("SELECT `network_array_id` FROM `{?_MYSQL_PREFIX?}_network_array_translation` WHERE `network_id`=%s AND `network_type_id`=%s AND `network_array_index`='%s' LIMIT 1",
@@ -190,7 +212,7 @@ function getNetworkDataById ($networkId, $column = '') {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // Set current network id
@@ -202,7 +224,7 @@ function getNetworkDataById ($networkId, $column = '') {
                $GLOBALS['network_data'][$networkId] = array();
 
                // Query for the network data
-               $result = SQL_QUERY_ESC('SELECT
+               $result = SQL_QUERY_ESC("SELECT
        `network_id`,
        `network_short_name`,
        `network_title`,
@@ -217,10 +239,10 @@ FROM
        `{?_MYSQL_PREFIX?}_network_data`
 WHERE
        `network_id`=%s
-LIMIT 1',
+LIMIT 1",
                        array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-               // Do we have an entry?
+               // Is there an entry?
                if (SQL_NUMROWS($result) == 1) {
                        // Then get it
                        $GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
@@ -245,7 +267,7 @@ function getNetworkDataByTypeId ($networkId, $column = '') {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network type id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network type id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // Set current network id
@@ -257,7 +279,7 @@ function getNetworkDataByTypeId ($networkId, $column = '') {
                $GLOBALS['network_data'][$networkId] = array();
 
                // Query for the network data
-               $result = SQL_QUERY_ESC('SELECT
+               $result = SQL_QUERY_ESC("SELECT
        d.`network_id`,
        d.`network_short_name`,
        d.`network_title`,
@@ -280,10 +302,10 @@ ON
        d.`network_id`=t.`network_id`
 WHERE
        t.`network_type_id`=%s
-LIMIT 1',
+LIMIT 1",
                        array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-               // Do we have an entry?
+               // Is there an entry?
                if (SQL_NUMROWS($result) == 1) {
                        // Then get it
                        $GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
@@ -308,7 +330,7 @@ function getNetworkTypeDataById ($networkId) {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network type id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network type id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // By default we have no data
@@ -329,7 +351,7 @@ WHERE
 LIMIT 1',
                array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-       // Do we have an entry?
+       // Is there an entry?
        if (SQL_NUMROWS($result) == 1) {
                // Then get it
                $GLOBALS['network_type_data'][$networkId] = SQL_FETCHARRAY($result);
@@ -347,7 +369,7 @@ function getNetworkRequestParamsDataById ($networkId) {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // By default we have no data
@@ -368,7 +390,7 @@ WHERE
 LIMIT 1',
                array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-       // Do we have an entry?
+       // Is there an entry?
        if (SQL_NUMROWS($result) == 1) {
                // Then get it
                $networkRequestData = SQL_FETCHARRAY($result);
@@ -386,7 +408,7 @@ function doNetworkUpdateDataByArray ($networkId, $networkData) {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // Just call our inner method
@@ -398,7 +420,7 @@ function doNetworkUpdateTypeByArray ($networkId, $networkTypeData) {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network type handler id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network type handler id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // Just call our inner method
@@ -410,7 +432,7 @@ function doNetworkUpdateParamsByArray ($networkId, $networkParamData) {
        // Ids lower one are not accepted
        if ($networkId < 1) {
                // Not good, should be fixed
-               debug_report_bug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $networkId . ' is smaller than 1.');
+               reportBug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $networkId . ' is smaller than 1.');
        } // END - if
 
        // Just call our inner method
@@ -438,16 +460,18 @@ function generateAdminNetworkList () {
        $content = '';
 
        // Query for all networks
-       $result = SQL_QUERY('SELECT
+       $result = SQL_QUERY("SELECT
        `network_id`,
        `network_short_name`,
        `network_title`
 FROM
        `{?_MYSQL_PREFIX?}_network_data`
+WHERE
+       `network_active`='Y'
 ORDER BY
-       `network_short_name` ASC', __FUNCTION__, __LINE__);
+       `network_short_name` ASC", __FUNCTION__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
@@ -492,7 +516,7 @@ ORDER BY
                        bigintval($networkId)
                ), __FUNCTION__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
@@ -524,19 +548,23 @@ function generateAdminDistinctNetworkTypeList () {
        $content = '';
 
        // Query all types of this network
-       $result = SQL_QUERY('SELECT
-       t.`network_type_id`, t.`network_type_handler`, d.`network_title`
+       $result = SQL_QUERY("SELECT
+       t.`network_type_id`,
+       t.`network_type_handler`,
+       d.`network_title`
 FROM
        `{?_MYSQL_PREFIX?}_network_types` AS t
 LEFT JOIN
        `{?_MYSQL_PREFIX?}_network_data` AS d
 ON
        t.`network_id`=d.`network_id`
+WHERE
+       d.`network_active`='Y'
 ORDER BY
        d.`network_short_name` ASC,
-       t.`network_type_handler` ASC', __FUNCTION__, __LINE__);
+       t.`network_type_handler` ASC", __FUNCTION__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
@@ -573,7 +601,7 @@ function generateNetworkTypeOptions ($networkId) {
        // Is this cached?
        if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
                // Generate output and cache it
-               $GLOBALS[__FUNCTION__][$networkId] = generateOptionList(
+               $GLOBALS[__FUNCTION__][$networkId] = generateOptions(
                        'network_types',
                        'network_type_id',
                        'network_type_handler',
@@ -593,11 +621,11 @@ function generateNetworkTypeOptions ($networkId) {
 }
 
 // Generates an options list of all available (hard-coded) handlers
-function generateNetworkTypesAvailableOptions () {
+function generateNetworkTypesAvailableOptions ($defaultType = NULL) {
        // Is it cached?
-       if (!isset($GLOBALS[__FUNCTION__])) {
+       if (!isset($GLOBALS[__FUNCTION__][$defaultType])) {
                // Generate list
-               $GLOBALS[__FUNCTION__] = generateOptionList(
+               $GLOBALS[__FUNCTION__][$defaultType] = generateOptions(
                        '/ARRAY/',
                        array(
                                'banner',
@@ -631,7 +659,7 @@ function generateNetworkTypesAvailableOptions () {
                                'traffic'
                        ),
                        array(),
-                       '',
+                       $defaultType,
                        '', '',
                        $GLOBALS['network_types_disabled'],
                        'translateNetworkTypeHandler'
@@ -639,15 +667,15 @@ function generateNetworkTypesAvailableOptions () {
        } // END - if
 
        // Return content
-       return $GLOBALS[__FUNCTION__];
+       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__])) {
                // Generate and cache it
-               $GLOBALS[__FUNCTION__] = generateOptionList(
+               $GLOBALS[__FUNCTION__] = generateOptions(
                        '/ARRAY/',
                        array(
                                'id',
@@ -670,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__] = generateOptions(
+                       '/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
 
@@ -683,7 +745,7 @@ function generateNetworkTranslationOptions ($default = '') {
        // Is it cached?
        if (!isset($GLOBALS[__FUNCTION__][$default])) {
                // Generate and cache it
-               $GLOBALS[__FUNCTION__][$default] = generateOptionList(
+               $GLOBALS[__FUNCTION__][$default] = generateOptions(
                        'network_translations',
                        'network_translation_id',
                        'network_translation_name',
@@ -701,10 +763,10 @@ function generateNetworkTranslationOptions ($default = '') {
 
 // Generates an option list of request types
 function generateNetworkRequestTypeOptions ($default = '') {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$default])) {
                // Generate the list
-               $GLOBALS[__FUNCTION__][$default] = generateOptionList(
+               $GLOBALS[__FUNCTION__][$default] = generateOptions(
                        '/ARRAY/',
                        array(
                                'GET',
@@ -724,10 +786,10 @@ function generateNetworkRequestTypeOptions ($default = '') {
 
 // Generates an option list of network_api_active
 function generateNetworkApiActiveOptions ($default = '') {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$default])) {
                // Generate the list
-               $GLOBALS[__FUNCTION__][$default] = generateYesNoOptionList($default);
+               $GLOBALS[__FUNCTION__][$default] = generateYesNoOptions($default);
        } // END - if
 
        // Return cache
@@ -736,31 +798,82 @@ function generateNetworkApiActiveOptions ($default = '') {
 
 // Translates 'translate_name' for e.g. templates
 function translateNetworkTranslationName ($name) {
-       // Get the message id
-       return '{--ADMIN_NETWORK_TRANSLATE_' . strtoupper($name) . '_NAME--}';
+       // Generate id
+       $messageId = 'ADMIN_NETWORK_TRANSLATE_' . strtoupper($name) . '_NAME';
+
+       // Is the message id there?
+       if (!isMessageIdValid($messageId)) {
+               // Not valid type
+               reportBug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+       } // END - if
+
+       // Return message id
+       return '{--' . $messageId . '--}';
 }
 
 // Translates the network type handler (e.g. banner, paidmail) for templates
 function translateNetworkTypeHandler ($type) {
-       // Get the message id
-       return '{--ADMIN_NETWORK_HANDLER_TYPES_' . strtoupper($type) . '--}';
+       // Generate id
+       $messageId = 'ADMIN_NETWORK_TYPE_HANDLER_' . strtoupper($type);
+
+       // Is the message id there?
+       if (!isMessageIdValid($messageId)) {
+               // Not valid type
+               reportBug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+       } // END - if
+
+       // Return message id
+       return '{--' . $messageId . '--}';
 }
 
 // Translates request type
 function translateNetworkRequestType ($type) {
-       // Get the message id
-       return '{--ADMIN_NETWORK_REQUEST_TYPE_' . strtoupper($type) . '--}';
+       // Generate id
+       $messageId = 'ADMIN_NETWORK_REQUEST_TYPE_' . strtoupper($type) . '';
+
+       // Is the message id there?
+       if (!isMessageIdValid($messageId)) {
+               // Not valid type
+               reportBug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+       } // END - if
+
+       // Return message id
+       return '{--' . $messageId . '--}';
 }
 
 // Translates request parameter
-function translateNetworkRequestParamKey ($param) {
-       // Get the message id
-       return '{--ADMIN_NETWORK_REQUEST_PARAMETER_' . strtoupper($param) . '--}';
+function translateNetworkRequestParameterKey ($param) {
+       // Generate id
+       $messageId = 'ADMIN_NETWORK_REQUEST_PARAMETER_' . strtoupper($param) . '';
+
+       // Is the message id there?
+       if (!isMessageIdValid($messageId)) {
+               // Not valid param
+               reportBug(__FUNCTION__, __LINE__, 'param=' . $param . ' is invalid.');
+       } // END - if
+
+       // Return message id
+       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
+               reportBug(__FUNCTION__, __LINE__, 'param=' . $param . ' is invalid.');
+       } // END - if
+
+       // Return message id
+       return '{--' . $messageId . '--}';
 }
 
 // Translates API index
 function translateNetworkApiIndex ($index) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS['network_array_index'])) {
                // Get an array of all API array indexes
                $GLOBALS['network_array_index'] = array();
@@ -779,7 +892,7 @@ ON
 ORDER BY
        `sort` ASC', __FUNCTION__, __LINE__);
 
-               // Do we have entries?
+               // Are there entries?
                if (!SQL_HASZERONUMS($result)) {
                        // Get all entries
                        while ($row = SQL_FETCHARRAY($result)) {
@@ -807,7 +920,7 @@ ORDER BY
 
 // Translates network API configuration status (see function isNetworkApiConfigured()) by given id
 function translateNetworkApiConfiguredStatusById ($networkId) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
                // By default it is not configured
                $GLOBALS[__FUNCTION__][$networkId] = '{--ADMIN_NETWORK_API_NOT_CONFIGURED--}';
@@ -825,7 +938,7 @@ function translateNetworkApiConfiguredStatusById ($networkId) {
 
 // Checks if the given network is configured by looking its API configuration entry up
 function isNetworkApiConfigured ($networkId) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
                // Check for an entry in network_api_config
                $GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(
@@ -841,9 +954,9 @@ function isNetworkApiConfigured ($networkId) {
        return $GLOBALS[__FUNCTION__][$networkId];
 }
 
-// Checks wether the given network type handler is configured
+// Checks whether the given network type handler is configured
 function isNetworkTypeHandlerConfigured ($networkId, $networkTypeId) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$networkId][$networkTypeId])) {
                // Determine it
                $GLOBALS[__FUNCTION__][$networkId][$networkTypeId] = (countSumTotalData(
@@ -860,6 +973,12 @@ function isNetworkTypeHandlerConfigured ($networkId, $networkTypeId) {
        return $GLOBALS[__FUNCTION__][$networkId][$networkTypeId];
 }
 
+// Handles the network-payment-check request
+function handleNetworkPaymentCheckRequest () {
+       // @TODO Implement this function, don't forget to set HTTP status back to '200 OK' if everything went fine
+       reportBug(__FUNCTION__, __LINE__, 'Not yet implemented.');
+}
+
 //------------------------------------------------------------------------------
 //                             Call-back functions
 //------------------------------------------------------------------------------
@@ -894,7 +1013,7 @@ function doAdminNetworkProcessAddNetwork () {
 
 // Displays selected networks for editing
 function doAdminNetworkProcessHandleNetworks () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // Something has been selected, so start displaying one by one
                $OUT = '';
@@ -904,7 +1023,7 @@ function doAdminNetworkProcessHandleNetworks () {
                                // Load this network's data
                                $networkData = getNetworkDataById($networkId);
 
-                               // Do we have found the network?
+                               // Is there found the network?
                                if (count($networkData) > 0) {
                                        // Add row template with given form name
                                        $OUT .= loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks_row', true, $networkData);
@@ -928,7 +1047,7 @@ function doAdminNetworkProcessHandleNetworks () {
 
 // Handle network type form
 function doAdminNetworkProcessHandleNetworkTypes () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // Load network data
                $networkData = getNetworkDataById(getRequestElement('network_id'));
@@ -941,7 +1060,7 @@ function doAdminNetworkProcessHandleNetworkTypes () {
                                // Load this network's data
                                $networkTypeData = getNetworkTypeDataById($networkId);
 
-                               // Do we have found the network?
+                               // Is there found the network?
                                if (count($networkTypeData) > 0) {
                                        if (isFormSent('edit')) {
                                                // Add row template for deleting
@@ -951,7 +1070,7 @@ function doAdminNetworkProcessHandleNetworkTypes () {
                                                $OUT .= loadTemplate('admin_delete_network_types_row', true, $networkTypeData);
                                        } else {
                                                // Problem!
-                                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
+                                               reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
                                } // END - if
                        } // END - if
@@ -966,21 +1085,21 @@ function doAdminNetworkProcessHandleNetworkTypes () {
                                loadTemplate('admin_delete_network_types', false, $OUT);
                        } else {
                                // Problem!
-                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
+                               reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                        }
 
                        // Don't display the list/add new form
                        $GLOBALS['network_display'] = false;
                } else {
                        // Nothing selected/found
-                       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_HANDLER_TYPES_NOTHING_FOUND--}');
+                       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_FOUND--}');
                }
        } // END - if
 }
 
 // Handle network request parameter form
 function doAdminNetworkProcessHandleRequestParams () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // Init cache array
                $GLOBALS['network_request_params_disabled'] = array();
@@ -996,7 +1115,7 @@ function doAdminNetworkProcessHandleRequestParams () {
                                // Load this network's data
                                $networkRequestData = getNetworkRequestParamsDataById($networkId);
 
-                               // Do we have found the network?
+                               // Is there found the network?
                                if (count($networkRequestData) > 0) {
                                        if (isFormSent('edit')) {
                                                // Add row template for deleting
@@ -1009,7 +1128,7 @@ function doAdminNetworkProcessHandleRequestParams () {
                                                $OUT .= loadTemplate('admin_delete_network_request_params_row', true, $networkRequestData);
                                        } else {
                                                // Problem!
-                                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
+                                               reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
                                } // END - if
                        } // END - if
@@ -1024,7 +1143,7 @@ function doAdminNetworkProcessHandleRequestParams () {
                                loadTemplate('admin_delete_network_request_params', false, $OUT);
                        } else {
                                // Problem!
-                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
+                               reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                        }
 
                        // Don't display the list/add new form
@@ -1038,7 +1157,7 @@ function doAdminNetworkProcessHandleRequestParams () {
 
 // Changes given networks
 function doAdminNetworkProcessChangeNetworks () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
@@ -1057,10 +1176,10 @@ function doAdminNetworkProcessChangeNetworks () {
                                                continue;
                                        } // END - if
 
-                                       // Do we have this enty?
+                                       // Is there this enty?
                                        if (!isset($entry[$networkId])) {
                                                // Not found, needs fixing
-                                               debug_report_bug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
+                                               reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
                                        } // END - if
 
                                        // Add this entry
@@ -1072,7 +1191,7 @@ function doAdminNetworkProcessChangeNetworks () {
                        } // END - if
                } // END - foreach
 
-               // Do we have updates?
+               // Is there updates?
                if ($updated > 0) {
                        // Updates done
                        displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}');
@@ -1085,7 +1204,7 @@ function doAdminNetworkProcessChangeNetworks () {
 
 // Removes given networks
 function doAdminNetworkProcessRemoveNetworks () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
@@ -1099,7 +1218,7 @@ function doAdminNetworkProcessRemoveNetworks () {
                        } // END - if
                } // END - foreach
 
-               // Do we have removes?
+               // Is there removes?
                if ($removed > 0) {
                        // Removals done
                        displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}');
@@ -1115,7 +1234,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_HANDLER_TYPES_HANDLE_ALREADY_ADDED=' . postRequestElement('network_type_handler') . '%}');
+               loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_TYPE_HANDLER_ALREADY_ADDED=' . postRequestElement('network_type_handler') . '%}');
 
                // ... so abort here
                return false;
@@ -1142,13 +1261,13 @@ function doAdminNetworkProcessAddNetworkType () {
                loadTemplate('admin_network_type_added', false, postRequestArray());
        } else {
                // Not added
-               loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_HANDLER_TYPES_NOT_ADDED=' . postRequestElement('network_type_handler') . '%}');
+               loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_TYPE_HANDLER_NOT_ADDED=' . postRequestElement('network_type_handler') . '%}');
        }
 }
 
 // Changes given network type handlers
 function doAdminNetworkProcessChangeHandlerTypes () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
@@ -1167,10 +1286,10 @@ function doAdminNetworkProcessChangeHandlerTypes () {
                                                continue;
                                        } // END - if
 
-                                       // Do we have this enty?
+                                       // Is there this enty?
                                        if (!isset($entry[$networkId])) {
                                                // Not found, needs fixing
-                                               debug_report_bug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
+                                               reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
                                        } // END - if
 
                                        // Fix empty network_type_banner_url to NULL
@@ -1188,20 +1307,20 @@ function doAdminNetworkProcessChangeHandlerTypes () {
                        } // END - if
                } // END - foreach
 
-               // Do we have updates?
+               // Is there updates?
                if ($updated > 0) {
                        // Updates done
-                       displayMessage('{%message,ADMIN_NETWORK_HANDLER_TYPES_UPDATED=' . $updated . '%}');
+                       displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_UPDATED=' . $updated . '%}');
                } else {
                        // Nothing changed
-                       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_HANDLER_TYPES_NOTHING_CHANGED--}');
+                       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_CHANGED--}');
                }
        } // END - if
 }
 
 // Changes given network request parameters
 function doAdminNetworkProcessChangeRequestParams () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
@@ -1220,10 +1339,10 @@ function doAdminNetworkProcessChangeRequestParams () {
                                                continue;
                                        } // END - if
 
-                                       // Do we have this enty?
+                                       // Is there this enty?
                                        if (!isset($entry[$networkId])) {
                                                // Not found, needs fixing
-                                               debug_report_bug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
+                                               reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
                                        } // END - if
 
                                        // Fix empty network_request_param_default to NULL
@@ -1241,7 +1360,7 @@ function doAdminNetworkProcessChangeRequestParams () {
                        } // END - if
                } // END - foreach
 
-               // Do we have updates?
+               // Is there updates?
                if ($updated > 0) {
                        // Updates done
                        displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_UPDATED=' . $updated . '%}');
@@ -1254,7 +1373,7 @@ function doAdminNetworkProcessChangeRequestParams () {
 
 // Removes given network type handlers
 function doAdminNetworkProcessRemoveNetworkTypes () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
@@ -1268,20 +1387,20 @@ function doAdminNetworkProcessRemoveNetworkTypes () {
                        } // END - if
                } // END - foreach
 
-               // Do we have removes?
+               // Is there removes?
                if ($removed > 0) {
                        // Removals done
-                       displayMessage('{%message,ADMIN_NETWORK_HANDLER_TYPES_REMOVED=' . $removed . '%}');
+                       displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_REMOVED=' . $removed . '%}');
                } else {
                        // Nothing removed
-                       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_HANDLER_TYPES_NOTHING_REMOVED--}');
+                       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_NOTHING_REMOVED--}');
                }
        } // END - if
 }
 
 // Removes given network request parameters
 function doAdminNetworkProcessRemoveNetworkRequestParams () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
@@ -1295,7 +1414,7 @@ function doAdminNetworkProcessRemoveNetworkRequestParams () {
                        } // END - if
                } // END - foreach
 
-               // Do we have removes?
+               // Is there removes?
                if ($removed > 0) {
                        // Removals done
                        displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_REMOVED=' . $removed . '%}');
@@ -1307,7 +1426,7 @@ function doAdminNetworkProcessRemoveNetworkRequestParams () {
 }
 
 // Adds a request parameter to given network and type
-function doAdminNetworkProcessAddNetworkRequestParams () {
+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
@@ -1342,6 +1461,42 @@ function doAdminNetworkProcessAddNetworkRequestParams () {
        }
 }
 
+// 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?
@@ -1419,7 +1574,7 @@ function doAdminNetworkProcessNetworkApiConfig () {
 }
 
 // Only adds network type configuration if not yet present
-function doAdminNetworkProcessAddHandlerTypesConfig () {
+function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
        // Remove the 'ok' part
        unsetPostRequestElement('ok');
 
@@ -1439,17 +1594,8 @@ function doAdminNetworkProcessAddHandlerTypesConfig () {
                } // END - if
        } // END - foreach
 
-       // Initialize variables
-       $content = array();
-       $id = 'network_max_reload_time_ye';
-       $skip = false;
-       $postData = postRequestArray();
-
-       // Convert "reload time selections"
-       convertSelectionsToEpocheTime($postData, $content, $id, $skip);
-
-       // Set the POST array back
-       setPostRequestArray($postData);
+       // Convert data in POST array
+       convertSelectionsToEpocheTimeInPostData($content, 'network_max_reload_time_ye', $skip);
 
        // Is there already an entry?
        if (isNetworkTypeHandlerConfigured(getRequestElement('network_id'), getRequestElement('network_type_id'))) {
@@ -1458,31 +1604,75 @@ function doAdminNetworkProcessAddHandlerTypesConfig () {
                return;
        } // END - if
 
-       // Get SQL query for new entry
-       $SQL = getInsertSqlFromArray(postRequestArray(), 'network_types_config');
+       // Copy 'set all' and remove it from POST data
+       $setAll = (postRequestElement('set_all') === 'Y');
+       unsetPostRequestElement('set_all');
+
+       // Shall we set for all?
+       if ($setAll === true) {
+               // Get all handlers
+               $result = SQL_QUERY_ESC('SELECT `network_type_id` FROM `{?_MYSQL_PREFIX?}_network_types` WHERE `network_id`=%s ORDER BY `network_type_id` ASC',
+                       array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
+
+               // Are there entries?
+               if (SQL_HASZERONUMS($result)) {
+                       // No, then abort here
+                       displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
+                       return;
+               } // END - if
 
-       // Run the query
-       SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+               // Init number of rows
+               $numRows = 0;
 
-       // Output message
-       if (!SQL_HASZEROAFFECTED()) {
-               // Successfully added
-               displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}');
+               // Fetch all ids
+               while (list($typeId) = SQL_FETCHROW($result)) {
+                       // Set it in GET data
+                       setGetRequestElement('network_type_id', $typeId);
+
+                       // Call this function again
+                       $numRows += doAdminNetworkProcessAddHandlerTypesConfig(false);
+               } // END - while
+
+               // Free result
+               SQL_FREERESULT($result);
+
+               // Output message
+               if ($numRows > 0) {
+                       // Something has been updated
+                       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--}');
+               }
        } else {
-               // Not added
-               loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}');
+               // Get SQL query for new entry
+               $SQL = getInsertSqlFromArray(postRequestArray(), 'network_types_config');
+
+               // Run the query
+               SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+
+               // Shall we display the message?
+               if ($displayMessage === true) {
+                       // Output message
+                       if (!SQL_HASZEROAFFECTED()) {
+                               // Successfully added
+                               displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}');
+                       } else {
+                               // Not added
+                               loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}');
+                       }
+               } else {
+                       // Return amount of affected rows (1 or 2)
+                       return SQL_AFFECTEDROWS();
+               }
        }
 }
 
 // Only changes network type configuration if not yet present
-function doAdminNetworkProcessEditHandlerTypesConfig () {
+function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
        // Remove the 'ok' part
        unsetPostRequestElement('ok');
 
-       // Add both ids
-       setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
-       setPostRequestElement('network_type_id', bigintval(getRequestElement('network_type_id')));
-
        /*
         * Some parameters are optional, at least one must be given so check a bunch
         * of parameters.
@@ -1495,17 +1685,8 @@ function doAdminNetworkProcessEditHandlerTypesConfig () {
                } // END - if
        } // END - foreach
 
-       // Initialize variables
-       $content = array();
-       $id = 'network_max_reload_time_ye';
-       $skip = false;
-       $postData = postRequestArray();
-
-       // Convert "reload time selections"
-       convertSelectionsToEpocheTime($postData, $content, $id, $skip);
-
-       // Set the POST array back
-       setPostRequestArray($postData);
+       // Convert time selections in POST data
+       convertSelectionsToEpocheTimeInPostArray('network_max_reload_time_ye');
 
        // Is there already an entry?
        if (!isNetworkTypeHandlerConfigured(getRequestElement('network_id'), getRequestElement('network_type_id'))) {
@@ -1514,19 +1695,67 @@ function doAdminNetworkProcessEditHandlerTypesConfig () {
                return;
        } // END - if
 
-       // Get SQL query for new entry
-       $SQL = getUpdateSqlFromArray(postRequestArray(), 'network_types_config', 'network_data_id', postRequestElement('network_data_id'), array('network_data_id'));
+       // Copy 'set all' and remove it from POST data
+       $setAll = (postRequestElement('set_all') === 'Y');
+       unsetPostRequestElement('set_all');
+
+       // Shall we set for all?
+       if ($setAll === true) {
+               // Get all data entries
+               $result = SQL_QUERY_ESC('SELECT `network_data_id` FROM `{?_MYSQL_PREFIX?}_network_types_config` WHERE `network_id`=%s ORDER BY `network_type_id` ASC',
+                       array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
+
+               // Are there entries?
+               if (SQL_HASZERONUMS($result)) {
+                       // No, then abort here
+                       displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
+                       return;
+               } // END - if
 
-       // Run the query
-       SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+               // Init number of rows
+               $numRows = 0;
 
-       // Output message
-       if (!SQL_HASZEROAFFECTED()) {
-               // Successfully added
-               displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}');
+               // Fetch all ids
+               while (list($dataId) = SQL_FETCHROW($result)) {
+                       // Set it in GET data
+                       setPostRequestElement('network_data_id', $dataId);
+
+                       // Call this function again
+                       $numRows += doAdminNetworkProcessEditHandlerTypesConfig(false);
+               } // END - while
+
+               // Free result
+               SQL_FREERESULT($result);
+
+               // Output message
+               if ($numRows > 0) {
+                       // Something has been updated
+                       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--}');
+               }
        } else {
-               // Not added
-               loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
+               // Get SQL query for new entry
+               $SQL = getUpdateSqlFromArray(postRequestArray(), 'network_types_config', 'network_data_id', postRequestElement('network_data_id'), array('network_data_id'));
+
+               // Run the query
+               SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+
+               // Shall we display the message?
+               if ($displayMessage === true) {
+                       // Output message
+                       if (!SQL_HASZEROAFFECTED()) {
+                               // Successfully added
+                               displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_SAVED--}');
+                       } else {
+                               // Not added
+                               loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
+                       }
+               } else {
+                       // Return amount of affected rows (1 or 2)
+                       return SQL_AFFECTEDROWS();
+               }
        }
 }
 
@@ -1559,19 +1788,21 @@ 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?
        if (!isset($validExports[getWhat()])) {
                // Not valid
-               debug_report_bug(__FUNCTION__, __LINE__, 'what=' . getWhat() . ' - not supported');
+               reportBug(__FUNCTION__, __LINE__, 'what=' . getWhat() . ' - not supported');
        } // END - if
 
        // Generate call-back, some tables require to export not all columns
@@ -1580,10 +1811,10 @@ function doAdminNetworkProcessExport () {
        // Is the call-back function there?
        if (!function_exists($callbackName)) {
                // No, this is really bad
-               debug_report_bug(__FUNCTION__, __LINE__, 'Invalid call-back function ' . $callbackName . ' detected.');
+               reportBug(__FUNCTION__, __LINE__, 'Invalid call-back function ' . $callbackName . ' detected.');
        } elseif (isset($GLOBALS[__FUNCTION__][$callbackName])) {
                // Already called!
-               debug_report_bug(__FUNCTION__, __LINE__, 'Double-call of export function ' . $callbackName . ' detected.');
+               reportBug(__FUNCTION__, __LINE__, 'Double-call of export function ' . $callbackName . ' detected.');
        }
 
        // Call the function
@@ -1597,7 +1828,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`,
@@ -1608,7 +1839,8 @@ function doAdminNetworkExportNetworkData () {
        `network_request_type`,
        `network_charset`,
        `network_require_id_card`,
-       `network_query_amount`
+       `network_query_amount`,
+       `network_active`
 FROM
        `{?_MYSQL_PREFIX?}_network_data`
 ORDER BY
@@ -1616,12 +1848,12 @@ ORDER BY
                __FUNCTION__, __LINE__);
 
        // Start an empty SQL query
-       $SQL = '';
+       $SQL = "INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_network_data` (`network_short_name`,`network_title`,`network_reflink`,`network_data_separator`,`network_row_separator`,`network_request_type`,`network_charset`,`network_require_id_card`,`network_query_amount`,`network_active`) VALUES\n";
 
        // Load all entries
        while ($content = SQL_FETCHARRAY($result)) {
                // Add row
-               $SQL .= "<pre>('" .
+               $SQL .= "('" .
                        $content['network_short_name'] . "', '" .
                        $content['network_title'] . "', '" .
                        $content['network_reflink'] . "', '" .
@@ -1630,11 +1862,12 @@ ORDER BY
                        $content['network_request_type'] . "', '" .
                        $content['network_charset'] . "', '" .
                        $content['network_require_id_card'] . "', " .
-                       $content['network_query_amount'] . '),</pre>';
+                       $content['network_query_amount'] . ", '" .
+                       $content['network_active'] . "'),\n";
        } // END - while
 
        // Remove last commata and close braces
-       $SQL = substr($SQL, 0, -7) . '</pre>';
+       $SQL = substr($SQL, 0, -2);
 
        // Free result
        SQL_FREERESULT($result);
@@ -1644,11 +1877,11 @@ 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
-               debug_report_bug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
+               reportBug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
        } // END - if
 
        // Get all network types of given network
@@ -1658,7 +1891,8 @@ function doAdminNetworkExportNetworkTypes () {
        `network_type_handler`,
        `network_type_api_url`,
        `network_type_click_url`,
-       `network_type_banner_url`
+       `network_type_banner_url`,
+       `network_type_reload_time_unit`
 FROM
        `{?_MYSQL_PREFIX?}_network_types`
 WHERE
@@ -1670,7 +1904,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Start an empty SQL query
-       $SQL = "<pre>INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_network_types` (`network_type_id`,`network_id`,`network_type_handler`,`network_type_api_url`,`network_type_click_url`,`network_type_banner_url`) VALUES\n";
+       $SQL = "INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_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`) VALUES\n";
 
        // Load all entries
        while ($content = SQL_FETCHARRAY($result)) {
@@ -1685,15 +1919,18 @@ ORDER BY
                // Is the column NULL?
                if (is_null($content['network_type_banner_url'])) {
                        // Column is NULL
-                       $SQL .= "NULL),\n";
+                       $SQL .= 'NULL';
                } else {
                        // Column is set
-                       $SQL .= $content['network_type_banner_url'] . "'),\n";
+                       $SQL .= chr(39) . $content['network_type_banner_url'] . chr(39);
                }
+
+               // Add more
+               $SQL .= ",'" . $content['network_type_reload_time_unit'] . "'),\n";
        } // END - while
 
        // Remove last commata and close braces
-       $SQL = substr($SQL, 0, -2) . '</pre>';
+       $SQL = substr($SQL, 0, -2);
 
        // Free result
        SQL_FREERESULT($result);
@@ -1703,11 +1940,11 @@ 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
-               debug_report_bug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
+               reportBug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
        } // END - if
 
        // Get all network types of given network
@@ -1729,7 +1966,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Start an empty SQL query
-       $SQL = "<pre>INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_network_request_params` (`network_id`,`network_type_id`,`network_request_param_key`,`network_request_param_value`,`network_request_param_default`) VALUES\n";
+       $SQL = "INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_network_request_params` (`network_id`,`network_type_id`,`network_request_param_key`,`network_request_param_value`,`network_request_param_default`) VALUES\n";
 
        // Load all entries
        while ($content = SQL_FETCHARRAY($result)) {
@@ -1738,7 +1975,7 @@ ORDER BY
                        $content['network_id'] . ', ' .
                        $content['network_type_id'] . ", '" .
                        $content['network_request_param_key'] . "', '" .
-                       $content['network_request_param_value'] . "', '";
+                       $content['network_request_param_value'] . "', ";
                
                // Is the column NULL?
                if (is_null($content['network_request_param_default'])) {
@@ -1746,12 +1983,12 @@ ORDER BY
                        $SQL .= "NULL),\n";
                } else {
                        // Column is set
-                       $SQL .= $content['network_request_param_default'] . "'),\n";
+                       $SQL .= chr(39) . $content['network_request_param_default'] . "'),\n";
                }
        } // END - while
 
        // Remove last commata and close braces
-       $SQL = substr($SQL, 0, -2) . '</pre>';
+       $SQL = substr($SQL, 0, -2);
 
        // Free result
        SQL_FREERESULT($result);
@@ -1760,12 +1997,67 @@ 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
+               reportBug(__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 `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_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 .= chr(39) . $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
-               debug_report_bug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
+               reportBug(__FUNCTION__, __LINE__, 'network_id not provided, please fix your links.');
        } // END - if
 
        // Get all network types of given network
@@ -1786,7 +2078,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Start an empty SQL query
-       $SQL = "<pre>INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_network_array_translation` (`network_id`,`network_type_id`,`network_array_index`,`sort`) VALUES\n";
+       $SQL = "INSERT INTO `&#123;&#63;_MYSQL_PREFIX&#63;&#125;_network_array_translation` (`network_id`,`network_type_id`,`network_array_index`,`sort`) VALUES\n";
 
        // Load all entries
        while ($content = SQL_FETCHARRAY($result)) {
@@ -1799,7 +2091,7 @@ ORDER BY
        } // END - while
 
        // Remove last commata and close braces
-       $SQL = substr($SQL, 0, -2) . '</pre>';
+       $SQL = substr($SQL, 0, -2);
 
        // Free result
        SQL_FREERESULT($result);