), __FUNCTION__, __LINE__);
// Is there at least one record?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Then load all!
while ($dataRow = SQL_FETCHARRAY($result)) {
// Shall we group these results?
// Prepare content
$content = merge_array($extraFields, array(
'url' => $url,
- 'frametester' => generateFrametesterUrl($url),
'url_userid' => $userid,
'url_status' => $status,
));
$templateName = sprintf("admin_surfbar_%s", $messageType);
// Prepare subject
- $subject = getMessage(sprintf("ADMIN_SURFBAR_NOTIFY_%s_SUBJECT",
+ $subject = sprintf("{--ADMIN_SURFBAR_NOTIFY_%s_SUBJECT--}",
strtoupper($messageType)
- ));
+ );
// Is the subject line there?
if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
$templateName = sprintf("member_surfbar_%s", $messageType);
// Prepare subject
- $subject = getMessage(sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT",
+ $subject = sprintf("{--MEMBER_SURFBAR_NOTIFY_%s_SUBJECT--}",
strtoupper($messageType)
- ));
+ );
// Is the subject line there?
if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
// Translate the URL status
function translateSurfbarUrlStatus ($status) {
- // Create constant name
- $constantName = sprintf("SURFBAR_URL_STATUS_%s", strtoupper($status));
-
- // Get message
- $statusTranslated = getMessage($constantName);
-
// Return result
- return $statusTranslated;
+ return sprintf("{--SURFBAR_URL_STATUS_%s--}", strtoupper($status));
}
// Determine reward
// Check if the "reload lock" of the current user is full, call this function
// before you call SURFBAR_CHECK_RELOAD_LOCK().
-function SURFBAR_CHECK_RELOAD_FULL() {
+function SURFBAR_CHECK_RELOAD_FULL () {
// Default is full!
$isFull = true;
// Free result
SQL_FREERESULT($result);
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $cnt);
+
// Return result
return $cnt;
}
function SURFBAR_PAY_POINTS () {
// Remove it from the URL owner
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.SURFBAR_GET_USERID().',costs='.SURFBAR_GET_COSTS().'', false);
- if (SURFBAR_GET_USERID() > 0) {
+ if (isValidUserId(SURFBAR_GET_USERID())) {
subtractPoints(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
} // END - if
// Update statistics record
SURFBAR_UPDATE_INSERT_STATS_RECORD();
+ // Update salt
+ SURFBAR_GENERATE_VALIDATION_CODE(SURFBAR_GET_ID());
+
// Simply store the salt from cache away in database...
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_salts` SET `salts_last_salt`='%s' WHERE `salts_url_id`=%s AND `salts_userid`=%s LIMIT 1",
array(
array(getMemberId()), __FUNCTION__, __LINE__);
// Are there entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all rows
while ($row = SQL_FETCHARRAY($result)) {
// Add the row
array($status), __FUNCTION__, __LINE__);
// Some entries there?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all actions
// @TODO This can be somehow rewritten
while ($content = SQL_FETCHARRAY($result)) {
return $nextId;
}
+// ----------------------------------------------------------------------------
+// Wrapper function
+// ----------------------------------------------------------------------------
+
+// "Getter" for surfbar_dynamic_percent
+function getSurfbarDynamicPercent () {
+ // Do we have cache?
+ if (!isset($GLOBALS['surfbar_dynamic_percent'])) {
+ // Determine it
+ $GLOBALS['surfbar_dynamic_percent'] = getConfig('surfbar_dynamic_percent');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['surfbar_dynamic_percent'];
+}
+
+// "Getter" for surfbar_static_reward
+function getSurfbarStaticReward () {
+ // Do we have cache?
+ if (!isset($GLOBALS['surfbar_static_reward'])) {
+ // Determine it
+ $GLOBALS['surfbar_static_reward'] = getConfig('surfbar_static_reward');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['surfbar_static_reward'];
+}
+
+// "Getter" for surfbar_static_time
+function getSurfbarStaticTime () {
+ // Do we have cache?
+ if (!isset($GLOBALS['surfbar_static_time'])) {
+ // Determine it
+ $GLOBALS['surfbar_static_time'] = getConfig('surfbar_static_time');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['surfbar_static_time'];
+}
+
+// "Getter" for surfbar_max_order
+function getSurfbarMaxOrder () {
+ // Do we have cache?
+ if (!isset($GLOBALS['surfbar_max_order'])) {
+ // Determine it
+ $GLOBALS['surfbar_max_order'] = getConfig('surfbar_max_order');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['surfbar_max_order'];
+}
+
// -----------------------------------------------------------------------------
// PLEASE DO NOT ADD ANY OTHER FUNCTIONS BELOW THIS LINE IF THEY DON'T "WRAP"
// THE $GLOBALS['surfbar_cache'] ARRAY!