Suggestion for an addon


anon666

Member
My suggestion for an addon: recalculate the number of posts from users.


On xenforo.com I found this query:

SQL:
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 );

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
);


You have a analogous addon to recalculate the number of likes: https://www.xf2addons.com/resources/rebuild-likes.120/
 

Andy

Administrator
Staff member
It's always best to start off explaining the problem you would like to fix.
 

anon666

Member
I imported from a database backup a forum that I had accidentally deleted, with the XenForo Importers 1.0.1a tool, and I've used that import tool a couple more times, and since then the number of user messages is much higher than the real one.
 

anon666

Member
Perdona que te responda en español, porque el traductor online creo que no es muy fiel.

Por ejemplo, el numero real de mensajes del usario x es 500
Despues de la importación de los hilos borrados, en el perfil del usuario, dice que el total de sus mensajes son 1000, aproximadamente el doble

Tambien lo dice en la pestaña "Members" > "Notable members" > "Most messages"

el dato de numero total de mensajes de cada usuario es aproximadamente el doble al real.

Despues de aplicar la query que cito mas arriba en la base de datos, ya se aproxima más, pero sigue estando el dato inflado.
 
Similar threads
Thread starter Title Forum Replies Date
X Suggestion for an addon General 8
S Addon Suggestion: Add member X to member Y's ignore list General 4
S Suggestion for Auto Move (what I need) General 1
B Suggestion for First post email General 1
S Suggestion: More RM statistics General 3
Tourmeister Suggestion for "Thread poster review" General 1
M [suggestion] conversation search plus General 5
R Suggestion: Ability to Change default sort for XFRM General 6
X Suggestion new Add-on to Send Email General 0
X [suggestion] Ad manager 1.4 General 4
Robru [suggestion] add-ons for XF2.1 General 1
X Suggestion Add Template to threads General 0
N [Suggestion] Tag manager (in ACP) General 5
X new suggestion for a new add-on General 6
X suggestion for New content limit 1.2 General 4
Mellow Suggestion for RSVP General 9
A Suggestion Weekly digest General 3
Mellow Suggestion for Calendar General 2
N Suggestion for duplicate user add-on General 1
Dave Stromberger [Suggestion] Fix ALL CAPS posts General 3
BassMan [Calendar][suggestion] Today button General 2
kensonplays [Suggestion] Calendar/Countdown Sync General 10
BassMan [suggestion] Bookmark General 0
A [Suggestion] Featured posts add-on, maximum height General 5
S Add-on Suggestion: Alert admin if a link is added to an existing post by a new member General 1
BassMan [suggestion] Email Subscription General 1
S Suggestion: Time Limit On Editting Thread Titles General 5
BassMan [suggestion] Periodically sending confirmation emails General 16
M Suggestion for Forum Moderators Resource General 1
T Suggestion: Most users online General 3
E Suggestion: Trader: add trader profile to "Message user info elements" General 10
BassMan Weekly Digest [suggestion] General 21
BassMan Quick Search suggestion General 4
pilou suggestion add-ons : Sticky Thread Order General 2
P Add-on suggestion - Thread of the day General 5
T Change date suggestion General 5
Gator [Suggestion] Add "Featured Thread(s)" Widget General 0
L Sold addon General 8
C Add Prefix to Advanced Search Addon General 0
C Extending Resolved Addon General 1
T Is it possible to set minimum length of the title with Title control Addon General 5
S Any top weekly poster or contributores addon here ? General 1
E History addon bug General 2
andrea Prefix listing Addon General 2
mkucuksari Bump Limit Addon Error General 2
M Robots addon database prune General 3
E Hey thanks for thoes great addon can i suugest a addon idea ? General 1
1 simple referral addon General 1
B calendar addon no longer supports Resources? General 0
J Addon idea: Raise limit of forum title General 5

Similar threads

Top