Reset Messages, Likes, Trophy Points

Статус
В этой теме нельзя размещать новые ответы.

HDTechVideo

Проверенные
Сообщения
46
Реакции
59
Баллы
8,115
Is there any way to reset the manually changed message count, likes and Trophy points according to his/her original message count and likes.
 
Proper Answer

In PHPMyAdmin
Run
Код:
UPDATE xf_user AS user
SET message_count = (
    SELECT COUNT(*)
    FROM xf_post AS post
    LEFT JOIN xf_thread AS thread ON (thread.thread_id = post.thread_id)
    WHERE post.user_id = user.user_id
    AND post.message_state = 'visible' AND thread.discussion_state = 'visible'
    GROUP BY post.user_id
);

Then Run the attached php file
http://xenforo.info/threads/reset-messages-likes-trophy-points.575/#post-1501
(Upload the file into your xenforo root and then run)

Finally Run the following query in PHPMyAdmin
Код:
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
);
Then Admin CP -> Tools -> Cron Entries -> Update User Trophies -> Controls: Run

Yes :tongue:
 
  • Мне нравится
Реакции: Hope
Статус
В этой теме нельзя размещать новые ответы.
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу