]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
Obsolete templates removed, surfbar fixed (admin add, userid not used)
[mailer.git] / inc / libs / surfbar_functions.php
index 7df9fd5b8173bd60c9aac3a65b28af1aabd8f8b5..ec045622f3b728ba6420dfb4f509b69b79b7d2b7 100644 (file)
@@ -53,7 +53,7 @@ function SURFBAR_ADMIN_ADD_URL ($url) {
        } elseif (SURFBAR_LOOKUP_BY_URL($url, "0")) {
                // URL already found in surfbar!
                return false;
        } elseif (SURFBAR_LOOKUP_BY_URL($url, "0")) {
                // URL already found in surfbar!
                return false;
-       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS("0")) {
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
                // No more allowed!
                return false;
        }
                // No more allowed!
                return false;
        }
@@ -110,7 +110,7 @@ function SURFBAR_MEMBER_ADD_URL ($url) {
        } elseif (SURFBAR_LOOKUP_BY_URL($url, $GLOBALS['userid'])) {
                // URL already found in surfbar!
                return false;
        } elseif (SURFBAR_LOOKUP_BY_URL($url, $GLOBALS['userid'])) {
                // URL already found in surfbar!
                return false;
-       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
+       } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS($GLOBALS['userid'])) {
                // No more allowed!
                return false;
        }
                // No more allowed!
                return false;
        }
@@ -413,8 +413,8 @@ WHERE userid NOT IN (".implode(",", $UIDs).") AND status='%s'",
 function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
        global $_CONFIG;
 
 function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
        global $_CONFIG;
 
-       // Simply check it out
-       return (SURFBAR_GET_TOTAL_USER_URLS($uid) < $_CONFIG['surfbar_max_order']);
+       // Is this admin and userid is zero or does the user has some URLs left to book?
+       return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid) < $_CONFIG['surfbar_max_order']));
 }
 // Get total amount of URLs of given status for current user
 function SURFBAR_GET_TOTAL_USER_URLS ($uid=0) {
 }
 // Get total amount of URLs of given status for current user
 function SURFBAR_GET_TOTAL_USER_URLS ($uid=0) {