A lot texts rewritten and exclamation signs removed
[mailer.git] / inc / libs / surfbar_functions.php
index a46474ab9827c806401f298b20853445081086a6..1856892d13dfa5b760c19b3081b2a3ecaa05f9f2 100644 (file)
@@ -56,7 +56,7 @@ function SURFBAR_ADMIN_ADD_URL ($url, $limit, $reload) {
                // URL invalid
                logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Invalid URL.", $url, $limit, $reload));
                return false;
-       } elseif (SURFBAR_LOOKUP_BY_URL($url, '0')) {
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, 0)) {
                // URL already found in surfbar!
                logDebugMessage(__FUNCTION__, __LINE__, sprintf("Cannot add URL=%s,limit=%s,reload=%s : Already added.", $url, $limit, $reload));
                return false;
@@ -75,7 +75,7 @@ function SURFBAR_ADMIN_ADD_URL ($url, $limit, $reload) {
        }
 
        // Register the new URL
-       return SURFBAR_REGISTER_URL($url, '0', 'ACTIVE', 'unlock', array('limit' => $limit, 'reload' => $reload));
+       return SURFBAR_REGISTER_URL($url, 0, 'ACTIVE', 'unlock', array('limit' => $limit, 'reload' => $reload));
 }
 
 // Admin unlocked an email so we can migrate the URL
