]> git.mxchange.org Git - mailer.git/commitdiff
Final fixes for surfbar reload lock
authorRoland Häder <roland@mxchange.org>
Sat, 6 Sep 2008 18:55:04 +0000 (18:55 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 6 Sep 2008 18:55:04 +0000 (18:55 +0000)
inc/libs/surfbar_functions.php
surfbar.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!!!
index f2c47234eae731392fc33b08f36f6beb67442425..d283eacf2dc390db78a7b2ba8a509cf8e1d70e4f 100644 (file)
@@ -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("<br />");
                        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']);