$result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, (0".$ADD.") AS points
FROM "._MYSQL_PREFIX."_user_data
".$whereStatement1."".$ADD."
-ORDER BY active_bonus DESC, userid LIMIT %s",
+ORDER BY points DESC, userid
+LIMIT %s",
array($whereStatement2), __FILE__, __LINE__);
// Some entries were found?
// Make sure zero points are not mailed
if ($content['points'] > 0) {
// Add points to user's account directly
- ADD_POINTS_REFSYSTEM($content['uid'], $content['points'], false, "0", false, "direct");
+ ADD_POINTS_REFSYSTEM("monthly_bonus", $content['uid'], $content['points'], false, "0", false, "direct");
// Translate gender/points
- $content['gender'] = TRANSLATE_GENDER($content['gender']);
+ $content['gender'] = TRANSLATE_GENDER($content['gender']);
$content['points'] = TRANSLATE_COMMA($content['points']);
// Load email template and email it away