}
// 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
}
// @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) {
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
if (empty($count)) {
$count = '0';
} else {
- $count -= $old;
+ $count -= $oldReferralCount;
}
}
// Return count
- //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$count.'*');
+ //* DEBUG: */ debugOutput('*'.$userid.'/'.$oldReferralCount.'/'.$count.'*');
return $count;
}
}
// 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();
// 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();
}
// 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