1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Messages count after import...

Discussion in 'Installation, Upgrade, and Import Support' started by nando99, Jan 8, 2013.

  1. nando99

    nando99 Member

    We decided to just keep the members and not import the forums/content. I know I know, SEO etc... But that's what they wanted to do. Import from VB4 went fine, I've been setting up the forum and I just realized our message counts are all messed up. I guess it's using our post count from VB... How would I get it to show the correct actual number of messages we have? I tried rebuilding the user cache and forum cache and that didn't work :(

    Any help is appreciated.
     
  2. Slavik

    Slavik XenForo Moderator Staff Member

    This query should help:

    Code:
    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
    );
    
     
    Jake Bunce and nando99 like this.
  3. nando99

    nando99 Member

    AWESOME! thanks
     
  4. nando99

    nando99 Member

    1 more thing, trophies will need to be updated the same way... can you confirm the query syntax.... thanks in advance!
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    nando99 likes this.
  6. nando99

    nando99 Member

Share This Page