foreach ($actionArray as $actionId => $action) {
// Add form for this action
$OUT .= sprintf(LOAD_TEMPLATE('member_surfbar_list_form', true),
- $width,
- bigintval($urlId),
- strtolower($action),
- strtoupper($action),
- strtoupper($action)
+ $width,
+ bigintval($urlId),
+ strtolower($action),
+ strtoupper($action),
+ strtoupper($action)
);
} // END - foreach
function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) {
// Search for the requested action/status combination in database
$result = SQL_QUERY_ESC("SELECT new_status FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE `action`='%s' AND `status`='%s' LIMIT 1",
- array($action, $status), __FUNCTION__, __LINE__);
+ array($action, $status), __FUNCTION__, __LINE__);
// Is the entry there?
$isValid = (SQL_NUMROWS($result) == 1);
function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) {
// Create the data array for next function call
$data = array(
- $urlData['id'] => $urlData
+ $urlData['id'] => $urlData
);
// Simply change the status here
function SURFBAR_MEMBER_BOOKNOW_ACTION ($urlData) {
// Create the data array for next function call
$data = array(
- $urlData['id'] => $urlData
+ $urlData['id'] => $urlData
);
// Simply change the status here
// Has the URL or limit changed?
if (true) {
- //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
+ //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
// Run the query
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE `id`=%s AND `status`='%s' LIMIT 1",
- array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
+ array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
// All fine
$status = true;
// Update last notified
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET surfbar_low_notified=NOW() WHERE userid=%s LIMIT 1",
- array($uid), __FUNCTION__, __LINE__);
+ array($uid), __FUNCTION__, __LINE__);
} // END - if
} // END - foreach
}
WHERE %s='%s'".$add."
ORDER BY %s %s
%s",
- array($column, $searchTerm, $order, $sort, $limit), __FUNCTION__, __LINE__);
+ array($column, $searchTerm, $order, $sort, $limit), __FUNCTION__, __LINE__);
// Is there at least one record?
if (SQL_NUMROWS($result) > 0) {
// Just run the insert query for now
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_urls` (userid,url,status,views_max,views_allowed,fixed_reload) VALUES (%s,'%s','%s',%s,%s,%s)",
- array(
- $uid,
- $urlData['url'],
- $urlData['status'],
- $urlData['limit'],
- $urlData['limit'],
- $urlData['reload']
- ), __FUNCTION__, __LINE__
+ array(
+ $uid,
+ $urlData['url'],
+ $urlData['status'],
+ $urlData['limit'],
+ $urlData['limit'],
+ $urlData['reload']
+ ), __FUNCTION__, __LINE__
);
// Return insert id
// Prepare subject
$subject = getMessage(sprintf("ADMIN_SURFBAR_NOTIFY_%s_SUBJECT",
- strtoupper($messageType)
+ strtoupper($messageType)
));
// Is the subject line there?
// Prepare subject
$subject = getMessage(sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT",
- strtoupper($messageType)
+ strtoupper($messageType)
));
// Is the subject line there?
if (REQUEST_ISSET_GET(('frame'))) {
// Use the frame as a template name part... ;-)
$templateName = sprintf("surfbar_frame_%s",
- REQUEST_GET(('frame'))
+ REQUEST_GET(('frame'))
);
} // END - if
ON u.id=l.url_id
WHERE l.userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND (((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR u.fixed_reload = 0)
LIMIT 1",
- array(getUserId()), __FUNCTION__, __LINE__
+ array(getUserId()), __FUNCTION__, __LINE__
);
// Fetch row
$result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
WHERE userid NOT IN (".implode(',', $UIDs['uid']).") AND `status`='%s'",
- array($status), __FUNCTION__, __LINE__
+ array($status), __FUNCTION__, __LINE__
);
// Fetch row
FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
WHERE userid=%s".$add."
LIMIT %s",
- array($uid, getConfig('surfbar_max_order')), __FUNCTION__, __LINE__
+ array($uid, getConfig('surfbar_max_order')), __FUNCTION__, __LINE__
);
// Fetch row
///* DEBUG: */ return;
// Just add it to the database
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_locks` (userid, url_id) VALUES (%s, %s)",
- array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__);
+ array(getUserId(), bigintval($urlId)), __FUNCTION__, __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($urlId), getUserId()), __FUNCTION__, __LINE__);
+ array(bigintval($urlId), getUserId()), __FUNCTION__, __LINE__);
}
// Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf"
// Update URL stats
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET views_total=views_total+1".$add." WHERE `id`=%s LIMIT 1",
- array(SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
+ array(SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
// Update the stats entry
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_stats` SET count=count+1 WHERE userid=%s AND url_id=%s LIMIT 1",
- array(getUserId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
+ array(getUserId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
// Was that update okay?
if (SQL_AFFECTEDROWS() < 1) {
// No, then insert entry
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_stats` (userid,url_id,count) VALUES (%s,%s,1)",
- array(getUserId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
+ array(getUserId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
} // END - if
// Update total/daily/weekly/monthly counter
// Simply store the salt from cache away in database...
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_salts` SET last_salt='%s' WHERE url_id=%s AND `userid`=%s LIMIT 1",
- array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), getUserId()), __FUNCTION__, __LINE__);
+ array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), getUserId()), __FUNCTION__, __LINE__);
// Debug message
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "salt=".SURFBAR_GET_SALT().",id=".SURFBAR_GET_ID().",uid=".getUserId()."", false);
if (SQL_AFFECTEDROWS() < 1) {
// Insert missing entry!
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_salts` (url_id,userid,last_salt) VALUES (%s, %s, '%s')",
- array(SURFBAR_GET_ID(), getUserId(), SURFBAR_GET_SALT()), __FUNCTION__, __LINE__);
+ array(SURFBAR_GET_ID(), getUserId(), SURFBAR_GET_SALT()), __FUNCTION__, __LINE__);
} // END - if
// Debug message
WHERE userid=%s AND url_id=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(last_surfed)
ORDER BY last_surfed ASC
LIMIT 1",
- array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__
+ array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__
);
// Fetch counter
WHERE u.userid NOT IN (%s,0) AND u.`status`='ACTIVE'
GROUP BY u.userid
ORDER BY u.userid ASC",
- array(getUserId()), __FUNCTION__, __LINE__);
+ array(getUserId()), __FUNCTION__, __LINE__);
} else {
// Get all userid
$result = SQL_QUERY("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
FROM `{!_MYSQL_PREFIX!}_surfbar_stats`
WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) <= %s
GROUP BY userid",
- array(getConfig('online_timeout')), __FUNCTION__, __LINE__);
+ array(getConfig('online_timeout')), __FUNCTION__, __LINE__);
// Fetch count
$cnt = SQL_NUMROWS($result);
return $cnt;
}
-// Determine waiting time for one URL
+// Determine waiting time for one URL
function SURFBAR_DETERMINE_WAIT_TIME () {
// Get fixed reload lock
$fixed = SURFBAR_GET_FIXED_RELOAD();
userid=%s
ORDER BY
id ASC", array(getUserId()),
- __FUNCTION__, __LINE__);
+ __FUNCTION__, __LINE__);
// Load all entries
while ($content = SQL_FETCHARRAY($result)) {
FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u
WHERE u.userid=%s AND u.status != 'DELETED'
ORDER BY u.id ASC",
- array(getUserId()), __FUNCTION__, __LINE__);
+ array(getUserId()), __FUNCTION__, __LINE__);
// Are there entries?
if (SQL_NUMROWS($result) > 0) {
// Get all assigned actions
$result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE `status`='%s' ORDER BY `id` ASC",
- array($status), __FUNCTION__, __LINE__);
+ array($status), __FUNCTION__, __LINE__);
// Some entries there?
if (SQL_NUMROWS($result) > 0) {
GROUP BY sbu.id
ORDER BY l.last_surfed ASC, sbu.id ASC
LIMIT %s,1",
- array($randNum), __FUNCTION__, __LINE__
+ array($randNum), __FUNCTION__, __LINE__
);
} else {
// Get data from specified id number
ON sbu.id=l.url_id
WHERE sbu.userid != %s AND sbu.`status`='ACTIVE' AND sbu.id=%s AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))
LIMIT 1",
- array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__
+ array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__
);
}