* $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 *
// 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;
// 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;
$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
$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
), __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?
$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
$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
'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
array(getMemberId()), __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all rows
while ($row = sqlFetchArray($result)) {
// Add the row
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)) {
// 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) {
// 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