TRUNCATE TABLE xf_user_trophy;
UPDATE xf_user AS u
SET u.trophy_points = (
SELECT SUM(t.trophy_points)
FROM xf_user_trophy AS ut
LEFT JOIN xf_trophy AS t ON (t.trophy_id = ut.trophy_id)
WHERE ut.user_id = u.user_id
);
Run these two queries:
Trophies are awarded by this cron, so you may wish to manually run the task after running these queries:
Admin CP -> Tools -> Cron Entries -> Update User Trophies -> Controls: Run
And note that the trophy cron only updates users who have been active in the last 24 hours, so there may be a delay for some users despite manually running the cron.
This is an important point - my suggestion is to add it to the manual. I've been going nuts trying to figure out why some users are not being renamed with the default ladder (awarded points)......I've run the cron and waited a day and still no go.....duh, they won't get updated until later....after they login.
It would be nice to have buttons in XF which allowed those of us with lots of extra RAM and processing power to "award points to ALL users" or something similar.....instead of waiting for them to login and then the cron job after that.
$conditions = array(
'user_state' => 'valid',
'is_banned' => 0,
// 'last_activity' => array('>', XenForo_Application::$time - 86400)
);
How did you sorted it?forget that, sorted it
TRUNCATE TABLE xf_user_trophy;
UPDATE xf_user AS u
SET u.trophy_points = (
SELECT SUM(t.trophy_points)
FROM xf_user_trophy AS ut
LEFT JOIN xf_trophy AS t ON (t.trophy_id = ut.trophy_id)
WHERE ut.user_id = u.user_id
);
Any other way? some thing through ssh maybe?Run it via PhpMyAdmin.
mysql -uDBUSER -pDBPASS DBNAME
TRUNCATE TABLE xf_user_trophy;
UPDATE xf_user AS u
SET u.trophy_points = (
SELECT SUM(t.trophy_points)
FROM xf_user_trophy AS ut
LEFT JOIN xf_trophy AS t ON (t.trophy_id = ut.trophy_id)
WHERE ut.user_id = u.user_id
);
Don't run the cron task. Use the "Rebuild Trophies" option in Rebuild Caches (1.2.1 only). It will do what you want.
We use essential cookies to make this site work, and optional cookies to enhance your experience.