X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fnetwork_functions.php;h=1ec81ad88917f19e1bbe9894293b42af3b97d163;hb=7454c5626871adc340ae1c90a2140366c4b73d9c;hp=92174639cab7979bfe389342f1e06ff738b10145;hpb=3b712465a3f2b368ba8b74c39fed477de4278535;p=mailer.git diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index 92174639ca..1ec81ad889 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -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,18 +55,21 @@ 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 $GLOBALS['network_form_name'] = 'invalid'; // Now search all valid - foreach (array('ok', 'edit', 'delete', 'do_edit', 'do_delete') as $form) { + foreach (array('save_config', 'add', 'edit', 'delete', 'do_edit', 'do_delete') as $formName) { // Is it detected - if (isFormSent($form)) { + if (isFormSent($formName)) { // Use this form name - $GLOBALS['network_form_name'] = $form; + $GLOBALS['network_form_name'] = $formName; + + // Remove it generically here + unsetPostRequestElement($formName); // Abort loop break; @@ -76,13 +79,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, postData=
' . print_r(postRequestArray(), TRUE));
 	} // 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,7 +106,7 @@ 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
@@ -113,23 +116,61 @@ function doAdminNetworkProcessForm () {
 	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",
-		array($name), __FUNCTION__, __LINE__);
+	// Is there cache?
+	if (!isset($GLOBALS[__FUNCTION__][$name])) {
+		// Does it exist?
+		$GLOBALS[__FUNCTION__][$name] = (countSumTotalData($name, 'network_data', 'network_id', 'network_short_name', TRUE) == 1);
+	} // END - if
 
-	// Does it exist?
-	$isValid = (SQL_NUMROWS($result) == 1);
+	// Return result
+	return $GLOBALS[__FUNCTION__][$name];
+}
 
-	// Free result
-	SQL_FREERESULT($result);
+// Checks whether the (short) named network is activated
+function isNetworkActiveByShortName ($name) {
+	// Is there cache?
+	if (!isset($GLOBALS[__FUNCTION__][$name])) {
+		// Does it exist?
+		$GLOBALS[__FUNCTION__][$name] = ((isNetworkNameValid($name)) && (countSumTotalData($name, 'network_data', 'network_id', 'network_short_name', TRUE, " AND `network_active`='Y'") == 1));
+	} // END - if
 
 	// Return result
-	return $isValid;
+	return $GLOBALS[__FUNCTION__][$name];
+}
+
+// Checks whether the network by given id is activated
+function isNetworkActiveById ($networkId) {
+	// Is there cache?
+	if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
+		// Does it exist?
+		$GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(bigintval($networkId), 'network_data', 'network_id', 'network_id', TRUE, " AND `network_active`='Y'") == 1);
+	} // END - if
+
+	// Return result
+	return $GLOBALS[__FUNCTION__][$networkId];
+}
+
+// "Getter" for 'network_activated' column depending on current administrator's expert setting
+function getNetworkActivatedColumn ($whereAnd = 'WHERE', $table = '') {
+	// Is there cache?
+	if (!isset($GLOBALS[__FUNCTION__][$whereAnd][$table])) {
+		// Default is exclude deactivated networks
+		$GLOBALS[__FUNCTION__][$whereAnd][$table] = ' ' . $whereAnd . ' ' . $table . "`network_active`='Y'";
+
+		// Is the export setting on?
+		if (isAdminsExpertSettingEnabled()) {
+			// Then allow all networks
+			$GLOBALS[__FUNCTION__][$whereAnd][$table] = '';
+		} // END - if
+	} // END - if
+
+	// Return cache
+	return $GLOBALS[__FUNCTION__][$whereAnd][$table];
 }
 
-// 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",
@@ -148,7 +189,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",
@@ -168,7 +209,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",
@@ -193,8 +253,11 @@ 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.');
-	} // END - if
+		reportBug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is smaller than 1.');
+	} elseif ((!isNetworkActiveById($networkId)) && (!isAdminsExpertSettingEnabled())) {
+		// Do not load inactive network data
+		reportBug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is not active.');
+	}
 
 	// Set current network id
 	setCurrentNetworkId($networkId);
@@ -205,7 +268,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`,
@@ -220,10 +283,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);
@@ -234,13 +297,16 @@ LIMIT 1",
 	} // END - if
 
 	// Return result
-	if (empty($column)) {
+	if ((empty($column)) && (isset($GLOBALS['network_data'][$networkId]))) {
 		// Return array
 		return $GLOBALS['network_data'][$networkId];
-	} else {
+	} elseif (isset($GLOBALS['network_data'][$networkId][$column])) {
 		// Return column
 		return $GLOBALS['network_data'][$networkId][$column];
 	}
+
+	// Return NULL
+	return NULL;
 }
 
 // "Getter" for a network's data by provided type id number
@@ -248,8 +314,11 @@ 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.');
-	} // END - if
+		reportBug(__FUNCTION__, __LINE__, 'Network type id ' . $networkId . ' is smaller than 1.');
+	} elseif ((!isNetworkActiveById($networkId)) && (!isAdminsExpertSettingEnabled())) {
+		// Do not load inactive network data
+		reportBug(__FUNCTION__, __LINE__, 'Network id ' . $networkId . ' is not active.');
+	}
 
 	// Set current network id
 	setCurrentNetworkId($networkId);
@@ -260,7 +329,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`,
@@ -274,7 +343,8 @@ function getNetworkDataByTypeId ($networkId, $column = '') {
 	t.`network_type_handler`,
 	t.`network_type_api_url`,
 	t.`network_type_click_url`,
-	t.`network_type_banner_url`
+	t.`network_type_banner_url`,
+	t.`network_text_encoding`
 FROM
 	`{?_MYSQL_PREFIX?}_network_data` AS d
 LEFT JOIN
@@ -283,10 +353,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);
@@ -307,15 +377,15 @@ LIMIT 1",
 }
 
 // "Getter" for a network type data by provided id number
