]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
no more SSL
[mailer.git] / inc / libs / surfbar_functions.php
index acb07cf9e1bee8731d91463337439a6868d4983b..90472980778f424292d45bb7929d5bb14445814b 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -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
@@ -637,7 +637,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Is there at least one record?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Then load all!
                while ($dataRow = sqlFetchArray($result)) {
                        // Shall we group these results?
@@ -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
@@ -1666,7 +1665,7 @@ ORDER BY
                array(getMemberId()), __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all rows
                while ($row = sqlFetchArray($result)) {
                        // Add the row
@@ -1691,7 +1690,7 @@ function getSurfbarArrayFromStatus ($status) {
                array($status), __FUNCTION__, __LINE__);
 
        // Some entries there?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all actions
                // @TODO This can be somehow rewritten
                while ($content = sqlFetchArray($result)) {
@@ -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