$lastOnline = '';
// Shall I include only active members?
-if ((getConfig('birthday_active') == 'Y') && (isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
- $add = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+if ((getConfig('birthday_active') == 'Y') && (isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
+ $add = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Only confirmed members shall receive birthday mails...
} // END - if
// Recheck if logged in
- if (!isMember()) {
+ if ((!isMember()) || ((isAdmin()) && (!isDebugModeEnabled()))) {
return false;
} // END - if
// Add points to his account directly
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `turbo_bonus`=`turbo_bonus`+%s WHERE `userid`=%s LIMIT 1",
array(
- bigintval($userid),
- $points
+ $points,
+ bigintval($userid)
), __FUNCTION__, __LINE__);
// Rember this whole data for displaying ranking list
// Autopurge installed?
if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
addSql("SELECT
// Autopurge installed?
if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
addSql("SELECT
$content['wait_selection'] = createConfigurationTimeSelections('beg_notify_wait' , 'ms' );
// Init all Y/N selections
- foreach (array('rallye', 'active', 'mode', 'rallye_enable_notify', 'rallye_disable_notify', 'new_member_notify', 'include_own') as $entry) {
+ foreach (array('rallye', 'active', 'rallye_enable_notify', 'rallye_disable_notify', 'new_member_notify', 'include_own') as $entry) {
$content[$entry . '_y'] = '';
$content[$entry . '_n'] = '';
$content[$entry . '_' . strtolower(getConfig('beg_' . $entry))] = ' checked="checked"';
// Autopurge installed?
if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Check if at least one is in the active rallye
// Autopurge installed?
if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Check if at least one is in the active rallye
$result = SQL_QUERY("SELECT
- `userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS `points`, `last_online`
+ `userid`, `email`, `gender`, `surname`, `family`, " . $USE . " AS `points`, `last_online`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Let's check if there are some points left we can pay...
// Autopurge installed?
if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Let's check if there are some points left we can 'pay'...
// Let's check if there are some points left we can pay...
if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
// Okay, include last online timestamp
- $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// SQL string to check for accounts
// Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
// Okay, include last online timestamp
- $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
+ $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
} // END - if
// Add more bonus points here
}
// Reduce this users total received emails?
- if ($num === 0) $userids[$data['userid']] = $data['userid'];
+ if ($num === 0) {
+ $userids[$data['userid']] = $data['userid'];
+ } // END - if
} // END - while
if (count($userids) > 0) {
// @TODO Fix inconsistency between last_module and getWhat()
function updateLastActivity($userid) {
// Run the update query
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `last_module`='%s', `last_online`=UNIX_TIMESTAMP(), `REMOTE_ADDR`='%s' WHERE `userid`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
+SET
+ `last_module`='%s',
+ `last_online`=UNIX_TIMESTAMP(),
+ `REMOTE_ADDR`='%s'
+WHERE
+ `userid`=%s
+LIMIT 1",
array(
getWhat(),
detectRemoteAddr(),
// Status must be CONFIRMED
if (getUserData('status') == 'CONFIRMED') {
// Update last activity if not admin
- if (!isAdmin()) {
+ if ((!isAdmin()) || (isDebugModeEnabled())) {
// Is not admin, so update last activity
updateLastActivity($userId);
} // END - if