X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-bonus.php;h=afd5af2f32b7f0fc169bcb3c35f46b862fd8cc79;hb=2fbe5fb8357e81e5542c6d067dc1edf9a7d7f8f5;hp=a480b8afd2184a8c56f6bad1c4ad3709c912a041;hpb=c3b4eaf29946349ff058691db2dcb615a5379bb2;p=mailer.git diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index a480b8afd2..afd5af2f32 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { addYouAreHereLink('member', __FILE__); if ((!isExtensionActive('bonus')) && (!isAdmin())) { - loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('bonus')); + displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=bonus%}'); return; } // END - if @@ -65,16 +65,19 @@ if (isExtensionInstalledAndNewer('bonus', '0.6.9')) { $USE = '`turbo_bonus`'; } +// Init variables +$lastOnline = '%s'; +$ONLINE = ''; + // Autopurge installed? -$lastOnline = '%s'; $ONLINE = ''; -if (isExtensionActive('autopurge')) { +if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) { // Use last online timestamp to keep inactive members away from here - $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?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'... $result = SQL_QUERY_ESC("SELECT - `userid`, ".$USE." AS points, `last_online` + `userid`, ".$USE." AS `points`, `last_online` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE @@ -97,8 +100,8 @@ if (!SQL_HASZERONUMS($result)) { $count = 1; while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the template - $content['cnt'] = $count; - $content['last_online'] = generateDateTime($content['last_online'], 2); + $content['count'] = $count; + $content['last_online'] = generateDateTime($content['last_online'], '2'); // Load row template $OUT .= loadTemplate('member_bonus_row', true, $content);