Compilation time added, some compileCode() calles removed, ADMIN_WHAT_404 added
[mailer.git] / inc / libs / surfbar_functions.php
index 120cb25103d7fe9b9596cfedf4de117ce0547deb..1fc4d35ca50341717937e26ca9ba81e1f2315205 100644 (file)
@@ -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
@@ -438,20 +438,16 @@ function SURFBAR_MEMBER_EXECUTE_EDIT_ACTION ($urlData) {
        // Default is nothing done
        $status = false;
 
-       // Translate URLs for testing
-       $url1 = compileCode($urlData['url']);
-       $url2 = compileCode($urlData['edit']['url']);
-
        // Has the URL or limit changed?
        if (true) {
                //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
                // Run the query
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE `id`=%s AND `status`='%s' LIMIT 1",
-               array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
+                       array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
 
                // All fine
                $status = true;
-       }
+       } // END - if
 
        // Return status
        return $status;
@@ -611,7 +607,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;
@@ -908,13 +904,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
@@ -1411,7 +1407,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 +1526,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();