// Checks wether a nickname or userid was entered and caches the result
function isNicknameUsed ($userid) {
- // Default is false
- $isUsed = false;
-
// Is the cache there
- if (isset($GLOBALS['is_nickname_used'][$userid])) {
- // Then use it
- $isUsed = $GLOBALS['is_nickname_used'][$userid];
- } else {
+ if (!isset($GLOBALS['is_nickname_used'][$userid])) {
// Determine it
- $isUsed = (('' . round($userid) . '') != $userid);
-
- // And write it to the cache
- $GLOBALS['is_nickname_used'][$userid] = $isUsed;
- }
+ $GLOBALS['is_nickname_used'][$userid] = (('' . round($userid) . '') != $userid);
+ } // END - if
// Return the result
- return $isUsed;
+ return $GLOBALS['is_nickname_used'][$userid];
}
// Getter for 'what' value
// Checks if current userid is set
function isCurrentUserIdSet () {
- return ((isset($GLOBALS['current_userid'])) && ($GLOBALS['current_userid'] > 0));
+ return ((isset($GLOBALS['current_userid'])) && (isValidUserId($GLOBALS['current_userid'])));
}
// Checks wether we are debugging template cache
$data = '{--USERNAME_GUEST--}';
// Can we fetch the user data?
- if (($userid > 0) && (fetchUserData($userid, $keyColumn))) {
+ if ((isValidUserId($userid)) && (fetchUserData($userid, $keyColumn))) {
// Now get the data back
$data = getUserData($valueColumn);
} // END - if
return $GLOBALS['ap_inactive_since'];
}
+// Checks wether proxy configuration is used
+function isProxyUsed () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_proxy_used'])) {
+ // Determine it
+ $GLOBALS['is_proxy_used'] = ((getExtensionVersion('sql_patches') >= '0.4.3') && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_proxy_used'];
+}
+
+// Checks wether POST data contains selections
+function ifPostContainsSelections ($element = 'sel') {
+ // Do we have cache?
+ if (!isset($GLOBALS['post_contains_selections'][$element])) {
+ // Determine it
+ $GLOBALS['post_contains_selections'][$element] = (countPostSelection($element) > 0);
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['post_contains_selections'][$element];
+}
+
// [EOF]
?>