Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / libs / network_functions.php
index c6c5981b83c5180218d55876960c803a0bb6caa0..f89979e68dc8e36e5f900a4003d438967c70bdaf 100644 (file)
@@ -82,7 +82,7 @@ function detectNetworkProcessForm () {
 
 // 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();
@@ -242,7 +242,7 @@ WHERE
 LIMIT 1",
                        array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-               // Do we have an entry?
+               // Is there an entry?
                if (SQL_NUMROWS($result) == 1) {
                        // Then get it
                        $GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
@@ -305,7 +305,7 @@ WHERE
 LIMIT 1",
                        array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-               // Do we have an entry?
+               // Is there an entry?
                if (SQL_NUMROWS($result) == 1) {
                        // Then get it
                        $GLOBALS['network_data'][$networkId] = SQL_FETCHARRAY($result);
@@ -351,7 +351,7 @@ WHERE
 LIMIT 1',
                array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-       // Do we have an entry?
+       // Is there an entry?
        if (SQL_NUMROWS($result) == 1) {
                // Then get it
                $GLOBALS['network_type_data'][$networkId] = SQL_FETCHARRAY($result);
@@ -390,7 +390,7 @@ WHERE
 LIMIT 1',
                array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
-       // Do we have an entry?
+       // Is there an entry?
        if (SQL_NUMROWS($result) == 1) {
                // Then get it
                $networkRequestData = SQL_FETCHARRAY($result);
@@ -471,7 +471,7 @@ WHERE
 ORDER BY
        `network_short_name` ASC", __FUNCTION__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
@@ -516,7 +516,7 @@ ORDER BY
                        bigintval($networkId)
                ), __FUNCTION__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
@@ -564,7 +564,7 @@ ORDER BY
        d.`network_short_name` ASC,
        t.`network_type_handler` ASC", __FUNCTION__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
@@ -763,7 +763,7 @@ 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] = generateOptions(
@@ -786,7 +786,7 @@ 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] = generateYesNoOptions($default);
@@ -873,7 +873,7 @@ function translateNetworkVcheckParameterKey ($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();
@@ -892,7 +892,7 @@ ON
 ORDER BY
        `sort` ASC', __FUNCTION__, __LINE__);
 
-               // Do we have entries?
+               // Are there entries?
                if (!SQL_HASZERONUMS($result)) {
                        // Get all entries
                        while ($row = SQL_FETCHARRAY($result)) {
@@ -920,7 +920,7 @@ ORDER BY
 
 // Translates network API configuration status (see function isNetworkApiConfigured()) by given id
 function translateNetworkApiConfiguredStatusById ($networkId) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
                // By default it is not configured
                $GLOBALS[__FUNCTION__][$networkId] = '{--ADMIN_NETWORK_API_NOT_CONFIGURED--}';
@@ -938,7 +938,7 @@ function translateNetworkApiConfiguredStatusById ($networkId) {
 
 // Checks if the given network is configured by looking its API configuration entry up
 function isNetworkApiConfigured ($networkId) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$networkId])) {
                // Check for an entry in network_api_config
                $GLOBALS[__FUNCTION__][$networkId] = (countSumTotalData(
@@ -956,7 +956,7 @@ function isNetworkApiConfigured ($networkId) {
 
 // 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(
@@ -1013,7 +1013,7 @@ function doAdminNetworkProcessAddNetwork () {
 
 // Displays selected networks for editing
 function doAdminNetworkProcessHandleNetworks () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // Something has been selected, so start displaying one by one
                $OUT = '';
@@ -1023,7 +1023,7 @@ function doAdminNetworkProcessHandleNetworks () {
                                // Load this network's data
                                $networkData = getNetworkDataById($networkId);
 
-                               // Do we have found the network?
+                               // Is there found the network?
                                if (count($networkData) > 0) {
                                        // Add row template with given form name
                                        $OUT .= loadTemplate('admin_' . $GLOBALS['network_form_name'] . '_networks_row', true, $networkData);
@@ -1047,7 +1047,7 @@ function doAdminNetworkProcessHandleNetworks () {
 
 // Handle network type form
 function doAdminNetworkProcessHandleNetworkTypes () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // Load network data
                $networkData = getNetworkDataById(getRequestElement('network_id'));
@@ -1060,7 +1060,7 @@ function doAdminNetworkProcessHandleNetworkTypes () {
                                // Load this network's data
                                $networkTypeData = getNetworkTypeDataById($networkId);
 
-                               // Do we have found the network?
+                               // Is there found the network?
                                if (count($networkTypeData) > 0) {
                                        if (isFormSent('edit')) {
                                                // Add row template for deleting
@@ -1099,7 +1099,7 @@ function doAdminNetworkProcessHandleNetworkTypes () {
 
 // 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();
@@ -1115,7 +1115,7 @@ function doAdminNetworkProcessHandleRequestParams () {
                                // Load this network's data
                                $networkRequestData = getNetworkRequestParamsDataById($networkId);
 
-                               // Do we have found the network?
+                               // Is there found the network?
                                if (count($networkRequestData) > 0) {
                                        if (isFormSent('edit')) {
                                                // Add row template for deleting
@@ -1157,7 +1157,7 @@ function doAdminNetworkProcessHandleRequestParams () {
 
 // Changes given networks
 function doAdminNetworkProcessChangeNetworks () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
@@ -1176,7 +1176,7 @@ function doAdminNetworkProcessChangeNetworks () {
                                                continue;
                                        } // END - if
 
-                                       // Do we have this enty?
+                                       // Is there this enty?
                                        if (!isset($entry[$networkId])) {
                                                // Not found, needs fixing
                                                reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
@@ -1191,7 +1191,7 @@ function doAdminNetworkProcessChangeNetworks () {
                        } // END - if
                } // END - foreach
 
-               // Do we have updates?
+               // Is there updates?
                if ($updated > 0) {
                        // Updates done
                        displayMessage('{%message,ADMIN_NETWORK_UPDATED=' . $updated . '%}');
@@ -1204,7 +1204,7 @@ function doAdminNetworkProcessChangeNetworks () {
 
 // Removes given networks
 function doAdminNetworkProcessRemoveNetworks () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
@@ -1218,7 +1218,7 @@ function doAdminNetworkProcessRemoveNetworks () {
                        } // END - if
                } // END - foreach
 
-               // Do we have removes?
+               // Is there removes?
                if ($removed > 0) {
                        // Removals done
                        displayMessage('{%message,ADMIN_NETWORK_REMOVED=' . $removed . '%}');
@@ -1267,7 +1267,7 @@ function doAdminNetworkProcessAddNetworkType () {
 
 // Changes given network type handlers
 function doAdminNetworkProcessChangeHandlerTypes () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
@@ -1286,7 +1286,7 @@ function doAdminNetworkProcessChangeHandlerTypes () {
                                                continue;
                                        } // END - if
 
-                                       // Do we have this enty?
+                                       // Is there this enty?
                                        if (!isset($entry[$networkId])) {
                                                // Not found, needs fixing
                                                reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
@@ -1307,7 +1307,7 @@ 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 . '%}');
@@ -1320,7 +1320,7 @@ function doAdminNetworkProcessChangeHandlerTypes () {
 
 // Changes given network request parameters
 function doAdminNetworkProcessChangeRequestParams () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
@@ -1339,7 +1339,7 @@ function doAdminNetworkProcessChangeRequestParams () {
                                                continue;
                                        } // END - if
 
-                                       // Do we have this enty?
+                                       // Is there this enty?
                                        if (!isset($entry[$networkId])) {
                                                // Not found, needs fixing
                                                reportBug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $networkId . ' found.');
@@ -1360,7 +1360,7 @@ function doAdminNetworkProcessChangeRequestParams () {
                        } // END - if
                } // END - foreach
 
-               // Do we have updates?
+               // Is there updates?
                if ($updated > 0) {
                        // Updates done
                        displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_UPDATED=' . $updated . '%}');
@@ -1373,7 +1373,7 @@ function doAdminNetworkProcessChangeRequestParams () {
 
 // Removes given network type handlers
 function doAdminNetworkProcessRemoveNetworkTypes () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
@@ -1387,7 +1387,7 @@ 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 . '%}');
@@ -1400,7 +1400,7 @@ function doAdminNetworkProcessRemoveNetworkTypes () {
 
 // Removes given network request parameters
 function doAdminNetworkProcessRemoveNetworkRequestParams () {
-       // Do we have selections?
+       // Is there selections?
        if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
@@ -1414,7 +1414,7 @@ function doAdminNetworkProcessRemoveNetworkRequestParams () {
                        } // END - if
                } // END - foreach
 
-               // Do we have removes?
+               // Is there removes?
                if ($removed > 0) {
                        // Removals done
                        displayMessage('{%message,ADMIN_NETWORK_REQUEST_PARAMETER_REMOVED=' . $removed . '%}');
@@ -1614,7 +1614,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = true) {
                $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--}');
@@ -1705,7 +1705,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = true) {
                $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--}');