* $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 *
// '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
// 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
}
// 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
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",
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",
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",
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",
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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',
// Is it cached?
if (!isset($GLOBALS[__FUNCTION__][$defaultType])) {
// Generate list
- $GLOBALS[__FUNCTION__][$defaultType] = generateOptionList(
+ $GLOBALS[__FUNCTION__][$defaultType] = generateOptions(
'/ARRAY/',
array(
'banner',
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',
'',
'', '',
$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
// 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',
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$default])) {
// Generate the list
- $GLOBALS[__FUNCTION__][$default] = generateOptionList(
+ $GLOBALS[__FUNCTION__][$default] = generateOptions(
'/ARRAY/',
array(
'GET',
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$default])) {
// Generate the list
- $GLOBALS[__FUNCTION__][$default] = generateYesNoOptionList($default);
+ $GLOBALS[__FUNCTION__][$default] = generateYesNoOptions($default);
} // END - if
// Return cache
// Is the message id there?
if (!isMessageIdValid($messageId)) {
// Not valid type
- debug_report_bug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+ reportBug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
} // END - if
// Return message id
// Is the message id there?
if (!isMessageIdValid($messageId)) {
// Not valid type
- debug_report_bug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+ reportBug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
} // END - if
// Return message id
// Is the message id there?
if (!isMessageIdValid($messageId)) {
// Not valid type
- debug_report_bug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+ reportBug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
} // END - if
// Return message id
}
// Translates request parameter
-function translateNetworkRequestParamKey ($param) {
+function translateNetworkRequestParameterKey ($param) {
// Generate id
$messageId = 'ADMIN_NETWORK_REQUEST_PARAMETER_' . strtoupper($param) . '';
// Is the message id there?
if (!isMessageIdValid($messageId)) {
// Not valid param
- debug_report_bug(__FUNCTION__, __LINE__, 'param=' . $param . ' is invalid.');
+ 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 $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?
if (!isset($GLOBALS[__FUNCTION__][$networkId][$networkTypeId])) {
return $GLOBALS[__FUNCTION__][$networkId][$networkTypeId];
}
+// Handles the network-payment-check request
+function handleNetworkPaymentCheckRequest () {
+ // @TODO Implement this function
+ reportBug(__FUNCTION__, __LINE__, 'Not yet implemented.');
+}
+
//------------------------------------------------------------------------------
// Call-back functions
//------------------------------------------------------------------------------
$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
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
$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
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
// Do we have 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
// Do we have 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
// Do we have 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
}
}
+// 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?
} // END - if
} // END - foreach
- // Initialize variables
- $content = array();
- $id = 'network_max_reload_time_ye';
- $skip = false;
-
- // Get all POST data
- $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'))) {
} // 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'))) {
// 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
// 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
}
// Exports (and displays) the table 'network_data'
-function doAdminNetworkExportNetworkData () {
+function doAdminNetworkExportData () {
// Query for all networks
$result = SQL_QUERY('SELECT
`network_short_name`,
`network_request_type`,
`network_charset`,
`network_require_id_card`,
- `network_query_amount`
+ `network_query_amount`,
+ `network_active`
FROM
`{?_MYSQL_PREFIX?}_network_data`
ORDER BY
__FUNCTION__, __LINE__);
// Start an empty SQL query
- $SQL = "<pre>INSERT INTO `{?_MYSQL_PREFIX?}_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`) VALUES\n";
+ $SQL = "INSERT INTO `{?_MYSQL_PREFIX?}_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)) {
$content['network_request_type'] . "', '" .
$content['network_charset'] . "', '" .
$content['network_require_id_card'] . "', " .
- $content['network_query_amount'] . "),\n";
+ $content['network_query_amount'] . ", '" .
+ $content['network_active'] . "'),\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);
}
// 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
), __FUNCTION__, __LINE__);
// Start an empty SQL query
- $SQL = "<pre>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`) VALUES\n";
+ $SQL = "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`) VALUES\n";
// Load all entries
while ($content = SQL_FETCHARRAY($result)) {
$SQL .= 'NULL';
} else {
// Column is set
- $SQL .= "'" . $content['network_type_banner_url'] . "'";
+ $SQL .= chr(39) . $content['network_type_banner_url'] . chr(39);
}
// Add more
- $SQL .= $content['network_type_reload_time_unit'] . "')\n";
+ $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);
}
// 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
), __FUNCTION__, __LINE__);
// Start an empty SQL query
- $SQL = "<pre>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\n";
+ $SQL = "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\n";
// Load all entries
while ($content = SQL_FETCHARRAY($result)) {
$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);
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 `{?_MYSQL_PREFIX?}_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
), __FUNCTION__, __LINE__);
// Start an empty SQL query
- $SQL = "<pre>INSERT INTO `{?_MYSQL_PREFIX?}_network_array_translation` (`network_id`,`network_type_id`,`network_array_index`,`sort`) VALUES\n";
+ $SQL = "INSERT INTO `{?_MYSQL_PREFIX?}_network_array_translation` (`network_id`,`network_type_id`,`network_array_index`,`sort`) VALUES\n";
// Load all entries
while ($content = SQL_FETCHARRAY($result)) {
} // END - while
// Remove last commata and close braces
- $SQL = substr($SQL, 0, -2) . '</pre>';
+ $SQL = substr($SQL, 0, -2);
// Free result
SQL_FREERESULT($result);