}
// Writes content to a file
-function writeToFile ($FQFN, $content, $aquireLock = false) {
+function writeToFile ($FQFN, $content, $aquireLock = FALSE) {
// Is the file writeable?
if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!changeMode($FQFN, 0644))) {
// Not writeable!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
// Failed! :(
- return false;
+ return FALSE;
} // END - if
// By default all is failed...
- $GLOBALS['file_readable'][$FQFN] = false;
+ $GLOBALS['file_readable'][$FQFN] = FALSE;
unset($GLOBALS['file_content'][$FQFN]);
- $return = false;
+ $return = FALSE;
// Is the function there?
if (function_exists('file_put_contents')) {
// With lock?
- if ($aquireLock === true) {
+ if ($aquireLock === TRUE) {
// Write it directly with lock
$return = file_put_contents($FQFN, $content, LOCK_EX);
} else {
// 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?
- if ($aquireLock === true) {
- // Aquire lock
+ // Aquire a lock?
+ if ($aquireLock === TRUE) {
+ // Aquire a lock.
flock($fp, LOCK_EX);
} // END - if
}
// Was something written?
- if ($return !== false) {
+ if ($return !== FALSE) {
// Mark it as readable
- $GLOBALS['file_readable'][$FQFN] = true;
+ $GLOBALS['file_readable'][$FQFN] = TRUE;
// Remember content in cache
$GLOBALS['file_content'][$FQFN] = $content;
} // END - if
// Return status
- return (($return !== false) && (changeMode($FQFN, 0644)));
+ return (($return !== FALSE) && (changeMode($FQFN, 0644)));
}
// Clears the output buffer. This function does *NOT* backup sent content.
} // END - if
// Mark this function as called
- $GLOBALS[__FUNCTION__] = true;
+ $GLOBALS[__FUNCTION__] = TRUE;
}
// Encode strings
// 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)));
// 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);
// "Getter" for remote IP number
function detectRemoteAddr () {
// Get remote ip from environment
- $remoteAddr = determineRealRemoteAddress(true);
+ $remoteAddr = determineRealRemoteAddress(TRUE);
// Is removeip installed?
if (isExtensionActive('removeip')) {
}
// "Getter" for user agent
-function detectUserAgent ($alwaysReal = false) {
+function detectUserAgent ($alwaysReal = FALSE) {
// Get remote ip from environment
$userAgent = getenv('HTTP_USER_AGENT');
// Is removeip installed?
- if ((isExtensionActive('removeip')) && ($alwaysReal === false)) {
+ if ((isExtensionActive('removeip')) && ($alwaysReal === FALSE)) {
// Then anonymize it
$userAgent = getAnonymousUserAgent($userAgent);
} // END - if
// 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();
// 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__] = (
// Checks whether the hourly reset mode is active
function isHourlyResetEnabled () {
// Now simply check it
- return ((isset($GLOBALS['hourly_enabled'])) && ($GLOBALS['hourly_enabled'] === true));
+ return ((isset($GLOBALS['hourly_enabled'])) && ($GLOBALS['hourly_enabled'] === TRUE));
}
// Checks whether the reset mode is active
function isResetModeEnabled () {
// Now simply check it
- return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === true));
+ return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === TRUE));
}
// Checks whether the debug mode is enabled
// 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'])));
// even if there is no xdebug extension installed.
function copyFileVerified ($source, $dest, $chmod = '') {
// Failed is the default
- $status = false;
+ $status = FALSE;
// Is the source file there?
if (!isFileReadable($source)) {
reportBug(__FUNCTION__, __LINE__, 'copy() has failed to copy the file.');
} else {
// Reset cache
- $GLOBALS['file_readable'][$dest] = true;
+ $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;
// Is the file there?
if (isFileReadable($FQFN)) {
// Reset cache first
- $GLOBALS['file_readable'][$FQFN] = false;
+ $GLOBALS['file_readable'][$FQFN] = FALSE;
// Yes, so remove it
return unlink($FQFN);
// All fine if no file was removed. If we change this to 'false' or rewrite
// above if() block it would be to restrictive.
- return true;
+ return TRUE;
}
// 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
function isConfigLocalLoaded () {
- return ((isset($GLOBALS['config_local_loaded'])) && ($GLOBALS['config_local_loaded'] === true));
+ return ((isset($GLOBALS['config_local_loaded'])) && ($GLOBALS['config_local_loaded'] === TRUE));
}
// Checks whether a nickname or userid was entered and caches the result
// Is the cache there
if (!isset($GLOBALS[__FUNCTION__][$userid])) {
// Determine it
- $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . bigintval($userid, true, false) . '') != $userid) && ($userid != 'NULL'));
+ $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . bigintval($userid, TRUE, FALSE) . '') != $userid) && ($userid != 'NULL'));
} // END - if
// Return the result
}
// Getter for 'what' value
-function getWhat ($strict = true) {
+function getWhat ($strict = TRUE) {
// Default is null
$what = NULL;
$isset = (isset($GLOBALS['__what']) && (!empty($GLOBALS['__what'])));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
debug_report_bug(__FUNCTION__, __LINE__, 'what is empty.');
} // END - if
}
// Getter for 'action' value
-function getAction ($strict = true) {
+function getAction ($strict = TRUE) {
// Default is null
$action = NULL;
$isset = ((isset($GLOBALS['__action'])) && (!empty($GLOBALS['__action'])));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
reportBug(__FUNCTION__, __LINE__, 'action is empty.');
} // END - if
}
// Getter for 'module' value
-function getModule ($strict = true) {
+function getModule ($strict = TRUE) {
// Default is null
$module = NULL;
$isset = ((isset($GLOBALS['__module'])) && (!empty($GLOBALS['__module'])));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
reportBug(__FUNCTION__, __LINE__, 'Module is empty.');
} // END - if
// Return it
- return (($isset === true) && ($GLOBALS['__module'] != 'unknown')) ;
+ return (($isset === TRUE) && ($GLOBALS['__module'] != 'unknown')) ;
}
// Getter for 'output_mode' value
$isset = (isset($GLOBALS['__output_mode']));
// Should we abort here?
- if (($strict === true) && ($isset === false)) {
+ if (($strict === TRUE) && ($isset === FALSE)) {
// Output backtrace
reportBug(__FUNCTION__, __LINE__, 'Output mode is not set.');
} // END - if
}
// Enables block-mode
-function enableBlockMode ($enabled = true) {
+function enableBlockMode ($enabled = TRUE) {
$GLOBALS['__block_mode'] = $enabled;
}
// Wrapper function to redirect to de-refered URL
function redirectToDereferedUrl ($url) {
// Redirect to to
- redirectToUrl(generateDerefererUrl($url));
+ redirectToUrl(generateDereferrerUrl($url));
}
// Wrapper function for checking if extension is installed and newer or same version
// Wrapper function for installation phase
function isInstallationPhase () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = ((!isInstalled()) || (isInstalling()));
// 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());
// 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');
function isUserDataValid () {
// User id should not be zero so abort here
if (!isCurrentUserIdSet()) {
- return false;
+ // Debug message, may be noisy
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isCurrentUserIdSet()=false - ABORTING!');
+
+ // Abort here
+ return FALSE;
} // END - if
// Is it cached?
// Setter for current userid
function setCurrentUserId ($userid) {
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid . ' - ENTERED!');
+
+ // Is the cache from below functions different?
+ if (((isset($GLOBALS['getCurrentUserId'])) && ($GLOBALS['getCurrentUserId'] != $userid)) || ((!isset($GLOBALS['current_userid'])) && (isset($GLOBALS['isCurrentUserIdSet'])))) {
+ // Then unset both
+ unsetCurrentUserId();
+ } // END - if
+
// Set userid
$GLOBALS['current_userid'] = bigintval($userid);
// Unset it to re-determine the actual state
unset($GLOBALS['is_userdata_valid'][$userid]);
- // Is the cache from below functions different?
- if ((isset($GLOBALS['getCurrentUserId'])) && ($GLOBALS['getCurrentUserId'] != $userid)) {
- // Then unset both
- unset($GLOBALS['getCurrentUserId']);
- unset($GLOBALS['isCurrentUserIdSet']);
- } // END - if
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid . ' - EXIT!');
}
// Getter for current userid
// 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'])));
return $GLOBALS[__FUNCTION__];
}
+// Unsets current userid
+function unsetCurrentUserId () {
+ // Is it set?
+ if (isset($GLOBALS['current_userid'])) {
+ // Unset this, too
+ unset($GLOBALS['isValidUserId'][$GLOBALS['current_userid']]);
+ } // END - if
+
+ // Unset all cache entries
+ unset($GLOBALS['current_userid']);
+ unset($GLOBALS['getCurrentUserId']);
+ unset($GLOBALS['isCurrentUserIdSet']);
+}
+
// 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');
// Wrapper for strpos() to ease porting from deprecated ereg() function
function isInString ($needle, $haystack) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'needle=' . $needle . ', haystack=' . $haystack . ', returned=' . intval(strpos($haystack, $needle) !== false));
- return (strpos($haystack, $needle) !== false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'needle=' . $needle . ', haystack=' . $haystack . ', returned=' . intval(strpos($haystack, $needle) !== FALSE));
+ return (strpos($haystack, $needle) !== FALSE);
}
// Wrapper for strpos() to ease porting from deprecated eregi() function
// 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';
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionActive('user')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' '));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' '));
} else {
$GLOBALS[__FUNCTION__] = 0;
}
} // END - if
// Return cached value
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, __FUNCTION__ . '()=' . $GLOBALS[__FUNCTION__]);
return $GLOBALS[__FUNCTION__];
}
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionActive('user')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' '));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' '));
} else {
$GLOBALS[__FUNCTION__] = 0;
}
} // END - if
// Return cached value
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, __FUNCTION__ . '()=' . $GLOBALS[__FUNCTION__]);
return $GLOBALS[__FUNCTION__];
}
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionActive('user')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' '));
+ $GLOBALS[__FUNCTION__] = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' '));
} else {
$GLOBALS[__FUNCTION__] = 0;
}
} // END - if
// Return cached value
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, __FUNCTION__ . '()=' . $GLOBALS[__FUNCTION__]);
return $GLOBALS[__FUNCTION__];
}
if (!isset($GLOBALS[__FUNCTION__])) {
// Then do it
if (isExtensionInstalledAndNewer('user', '0.3.4')) {
- $GLOBALS[__FUNCTION__] = countSumTotalData('{?user_min_confirmed?}', 'user_data', 'userid', 'rand_confirmed', true, runFilterChain('user_exclusion_sql', ' '), '>=');
+ $GLOBALS[__FUNCTION__] = countSumTotalData('{?user_min_confirmed?}', 'user_data', 'userid', 'rand_confirmed', TRUE, runFilterChain('user_exclusion_sql', ' '), '>=');
} else {
$GLOBALS[__FUNCTION__] = 0;
}
} // END - if
// Return cached value
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, __FUNCTION__ . '()=' . $GLOBALS[__FUNCTION__]);
return $GLOBALS[__FUNCTION__];
}
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid[' . gettype($userid) . ']=' . $userid);
- // Handle NULL
- if (is_null($userid)) {
- // Do not handle this as of below isset() will always return false
- return false;
- } // END - if
-
- // 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));
} // END - if
// Return cache
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',result=' . intval($GLOBALS[__FUNCTION__][$userid]));
return $GLOBALS[__FUNCTION__][$userid];
}
// Encodes entities
function encodeEntities ($str) {
// Secure it first
- $str = secureString($str, true, true);
+ $str = secureString($str, TRUE, TRUE);
// Encode dollar sign as well
$str = str_replace('$', '$', $str);
// 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');
// 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'));
// 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'));
// 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'));
// 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'));
// 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');
// 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');
// 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');
// 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');
// 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'));
// "Getter" for default language
function getDefaultLanguage () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('DEFAULT_LANG');
// "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');
// "Getter" for path
function getPath () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('PATH');
// "Getter" for url
function getUrl () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('URL');
// "Getter" for cache_path
function getCachePath () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('CACHE_PATH');
// "Getter" for secret_key
function getSecretKey () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('secret_key');
// "Getter" for SITE_KEY
function getSiteKey () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SITE_KEY');
// "Getter" for DATE_KEY
function getDateKey () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('DATE_KEY');
// "Getter" for master_salt
function getMasterSalt () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('master_salt');
// "Getter" for prime
function getPrime () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('_PRIME');
// "Getter" for encrypt_separator
function getEncryptSeparator () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ENCRYPT_SEPARATOR');
// "Getter" for mysql_prefix
function getMysqlPrefix () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('_MYSQL_PREFIX');
// "Getter" for table_type
function getTableType () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('_TABLE_TYPE');
// "Getter" for salt_length
function getSaltLength () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('salt_length');
// "Getter" for output_mode
function getOutputMode () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('OUTPUT_MODE');
// "Getter" for full_version
function getFullVersion () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('FULL_VERSION');
// "Getter" for title
function getTitle () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('TITLE');
// "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');
// "Getter" for server_url
function getServerUrl () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SERVER_URL');
// "Getter" for mt_word
function getMtWord () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mt_word');
// "Getter" for mt_word2
function getMtWord2 () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mt_word2');
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for mt_word3
+function getMtWord3 () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('mt_word3');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for START_TDAY
+function getStartTday () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('START_TDAY');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for START_YDAY
+function getStartYday () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('START_YDAY');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// "Getter" for main_title
function getMainTitle () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('MAIN_TITLE');
// "Getter" for file_hash
function getFileHash () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('file_hash');
// "Getter" for pass_scramble
function getPassScramble () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('pass_scramble');
// "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');
// "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');
// "Getter" for auto_purge
function getAutoPurge () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('auto_purge');
// "Getter" for bonus_userid
function getBonusUserid () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('bonus_userid');
// "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');
// "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');
// "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');
// "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');
// "Getter" for points
function getPoints () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('POINTS');
// "Getter" for slogan
function getSlogan () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SLOGAN');
// "Getter" for copy
function getCopy () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('COPY');
// "Getter" for webmaster
function getWebmaster () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('WEBMASTER');
// "Getter" for sql_count
function getSqlCount () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('sql_count');
// "Getter" for num_templates
function getNumTemplates () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('num_templates');
// "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');
// "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');
// "Getter" for points_register
function getPointsRegister () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('points_register');
// "Getter" for points_ref
function getPointsRef () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('points_ref');
// "Getter" for ref_payout
function getRefPayout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ref_payout');
// "Getter" for online_timeout
function getOnlineTimeout () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('online_timeout');
// "Getter" for index_home
function getIndexHome () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('index_home');
// "Getter" for one_day
function getOneDay () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('ONE_DAY');
// "Getter" for activate_xchange
function getActivateXchange () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('activate_xchange');
// "Getter" for img_type
function getImgType () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('img_type');
// "Getter" for code_length
function getCodeLength () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('code_length');
// "Getter" for least_cats
function getLeastCats () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('least_cats');
// "Getter" for pass_len
function getPassLen () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('pass_len');
// "Getter" for admin_menu
function getAdminMenu () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('admin_menu');
// "Getter" for last_month
function getLastMonth () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('last_month');
// "Getter" for max_send
function getMaxSend () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('max_send');
// "Getter" for mails_page
function getMailsPage () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('mails_page');
// "Getter" for rand_no
function getRandNo () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('rand_no');
// "Getter" for __DB_NAME
function getDbName () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('__DB_NAME');
// "Getter" for DOMAIN
function getDomain () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('DOMAIN');
// "Getter" for proxy_username
function getProxyUsername () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_username');
// "Getter" for proxy_password
function getProxyPassword () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_password');
// "Getter" for proxy_host
function getProxyHost () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_host');
// "Getter" for proxy_port
function getProxyPort () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('proxy_port');
// "Getter" for SMTP_HOSTNAME
function getSmtpHostname () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SMTP_HOSTNAME');
// "Getter" for SMTP_USER
function getSmtpUser () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SMTP_USER');
// "Getter" for SMTP_PASSWORD
function getSmtpPassword () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('SMTP_PASSWORD');
// "Getter" for points_word
function getPointsWord () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('points_word');
// "Getter" for profile_lock
function getProfileLock () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('profile_lock');
// "Getter" for url_tlock
function getUrlTlock () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('url_tlock');
// "Getter" for title_left
function getTitleLeft () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('title_left');
// "Getter" for title_right
function getTitleRight () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('title_right');
// "Getter" for title_middle
function getTitleMiddle () {
- // Do we have cache?
+ // Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
$GLOBALS[__FUNCTION__] = getConfig('title_middle');
// 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));
// 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));
// 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'));
// "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(
// 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');
// 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');
// 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');
// 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'));
// 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'])));
// 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()));
// Read and convert given entry
$postValue = convertCommaToDot(postRequestElement($postEntry));
+ // Log message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'postEntry=' . $postEntry . ',postValue=' . $postValue);
+
// ... and set it again
setPostRequestElement($postEntry, $postValue);
}
return floatval($floatString);
}
+/**
+ * Searches a multi-dimensional array (as used in many places) for given
+ * key/value pair as taken from user comments from PHP documentation website.
+ *
+ * @param $array An array with one or more dimensions
+ * @param $key Key to look for
+ * @param $valur Value to look for
+ * @return $results Resulted array or empty array if $array is no array
+ * @author sunelbe<at>gmail<dot>com
+ * @link http://de.php.net/manual/en/function.array-search.php#110120
+ */
+function search_array ($array, $key, $value) {
+ // Init array result
+ $results = array();
+
+ // Is $array really an array?
+ if (is_array($array)) {
+ // Does key and value match?
+ if (isset($array[$key]) && $array[$key] == $value) {
+ // Then add it as result
+ $results[] = $array;
+ } // END - if
+
+ // Search for whole array
+ foreach ($array as $subArray) {
+ // Search recursive and merge again
+ $results = merge_array($results, search_array($subArray, $key, $value));
+ } // END - foreach
+ } // END - if
+
+ // Return resulting array
+ return $results;
+}
+
// Generates a YES/NO option list from given default
function generateYesNoOptions ($defaultValue = '') {
// Generate it
// "Getter" for total available receivers
function getTotalReceivers ($mode = 'normal') {
// Get num rows
- $numRows = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, runFilterChain('user_exclusion_sql', ' AND `receive_mails` > 0' . runFilterChain('exclude_users', $mode)));
+ $numRows = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', TRUE, runFilterChain('user_exclusion_sql', ' AND `receive_mails` > 0' . runFilterChain('exclude_users', $mode)));
// Return value
return $numRows;
// 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);
+ $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_links', 'id', 'userid', TRUE);
} // END - if
// Return cache
// Checks whether frameset_mode is set to true
function isFramesetModeEnabled () {
// Check it
- return ((isset($GLOBALS['frameset_mode'])) && ($GLOBALS['frameset_mode'] === true));
+ return ((isset($GLOBALS['frameset_mode'])) && ($GLOBALS['frameset_mode'] === TRUE));
}
// Function to determine correct 'what' value
function convertSelectionsToEpocheTimeInPostData ($id) {
// Init variables
$content = array();
- $skip = false;
+ $skip = FALSE;
// Get all POST data
$postData = postRequestArray();
// Wraps checking if given points account type matches with given in POST data
function ifPointsAccountTypeMatchesPost ($type) {
// Check condition
- exit(__FUNCTION__.':type='.$type.',post=<pre>'.print_r(postRequestArray(), true).'</pre>');
+ exit(__FUNCTION__.':type='.$type.',post=<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
}
// 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)) {
// Get total amount (all levels)
- $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', true);
+ $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', TRUE);
} else {
// Get it from user refs
- $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', true, ' AND `level`=' . bigintval($level));
+ $GLOBALS[__FUNCTION__][$userid][$level] = countSumTotalData($userid, 'user_refs', 'refid', 'userid', TRUE, ' AND `level`=' . bigintval($level));
}
} // END - if
// 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 = '';