Extension ext-coupon continued, a lot improvements applied:
[mailer.git] / inc / modules / member / what-bonus.php
index 2fc94b378ae610245231f27453fd96514b972215..0850e128535bb79f7623b3115785a139ca815e92 100644 (file)
@@ -65,11 +65,14 @@ 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'...