@phalynx
the query should you change:
Code:
SELECT userid,
(_wr * " . (int) $vbulletin->options['vbsoccer_points']['wr'] . ") +
((_count - _wr - _rr - _rd) * " . (int) $vbulletin->options['vbsoccer_points']['rw'] . ") +
(_rd * " . (int) $vbulletin->options['vbsoccer_points']['rd'] . ") +
(_rr * " . (int) $vbulletin->options['vbsoccer_points']['rr'] . ") AS points
FROM (
SELECT userid, COUNT(*) AS _count,
SUM(score_key != bet_score_key) AS _wr,
SUM(bet_home=points_home AND bet_away=points_away) AS _rr,
SUM(CAST(bet_home - bet_away AS SIGNED)=(points_home - points_away)
AND NOT (bet_home = points_home AND bet_away = points_away)) AS _rd
FROM " . TABLE_PREFIX . "soccer_user_bet AS b
INNER JOIN " . TABLE_PREFIX . "soccer_match AS m ON(m.id=b.match_id)
WHERE userid=" . $user['userid'] . " AND score_key>0 AND match_is_finished=1
GROUP BY userid) AS userpoints
(der join auf die usertabelle ist nicht notwendig und das sortieren ebensowenig. ausserdem werden nur abgeschlossene spiele ber?cksichtigt. beachte, dass "u.userid" zu "userid" wird. am besten du kopierst das komplette query.)