From: Roland Häder Date: Sat, 6 Sep 2008 18:55:04 +0000 (+0000) Subject: Final fixes for surfbar reload lock X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=c3828688315db44a5179c6a33ba24e455e7ecded Final fixes for surfbar reload lock --- diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 58def20ec5..1a451ebb23 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -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}
\n"; - return ($cnt == 0); + return ($cnt == 1); } // Determine next id for surfbar view, always call this before you call other // getters below this function!!! diff --git a/surfbar.php b/surfbar.php index f2c47234ea..d283eacf2d 100644 --- a/surfbar.php +++ b/surfbar.php @@ -64,13 +64,16 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install require_once(PATH."inc/header.php"); // Load template - if ((isset($_GET['frame'])) && ($_GET['frame'] == "start")) { + if (((isset($_GET['frame'])) && ($_GET['frame'] == "stop")) || (!isset($_GET['frame']))) { // Load template for "start" page LOAD_TEMPLATE("surfbar_frame_start"); // Load banner OUTPUT_HTML("
"); LOAD_TEMPLATE("surfbar_start_banner"); + + // This makes the footer appear again + unset($_GET['frame']); } else { // Prepare content $content = array( @@ -86,7 +89,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install SURFBAR_GET_NEXT_ID($_GET['id']); // Check reload lock and validation code - if ((SURFBAR_CHECK_RELOAD_LOCK($_GET['id'])) && (SURFBAR_CHECK_VALIDATION_CODE($_GET['id'], $_GET['check'], $_GET['salt']))) { + if ((!SURFBAR_CHECK_RELOAD_LOCK($_GET['id'])) && (SURFBAR_CHECK_VALIDATION_CODE($_GET['id'], $_GET['check'], $_GET['salt']))) { // Lock the URL (id) down SURFBAR_LOCKDOWN_ID($_GET['id']);