while (strpos($tmpl_file, "\'") !== false) { $tmpl_file = str_replace("\'", '{QUOT}', $tmpl_file); }
// Do we have to compile the code?
+ $ret = "";
if ((strpos($tmpl_file, "\$") !== false) || (strpos($tmpl_file, '{--') !== false) || (strpos($tmpl_file, '--}') > 0)) {
// Okay, compile it!
$tmpl_file = "\$ret=\"".COMPILE_CODE(addslashes($tmpl_file))."\";";
$ADD = " AND l.id IN (".implode(",", $USE).")";
} // END - if
+ // Get all userid
+ $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_surfbar_urls
+WHERE userid != %s AND status='CONFIRMED'
+GROUP BY userid
+ORDER BY userid ASC",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+
+ // Load all userid
+ $UIDs = array($GLOBALS['userid']);
+ while (list($uid) = SQL_FETCHROW($result)) {
+ // Get total points
+ $points = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points");
+ //* DEBUG: */ echo __FUNCTION__.":uid={$uid},points={$points}<br />\n";
+
+ // Shall we add this to ignore?
+ if ($points <= 0) {
+ // Ignore this one!
+ $UIDs[] = $uid;
+ } // END - if
+ } // END - while
+
+ // Free result
+ SQL_FREERESULT($result);
+
// And query the database
//* DEBUG: */ echo __FUNCTION__.":randNum={$randNum},maxRand={$maxRand},surfLock=".SURFBAR_GET_DATA('surf_lock')."<br />\n";
$result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.reward, sbu.costs, sbu.views_total, p.time, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed
ON sbu.id=sbs.url_id
LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l
ON sbu.id=l.url_id
-WHERE sbu.userid != %s AND sbu.status='CONFIRMED'".$ADD."
+WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND sbu.status='CONFIRMED'".$ADD."
GROUP BY sbu.id
ORDER BY l.last_surfed ASC, sbu.id ASC
LIMIT %s,1",
- array($GLOBALS['userid'], $randNum), __FILE__, __LINE__
+ array($randNum), __FILE__, __LINE__
);
/*
while($content = SQL_FETCHARRAY($result)) {
} // END - if
// Is there a check value?
- if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isset($_GET['frame'])) && ($_GET['frame'] == "stop"))) {
+ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isset($_GET['frame'])) && (($_GET['frame'] == "stop") || ($_GET['frame'] == "stop2")))) {
// Reload-lock is full, surfbar stopped so...
// Load header
require_once(PATH."inc/header.php");
'curr_reload' => SURFBAR_GET_USER_RELOAD_LOCK(),
'max_urls' => SURFBAR_GET_TOTAL_URLS(),
'reload' => SURFBAR_GET_RELOAD_TIME($nextId)
- );
+ );
// Update salt (double-call lock!)
SURFBAR_UPDATE_SALT();
- } // END - if
+ } else {
+ // Load new URL
+ LOAD_URL("surfbar.php?frame=stop2");
+ }
+ } elseif ((isset($_GET['frame'])) && ($_GET['frame'] == "start")) {
+ // Starter frame found so let the footer display
+ unset($_GET['frame']);
} else {
// Load header in frameset mode
$isFrameset = true;