-function getNetworkTypeDataById ($networkId) {
+function getNetworkTypeDataById ($networkTypeId) {
 	// Ids lower one are not accepted
-	if ($networkId < 1) {
+	if ($networkTypeId < 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 ' . $networkTypeId . ' is smaller than 1.');
 	} // END - if
 
 	// By default we have no data
-	$GLOBALS['network_type_data'][$networkId] = array();
+	$GLOBALS['network_type_data'][$networkTypeId] = array();
 
 	// Query for the network data
 	$result = SQL_QUERY_ESC('SELECT
@@ -330,27 +400,27 @@ FROM
 WHERE
 	`network_type_id`=%s
 LIMIT 1',
-		array(bigintval($networkId)), __FUNCTION__, __LINE__);
+		array(bigintval($networkTypeId)), __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);
+		$GLOBALS['network_type_data'][$networkTypeId] = SQL_FETCHARRAY($result);
 	} // END - if
 
 	// Free result
 	SQL_FREERESULT($result);
 
 	// Return result
-	return $GLOBALS['network_type_data'][$networkId];
+	return $GLOBALS['network_type_data'][$networkTypeId];
 }
 
 // "Getter" for a network request parameter data by provided id number
-function getNetworkRequestParamsDataById ($networkId) {
+function getNetworkRequestParamsDataById ($networkRequestId) {
 	// Ids lower one are not accepted
-	if ($networkId < 1) {
+	if ($networkRequestId < 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 ' . $networkRequestId . ' is smaller than 1.');
 	} // END - if
 
 	// By default we have no data
@@ -369,9 +439,9 @@ FROM
 WHERE
 	`network_request_param_id`=%s
 LIMIT 1',
-		array(bigintval($networkId)), __FUNCTION__, __LINE__);
+		array(bigintval($networkRequestId)), __FUNCTION__, __LINE__);
 
-	// Do we have an entry?
+	// Is there an entry?
 	if (SQL_NUMROWS($result) == 1) {
 		// Then get it
 		$networkRequestData = SQL_FETCHARRAY($result);
@@ -384,50 +454,100 @@ LIMIT 1',
 	return $networkRequestData;
 }
 
+// "Getter" for a network array translation data by provided id number
+function getNetworkArrayTranslationsDataById ($networkTranslationId) {
+	// Ids lower one are not accepted
+	if ($networkTranslationId < 1) {
+		// Not good, should be fixed
+		reportBug(__FUNCTION__, __LINE__, 'Network array translation id ' . $networkTranslationId . ' is smaller than 1.');
+	} // END - if
+
+	// By default we have no data
+	$networkTranslationData = array();
+
+	// Query for the network data
+	$result = SQL_QUERY_ESC('SELECT
+	`network_array_id`,
+	`network_id`,
+	`network_type_id`,
+	`network_array_index`,
+	`network_array_sort`
+FROM
+	`{?_MYSQL_PREFIX?}_network_array_translation`
+WHERE
+	`network_array_id`=%s
+LIMIT 1',
+		array(bigintval($networkTranslationId)), __FUNCTION__, __LINE__);
+
+	// Is there an entry?
+	if (SQL_NUMROWS($result) == 1) {
+		// Then get it
+		$networkTranslationData = SQL_FETCHARRAY($result);
+	} // END - if
+
+	// Free result
+	SQL_FREERESULT($result);
+
+	// Return result
+	return $networkTranslationData;
+}
+
 // Updates given network (id) with data from array
 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
-	return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), array(), false, false);
+	return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), array(), FALSE, FALSE);
 }
 
 // Updates given network type handler (id) with data from array
-function doNetworkUpdateTypeByArray ($networkId, $networkTypeData) {
+function doNetworkUpdateTypeByArray ($networkTypeId, $networkTypeData) {
 	// Ids lower one are not accepted
-	if ($networkId < 1) {
+	if ($networkTypeId < 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 ' . $networkTypeId . ' is smaller than 1.');
 	} // END - if
 
 	// Just call our inner method
-	return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkId)), array(), false, false);
+	return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), array(), FALSE, FALSE);
 }
 
 // Updates given network request parameters (id) with data from array
-function doNetworkUpdateParamsByArray ($networkId, $networkParamData) {
+function doNetworkUpdateParamsByArray ($networkParamsId, $networkParamsData) {
 	// Ids lower one are not accepted
-	if ($networkId < 1) {
+	if ($networkParamsId < 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 ' . $networkParamsId . ' is smaller than 1.');
 	} // END - if
 
 	// Just call our inner method
-	return adminSaveSettings($networkParamData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkId)), array(), false, false);
+	return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), array(), FALSE, FALSE);
+}
+
+// Updates given network array translations (id) with data from array
+function doNetworkUpdateArrayTranslationsByArray ($networkTranslationsId, $networkTranslationsData) {
+	// Ids lower one are not accepted
+	if ($networkTranslationsId < 1) {
+		// Not good, should be fixed
+		reportBug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $networkTranslationsId . ' is smaller than 1.');
+	} // END - if
+
+	// Just call our inner method
+	return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), array(), FALSE, FALSE);
 }
 
 // Removes given network entry
