]> 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 996c31ae3622b5b923854c42e70bb81abbe2c141..78285c2ca14ab22e2d9d034b7e14bff337216c6c 100644 (file)
@@ -54,14 +54,14 @@ 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...
 $result = SQL_QUERY_ESC("SELECT
-       `userid`, `beg_points` AS points, `last_online`
+       `userid`, `beg_points`, `last_online`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
@@ -84,12 +84,8 @@ if (!SQL_HASZERONUMS($result)) {
        $count = 1;
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the template
-               $content = array(
-                       'cnt'         => $count,
-                       'userid'      => $content['userid'],
-                       'points'      => $content['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);
@@ -98,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);
 }