]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
Final fixes for surfbar reload lock
[mailer.git] / inc / libs / surfbar_functions.php
index 58def20ec59c91c1fab5e2658712cf578fa336c1..1a451ebb2355bca3edf152bae8dc4f90f818404b 100644 (file)
@@ -381,7 +381,8 @@ function SURFBAR_CHECK_RELOAD_LOCK ($id) {
        // Ask the database
        $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
 FROM "._MYSQL_PREFIX."_surfbar_locks
-WHERE userid=%s AND url_id=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") >= UNIX_TIMESTAMP(last_surfed)
+WHERE userid=%s AND url_id=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") < UNIX_TIMESTAMP(last_surfed)
+ORDER BY last_surfed ASC
 LIMIT 1",
                array($GLOBALS['userid'], bigintval($id)), __FILE__, __LINE__
        );
@@ -394,7 +395,7 @@ LIMIT 1",
 
        // Return check
        //* DEBUG: */ echo __FUNCTION__.":cnt={$cnt}<br />\n";
-       return ($cnt == 0);
+       return ($cnt == 1);
 }
 // Determine next id for surfbar view, always call this before you call other
 // getters below this function!!!