]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
Opps, not all elements for sprintf() has been set.
[mailer.git] / inc / libs / surfbar_functions.php
index acb07cf9e1bee8731d91463337439a6868d4983b..3acbc7c4d978aa2b610d114a83af3e2f97c8d7f8 100644 (file)
@@ -117,7 +117,7 @@ function doSurfbarAdminUnlockUrlIds ($IDs) {
                // No array
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array');
                return FALSE;
-       } elseif (count($IDs) == 0) {
+       } elseif (!isFilledArray($IDs)) {
                // Empty array
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty');
                return FALSE;
@@ -147,7 +147,7 @@ function doSurfbarAdminRejectUrlIds ($IDs) {
                // No array
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array');
                return FALSE;
-       } elseif (count($IDs) == 0) {
+       } elseif (!isFilledArray($IDs)) {
                // Empty array
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty');
                return FALSE;
@@ -529,7 +529,7 @@ function doHandleSurfbarDepletedViews () {
        $urlArray = getSurfbarUrlData('0', 'url_views_max', 'url_id', 'ASC', 'url_id', " AND `url_views_allowed` > 0 AND `url_status`='ACTIVE'");
 
        // Are there some entries?
-       if (count($urlArray) > 0) {
+       if (isFilledArray($urlArray)) {
                // Then handle all!
                foreach ($urlArray as $id => $urlData) {
                        // Backup data
@@ -584,7 +584,7 @@ function ifSurfbarHasUrlUserId ($url, $userid) {
        $urlArray = getSurfbarUrlData($url, 'url', 'url_id', 'ASC', 'url_id', sprintf(" AND `url_userid`=%s", bigintval($userid)));
 
        // Was it found?
-       return (count($urlArray) > 0);
+       return isFilledArray($urlArray);
 }
 
 // Load URL data by given search term and column
@@ -1000,7 +1000,7 @@ function getSurfbarTotalUrls ($status = 'ACTIVE', $excludeUserId = NULL) {
        $userids = determineSurfbarDepletedUserids();
 
        // If we dont get any user ids back, there are no URLs
-       if (count($userids['url_userid']) == 0) {
+       if (!isFilledArray($userids['url_userid'])) {
                // No user ids found, no URLs!
                return 0;
        } // END - if
@@ -1418,7 +1418,7 @@ function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = array(
        $newStatus = strtolower($newStatus);
 
        // Get URL data for status comparison if missing
-       if ((!is_array($data)) || (count($data) == 0)) {
+       if (!isFilledArray($data)) {
                // Fetch missing URL data
                $data = getSurfbarUrlData($urlId);
        } // END - if
@@ -1429,16 +1429,15 @@ function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = array(
                'prev_status' => $prevStatus,
                'new_status'  => $newStatus,
                'data'        => $data,
-               'abort'       => NULL
        );
 
        // Run pre filter chain
        $filterData = runFilterChain('pre_change_surfbar_url_status', $filterData);
 
        // Abort here?
-       if (!is_null($filterData['abort'])) {
+       if (isFilterChainAborted()) {
                // Abort here
-               return $filterData['abort'];
+               return FALSE;
        } // END - if
 
        // Update the status now
@@ -1736,7 +1735,7 @@ function determineSurfbarNextId ($urlId = NULL) {
 
                // Shall we add some URL ids to ignore?
                $add = '';
-               if (count($USE) > 0) {
+               if (isFilledArray($USE)) {
                        // Ignore some!
                        $add = " AND `sbu`.`url_id` NOT IN (";
                        foreach ($USE as $url_id => $lid) {
@@ -2002,7 +2001,7 @@ function isSurfbarAutoStartEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getSurfbarAutoStart() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntry('surfbar_auto_start')) && (getSurfbarAutoStart() == 'Y'));
        } // END - if
 
        // Return cache