]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-beg2.php
Extension ext-coupon continued, a lot improvements applied:
[mailer.git] / inc / modules / member / what-beg2.php
index 25b5bdce5577eb930160866f9f3bf756ceca9bb0..78285c2ca14ab22e2d9d034b7e14bff337216c6c 100644 (file)
@@ -54,9 +54,9 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) {
 $lastOnline = '%s';
 $ONLINE = '';
 
-if (isExtensionActive('autopurge')) {
+if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((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...
@@ -84,13 +84,8 @@ if (!SQL_HASZERONUMS($result)) {
        $count = 1;
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the template
-               // @TODO points->beg_points
-               $content = array(
-                       'cnt'         => $count,
-                       'userid'      => $content['userid'],
-                       'points'      => $content['beg_points'],
-                       'last_online' => generateDateTime($content['last_online'], 2),
-               );
+               $content['cnt']         = $count;
+               $content['last_online'] = generateDateTime($content['last_online'], 2);
 
                // Load row template
                $OUT .= loadTemplate('member_list_beg_row', true, $content);
@@ -99,7 +94,7 @@ if (!SQL_HASZERONUMS($result)) {
                $count++;
        } // END - while
 } else {
-       // No one is interested in our "active rallye" ! :-(
+       // No one is interested in our "begging rallye" ! :-(
        $OUT = loadTemplate('member_beg_404', true);
 }