]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/sponsor_functions.php
Mailer project rwritten:
[mailer.git] / inc / libs / sponsor_functions.php
index 36bb1a990bc40bec87d4f4729b62d637fe2a8725..5e20e785c67d941876596340e745c91f13d9b3ab 100644 (file)
@@ -667,7 +667,7 @@ function fetchSponsorData ($sponsor_id, $column = 'id') {
                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()) {
@@ -750,7 +750,7 @@ function getFetchedSponsorData ($keyColumn, $sponsor_id, $valueColumn) {
                $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
@@ -803,25 +803,13 @@ function getCurrentSponsorId () {
 
 // 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