From: Roland Häder <roland@mxchange.org>
Date: Thu, 11 Aug 2011 17:13:45 +0000 (+0000)
Subject: More '0' to NULL and fix for failing extension deprecation if no admin is logged in
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f11431f9a9e4eef095057af4e3f0c2a3971488da;p=mailer.git

More '0' to NULL and fix for failing extension deprecation if no admin is logged in
---

diff --git a/inc/config-functions.php b/inc/config-functions.php
index 189d4c448b..ba074262d3 100644
--- a/inc/config-functions.php
+++ b/inc/config-functions.php
@@ -273,7 +273,7 @@ function updateOldConfigFile () {
 }
 
 // Update config entries
-function updateConfiguration ($entries, $values, $updateMode='', $config = '0') {
+function updateConfiguration ($entries, $values, $updateMode = '', $config = '0') {
 	// Do not update config in CSS mode
 	if ((isCssOutputMode()) || (isRawOutputMode()) || (isInstallationPhase())) {
 		// This logger line may be very noisy
diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php
index a9588b2d5c..baf0bdef92 100644
--- a/inc/libs/rallye_functions.php
+++ b/inc/libs/rallye_functions.php
@@ -854,14 +854,14 @@ function addReferalRallyeTemplateSelection ($name = 'template', $default = '') {
 }
 
 // @TODO Please document this function
-function getReferalRallyeRefsCount ($currUserid, $old = '0') {
+function getReferalRallyeRefsCount ($currUserid, $oldReferralCount = '0') {
 	// Check current refs
 	if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
 		// Get refs from cache
 		$count = '0';
 		foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
 			// Do we have a ref for this user?
-			//* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',old='.$old.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
+			//* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',oldReferralCount='.$oldReferralCount.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
 			if (($currUserid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
 				//* DEBUG: */ debugOutput('userid matches!');
 				foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
@@ -889,8 +889,8 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
 			incrementStatsEntry('cache_hits');
 
 			// Remove old refs
-			//* DEBUG: */ debugOutput('+'.$count.'/'.$old.'+');
-			$count -= $old;
+			//* DEBUG: */ debugOutput('+'.$count.'/'.$oldReferralCount.'+');
+			$count -= $oldReferralCount;
 		} // END - if
 	} else {
 		// Load current refs from database
@@ -917,12 +917,12 @@ WHERE
 		if (empty($count)) {
 			$count = '0';
 		} else {
-			$count -= $old;
+			$count -= $oldReferralCount;
 		}
 	}
 
 	// Return count
-	//* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$count.'*');
+	//* DEBUG: */ debugOutput('*'.$userid.'/'.$oldReferralCount.'/'.$count.'*');
 	return $count;
 }
 
diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php
index a1ac2af28a..f1b2cb882b 100644
--- a/inc/libs/surfbar_functions.php
+++ b/inc/libs/surfbar_functions.php
@@ -934,7 +934,7 @@ LIMIT 1",
 }
 
 // Get total amount of URLs of given status for current user or of ACTIVE URLs by default
-function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = '0') {
+function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = NULL) {
 	// Determine depleted user account
 	$userids = SURFBAR_DETERMINE_DEPLETED_USERIDS();
 
@@ -1649,14 +1649,14 @@ function SURFBAR_RELOAD_TO_STOP_PAGE ($page = 'stop') {
 
 // Determine next id for surfbar or get data for given id, always call this before you call other
 // getters below this function!
-function SURFBAR_DETERMINE_NEXT_ID ($urlId = '0') {
+function SURFBAR_DETERMINE_NEXT_ID ($urlId = NULL) {
 	/* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ' - ENTERED!');
 	// Default is no id and no random number
 	$nextId = '0';
 	$randNum = '0';
 
 	// Is the id set?
-	if ($urlId == '0') {
+	if (is_null($urlId)) {
 		// Get array with lock ids
 		$USE = SURFBAR_GET_LOCK_IDS();
 
diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php
index 8a8e310709..a9733b4ec1 100644
--- a/inc/mysql-manager.php
+++ b/inc/mysql-manager.php
@@ -1691,12 +1691,12 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
 }
 
 // Creates a new task
-function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId = '0', $strip = true) {
+function createNewTask ($subject, $notes, $taskType, $userid = NULL, $adminId = NULL, $strip = true) {
 	// Insert the task data into the database
 	SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`,`userid`,`status`,`task_type`,`subject`,`text`,`task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
 		array(
-			$adminId,
-			$userid,
+			makeZeroToNull($adminId),
+			makeZeroToNull($userid),
 			$taskType,
 			$subject,
 			$notes