Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / wrapper-functions.php
index 733d25ce18a201d0046bf6e7b18401f9fec0e134..762538a570dd0680dcf69dc9c4dc51634d29a119 100644 (file)
@@ -91,9 +91,9 @@ function writeToFile ($FQFN, $content, $aquireLock = false) {
                // Write it with fopen
                $fp = fopen($FQFN, 'w') or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
 
-               // Do we need to aquire a lock?
+               // Aquire a lock?
                if ($aquireLock === true) {
-                       // Aquire lock
+                       // Aquire a lock.
                        flock($fp, LOCK_EX);
                } // END - if
 
@@ -176,7 +176,7 @@ function merge_array ($array1, $array2) {
 
 // Check if given FQFN is a readable file
 function isFileReadable ($FQFN) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS['file_readable'][$FQFN])) {
                // Check all...
                $GLOBALS['file_readable'][$FQFN] = ((is_file($FQFN)) && (file_exists($FQFN)) && (is_readable($FQFN)));
@@ -188,7 +188,7 @@ function isFileReadable ($FQFN) {
 
 // Checks whether the given FQFN is a directory and not ., .. or .svn
 function isDirectory ($FQFN) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$FQFN])) {
                // Generate baseName
                $baseName = basename($FQFN);
@@ -296,7 +296,7 @@ function detectServerName () {
 // Removes any  existing www. from SERVER_NAME. This is very silly but enough
 // for our purpose here.
 function detectDomainName () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Get server name
                $domainName = detectServerName();
@@ -329,7 +329,7 @@ function isInstalling () {
 
 // Check whether this script is installed
 function isInstalled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine whether this script is installed
                $GLOBALS[__FUNCTION__] = (
@@ -439,7 +439,7 @@ function isDebugRegularExpressionEnabled () {
 
 // Checks whether the cache instance is valid
 function isCacheInstanceValid () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
@@ -477,14 +477,14 @@ function copyFileVerified ($source, $dest, $chmod = '') {
                $GLOBALS['file_readable'][$dest] = true;
        }
 
+       // All fine by default
+       $status = true;
+
        // If there are chmod rights set, apply them
        if (!empty($chmod)) {
                // Try to apply them
                $status = changeMode($dest, $chmod);
-       } else {
-               // All fine
-               $status = true;
-       }
+       } // END - if
 
        // All fine
        return $status;
@@ -521,14 +521,20 @@ function removeFile ($FQFN) {
 
 // Wrapper for $_POST['sel']
 function countPostSelection ($element = 'sel') {
-       // Is it set?
-       if (isPostRequestElementSet($element)) {
-               // Return counted elements
-               return countSelection(postRequestElement($element));
-       } else {
-               // Return zero if not found
-               return '0';
-       }
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__][$element])) {
+               // Default is zero
+               $GLOBALS[__FUNCTION__][$element] = '0';
+
+               // Is it set?
+               if (isPostRequestElementSet($element)) {
+                       // Return counted elements
+                       $GLOBALS[__FUNCTION__][$element] = countSelection(postRequestElement($element));
+               } // END - if
+       } // END - if
+
+       // Return cached value
+       return $GLOBALS[__FUNCTION__][$element];
 }
 
 // Checks whether the config-local.php is loaded
@@ -794,7 +800,7 @@ function getUsername () {
 
 // Wrapper function for installation phase
 function isInstallationPhase () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((!isInstalled()) || (isInstalling()));
@@ -843,7 +849,7 @@ function getCurrentAdminLogin () {
        // Log debug message
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'called!');
 
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getAdminLogin(getCurrentAdminId());
@@ -936,7 +942,7 @@ function getUserData ($column) {
 
 // Checks whether given user data is set to 'Y'
 function isUserDataEnabled ($column) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][getCurrentUserId()][$column])) {
                // Determine it
                $GLOBALS[__FUNCTION__][getCurrentUserId()][$column] = (getUserData($column) == 'Y');
@@ -1030,7 +1036,7 @@ function getCurrentUserId () {
 
 // Checks if current userid is set
 function isCurrentUserIdSet () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isset($GLOBALS['current_userid'])) && (isValidUserId($GLOBALS['current_userid'])));
@@ -1042,7 +1048,7 @@ function isCurrentUserIdSet () {
 
 // Unsets current userid
 function unsetCurrentUserId () {
-       // Do we have it set?
+       // Is it set?
        if (isset($GLOBALS['current_userid'])) {
                // Unset this, too
                unset($GLOBALS['isValidUserId'][$GLOBALS['current_userid']]);
@@ -1056,7 +1062,7 @@ function unsetCurrentUserId () {
 
 // Checks whether we are debugging template cache
 function isDebuggingTemplateCache () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y');
@@ -1181,7 +1187,7 @@ function sendRawRedirect ($url) {
 
 // Determines the country of the given user id
 function determineCountry ($userid) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Default is 'invalid'
                $GLOBALS[__FUNCTION__][$userid] = 'invalid';
@@ -1272,7 +1278,7 @@ function isValidUserId ($userid) {
        // Debug message
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid);
 
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Check it out
                $GLOBALS[__FUNCTION__][$userid] = ((!is_null($userid)) && (!empty($userid)) && ($userid > 0));
@@ -1465,7 +1471,7 @@ function getMinute ($timestamp = NULL) {
 
 // Checks whether the title decoration is enabled
 function isTitleDecorationEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Just check it
                $GLOBALS[__FUNCTION__] = (getConfig('enable_title_deco') == 'Y');
@@ -1477,7 +1483,7 @@ function isTitleDecorationEnabled () {
 
 // Checks whether filter usage updates are enabled (expensive queries!)
 function isFilterUsageUpdateEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.6.0')) && (isConfigEntrySet('update_filter_usage')) && (getConfig('update_filter_usage') == 'Y'));
@@ -1489,7 +1495,7 @@ function isFilterUsageUpdateEnabled () {
 
 // Checks whether debugging of weekly resets is enabled
 function isWeeklyResetDebugEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'));
@@ -1501,7 +1507,7 @@ function isWeeklyResetDebugEnabled () {
 
 // Checks whether debugging of monthly resets is enabled
 function isMonthlyResetDebugEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'));
@@ -1513,7 +1519,7 @@ function isMonthlyResetDebugEnabled () {
 
 // Checks whether displaying of debug SQLs are enabled
 function isDisplayDebugSqlEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y'));
@@ -1525,7 +1531,7 @@ function isDisplayDebugSqlEnabled () {
 
 // Checks whether module title is enabled
 function isModuleTitleEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = (getConfig('enable_mod_title') == 'Y');
@@ -1537,7 +1543,7 @@ function isModuleTitleEnabled () {
 
 // Checks whether what title is enabled
 function isWhatTitleEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = (getConfig('enable_what_title') == 'Y');
@@ -1549,7 +1555,7 @@ function isWhatTitleEnabled () {
 
 // Checks whether stats are enabled
 function ifInternalStatsEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Then determine it
                $GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y');
@@ -1561,7 +1567,7 @@ function ifInternalStatsEnabled () {
 
 // Checks whether admin-notification of certain user actions is enabled
 function isAdminNotificationEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = (getConfig('admin_notify') == 'Y');
@@ -1573,7 +1579,7 @@ function isAdminNotificationEnabled () {
 
 // Checks whether random referral id selection is enabled
 function isRandomReferralIdEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getConfig('select_user_zero_refid') == 'Y'));
@@ -1585,7 +1591,7 @@ function isRandomReferralIdEnabled () {
 
 // "Getter" for default language
 function getDefaultLanguage () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('DEFAULT_LANG');
@@ -1597,7 +1603,7 @@ function getDefaultLanguage () {
 
 // "Getter" for default referral id
 function getDefRefid () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('def_refid');
@@ -1609,7 +1615,7 @@ function getDefRefid () {
 
 // "Getter" for path
 function getPath () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('PATH');
@@ -1621,7 +1627,7 @@ function getPath () {
 
 // "Getter" for url
 function getUrl () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('URL');
@@ -1633,7 +1639,7 @@ function getUrl () {
 
 // "Getter" for cache_path
 function getCachePath () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('CACHE_PATH');
@@ -1645,7 +1651,7 @@ function getCachePath () {
 
 // "Getter" for secret_key
 function getSecretKey () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('secret_key');
@@ -1657,7 +1663,7 @@ function getSecretKey () {
 
 // "Getter" for SITE_KEY
 function getSiteKey () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('SITE_KEY');
@@ -1669,7 +1675,7 @@ function getSiteKey () {
 
 // "Getter" for DATE_KEY
 function getDateKey () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('DATE_KEY');
@@ -1681,7 +1687,7 @@ function getDateKey () {
 
 // "Getter" for master_salt
 function getMasterSalt () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('master_salt');
@@ -1693,7 +1699,7 @@ function getMasterSalt () {
 
 // "Getter" for prime
 function getPrime () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('_PRIME');
@@ -1705,7 +1711,7 @@ function getPrime () {
 
 // "Getter" for encrypt_separator
 function getEncryptSeparator () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ENCRYPT_SEPARATOR');
@@ -1717,7 +1723,7 @@ function getEncryptSeparator () {
 
 // "Getter" for mysql_prefix
 function getMysqlPrefix () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('_MYSQL_PREFIX');
@@ -1729,7 +1735,7 @@ function getMysqlPrefix () {
 
 // "Getter" for table_type
 function getTableType () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('_TABLE_TYPE');
@@ -1741,7 +1747,7 @@ function getTableType () {
 
 // "Getter" for salt_length
 function getSaltLength () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('salt_length');
@@ -1753,7 +1759,7 @@ function getSaltLength () {
 
 // "Getter" for output_mode
 function getOutputMode () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('OUTPUT_MODE');
@@ -1765,7 +1771,7 @@ function getOutputMode () {
 
 // "Getter" for full_version
 function getFullVersion () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('FULL_VERSION');
@@ -1777,7 +1783,7 @@ function getFullVersion () {
 
 // "Getter" for title
 function getTitle () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('TITLE');
@@ -1789,7 +1795,7 @@ function getTitle () {
 
 // "Getter" for curr_svn_revision
 function getCurrentRepositoryRevision () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('CURRENT_REPOSITORY_REVISION');
@@ -1801,7 +1807,7 @@ function getCurrentRepositoryRevision () {
 
 // "Getter" for server_url
 function getServerUrl () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('SERVER_URL');
@@ -1813,7 +1819,7 @@ function getServerUrl () {
 
 // "Getter" for mt_word
 function getMtWord () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('mt_word');
@@ -1825,7 +1831,7 @@ function getMtWord () {
 
 // "Getter" for mt_word2
 function getMtWord2 () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('mt_word2');
@@ -1837,7 +1843,7 @@ function getMtWord2 () {
 
 // "Getter" for mt_word3
 function getMtWord3 () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('mt_word3');
@@ -1849,7 +1855,7 @@ function getMtWord3 () {
 
 // "Getter" for START_TDAY
 function getStartTday () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('START_TDAY');
@@ -1861,7 +1867,7 @@ function getStartTday () {
 
 // "Getter" for START_YDAY
 function getStartYday () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('START_YDAY');
@@ -1873,7 +1879,7 @@ function getStartYday () {
 
 // "Getter" for main_title
 function getMainTitle () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('MAIN_TITLE');
@@ -1885,7 +1891,7 @@ function getMainTitle () {
 
 // "Getter" for file_hash
 function getFileHash () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('file_hash');
@@ -1897,7 +1903,7 @@ function getFileHash () {
 
 // "Getter" for pass_scramble
 function getPassScramble () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('pass_scramble');
@@ -1909,7 +1915,7 @@ function getPassScramble () {
 
 // "Getter" for ap_inactive_since
 function getApInactiveSince () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ap_inactive_since');
@@ -1921,7 +1927,7 @@ function getApInactiveSince () {
 
 // "Getter" for user_min_confirmed
 function getUserMinConfirmed () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('user_min_confirmed');
@@ -1933,7 +1939,7 @@ function getUserMinConfirmed () {
 
 // "Getter" for auto_purge
 function getAutoPurge () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('auto_purge');
@@ -1945,7 +1951,7 @@ function getAutoPurge () {
 
 // "Getter" for bonus_userid
 function getBonusUserid () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('bonus_userid');
@@ -1957,7 +1963,7 @@ function getBonusUserid () {
 
 // "Getter" for ap_inactive_time
 function getApInactiveTime () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ap_inactive_time');
@@ -1969,7 +1975,7 @@ function getApInactiveTime () {
 
 // "Getter" for ap_dm_timeout
 function getApDmTimeout () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ap_dm_timeout');
@@ -1981,7 +1987,7 @@ function getApDmTimeout () {
 
 // "Getter" for ap_tasks_time
 function getApTasksTime () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ap_tasks_time');
@@ -1993,7 +1999,7 @@ function getApTasksTime () {
 
 // "Getter" for ap_unconfirmed_time
 function getApUnconfirmedTime () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ap_unconfirmed_time');
@@ -2005,7 +2011,7 @@ function getApUnconfirmedTime () {
 
 // "Getter" for points
 function getPoints () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('POINTS');
@@ -2017,7 +2023,7 @@ function getPoints () {
 
 // "Getter" for slogan
 function getSlogan () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('SLOGAN');
@@ -2029,7 +2035,7 @@ function getSlogan () {
 
 // "Getter" for copy
 function getCopy () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('COPY');
@@ -2041,7 +2047,7 @@ function getCopy () {
 
 // "Getter" for webmaster
 function getWebmaster () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('WEBMASTER');
@@ -2053,7 +2059,7 @@ function getWebmaster () {
 
 // "Getter" for sql_count
 function getSqlCount () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('sql_count');
@@ -2065,7 +2071,7 @@ function getSqlCount () {
 
 // "Getter" for num_templates
 function getNumTemplates () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('num_templates');
@@ -2077,7 +2083,7 @@ function getNumTemplates () {
 
 // "Getter" for dns_cache_timeout
 function getDnsCacheTimeout () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('dns_cache_timeout');
@@ -2089,7 +2095,7 @@ function getDnsCacheTimeout () {
 
 // "Getter" for menu_blur_spacer
 function getMenuBlurSpacer () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('menu_blur_spacer');
@@ -2101,7 +2107,7 @@ function getMenuBlurSpacer () {
 
 // "Getter" for points_register
 function getPointsRegister () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('points_register');
@@ -2113,7 +2119,7 @@ function getPointsRegister () {
 
 // "Getter" for points_ref
 function getPointsRef () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('points_ref');
@@ -2125,7 +2131,7 @@ function getPointsRef () {
 
 // "Getter" for ref_payout
 function getRefPayout () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ref_payout');
@@ -2137,7 +2143,7 @@ function getRefPayout () {
 
 // "Getter" for online_timeout
 function getOnlineTimeout () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('online_timeout');
@@ -2149,7 +2155,7 @@ function getOnlineTimeout () {
 
 // "Getter" for index_home
 function getIndexHome () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('index_home');
@@ -2161,7 +2167,7 @@ function getIndexHome () {
 
 // "Getter" for one_day
 function getOneDay () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('ONE_DAY');
@@ -2173,7 +2179,7 @@ function getOneDay () {
 
 // "Getter" for activate_xchange
 function getActivateXchange () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('activate_xchange');
@@ -2185,7 +2191,7 @@ function getActivateXchange () {
 
 // "Getter" for img_type
 function getImgType () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('img_type');
@@ -2197,7 +2203,7 @@ function getImgType () {
 
 // "Getter" for code_length
 function getCodeLength () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('code_length');
@@ -2209,7 +2215,7 @@ function getCodeLength () {
 
 // "Getter" for least_cats
 function getLeastCats () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('least_cats');
@@ -2221,7 +2227,7 @@ function getLeastCats () {
 
 // "Getter" for pass_len
 function getPassLen () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('pass_len');
@@ -2233,7 +2239,7 @@ function getPassLen () {
 
 // "Getter" for admin_menu
 function getAdminMenu () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('admin_menu');
@@ -2245,7 +2251,7 @@ function getAdminMenu () {
 
 // "Getter" for last_month
 function getLastMonth () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('last_month');
@@ -2257,7 +2263,7 @@ function getLastMonth () {
 
 // "Getter" for max_send
 function getMaxSend () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('max_send');
@@ -2269,7 +2275,7 @@ function getMaxSend () {
 
 // "Getter" for mails_page
 function getMailsPage () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('mails_page');
@@ -2281,7 +2287,7 @@ function getMailsPage () {
 
 // "Getter" for rand_no
 function getRandNo () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('rand_no');
@@ -2293,7 +2299,7 @@ function getRandNo () {
 
 // "Getter" for __DB_NAME
 function getDbName () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('__DB_NAME');
@@ -2305,7 +2311,7 @@ function getDbName () {
 
 // "Getter" for DOMAIN
 function getDomain () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('DOMAIN');
@@ -2317,7 +2323,7 @@ function getDomain () {
 
 // "Getter" for proxy_username
 function getProxyUsername () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('proxy_username');
@@ -2329,7 +2335,7 @@ function getProxyUsername () {
 
 // "Getter" for proxy_password
 function getProxyPassword () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('proxy_password');
@@ -2341,7 +2347,7 @@ function getProxyPassword () {
 
 // "Getter" for proxy_host
 function getProxyHost () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('proxy_host');
@@ -2353,7 +2359,7 @@ function getProxyHost () {
 
 // "Getter" for proxy_port
 function getProxyPort () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('proxy_port');
@@ -2365,7 +2371,7 @@ function getProxyPort () {
 
 // "Getter" for SMTP_HOSTNAME
 function getSmtpHostname () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('SMTP_HOSTNAME');
@@ -2377,7 +2383,7 @@ function getSmtpHostname () {
 
 // "Getter" for SMTP_USER
 function getSmtpUser () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('SMTP_USER');
@@ -2389,7 +2395,7 @@ function getSmtpUser () {
 
 // "Getter" for SMTP_PASSWORD
 function getSmtpPassword () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('SMTP_PASSWORD');
@@ -2401,7 +2407,7 @@ function getSmtpPassword () {
 
 // "Getter" for points_word
 function getPointsWord () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('points_word');
@@ -2413,7 +2419,7 @@ function getPointsWord () {
 
 // "Getter" for profile_lock
 function getProfileLock () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('profile_lock');
@@ -2425,7 +2431,7 @@ function getProfileLock () {
 
 // "Getter" for url_tlock
 function getUrlTlock () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('url_tlock');
@@ -2437,7 +2443,7 @@ function getUrlTlock () {
 
 // "Getter" for title_left
 function getTitleLeft () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('title_left');
@@ -2449,7 +2455,7 @@ function getTitleLeft () {
 
 // "Getter" for title_right
 function getTitleRight () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('title_right');
@@ -2461,7 +2467,7 @@ function getTitleRight () {
 
 // "Getter" for title_middle
 function getTitleMiddle () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = getConfig('title_middle');
@@ -2545,7 +2551,7 @@ function getPointsRemoveAccount () {
 
 // Checks whether proxy configuration is used
 function isProxyUsed () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.4.3')) && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
@@ -2557,7 +2563,7 @@ function isProxyUsed () {
 
 // Checks whether POST data contains selections
 function ifPostContainsSelections ($element = 'sel') {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$element])) {
                // Determine it
                $GLOBALS[__FUNCTION__][$element] = ((isPostRequestElementSet($element)) && (is_array(postRequestElement($element))) && (countPostSelection($element) > 0));
@@ -2569,7 +2575,7 @@ function ifPostContainsSelections ($element = 'sel') {
 
 // Checks whether verbose_sql is Y and returns true/false if so
 function isVerboseSqlEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y'));
@@ -2581,7 +2587,7 @@ function isVerboseSqlEnabled () {
 
 // "Getter" for total user points
 function getTotalPoints ($userid) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Init array for filter chain
                $data = array(
@@ -2602,7 +2608,7 @@ function getTotalPoints ($userid) {
 
 // Wrapper to get used points for given userid
 function getUserUsedPoints ($userid) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Determine it
                $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_data', 'used_points');
@@ -2614,7 +2620,7 @@ function getUserUsedPoints ($userid) {
 
 // Wrapper to check if url_blacklist is enabled
 function isUrlBlacklistEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = (getConfig('url_blacklist') == 'Y');
@@ -2626,7 +2632,7 @@ function isUrlBlacklistEnabled () {
 
 // Checks whether direct payment is allowed in configuration
 function isDirectPaymentEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = (getConfig('allow_direct_pay') == 'Y');
@@ -2638,7 +2644,7 @@ function isDirectPaymentEnabled () {
 
 // Checks whether JavaScript-based admin menu is enabled
 function isAdminMenuJavascriptEnabled () {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
                $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.7')) && (getAdminMenuJavaScript() == 'Y'));
@@ -2650,7 +2656,7 @@ function isAdminMenuJavascriptEnabled () {
 
 // Wrapper to check if current task is for extension (not update)
 function isExtensionTask ($content) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$content['task_type'] . '_' . $content['infos']])) {
                // Determine it
                $GLOBALS[__FUNCTION__][$content['task_type'] . '_' . $content['infos']] = (($content['task_type'] == 'EXTENSION') && ((isExtensionNameValid($content['infos'])) || (isExtensionDeprecated($content['infos']))) && (!isExtensionInstalled($content['infos'])));
@@ -2758,7 +2764,7 @@ function generateWrappedUserEmailLink ($email) {
 // Wrapper to check if user points are locked
 function ifUserPointsLocked ($userid) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Determine it
                $GLOBALS[__FUNCTION__][$userid] = ((getFetchedUserData('userid', $userid, 'ref_payout') > 0) && (!isDirectPaymentEnabled()));
@@ -2901,7 +2907,7 @@ function getTotalReceivers ($mode = 'normal') {
 
 // Wrapper "getter" to get total unconfirmed mails for given userid
 function getTotalUnconfirmedMails ($userid) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
                // Determine it
                $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_links', 'id', 'userid', true);
@@ -3081,7 +3087,7 @@ function ifPointsAccountTypeMatchesPost ($type) {
 
 // Gets given user's total referral
 function getUsersTotalReferrals ($userid, $level = NULL) {
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid][$level])) {
                // Is the level NULL?
                if (is_null($level)) {
@@ -3100,7 +3106,7 @@ function getUsersTotalReferrals ($userid, $level = NULL) {
 // Gets given user's total referral
 function getUsersTotalLockedReferrals ($userid, $level = NULL) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level[' . gettype($level) . ']=' . $level . ' - ENTERED!');
-       // Do we have cache?
+       // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid][$level])) {
                // Default is all refs
                $add = '';