-function doAdminRemoveNetworkEntry ($table, $column, $networkId, $limit = 1) {
+function doAdminRemoveNetworkEntry ($table, $column, $id, $limit = 1) {
 	// Remove the entry
 	SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_network_%s` WHERE `%s`=%s LIMIT %s",
 		array(
 			$table,
 			$column,
-			$networkId,
+			$id,
 			$limit
 		), __FUNCTION__, __LINE__);
 
@@ -441,18 +561,17 @@ 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'
+' . getNetworkActivatedColumn() . '
 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();
@@ -468,7 +587,7 @@ ORDER BY
 		$content = generateSelectionBoxFromArray($rows, 'network_id', 'network_id', '', '', 'network');
 	} else {
 		// Nothing selected
-		$content = loadTemplate('admin_settings_unsaved', false, '{--ADMIN_ENTRIES_404--}');
+		$content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}');
 	}
 
 	// Free the result
@@ -491,13 +610,14 @@ FROM
 	`{?_MYSQL_PREFIX?}_network_types`
 WHERE
 	`network_id`=%s
+	' . getNetworkActivatedColumn('AND') . '
 ORDER BY
 	`network_type_handler` ASC',
 		array(
 			bigintval($networkId)
 		), __FUNCTION__, __LINE__);
 
-	// Do we have entries?
+	// Are there entries?
 	if (!SQL_HASZERONUMS($result)) {
 		// List all entries
 		$rows = array();
@@ -513,7 +633,7 @@ ORDER BY
 		$content = generateSelectionBoxFromArray($rows, 'network_type', 'network_type_id');
 	} else {
 		// Nothing selected
-		$content = loadTemplate('admin_settings_unsaved', false, '{--ADMIN_ENTRIES_404--}');
+		$content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}');
 	}
 
 	// Free the result
@@ -529,7 +649,7 @@ function generateAdminDistinctNetworkTypeList () {
 	$content = '';
 
 	// Query all types of this network
-	$result = SQL_QUERY("SELECT
+	$result = SQL_QUERY('SELECT
 	t.`network_type_id`,
 	t.`network_type_handler`,
 	d.`network_title`
@@ -539,13 +659,12 @@ LEFT JOIN
 	`{?_MYSQL_PREFIX?}_network_data` AS d
 ON
 	t.`network_id`=d.`network_id`
-WHERE
-	d.`network_active`='Y'
+' . getNetworkActivatedColumn('WHERE', 'd') . '
 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();
@@ -561,7 +680,7 @@ ORDER BY
 		$content = generateSelectionBoxFromArray($rows, 'network_type', 'network_type_id', '', '_title');
 	} else {
 		// Nothing selected
-		$content = loadTemplate('admin_settings_unsaved', false, '{--ADMIN_ENTRIES_404--}');
+		$content = loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_ENTRIES_404--}');
 	}
 
 	// Free the result
@@ -576,20 +695,21 @@ ORDER BY
 function generateNetworkTypeOptions ($networkId) {
 	// Is this an array, then we just came back from edit/delete actions
 	if (is_array($networkId)) {
+		// Set it as empty string
 		$networkId = '';
 	} // END - if
 
 	// 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',
 			$networkId,
 			'',
 			sprintf(
-				"WHERE `network_id`=%s",
+				"WHERE `network_id`=%s" . getNetworkActivatedColumn('AND'),
 				bigintval(getRequestElement('network_id'))
 			),
 			'',
@@ -606,7 +726,7 @@ function generateNetworkTypesAvailableOptions ($defaultType = NULL) {
 	// Is it cached?
 	if (!isset($GLOBALS[__FUNCTION__][$defaultType])) {
 		// Generate list
-		$GLOBALS[__FUNCTION__][$defaultType] = generateOptionList(
+		$GLOBALS[__FUNCTION__][$defaultType] = generateOptions(
 			'/ARRAY/',
 			array(
 				'banner',
@@ -626,6 +746,9 @@ function generateNetworkTypesAvailableOptions ($defaultType = NULL) {
 				'skybanner',
 				'skybanner_click',
 				'skybanner_view',
+				'halfbanner',
+				'halfbanner_click',
+				'halfbanner_view',
 				'layer',
 				'layer_click',
 				'layer_view',
@@ -635,9 +758,13 @@ function generateNetworkTypesAvailableOptions ($defaultType = NULL) {
 				'htmlmail',
 				'lead',
 				'sale',
+				'lead_sale',
 				'payperactive',
 				'pagepeel',
-				'traffic'
+				'traffic',
+				'signature',
+				'signature_click',
+				'signature_view',
 			),
 			array(),
 			$defaultType,
@@ -651,15 +778,38 @@ function generateNetworkTypesAvailableOptions ($defaultType = NULL) {
 	return $GLOBALS[__FUNCTION__][$defaultType];
 }
 
-// Generates an options list (somewhat getter) ofr request keys
+// Generates an options list of all available (hard-coded) text encoders
+function generateNetworkTextEncodingAvailableOptions ($defaultEncoding = NULL) {
+	// Is it cached?
+	if (!isset($GLOBALS[__FUNCTION__][$defaultEncoding])) {
+		// Generate list
+		$GLOBALS[__FUNCTION__][$defaultEncoding] = generateOptions(
+			'/ARRAY/',
+			array(
+				'NONE',
+				'BASE64',
+			),
+			array(),
+			$defaultEncoding,
+			'', '',
+			array(),
+			'translateNetworkTextEncoding'
+		);
+	} // END - if
+
+	// Return content
+	return $GLOBALS[__FUNCTION__][$defaultEncoding];
+}
+
+// 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',
+				'affiliate_id',
 				'sid',
 				'hash',
 				'password',
@@ -679,7 +829,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
 
@@ -692,14 +876,14 @@ 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',
 			$default,
 			'',
 			'',
-			$GLOBALS['network_translation_disabled'],
+			$GLOBALS['network_array_translation_disabled'],
 			'translateNetworkTranslationName'
 		);
 	} // END - if
@@ -710,10 +894,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',
@@ -733,10 +917,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
@@ -750,8 +934,8 @@ function translateNetworkTranslationName ($name) {
 
 	// Is the message id there?
 	if (!isMessageIdValid($messageId)) {
-		// Not valid type
-		debug_report_bug(__FUNCTION__, __LINE__, 'type=' . $type . ' is invalid.');
+		// Not valid name
+		reportBug(__FUNCTION__, __LINE__, 'name=' . $name . ' is invalid.');
 	} // END - if
 
 	// Return message id
@@ -766,7 +950,7 @@ function translateNetworkTypeHandler ($type) {
 	// 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
@@ -781,7 +965,7 @@ function translateNetworkRequestType ($type) {
 	// 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
@@ -789,14 +973,44 @@ function translateNetworkRequestType ($type) {
 }
 
 // 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 '{--' . $messageId . '--}';
+}
+
+// Translate text-encoding
+function translateNetworkTextEncoding ($encoding) {
+	// Generate id
+	$messageId = 'ADMIN_NETWORK_TYPE_TEXT_ENCODING_' . strtoupper($encoding) . '';
+
+	// Is the message id there?
+	if (!isMessageIdValid($messageId)) {
+		// Not valid encoding
+		reportBug(__FUNCTION__, __LINE__, 'encoding=' . $encoding . ' is invalid.');
 	} // END - if
 
 	// Return message id
@@ -805,7 +1019,7 @@ function translateNetworkRequestParamKey ($param) {
 
 // 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();
@@ -822,9 +1036,9 @@ INNER JOIN
 ON
 	`network_array_index`=`network_translation_id`
 ORDER BY
-	`sort` ASC', __FUNCTION__, __LINE__);
+	`network_array_sort` ASC', __FUNCTION__, __LINE__);
 
-		// Do we have entries?
+		// Are there entries?
 		if (!SQL_HASZERONUMS($result)) {
 			// Get all entries
 			while ($row = SQL_FETCHARRAY($result)) {
@@ -852,13 +1066,16 @@ 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--}';
 
 		// So is it configured?
-		if (isNetworkApiConfigured($networkId)) {
+		if (!isNetworkActiveById($networkId)) {
+			// Network is not active
+			$GLOBALS[__FUNCTION__][$networkId] = '{--ADMIN_NETWORK_API_NOT_ACTIVE--}';
+		} elseif (isNetworkApiConfigured($networkId)) {
 			// Yes, it is
 			$GLOBALS[__FUNCTION__][$networkId] = '{--ADMIN_NETWORK_API_CONFIGURED--}';
 		} // END - if
@@ -870,7 +1087,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(
@@ -886,9 +1103,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(
@@ -905,6 +1122,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
 //------------------------------------------------------------------------------
@@ -914,13 +1137,10 @@ function doAdminNetworkProcessAddNetwork () {
 	// We can say here, the form is sent, so check if the network is already added
 	if (isNetworkNameValid(postRequestElement('network_short_name'))) {
 		// Already there
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_ALREADY_ADDED=' . postRequestElement('network_short_name') . '%}');
-		return false;
+		loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ALREADY_ADDED=' . postRequestElement('network_short_name') . '%}');
+		return FALSE;
 	} // END - if
 
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
-
 	// Add the whole request to database
 	SQL_QUERY(getInsertSqlFromArray(postRequestArray(), 'network_data'), __FUNCTION__, __LINE__);
 
@@ -930,16 +1150,16 @@ function doAdminNetworkProcessAddNetwork () {
 	// Output message
 	if (!SQL_HASZEROAFFECTED()) {
 		// Successfully added
-		loadTemplate('admin_network_added', false, postRequestArray());
+		loadTemplate('admin_network_added', FALSE, postRequestArray());
 	} else {
 		// Not added
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_DATA_NOT_ADDED=' . postRequestElement('network_short_name') . '%}');
+		loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_DATA_NOT_ADDED=' . postRequestElement('network_short_name') . '%}');
 	}
 }
 
 // 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 = '';
@@ -949,31 +1169,36 @@ 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);
+					$OUT .= loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks_row', TRUE, $networkData);
 				} // END - if
 			} // END - if
 		} // END - foreach
 
 		// If we have no rows, we don't need to display the edit form
 		if (!empty($OUT)) {
+			// Init array with generic element
+			$content = array(
+				'rows' => $OUT
+			);
+
 			// Output main template
-			loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks', false, $OUT);
+			loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks', FALSE, $content);
 
 			// Don't display the list/add new form
-			$GLOBALS['network_display'] = false;
+			$GLOBALS['network_display'] = FALSE;
 		} else {
 			// Nothing selected/found
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_NOTHING_FOUND--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_FOUND--}');
 		}
 	} // END - if
 }
 
 // Handle network type form
 function doAdminNetworkProcessHandleNetworkTypes () {
-	// Do we have selections?
+	// Is there selections?
 	if (ifPostContainsSelections()) {
 		// Load network data
 		$networkData = getNetworkDataById(getRequestElement('network_id'));
@@ -986,17 +1211,17 @@ 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
-						$OUT .= loadTemplate('admin_edit_network_types_row', true, $networkTypeData);
+						$OUT .= loadTemplate('admin_edit_network_types_row', TRUE, $networkTypeData);
 					} elseif (isFormSent('delete')) {
 						// Add row template for deleting
-						$OUT .= loadTemplate('admin_delete_network_types_row', true, $networkTypeData);
+						$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/delete.');
 					}
 				} // END - if
 			} // END - if
@@ -1004,28 +1229,34 @@ function doAdminNetworkProcessHandleNetworkTypes () {
 
 		// If we have no rows, we don't need to display the edit form
 		if (!empty($OUT)) {
+			// Prepare array with generic elements
+			$content = array(
+				'rows'       => $OUT,
+				'network_id' => bigintval(getRequestElement('network_id'))
+			);
+
 			// Output main template
 			if (isFormSent('edit')) {
-				loadTemplate('admin_edit_network_types', false, $OUT);
+				loadTemplate('admin_edit_network_types', FALSE, $content);
 			} elseif (isFormSent('delete')) {
-				loadTemplate('admin_delete_network_types', false, $OUT);
+				loadTemplate('admin_delete_network_types', FALSE, $content);
 			} else {
 				// Problem!
-				debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
+				reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
 			}
 
 			// Don't display the list/add new form
-			$GLOBALS['network_display'] = false;
+			$GLOBALS['network_display'] = FALSE;
 		} else {
 			// Nothing selected/found
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_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();
@@ -1041,20 +1272,20 @@ 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
-						$OUT .= loadTemplate('admin_edit_network_request_params_row', true, $networkRequestData);
+						$OUT .= loadTemplate('admin_edit_network_request_params_row', TRUE, $networkRequestData);
 					} elseif (isFormSent('delete')) {
 						// Get type data
 						$networkRequestData['network_type_data'] = getNetworkTypeDataById($networkRequestData['network_type_id']);
 
 						// Add row template for deleting
-						$OUT .= loadTemplate('admin_delete_network_request_params_row', true, $networkRequestData);
+						$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/delete.');
 					}
 				} // END - if
 			} // END - if
@@ -1062,28 +1293,34 @@ function doAdminNetworkProcessHandleRequestParams () {
 
 		// If we have no rows, we don't need to display the edit form
 		if (!empty($OUT)) {
+			// Prepare array with generic elements
+			$content = array(
+				'rows'       => $OUT,
+				'network_id' => bigintval(getRequestElement('network_id'))
+			);
+
 			// Output main template
 			if (isFormSent('edit')) {
-				loadTemplate('admin_edit_network_request_params', false, $OUT);
+				loadTemplate('admin_edit_network_request_params', FALSE, $content);
 			} elseif (isFormSent('delete')) {
-				loadTemplate('admin_delete_network_request_params', false, $OUT);
+				loadTemplate('admin_delete_network_request_params', FALSE, $content);
 			} else {
 				// Problem!
-				debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
+				reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
 			}
 
 			// Don't display the list/add new form
-			$GLOBALS['network_display'] = false;
+			$GLOBALS['network_display'] = FALSE;
 		} else {
 			// Nothing selected/found
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
 		}
 	} // END - if
 }
 
 // Changes given networks
 function doAdminNetworkProcessChangeNetworks () {
-	// Do we have selections?
+	// Is there selections?
 	if (ifPostContainsSelections()) {
 		// By default nothing is updated
 		$updated = 0;
@@ -1102,10 +1339,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
@@ -1117,20 +1354,20 @@ function doAdminNetworkProcessChangeNetworks () {
 			} // END - if
 		} // END - foreach
 
-		// Do we have updates?
+		// Is there updates?
 		if ($updated > 0) {
 			// Updates done
 			displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}');
 		} else {
 			// Nothing changed
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_NOTHING_CHANGED--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_CHANGED--}');
 		}
 	} // END - if
 }
 
 // Removes given networks
 function doAdminNetworkProcessRemoveNetworks () {
-	// Do we have selections?
+	// Is there selections?
 	if (ifPostContainsSelections()) {
 		// By default nothing is removed
 		$removed = 0;
@@ -1144,13 +1381,13 @@ function doAdminNetworkProcessRemoveNetworks () {
 			} // END - if
 		} // END - foreach
 
-		// Do we have removes?
+		// Is there removes?
 		if ($removed > 0) {
 			// Removals done
 			displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}');
 		} else {
 			// Nothing removed
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_NOTHING_REMOVED--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_NOTHING_REMOVED--}');
 		}
 	} // END - if
 }
@@ -1160,20 +1397,17 @@ 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_TYPE_HANDLER_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;
+		return FALSE;
 	} // END - if
 
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
-
 	// Add id
 	setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
 
 	// Is network_type_banner_url set?
-	if (postRequestElement('network_type_banner_url') == '') {
+	if (!isPostRequestElementSet('network_type_banner_url')) {
 		// Remove empty value to get a NULL for an optional entry
 		unsetPostRequestElement('network_type_banner_url');
 	} // END - if
@@ -1184,16 +1418,16 @@ function doAdminNetworkProcessAddNetworkType () {
 	// Output message
 	if (!SQL_HASZEROAFFECTED()) {
 		// Successfully added
-		loadTemplate('admin_network_type_added', false, postRequestArray());
+		loadTemplate('admin_network_type_added', FALSE, postRequestArray());
 	} else {
 		// Not added
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_TYPE_HANDLER_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;
@@ -1212,10 +1446,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
@@ -1233,20 +1467,20 @@ function doAdminNetworkProcessChangeHandlerTypes () {
 			} // END - if
 		} // END - foreach
 
-		// Do we have updates?
+		// Is there updates?
 		if ($updated > 0) {
 			// Updates done
 			displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_UPDATED=' . $updated . '%}');
 		} else {
 			// Nothing changed
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_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;
@@ -1265,10 +1499,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
@@ -1286,20 +1520,73 @@ 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 . '%}');
 		} else {
 			// Nothing changed
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_CHANGED--}');
+		}
+	} // END - if
+}
+
+// Changes given network array translations
+function doAdminNetworkProcessChangeArrayTranslations () {
+	// Is there selections?
+	if (ifPostContainsSelections()) {
+		// By default nothing is updated
+		$updated = 0;
+
+		// Something has been selected, so start updating them
+		foreach (postRequestElement('sel') as $networkId => $sel) {
+			// Update this entry?
+			if ($sel == 1) {
+				// Init data array
+				$networkTranslationsData = array();
+
+				// Transfer whole array, except 'sel'
+				foreach (postRequestArray() as $key => $entry) {
+					// Skip 'sel' and submit button
+					if (in_array($key, array('sel', 'do_edit'))) {
+						continue;
+					} // END - if
+
+					// Is there this enty?
+					if (!isset($entry[$networkId])) {
+						// Not found, needs fixing
+						reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
+					} // END - if
+
+					// Fix empty network_request_param_default to NULL
+					if (($key == 'network_request_param_default') && (trim($entry[$networkId]) == '')) {
+						// Set it to NULL
+						$entry[$networkId] = NULL;
+					} // END - if
+
+					// Add this entry
+					$networkTranslationsData[$key] = $entry[$networkId];
+				} // END - foreach
+
+				// Update the network data
+				$updated += doNetworkUpdateArrayTranslationsByArray($networkId, $networkTranslationsData);
+			} // END - if
+		} // END - foreach
+
+		// Is there updates?
+		if ($updated > 0) {
+			// Updates done
+			displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_UPDATED=' . $updated . '%}');
+		} else {
+			// Nothing changed
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_CHANGED--}');
 		}
 	} // END - if
 }
 
 // Removes given network type handlers
 function doAdminNetworkProcessRemoveNetworkTypes () {
-	// Do we have selections?
+	// Is there selections?
 	if (ifPostContainsSelections()) {
 		// By default nothing is removed
 		$removed = 0;
@@ -1313,20 +1600,20 @@ function doAdminNetworkProcessRemoveNetworkTypes () {
 			} // END - if
 		} // END - foreach
 
-		// Do we have removes?
+		// Is there removes?
 		if ($removed > 0) {
 			// Removals done
 			displayMessage('{%message,ADMIN_NETWORK_TYPE_HANDLER_REMOVED=' . $removed . '%}');
 		} else {
 			// Nothing removed
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_TYPE_HANDLER_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;
@@ -1340,13 +1627,40 @@ 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 . '%}');
 		} else {
 			// Nothing removed
-			loadTemplate('admin_settings_unsaved', false, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_REMOVED--}');
+		}
+	} // END - if
+}
+
+// Removes given network array translations
+function doAdminNetworkProcessRemoveNetworkArrayTranslation () {
+	// Is there selections?
+	if (ifPostContainsSelections()) {
+		// By default nothing is removed
+		$removed = 0;
+
+		// Something has been selected, so start updating them
+		foreach (postRequestElement('sel') as $networkId => $sel) {
+			// Update this entry?
+			if ($sel == 1) {
+				// Remove this entry
+				$removed += doAdminRemoveNetworkEntry('array_translation', 'network_array_id', $networkId);
+			} // END - if
+		} // END - foreach
+
+		// Is there removes?
+		if ($removed > 0) {
+			// Removals done
+			displayMessage('{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_REMOVED=' . $removed . '%}');
+		} else {
+			// Nothing removed
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_ARRAY_TRANSLATION_NOTHING_REMOVED--}');
 		}
 	} // END - if
 }
@@ -1356,20 +1670,17 @@ 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
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_request_param_key') . '%}');
+		loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_ALREADY_ADDED=' . postRequestElement('network_request_param_key') . '%}');
 
 		// ... so abort here
-		return false;
+		return FALSE;
 	} // END - if
 
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
-
 	// Add id
 	setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
 
 	// Is network_request_param_default set?
-	if (postRequestElement('network_request_param_default') == '') {
+	if (!isPostRequestElementSet('network_request_param_default')) {
 		// Remove empty value to get a NULL for an optional entry
 		unsetPostRequestElement('network_request_param_default');
 	} // END - if
@@ -1380,10 +1691,43 @@ function doAdminNetworkProcessAddRequestParam () {
 	// Output message
 	if (!SQL_HASZEROAFFECTED()) {
 		// Successfully added
-		loadTemplate('admin_network_request_param_added', false, postRequestArray());
+		loadTemplate('admin_network_request_param_added', FALSE, postRequestArray());
 	} else {
 		// Not added
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED=' . postRequestElement('network_request_param_key') . '%}');
+		loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_REQUEST_PARAMETER_NOT_ADDED=' . postRequestElement('network_request_param_key') . '%}');
+	}
+}
+
+// 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
+
+	// Add id
+	setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
+
+	// Is network_vcheck_param_default set?
+	if (!isPostRequestElementSet('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') . '%}');
 	}
 }
 
@@ -1392,20 +1736,17 @@ function doAdminNetworkProcessAddNetworkArrayTranslation () {
 	// Is the request parameter already used with given network?
 	if (isNetworkArrayTranslationValid(postRequestElement('network_array_index'), postRequestElement('network_type_id'), getRequestElement('network_id'))) {
 		// Already added
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED=' . postRequestElement('network_array_index') . '%}');
+		loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_ALREADY_ADDED=' . postRequestElement('network_array_index') . '%}');
 
 		// ... so abort here
-		return false;
+		return FALSE;
 	} // END - if
 
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
-
 	// Add id
 	setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
 
 	// Add sorting
-	setPostRequestElement('sort', (countSumTotalData(
+	setPostRequestElement('network_array_sort', (countSumTotalData(
 		bigintval(postRequestElement('network_id')),
 		'network_array_translation',
 		'network_array_id',
@@ -1420,23 +1761,84 @@ function doAdminNetworkProcessAddNetworkArrayTranslation () {
 	// Output message
 	if (!SQL_HASZEROAFFECTED()) {
 		// Successfully added
-		loadTemplate('admin_network_array_translation_added', false, postRequestArray());
+		loadTemplate('admin_network_array_translation_added', FALSE, postRequestArray());
 	} else {
 		// Not added
-		loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED=' . postRequestElement('network_array_index') . '%}');
+		loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_NETWORK_ARRAY_TRANSLATION_NOT_ADDED=' . postRequestElement('network_array_index') . '%}');
 	}
 }
 
+// Handle network array translation form
+function doAdminNetworkProcessHandleArrayTranslations () {
+	// Is there selections?
+	if (ifPostContainsSelections()) {
+		// Init cache array
+		$GLOBALS['network_array_translation_disabled'] = array();
+
+		// Load network data
+		$networkData = getNetworkDataById(getRequestElement('network_id'));
+
+		// Something has been selected, so start displaying one by one
+		$OUT = '';
+		foreach (postRequestElement('sel') as $networkId => $sel) {
+			// Is this selected?
+			if ($sel == 1) {
+				// Load this network's data
+				$networkTranslationsData = getNetworkArrayTranslationsDataById($networkId);
+
+				// Is there found the network?
+				if (count($networkTranslationsData) > 0) {
+					if (isFormSent('edit')) {
+						// Add row template for deleting
+						$OUT .= loadTemplate('admin_edit_network_array_translation_row', TRUE, $networkTranslationsData);
+					} elseif (isFormSent('delete')) {
+						// Get type data
+						$networkTranslationsData['network_type_data'] = getNetworkTypeDataById($networkTranslationsData['network_type_id']);
+
+						// Add row template for deleting
+						$OUT .= loadTemplate('admin_delete_network_array_translation_row', TRUE, $networkTranslationsData);
+					} else {
+						// Problem!
+						reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
+					}
+				} // END - if
+			} // END - if
+		} // END - foreach
+
+		// If we have no rows, we don't need to display the edit form
+		if (!empty($OUT)) {
+			// Prepare array with generic elements
+			$content = array(
+				'rows'       => $OUT,
+				'network_id' => bigintval(getRequestElement('network_id'))
+			);
+
+			// Output main template
+			if (isFormSent('edit')) {
+				loadTemplate('admin_edit_network_array_translation', FALSE, $content);
+			} elseif (isFormSent('delete')) {
+				loadTemplate('admin_delete_network_array_translation', FALSE, $content);
+			} else {
+				// Problem!
+				reportBug(__FUNCTION__, __LINE__, 'Cannot detect edit/delete.');
+			}
+
+			// Don't display the list/add new form
+			$GLOBALS['network_display'] = FALSE;
+		} else {
+			// Nothing selected/found
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_NETWORK_REQUEST_PARAMETER_NOTHING_FOUND--}');
+		}
+	} // END - if
+}
+
 // Adds/update network API configuration
 function doAdminNetworkProcessNetworkApiConfig () {
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
-
 	// Add id
 	setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
 
 	// Is network_api_referral_button set?
-	if (postRequestElement('network_api_referral_button') == '') {
+	if (!isPostRequestElementSet('network_api_referral_button')) {
 		// Remove empty value to get a NULL for an optional entry
 		unsetPostRequestElement('network_api_referral_button');
 	} // END - if
@@ -1459,44 +1861,33 @@ function doAdminNetworkProcessNetworkApiConfig () {
 		displayMessage('{--ADMIN_CONFIG_NETWORK_API_SAVED--}');
 	} else {
 		// Not added
-		loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CONFIG_NETWORK_API_NOT_SAVED--}');
+		loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_API_NOT_SAVED--}');
 	}
 }
 
 // Only adds network type configuration if not yet present
-function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
-
+function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = TRUE) {
 	// Add both ids
 	setPostRequestElement('network_id', bigintval(getRequestElement('network_id')));
 	setPostRequestElement('network_type_id', bigintval(getRequestElement('network_type_id')));
 
+	// Translate German comma to dot
+	convertCommaToDotInPostData('network_min_payment');
+
 	/*
 	 * Some parameters are optional, at least one must be given so check a bunch
 	 * of parameters.
 	 */
 	foreach (array('network_min_waiting_time', 'network_min_remain_clicks', 'network_min_payment', 'network_allow_erotic') as $element) {
 		// Is this element empty?
-		if (postRequestElement($element) == '') {
+		if (!isPostRequestElementSet($element)) {
 			// Then unset it to get a NULL for optional parameter
 			unsetPostRequestElement($element);
 		} // 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('network_max_reload_time_ye');
 
 	// Is there already an entry?
 	if (isNetworkTypeHandlerConfigured(getRequestElement('network_id'), getRequestElement('network_type_id'))) {
@@ -1510,12 +1901,12 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
 	unsetPostRequestElement('set_all');
 
 	// Shall we set for all?
-	if ($setAll === true) {
+	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__);
 
-		// Do we have entries?
+		// Are there entries?
 		if (SQL_HASZERONUMS($result)) {
 			// No, then abort here
 			displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
@@ -1531,7 +1922,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
 			setGetRequestElement('network_type_id', $typeId);
 
 			// Call this function again
-			$numRows += doAdminNetworkProcessAddHandlerTypesConfig(false);
+			$numRows += doAdminNetworkProcessAddHandlerTypesConfig(FALSE);
 		} // END - while
 
 		// Free result
@@ -1543,7 +1934,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
 			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--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
 		}
 	} else {
 		// Get SQL query for new entry
@@ -1553,14 +1944,14 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
 		SQL_QUERY($SQL, __FUNCTION__, __LINE__);
 
 		// Shall we display the message?
-		if ($displayMessage === true) {
+		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--}');
+				loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_SAVED--}');
 			}
 		} else {
 			// Return amount of affected rows (1 or 2)
@@ -1570,9 +1961,9 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
 }
 
 // Only changes network type configuration if not yet present
-function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
-	// Remove the 'ok' part
-	unsetPostRequestElement('ok');
+function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = TRUE) {
+	// Translate German comma to dot
+	convertCommaToDotInPostData('network_min_payment');
 
 	/*
 	 * Some parameters are optional, at least one must be given so check a bunch
@@ -1580,23 +1971,14 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
 	 */
 	foreach (array('network_min_waiting_time', 'network_min_remain_clicks', 'network_min_payment', 'network_allow_erotic') as $element) {
 		// Is this element empty?
-		if (postRequestElement($element) == '') {
+		if (!isPostRequestElementSet($element)) {
 			// Then unset it to get a NULL for optional parameter
 			unsetPostRequestElement($element);
 		} // 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
+	convertSelectionsToEpocheTimeInPostData('network_max_reload_time_ye');
 
 	// Is there already an entry?
 	if (!isNetworkTypeHandlerConfigured(getRequestElement('network_id'), getRequestElement('network_type_id'))) {
@@ -1610,12 +1992,12 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
 	unsetPostRequestElement('set_all');
 
 	// Shall we set for all?
-	if ($setAll === true) {
+	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__);
 
-		// Do we have entries?
+		// Are there entries?
 		if (SQL_HASZERONUMS($result)) {
 			// No, then abort here
 			displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
@@ -1631,7 +2013,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
 			setPostRequestElement('network_data_id', $dataId);
 
 			// Call this function again
-			$numRows += doAdminNetworkProcessEditHandlerTypesConfig(false);
+			$numRows += doAdminNetworkProcessEditHandlerTypesConfig(FALSE);
 		} // END - while
 
 		// Free result
@@ -1643,7 +2025,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
 			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--}');
+			loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
 		}
 	} else {
 		// Get SQL query for new entry
@@ -1653,14 +2035,14 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
 		SQL_QUERY($SQL, __FUNCTION__, __LINE__);
 
 		// Shall we display the message?
-		if ($displayMessage === true) {
+		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--}');
+				loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_HANDLER_NOT_CHANGED--}');
 			}
 		} else {
 			// Return amount of affected rows (1 or 2)
@@ -1698,19 +2080,21 @@ function doAdminNetworkProcessExport () {
 	// Init table with all valid what->table entries
 	$validExports = array(
 		// General network data
-		'list_networks'                  => 'network_data',
+		'list_network_data'              => '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
@@ -1719,24 +2103,24 @@ 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
 	call_user_func($callbackName);
 
 	// Mark it as called
-	$GLOBALS[__FUNCTION__][$callbackName] = true;
+	$GLOBALS[__FUNCTION__][$callbackName] = TRUE;
 
 	// Don't display the list/add new form
-	$GLOBALS['network_display'] = false;
+	$GLOBALS['network_display'] = FALSE;
 }
 
 // Exports (and displays) the table 'network_data'
-function doAdminNetworkExportNetworkData () {
+function doAdminNetworkExportData () {
 	// Query for all networks
 	$result = SQL_QUERY('SELECT
 	`network_short_name`,
@@ -1747,7 +2131,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
@@ -1755,7 +2140,7 @@ ORDER BY
 		__FUNCTION__, __LINE__);
 
 	// Start an empty SQL query
-	$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`) 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)) {
@@ -1769,25 +2154,26 @@ ORDER BY
 			$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) . '
