From: Roland Häder Date: Mon, 22 Oct 2012 17:21:07 +0000 (+0000) Subject: Commented out debug lines again X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b04edabc1961aded48e8becbb0777d81af893536;p=mailer.git Commented out debug lines again --- diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index d04fafebe9..58d118964e 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -49,31 +49,31 @@ function doSurfbarAdminAddUrl ($url, $limit, $reload, $waiting) { // Do some pre-checks if (!isAdmin()) { // Not an admin - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Not admin.", $url, $limit, $reload)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Not admin.", $url, $limit, $reload)); return FALSE; } elseif (!isUrlValid($url)) { // URL invalid - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid URL.", $url, $limit, $reload)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid URL.", $url, $limit, $reload)); return FALSE; } elseif (ifSurfbarHasUrlUserId($url, 0)) { // URL already found in surfbar! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Already added.", $url, $limit, $reload)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Already added.", $url, $limit, $reload)); return FALSE; } elseif (!ifSurfbarMemberAllowedMoreUrls()) { // No more allowed! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: No more URLs allowed.", $url, $limit, $reload)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: No more URLs allowed.", $url, $limit, $reload)); return FALSE; } elseif ('' . ($limit + 0) . '' != '' . $limit . '') { // Invalid limit entered - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid limit entered.", $url, $limit, $reload)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid limit entered.", $url, $limit, $reload)); return FALSE; } elseif ('' . ($reload + 0) . '' != '' . $reload . '') { // Invalid amount entered - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid reload entered.", $url, $limit, $reload)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s: Invalid reload entered.", $url, $limit, $reload)); return FALSE; } elseif ('' . ($waiting + 0) . '' != '' . $waiting . '') { // Invalid amount entered - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,waiting=%s: Invalid waiting entered.", $url, $limit, $waiting)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,waiting=%s: Invalid waiting entered.", $url, $limit, $waiting)); return FALSE; } @@ -86,19 +86,19 @@ function doSurfbarAdminMigrateUrl ($url, $userid) { // Do some pre-checks if (!isAdmin()) { // Not an admin - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Not admin, url=' . $url . ',userid=' . $userid); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Not admin, url=' . $url . ',userid=' . $userid); return FALSE; } elseif (!isUrlValid($url)) { // URL invalid - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Invalid URL, url=' . $url . ',userid=' . $userid); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Invalid URL, url=' . $url . ',userid=' . $userid); return FALSE; } elseif (ifSurfbarHasUrlUserId($url, $userid)) { // URL already found in surfbar! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Already added, url=' . $url . ',userid=' . $userid); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Already added, url=' . $url . ',userid=' . $userid); return FALSE; } elseif (!ifSurfbarMemberAllowedMoreUrls($userid)) { // No more allowed! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Maximum exceeded, url=' . $url . ',userid=' . $userid); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot migrate URL: Maximum exceeded, url=' . $url . ',userid=' . $userid); return FALSE; } @@ -111,15 +111,15 @@ function doSurfbarAdminUnlockUrlIds ($IDs) { // Is this an admin or invalid array? if (!isAdmin()) { // Not admin or invalid ids array - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Not admin'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Not admin'); return FALSE; } elseif (!is_array($IDs)) { // No array - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array'); return FALSE; } elseif (count($IDs) == 0) { // Empty array - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty'); return FALSE; } @@ -141,15 +141,15 @@ function doSurfbarAdminRejectUrlIds ($IDs) { // Is this an admin or invalid array? if (!isAdmin()) { // Not admin or invalid ids array - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Not admin'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Not admin'); return FALSE; } elseif (!is_array($IDs)) { // No array - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs type ' . gettype($IDs) . '!=array'); return FALSE; } elseif (count($IDs) == 0) { // Empty array - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: IDs is empty'); return FALSE; } @@ -175,23 +175,23 @@ function doSurfbarMemberAddUrl ($url, $limit) { // Do some pre-checks if (!isMember()) { // Not a member - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: isMember()=false'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: isMember()=false'); return FALSE; } elseif ((!isUrlValid($url)) && (!isAdmin())) { // URL invalid - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid, url=' . $url . ',limit=' . $limit); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid, url=' . $url . ',limit=' . $limit); return FALSE; } elseif (ifSurfbarHasUrlUserId($url, getMemberId())) { // URL already found in surfbar! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Already found, url=' . $url . ',limit=' . $limit); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Already found, url=' . $url . ',limit=' . $limit); return FALSE; } elseif (!ifSurfbarMemberAllowedMoreUrls(getMemberId())) { // No more allowed! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Maximum exceeded, url=' . $url . ',limit=' . $limit); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Maximum exceeded, url=' . $url . ',limit=' . $limit); return FALSE; } elseif (''.($limit + 0).'' != ''.$limit.'') { // Invalid amount entered - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid limit, url=' . $url . ',limit=' . $limit); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid limit, url=' . $url . ',limit=' . $limit); return FALSE; } @@ -233,19 +233,19 @@ function doSurfbarMemberByFormData ($formData, $urlArray) { // Is this a member? if (!isMember()) { // No member! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: isMember()=false'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: isMember()=false'); return FALSE; } elseif ((!isset($formData['url_id'])) || (!isset($formData['action']))) { // Important form elements are missing! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid form data, required field id/action not found'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Invalid form data, required field id/action not found'); return FALSE; } elseif (!isset($urlArray[$formData['url_id']])) { // Id not found in cache - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Field url_id not found in cache'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Field url_id not found in cache'); return FALSE; } elseif (!isSurfbarMemberActionStatusValid($formData['action'], $urlArray[$formData['url_id']]['url_status'])) { // Action not allowed for current URL status - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Action not allowed to perform. action=' . $formData['action'] . ',url_status=' . $urlArray[$formData['url_id']]['url_status'] . ',url_id=' . $formData['url_id']); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot add URL: Action not allowed to perform. action=' . $formData['action'] . ',url_status=' . $urlArray[$formData['url_id']]['url_status'] . ',url_id=' . $formData['url_id']); return FALSE; } @@ -325,7 +325,7 @@ function isSurfbarMemberActionStatusValid ($action, $status) { $isValid = (SQL_NUMROWS($result) == 1); // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'action=' . $action . ',status=' . $status . ',isValid=' . intval($isValid)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'action=' . $action . ',status=' . $status . ',isValid=' . intval($isValid)); // Fetch the new status if found if ($isValid === TRUE) { @@ -935,7 +935,7 @@ function determineSurfbarTemplateName() { * before you call ifSurfbarReloadLock(). */ function isSurfbarReloadFull () { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Fixed surf lock is ' . getConfig('surfbar_static_lock') . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Fixed surf lock is ' . getConfig('surfbar_static_lock') . ' - ENTERED!'); // Default is full! $isFull = TRUE; @@ -943,12 +943,12 @@ function isSurfbarReloadFull () { $GLOBALS['surfbar_cache']['surf_lock'] = getConfig('surfbar_static_lock'); // Is there dynamic model? - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'surf_lock=' . $GLOBALS['surfbar_cache']['surf_lock'] . ' - BEFORE'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'surf_lock=' . $GLOBALS['surfbar_cache']['surf_lock'] . ' - BEFORE'); if (getSurfbarPaymentModel() == 'DYNAMIC') { // "Calculate" dynamic lock $GLOBALS['surfbar_cache']['surf_lock'] += calculateSurfbarDynamicAddValue(); } // END - if - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'surf_lock=' . $GLOBALS['surfbar_cache']['surf_lock'] . ' - AFTER'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'surf_lock=' . $GLOBALS['surfbar_cache']['surf_lock'] . ' - AFTER'); // Ask the database $result = SQL_QUERY_ESC("SELECT @@ -989,7 +989,7 @@ LIMIT 1", $isFull = ((getSurfbarUserLocks() == $total) && ($total > 0)); // Return result - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userLocks=' . getSurfbarUserLocks() . ',total=' . $total . ',isFull=' . intval($isFull) . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userLocks=' . getSurfbarUserLocks() . ',total=' . $total . ',isFull=' . intval($isFull) . ' - EXIT!'); return $isFull; } @@ -1029,7 +1029,7 @@ LIMIT 1", SQL_FREERESULT($result); // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $count . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $count . ' - EXIT!'); // Return result return $count; @@ -1079,16 +1079,16 @@ function getSurfbarTotalUserUrls ($userid = NULL, $status = '', $exclude = '') { // Generate a validation code for the given id number function generateSurfbarValidationCode ($urlId, $salt = '') { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',salt=' . $salt . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',salt=' . $salt . ' - ENTERED!'); // Init hash with invalid value if (empty($salt)) { // Generate random hashed string $GLOBALS['surfbar_cache']['salt'] = sha1(generatePassword(mt_rand(200, 255))); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newSalt='.getSurfbarSalt().'', FALSE); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newSalt='.getSurfbarSalt().'', FALSE); } else { // Use this as salt! $GLOBALS['surfbar_cache']['salt'] = $salt; - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'oldSalt='.getSurfbarSalt().'', FALSE); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'oldSalt='.getSurfbarSalt().'', FALSE); } // Hash it with md5() and salt it with the random string @@ -1098,13 +1098,13 @@ function generateSurfbarValidationCode ($urlId, $salt = '') { $valHashedCode = encodeHashForCookie($hashedCode); // Return hashed value - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',salt=' . $salt . ',urlId=' . $urlId . ',salt=' . $salt . ',valHashedCode=' . $valHashedCode . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',salt=' . $salt . ',urlId=' . $urlId . ',salt=' . $salt . ',valHashedCode=' . $valHashedCode . ' - EXIT!'); return $valHashedCode; } // Check validation code function isSurfbarValidationCodeValid ($urlId, $check, $salt) { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',check=' . $check . ',salt=' . $salt . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',check=' . $check . ',salt=' . $salt . ' - ENTERED!'); // Secure id number $urlId = bigintval($urlId); @@ -1112,13 +1112,13 @@ function isSurfbarValidationCodeValid ($urlId, $check, $salt) { $code = generateSurfbarValidationCode($urlId, $salt); // Return result of checking hashes and salts - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',(code==check)=' . intval($code == $check) . ',(salt==salts_last_salt)=' . intval($salt == getSurfbarData('salts_last_salt')) . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',(code==check)=' . intval($code == $check) . ',(salt==salts_last_salt)=' . intval($salt == getSurfbarData('salts_last_salt')) . ' - EXIT!'); return (($code == $check) && ($salt == getSurfbarData('salts_last_salt'))); } // Lockdown the userid/id combination (reload lock) function addSurfbarReloadLockById ($urlId) { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',getMemberId()=' . getMemberId() . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',getMemberId()=' . getMemberId() . ' - ENTERED!'); // Search for an entry $countLock = countSumTotalData(getMemberId(), 'surfbar_locks', 'locks_id', 'locks_userid', TRUE, ' AND `locks_url_id`=' . bigintval($urlId)); @@ -1139,25 +1139,25 @@ function addSurfbarReloadLockById ($urlId) { getMemberId() ), __FUNCTION__, __LINE__); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',getMemberId()=' . getMemberId() . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS() . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',getMemberId()=' . getMemberId() . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS() . ' - EXIT!'); } // Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf" function doSurfbarPayPoints () { // Remove it from the URL owner - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getSurfbarUserid().',costs='.getSurfbarCosts() . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getSurfbarUserid().',costs='.getSurfbarCosts() . ' - ENTERED!'); if (isValidUserId(getSurfbarUserid())) { // Subtract points and ignore return status subtractPoints(sprintf("surfbar_%s", getSurfbarPaymentModel()), getSurfbarUserid(), getSurfbarCosts()); } // END - if - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getMemberId().',reward='.getSurfbarReward()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getMemberId().',reward='.getSurfbarReward()); // Init referral system here initReferralSystem(); // Book it to the user and ignore return status addPointsThroughReferralSystem(sprintf("surfbar:%s", getSurfbarPaymentModel()), getMemberId(), getSurfbarReward()); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getSurfbarUserid().',costs='.getSurfbarCosts() . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getSurfbarUserid().',costs='.getSurfbarCosts() . ' - EXIT!'); } // Updates the statistics of current URL/userid @@ -1230,7 +1230,7 @@ WHERE LIMIT 1", __FUNCTION__, __LINE__); // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'salt=' . getSurfbarSalt() . ',id=' . getSurfbarId() . ',userid=' . getMemberId() . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS() . ' - UPDATE!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'salt=' . getSurfbarSalt() . ',id=' . getSurfbarId() . ',userid=' . getMemberId() . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS() . ' - UPDATE!'); // Was that okay? if (SQL_HASZEROAFFECTED()) { @@ -1249,7 +1249,7 @@ LIMIT 1", __FUNCTION__, __LINE__); } // END - if // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'affectedRows=' . SQL_AFFECTEDROWS() . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'affectedRows=' . SQL_AFFECTEDROWS() . ' - EXIT!'); // Return if the update was okay return (!SQL_HASZEROAFFECTED()); @@ -1257,7 +1257,7 @@ LIMIT 1", __FUNCTION__, __LINE__); // Check if the reload lock is active for given id function ifSurfbarReloadLock ($urlId) { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $urlId . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $urlId . ' - ENTERED!'); // Ask the database $result = SQL_QUERY_ESC('SELECT COUNT(`locks_id`) AS `cnt` FROM @@ -1279,7 +1279,7 @@ LIMIT 1', SQL_FREERESULT($result); // Return check - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',count=' . $count . ',getSurfbarSurfLock()=' . getSurfbarSurfLock() . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',count=' . $count . ',getSurfbarSurfLock()=' . getSurfbarSurfLock() . ' - EXIT!'); return ($count == 1); } @@ -1340,12 +1340,12 @@ ORDER BY while ($content = SQL_FETCHARRAY($result)) { // Get total points $points = getTotalPoints($content['url_userid']); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $content['url_userid'] . ',points=' . $points); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $content['url_userid'] . ',points=' . $points); // Shall we add this to ignore? if ($points <= $limit) { // Ignore this one! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $content['url_userid'] . ' has depleted points amount!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $content['url_userid'] . ' has depleted points amount!'); $userids['url_userid'][$content['url_userid']] = $content['url_userid']; $userids['points'][$content['url_userid']] = $points; $userids['notified'][$content['url_userid']] = $content['notified']; @@ -1356,7 +1356,7 @@ ORDER BY SQL_FREERESULT($result); // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UIDs::count=' . count($userids) . ' (with own userid=' . getMemberId() . ')'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UIDs::count=' . count($userids) . ' (with own userid=' . getMemberId() . ')'); // Return result return $userids; @@ -1410,7 +1410,7 @@ function determineSurfbarWaitingTime () { // Changes the status of an URL from given to other function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = array()) { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',data[]=' . gettype($data) . ',newStatus=' . $newStatus . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',data[]=' . gettype($data) . ',newStatus=' . $newStatus . ' - ENTERED!'); // Make new status always lower-case $newStatus = strtolower($newStatus); @@ -1462,7 +1462,7 @@ function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = array( assert(isset($filterData['data'])); // All done! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - EXIT!'); return TRUE; } @@ -1565,17 +1565,17 @@ ORDER BY // Load all entries while ($content = SQL_FETCHARRAY($result)) { // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'next - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',rest='.(time() - $content['last_surfed']).'/'.getSurfbarSurfLock()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'next - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',rest='.(time() - $content['last_surfed']).'/'.getSurfbarSurfLock()); // Skip entries that are too old if (($content['last_surfed'] > (time() - getSurfbarSurfLock())) && (!in_array($content['locks_url_id'], $ignored))) { // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'okay - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',last='.$content['last_surfed']); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'okay - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',last='.$content['last_surfed']); // Add only if missing or bigger if ((!isset($IDs[$content['locks_url_id']])) || ($IDs[$content['locks_url_id']] > $content['last_surfed'])) { // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ADD - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',last='.$content['last_surfed']); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ADD - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',last='.$content['last_surfed']); // Add this id $IDs[$content['locks_url_id']] = $content['last_surfed']; @@ -1583,7 +1583,7 @@ ORDER BY } // END - if } else { // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ignore - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',last='.$content['last_surfed']); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ignore - lid='.$content['locks_id'].',url='.$content['locks_url_id'].',last='.$content['last_surfed']); // Ignore these old entries! array_push($ignored, $content['locks_url_id']); @@ -1623,7 +1623,7 @@ GROUP BY sbu.url_id ASC", __FUNCTION__, __LINE__); // Log last query - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'lastQuery='.getConfig('db_last_query').'|numRows='.SQL_NUMROWS($result).'|Affected='.SQL_AFFECTEDROWS()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'lastQuery='.getConfig('db_last_query').'|numRows='.SQL_NUMROWS($result).'|Affected='.SQL_AFFECTEDROWS()); // Fetch max rand $maxRand = SQL_NUMROWS($result); @@ -1705,7 +1705,7 @@ function getSurfbarArrayFromStatus ($status) { // Reload to configured stop page function redirectToSurfbarStopPage ($page = 'stop') { // Internal or external? - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'page=' . $page . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'page=' . $page . ' - ENTERED!'); if ((getConfig('surfbar_pause_mode') == 'INTERNAL') || (getConfig('surfbar_pause_url') == '')) { // Reload to internal page redirectToUrl('surfbar.php?frame=' . $page); @@ -1720,7 +1720,7 @@ function redirectToSurfbarStopPage ($page = 'stop') { * before you call other getters below this function! */ function determineSurfbarNextId ($urlId = NULL) { - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ' - ENTERED!'); // Default is no id and no random number $nextId = '0'; $randNum = '0'; @@ -1757,7 +1757,7 @@ function determineSurfbarNextId ($urlId = NULL) { } // END - if // And query the database - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'randNum='.$randNum.',maxRand='.$maxRand.',surfLock='.getSurfbarSurfLock()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'randNum='.$randNum.',maxRand='.$maxRand.',surfLock='.getSurfbarSurfLock()); $result = SQL_QUERY_ESC("SELECT sbu.url_id, sbu.url_userid, @@ -1824,12 +1824,12 @@ LIMIT 1", } // Is there an id number? - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'lastQuery='.getConfig('db_last_query').'|numRows='.SQL_NUMROWS($result).'|Affected='.SQL_AFFECTEDROWS()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'lastQuery='.getConfig('db_last_query').'|numRows='.SQL_NUMROWS($result).'|Affected='.SQL_AFFECTEDROWS()); if (SQL_NUMROWS($result) == 1) { // Load/cache data - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - BEFORE', FALSE); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - BEFORE', FALSE); $GLOBALS['surfbar_cache'] = merge_array($GLOBALS['surfbar_cache'], SQL_FETCHARRAY($result)); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - AFTER', FALSE); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'count('.count($GLOBALS['surfbar_cache']).') - AFTER', FALSE); // Determine waiting time $GLOBALS['surfbar_cache']['waiting'] = determineSurfbarWaitingTime(); @@ -1837,28 +1837,28 @@ LIMIT 1", // Is the last salt there? if (is_null($GLOBALS['surfbar_cache']['salts_last_salt'])) { // Then repair it wit the static! - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_salt - FIXED!', FALSE); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_salt - FIXED!', FALSE); $GLOBALS['surfbar_cache']['salts_last_salt'] = ''; } // END - if // Fix missing last_surfed if ((!isset($GLOBALS['surfbar_cache']['last_surfed'])) || (is_null($GLOBALS['surfbar_cache']['last_surfed']))) { // Fix it here - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_surfed - FIXED!', FALSE); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_surfed - FIXED!', FALSE); $GLOBALS['surfbar_cache']['last_surfed'] = '0'; } // END - if // Get base/fixed reward and costs $GLOBALS['surfbar_cache']['reward'] = determineSurfbarReward(); $GLOBALS['surfbar_cache']['costs'] = determineSurfbarCosts(); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'BASE/STATIC - reward='.getSurfbarReward().'|costs='.getSurfbarCosts()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'BASE/STATIC - reward='.getSurfbarReward().'|costs='.getSurfbarCosts()); // Only in dynamic model add the dynamic bonus! if (getSurfbarPaymentModel() == 'DYNAMIC') { // Calculate dynamic reward/costs and add it $GLOBALS['surfbar_cache']['reward'] += calculateSurfbarDynamicAddValue(); $GLOBALS['surfbar_cache']['costs'] += calculateSurfbarDynamicAddValue(); - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'DYNAMIC+ - reward='.getSurfbarReward().'|costs='.getSurfbarCosts()); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'DYNAMIC+ - reward='.getSurfbarReward().'|costs='.getSurfbarCosts()); } // END - if // Now get the id @@ -1869,7 +1869,7 @@ LIMIT 1", SQL_FREERESULT($result); // Return result - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',nextId=' . $nextId . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',nextId=' . $nextId . ' - EXIT!'); return $nextId; } @@ -2126,7 +2126,7 @@ function initSurfbar () { // Private getter for data elements function getSurfbarData ($element) { // Debug message - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ' - ENTERED!'); // Default is null $data = NULL; @@ -2138,7 +2138,7 @@ function getSurfbarData ($element) { } // END - if // Return result - /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element[' . $element . ']=[' . gettype($data) . ']' . $data . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element[' . $element . ']=[' . gettype($data) . ']' . $data . ' - EXIT!'); return $data; }