setCurrentSponsorId($sponsor_id);
// Don't look for invalid sponsor_ids...
- if (!isValidUserId($sponsor_id)) {
+ if (!isValidId($sponsor_id)) {
// Invalid, so abort here
reportBug(__FUNCTION__, __LINE__, 'Sponsor id ' . $sponsor_id . ' is invalid.');
} elseif (isSponsorDataValid()) {
$data = '';
// Can we fetch the sponsor data?
- if ((isValidSponsorId($sponsor_id)) && (fetchSponsorData($sponsor_id, $keyColumn))) {
+ if ((isValidId($sponsor_id)) && (fetchSponsorData($sponsor_id, $keyColumn))) {
// Now get the data back
$data = getSponsorData($valueColumn);
} // END - if
// Checks if current sponsor_id is set
function isCurrentSponsorIdSet () {
- return ((isset($GLOBALS['current_sponsor_id'])) && (isValidSponsorId($GLOBALS['current_sponsor_id'])));
-}
-
-// Is given sponsor_id valid?
-function isValidSponsorId ($sponsor_id) {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__][$sponsor_id])) {
- // Check it out
- $GLOBALS[__FUNCTION__][$sponsor_id] = ((!is_null($sponsor_id)) && (!empty($sponsor_id)) && ($sponsor_id > 0));
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__][$sponsor_id];
+ return ((isset($GLOBALS['current_sponsor_id'])) && (isValidId($GLOBALS['current_sponsor_id'])));
}
// Getter for sponsor data
function getSponsorData ($column) {
// Sponsor id should not be zero
- if (!isValidUserId(getCurrentSponsorId())) {
+ if (!isValidId(getCurrentSponsorId())) {
reportBug(__FUNCTION__, __LINE__, 'Sponsor id is zero.');
} // END - if