'; + $SQL = substr($SQL, 0, -2); // Free result SQL_FREERESULT($result); // Output the SQL query - loadTemplate('admin_export_network_data', false, $SQL); + loadTemplate('admin_export_network_data', FALSE, $SQL); } // 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 @@ -1798,7 +2184,8 @@ function doAdminNetworkExportNetworkTypes () { `network_type_api_url`, `network_type_click_url`, `network_type_banner_url`, - `network_type_reload_time_unit` + `network_type_reload_time_unit`, + `network_text_encoding` FROM `{?_MYSQL_PREFIX?}_network_types` WHERE @@ -1810,7 +2197,7 @@ ORDER BY ), __FUNCTION__, __LINE__); // Start an empty SQL query - $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`) 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`, `network_text_encoding`) VALUES\n";
 
 	// Load all entries
 	while ($content = SQL_FETCHARRAY($result)) {
@@ -1828,29 +2215,29 @@ ORDER BY
 			$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'] . "','" . $content['network_text_encoding'] . "'),\n";
 	} // END - while
 
 	// Remove last commata and close braces
-	$SQL = substr($SQL, 0, -2) . '
'; + $SQL = substr($SQL, 0, -2); // Free result SQL_FREERESULT($result); // Output the SQL query - loadTemplate('admin_export_network_types', false, $SQL); + loadTemplate('admin_export_network_types', FALSE, $SQL); } // 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 @@ -1872,7 +2259,7 @@ ORDER BY ), __FUNCTION__, __LINE__); // Start an empty SQL query - $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";
+	$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)) {
@@ -1889,26 +2276,81 @@ 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);
+
+	// Free result
+	SQL_FREERESULT($result);
+
+	// Output the SQL query
+	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) . '
'; + $SQL = substr($SQL, 0, -2); // Free result SQL_FREERESULT($result); // Output the SQL query - loadTemplate('admin_export_network_request_params', false, $SQL); + 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 @@ -1916,20 +2358,20 @@ function doAdminNetworkExportNetworkArrayTranslation () { `network_id`, `network_type_id`, `network_array_index`, - `sort` + `network_array_sort` FROM `{?_MYSQL_PREFIX?}_network_array_translation` WHERE `network_id`=%s ORDER BY `network_type_id` ASC, - `sort` ASC', + `network_array_sort` ASC', array( bigintval(getRequestElement('network_id')) ), __FUNCTION__, __LINE__); // Start an empty SQL query - $SQL = "
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`, `network_array_sort`) VALUES\n";
 
 	// Load all entries
 	while ($content = SQL_FETCHARRAY($result)) {
@@ -1938,17 +2380,17 @@ ORDER BY
 			$content['network_id'] . ', ' .
 			$content['network_type_id'] . ', ' .
 			$content['network_array_index'] . ', ' .
-			$content['sort'] . "),\n";
+			$content['network_array_sort'] . "),\n";
 	} // END - while
 
 	// Remove last commata and close braces
-	$SQL = substr($SQL, 0, -2) . '
'; + $SQL = substr($SQL, 0, -2); // Free result SQL_FREERESULT($result); // Output the SQL query - loadTemplate('admin_export_network_array_translation', false, $SQL); + loadTemplate('admin_export_network_array_translation', FALSE, $SQL); } // [EOF]