Refback and referal points hopefully fixed:
[mailer.git] / inc / libs / surfbar_functions.php
index 9072b7439a78115016f526edd7548d2fc5d677aa..9a8edbbb8d2bb5726215a8c4302bcdc7bf9f594b 100644 (file)
@@ -653,7 +653,9 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
        $userid = bigintval($urlData['url_userid']);
 
        // Is the id set?
-       if (empty($userid)) $userid = '0';
+       if (empty($userid)) {
+               $userid = NULL;
+       } // END - if
 
        // Just run the insert query for now
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_urls` (`url_userid`, `url`, `url_status`, `url_views_max`, `url_views_allowed`, `url_fixed_reload`) VALUES (%s,'%s','%s',%s,%s,%s)",
@@ -974,13 +976,13 @@ LIMIT 1",
 }
 
 // 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 = NULL) {
        // 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')) < getSurfbarMaxOrder()));
 }
 
 // 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 = NULL, $status = '', $exclude = '') {
        // Is the user 0 and user is logged in?
        if (($userid == '0') && (isMember())) {
                // Then use this userid