// Some security stuff...
if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
}
while (strpos($OUTPUT, '{!') > 0) {
// Prepare the content and eval() it...
$newContent = "";
- $eval = "\$newContent = \"" . COMPILE_CODE(addslashes($OUTPUT)) . "\";";
+ $eval = "\$newContent = \"".COMPILE_CODE(addslashes($OUTPUT))."\";";
@eval($eval);
if (empty($newContent)) {
// Compile and run finished rendered HTML code
while (strpos($OUTPUT, '{!') > 0) {
- $eval = "\$OUTPUT = \"" . COMPILE_CODE(addslashes($OUTPUT)) . "\";";
+ $eval = "\$OUTPUT = \"".COMPILE_CODE(addslashes($OUTPUT))."\";";
eval($eval);
}
// Do we have to compile the code?
if ((strpos($tmpl_file, "\$") !== false) || (strpos($tmpl_file, '{--') !== false) || (strpos($tmpl_file, '--}') > 0)) {
// Okay, compile it!
- $tmpl_file = "\$ret=\"" . COMPILE_CODE(addslashes($tmpl_file)) . "\";";
+ $tmpl_file = "\$ret=\"".COMPILE_CODE(addslashes($tmpl_file))."\";";
eval($tmpl_file);
} else {
// Simply return loaded code
// Send mail out to an email address
function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="") {
// Compile subject line (for POINTS constant etc.)
- $eval = "\$SUBJECT = \"" . COMPILE_CODE(addslashes($SUBJECT)) . "\";";
+ $eval = "\$SUBJECT = \"".COMPILE_CODE(addslashes($SUBJECT))."\";";
eval($eval);
$SUBJECT = html_entity_decode($SUBJECT);
}
// Finish navigation link
- $eval = substr($eval, 0, -7) . "]\";";
+ $eval = substr($eval, 0, -7)."]\";";
eval($eval);
// Return string
}
// Return hash
- return $salt . sha1($salt . $plainText);
+ return $salt.sha1($salt.$plainText);
}
//
function scrambleString($str) {
array($GLOBALS['userid'], bigintval($id)), __FILE__, __LINE__);
// Remove the salt from database
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_surfbar_salts WHERE url_id=%s AND userid=%s LIMIT 1",
- array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__);
+ //SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_surfbar_salts WHERE url_id=%s AND userid=%s LIMIT 1",
+ // array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__);
}
// Pay points to the user and remove it from the sender
function SURFBAR_PAY_POINTS ($id) {
SQL_FREERESULT($result);
// Return check
- //* DEBUG: */ echo __FUNCTION__.":cnt={$cnt}<br />\n";
+ //* DEBUG: */ echo __FUNCTION__.":cnt={$cnt},".SURFBAR_GET_DATA('surf_lock')."<br />\n";
return ($cnt == 1);
}
// Determine next id for surfbar view, always call this before you call other
ON sbu.id=sbs.url_id
LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l
ON sbu.id=l.url_id
-WHERE sbu.userid != %d AND sbu.status='CONFIRMED' AND (l.last_surfed IS NULL OR (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") >= UNIX_TIMESTAMP(l.last_surfed))
-ORDER BY l.last_surfed DESC, sbs.last_salt ASC, sbu.id ASC
-LIMIT %d,1",
+WHERE sbu.userid != %s AND sbu.status='CONFIRMED' AND (l.last_surfed IS NULL OR (UNIX_TIMESTAMP() - ".SURFBAR_GET_DATA('surf_lock').") >= UNIX_TIMESTAMP(l.last_surfed))
+ORDER BY l.last_surfed ASC, sbu.id ASC
+LIMIT %s,1",
array($GLOBALS['userid'], $randNum), __FILE__, __LINE__
);
} else {
// Get data from specified id number
- $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.reward, sbu.costs, sbu.views_total, p.time
+ $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
FROM "._MYSQL_PREFIX."_surfbar_urls AS sbu
LEFT JOIN "._MYSQL_PREFIX."_payments AS p
ON sbu.payment_id=p.id
LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs
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' AND sbu.id=%s
LIMIT 1",
array($GLOBALS['userid'], bigintval($id)), __FILE__, __LINE__
// Is the time there?
if (is_null($SURFBAR_CACHE['time'])) {
// Then repair it wit the static!
+ //* DEBUG: */ echo __FUNCTION__.": time - STATIC!<br />\n";
$SURFBAR_CACHE['time'] = $_CONFIG['surfbar_static_time'];
} // END - if
// Is the last salt there?
if (is_null($SURFBAR_CACHE['last_salt'])) {
// Then repair it wit the static!
+ //* DEBUG: */ echo __FUNCTION__.": last_salt - FIXED!<br />\n";
$SURFBAR_CACHE['last_salt'] = "";
} // END - if
// Fix missing last_surfed
if ((!isset($SURFBAR_CACHE['last_surfed'])) || (is_null($SURFBAR_CACHE['last_surfed']))) {
// Fix it here
+ //* DEBUG: */ echo __FUNCTION__.": last_surfed - FIXED!<br />\n";
$SURFBAR_CACHE['last_surfed'] = "0";
} // END - if