]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
Email templates changed, surfbar extended (dummy) with member actions
[mailer.git] / inc / libs / surfbar_functions.php
index e235ce19cbab6d757e6c18abaa248044bef81720..f4c90eb5850008fc5b584a9330c710c943d63d7e 100644 (file)
@@ -430,10 +430,10 @@ function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
        global $_CONFIG;
 
        // Is this admin and userid is zero or does the user has some URLs left to book?
        global $_CONFIG;
 
        // 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']));
+       return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < $_CONFIG['surfbar_max_order']));
 }
 // Get total amount of URLs of given status for current user
 }
 // Get total amount of URLs of given status for current user
-function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="") {
+function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
        global $_CONFIG;
 
        // Is the user 0 and user is logged in?
        global $_CONFIG;
 
        // Is the user 0 and user is logged in?
@@ -449,9 +449,19 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="") {
        $ADD = "";
 
        // Is the status set?
        $ADD = "";
 
        // Is the status set?
-       if (!empty($status)) {
+       if (is_array($status)) {
+               // Only URLs with these status
+               $ADD = sprintf(" AND status IN('%s')", implode("','", $status));
+       } elseif (!empty($status)) {
+               // Only URLs with this status
                $ADD = sprintf(" AND status='%s'", $status);
                $ADD = sprintf(" AND status='%s'", $status);
-       } // END - if
+       } elseif (is_array($exclude)) {
+               // Exclude URLs with these status
+               $ADD = sprintf(" AND status NOT IN('%s')", implode("','", $exclude));
+       } elseif (!empty($exclude)) {
+               // Exclude URLs with this status
+               $ADD = sprintf(" AND status != '%s'", $exclude);
+       }
 
        // Get amount from database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
 
        // Get amount from database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
@@ -911,7 +921,7 @@ function SURFBAR_GET_USER_URLS () {
        // Begin the query
        $result = SQL_QUERY_ESC("SELECT u.id, u.url, u.views_total, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason
 FROM "._MYSQL_PREFIX."_surfbar_urls AS u
        // Begin the query
        $result = SQL_QUERY_ESC("SELECT u.id, u.url, u.views_total, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason
 FROM "._MYSQL_PREFIX."_surfbar_urls AS u
-WHERE u.userid=%s
+WHERE u.userid=%s AND u.status != 'DELETED'
 ORDER BY u.id ASC",
                array($GLOBALS['userid']), __FILE__, __LINE__);
 
 ORDER BY u.id ASC",
                array($GLOBALS['userid']), __FILE__, __LINE__);
 
@@ -930,6 +940,10 @@ ORDER BY u.id ASC",
        // Return the array
        return $URLs;
 }
        // Return the array
        return $URLs;
 }
+// Create list of actions depending on status for the user
+function SURFBAR_MEMBER_ACTIONS ($id, $status) {
+       /* DEBUG: */ die("id={$id},status={$status}");
+}
 // Determine next id for surfbar or get data for given id, always call this before you call other
 // getters below this function!!!
 function SURFBAR_DETERMINE_NEXT_ID ($id = 0) {
 // Determine next id for surfbar or get data for given id, always call this before you call other
 // getters below this function!!!
 function SURFBAR_DETERMINE_NEXT_ID ($id = 0) {