@@ -103,7 +103,7 @@ function SURFBAR_ADMIN_MIGRATE_URL ($url, $userid) {
 function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) {
        // Is this an admin or invalid array?
        if (!isAdmin()) {
-               // Not admin or invalid IDs array
+               // Not admin or invalid ids array
                return false;
        } elseif (!is_array($IDs)) {
                // No array
@@ -130,7 +130,7 @@ function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) {
 function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) {
        // Is this an admin or invalid array?
        if (!isAdmin()) {
-               // Not admin or invalid IDs array
+               // Not admin or invalid ids array
                return false;
        } elseif (!is_array($IDs)) {
                // No array
@@ -227,7 +227,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) {
                // Important form elements are missing!
                return false;
        } elseif (!isset($URLs[$formData['id']])) {
-               // ID not found in cache
+               // id not found in cache
                return false;
        } elseif (!SURFBAR_VALIDATE_MEMBER_ACTION_STATUS($formData['action'], $URLs[$formData['id']]['status'])) {
                // Action not allowed for current URL status
@@ -363,11 +363,11 @@ function SURFBAR_MEMBER_RESUBMIT_ACTION ($urlData) {
 // Display selected "action form"
 function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        // Translate some data
-       $urlData['registered']    = generateDateTime($urlData['registered'], '2');
+       $urlData['registered']    = generateDateTime($urlData['registered'], 2);
        $urlData['views_total']   = translateComma($urlData['views_total']);
        $urlData['views_max']     = translateComma($urlData['views_max']);
        $urlData['views_allowed'] = translateComma($urlData['views_allowed']);
-       $urlData['last_locked']   = generateDateTime($urlData['last_locked'], '2');
+       $urlData['last_locked']   = generateDateTime($urlData['last_locked'], 2);
 
        // Is the lock reason empty?
        if (empty($urlData['lock_reason'])) {
@@ -477,7 +477,7 @@ function SURFBAR_HANDLE_SELF_MAINTENANCE () {
 // Handle URLs which limit has depleted
 function SURFBAR_HANDLE_DEPLETED_VIEWS () {
        // Get all URLs
-       $urlArray = SURFBAR_GET_URL_DATA('0', 'views_max', 'id', 'ASC', 'id', " AND views_allowed>0 AND `status`='ACTIVE'");
+       $urlArray = SURFBAR_GET_URL_DATA(0, 'views_max', 'id', 'ASC', 'id', " AND views_allowed>0 AND `status`='ACTIVE'");
 
        // Do we have some entries?
        if (count($urlArray) > 0) {
@@ -611,7 +611,7 @@ function SURFBAR_REGISTER_URL ($url, $userid, $status = 'PENDING', $addMode = 'r
        // Insert the URL into database
        $content['insert_id'] = SURFBAR_INSERT_URL_BY_ARRAY($content);
 
-       // Is this ID valid?
+       // Is this id valid?
        if ($content['insert_id'] == 0) {
                // INSERT did not insert any data!
                return false;
@@ -675,8 +675,8 @@ function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
 
        // Translate some data if present
        if (isset($content['status']))        $content['status']        = translateSurfbarUrlStatus($content['status']);
-       if (isset($content['registered']))    $content['registered']    = generateDateTime($content['registered'], '2');
-       if (isset($content['last_locked']))   $content['last_locked']   = generateDateTime($content['last_locked'], '2');
+       if (isset($content['registered']))    $content['registered']    = generateDateTime($content['registered'], 2);
+       if (isset($content['last_locked']))   $content['last_locked']   = generateDateTime($content['last_locked'], 2);
        if (isset($content['views_total']))   $content['views_total']   = translateComma($content['views_total']);
        if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
        if (isset($content['views_max']))     $content['views_max']     = translateComma($content['views_max']);
@@ -708,8 +708,8 @@ function SURFBAR_NOTIFY_USER ($messageType, $content) {
 
        // Translate some data if present
        if (isset($content['status']))        $content['status']        = translateSurfbarUrlStatus($content['status']);
-       if (isset($content['registered']))    $content['registered']    = generateDateTime($content['registered'], '2');
-       if (isset($content['last_locked']))   $content['last_locked']   = generateDateTime($content['last_locked'], '2');
+       if (isset($content['registered']))    $content['registered']    = generateDateTime($content['registered'], 2);
+       if (isset($content['last_locked']))   $content['last_locked']   = generateDateTime($content['last_locked'], 2);
        if (isset($content['views_total']))   $content['views_total']   = translateComma($content['views_total']);
        if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
        if (isset($content['views_max']))     $content['views_max']     = translateComma($content['views_max']);
@@ -908,13 +908,13 @@ WHERE `userid` NOT IN (".implode(', ', $UIDs['userid']).") AND `status`='%s'",
 }
 
 // Check wether the user is allowed to book more URLs
-function SURFBAR_IF_USER_BOOK_MORE_URLS ($userid=0) {
+function SURFBAR_IF_USER_BOOK_MORE_URLS ($userid = 0) {
        // Is this admin and userid is zero or does the user has some URLs left to book?
        return ((($userid == 0) && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array("REJECTED")) < getConfig('surfbar_max_order')));
 }
 
 // Get total amount of URLs of given status for current user
-function SURFBAR_GET_TOTAL_USER_URLS ($userid=0, $status = '',$exclude = '') {
+function SURFBAR_GET_TOTAL_USER_URLS ($userid = 0, $status = '',$exclude = '') {
        // Is the user 0 and user is logged in?
        if (($userid == 0) && (isMember())) {
                // Then use this userid
@@ -1321,7 +1321,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        $addon += abs(log($onlineUsers / $totalUsers + 1) * $percent * $totalUsers);
 
        // Get total URLs
-       $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', '0');
+       $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', 0);
 
        // Get user's total URLs
        $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, 'ACTIVE');
@@ -1355,7 +1355,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
        $addon += abs($max * $percent * $totalUsers);
 
        // Get total URLs
-       $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', '0');
+       $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', 0);
 
        // Calculate addon
        $addon += abs($max * $percent * $totalUrls);
@@ -1411,7 +1411,7 @@ ORDER BY
                                // Debug message
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ADD - lid='.$content['id'].',url='.$content['url_id'].',last='.$content['last_surfed'].'', false);
 
-                               // Add this ID
+                               // Add this id
                                $IDs[$content['url_id']] = $content['last_surfed'];
                                $USE[$content['url_id']] = $content['id'];
                        } // END - if
@@ -1530,7 +1530,7 @@ function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {
        $nextId = 0;
        $randNum = 0;
 
-       // Is the ID set?
+       // Is the id set?
        if ($urlId == 0) {
                // Get array with lock ids
                $USE = SURFBAR_GET_LOCK_IDS();