Getting total/own points rewritten to filter:
[mailer.git] / inc / modules / admin / what-list_user.php
index c7a54704936c9baba8e6c7404b894f6434cec969..2d6592c839600bcef9fb2f6624cbe27d51cf22a0 100644 (file)
@@ -140,14 +140,25 @@ LIMIT 1",
                $content['last_update']       = generateDateTime($content['last_update'], 0);
                $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], 0);
                $content['total_points']      = getTotalPoints($content['userid']);
-               $content['locked_points']     = countSumTotalData($userid, 'user_points', 'locked_points') + countSumTotalData($userid, 'user_points', 'locked_order_points');
-               $content['own_points']        = countSumTotalData($userid, 'user_points', 'points') + countSumTotalData($userid, 'user_points', 'order_points');
+               $content['locked_points']     = countSumTotalData($content['userid'], 'user_points', 'locked_points') + countSumTotalData($content['userid'], 'user_points', 'locked_order_points');
+
+               // Prepare array for filter
+               $data = array(
+                       'userid' => $content['userid'],
+                       'points' => 0
+               );
+
+               // Run the filter chain
+               $data = runFilterChain('get_own_points', $data);
+
+               // Add more data
+               $content['own_points']        = $data['points'];
                $content['lock_timestamp']    = generateDateTime($content['lock_timestamp'], 2);
                $content['nickname']          = '{--EXT_NICKNAME_404--}';
 
                // Link to email_details if some are sent
                if ($content['emails_sent'] > 0) {
-                       $content['emails_sent'] = $base . '&amp;what=email_details&amp;userid=' . $userid . '%}">}{%pipe,translateComma=' . $content['emails_sent'] . '%}</a>]';
+                       $content['emails_sent'] = $base . '&amp;what=email_details&amp;userid=' . $content['userid'] . '%}">}{%pipe,translateComma=' . $content['emails_sent'] . '%}</a>]';
                } // END - if
 
                // Nickname inclusion?