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

XF 1.3 User showing as "guest"

Discussion in 'Troubleshooting and Problems' started by nodle, Jun 11, 2014.

  1. nodle

    nodle Well-Known Member

    I have a user that shows as a "guest" he is not associated with any group. He was leftover from a import from IPB way back in the day. He later joined under a different name. All his post show but there is no account associated with him such as a user, banned, etc. He is just a "guest". Is there any way to associate this with an account so I can have control to say merge it with his other account etc.? Or has anyone else run into this problem and were able to resolve it? Thanks for the help. :)
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    There won't be any data in any of the tables so it won't be possible to merge with another account.
    There may be an add-on available which can do it, but I'm not aware of one.

    The other option is to look for add-ons which allow threads and posts to be reassigned.
     
  3. Martok

    Martok Well-Known Member

  4. nodle

    nodle Well-Known Member

    This looks promising @Jake Bunce would this still work on 1.3? I know he is the only guest so I would be safe there. Thanks for this @Martok ! @Donnie La Curan did you try this on your site and did it work?
     
  5. nodle

    nodle Well-Known Member

  6. Martok

    Martok Well-Known Member

    I've used this to re-create an account that I deleted and then changed my account deletion policy (in my case I created a new account and then ran Jake's queries). I didn't follow the rebuild post count query resource, I simply changed the post count in the users details in the ACP after checking how many posts there were being transferred from 'guest' to the new user and adding that on. I'd check with Jake if it's OK to do this for your user though with him still being 'live' whereas my user is long gone and unlikely to return.
     
  7. nodle

    nodle Well-Known Member

    Thanks for the help sir. I don't really care about his post count and I know he doesn't either. I mostly just wanted to clean up the forum so that I wouldn't have this user with no avatar and just some control over it.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, that is the one important point to note using that solution.
     
  9. nodle

    nodle Well-Known Member

    I guess I should make it clear that the user does have a name, he is just in a class as "guest" So I can't search for posts or threads by either the group or the user name in case it makes a difference. He basically just kinda shows as a deleted user and you can't click on his name either.

    aa.jpg
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, that is a deleted user.
     
  11. Martok

    Martok Well-Known Member

    Follow Jake's instructions in the post I linked to. In your database the user's posts will be associated with user_id=0 which is the guest user. His instructions show you how to change them so they are linked to his new user account (you'll need to find the user_id for that).

    As I said before, it's important that there are no guest posts or other deleted users, otherwise following those instructions will reallocate all guest and deleted user posts to this user.
     
  12. nodle

    nodle Well-Known Member

    Can't I just associate a new user id to it so he just becomes a new user then after he is a new user them merge the two account together? I would feel more comfortable merging the users in the ACP than running queries. Not to comfortable doing that stuff. So for example would I use this?

    Code:
    UPDATE xf_post
    SET user_id = test_user_33, username = 'test'
    WHERE username = 'Corey'
    AND user_id = 0;
    
    UPDATE xf_thread
    SET user_id = test_user_33, username = 'test'
    WHERE username = 'Corey'
    AND user_id = 0;
    Something like that? Does the user id really matter? Or will it mess things up later if someone goes to join with that user id will it just skip to the next number?
     
  13. Martok

    Martok Well-Known Member

    You're not merging users, you're associating the posts which are currently allocated to the guest user with your new user.

    The user_id is essential in this, you must use your user's current id for new_user_id in the queries.
     
  14. nodle

    nodle Well-Known Member

    Ok so I looked at the member id and it would be something like this then?

    Code:
    UPDATE xf_post
    SET user_id = c-pav.21, username = 'C Pav'
    WHERE username = 'Corey'
    AND user_id = 0;
    
    UPDATE xf_thread
    SET user_id = c-pav.21, username = 'C Pav'
    WHERE username = 'Corey'
    AND user_id = 0;
    I noticed under the member page it shows "c-pav.21" so do I not use underscores?
     
  15. Martok

    Martok Well-Known Member

    user_id is just the number, in this case 21.
     
  16. nodle

    nodle Well-Known Member

    Ya I must be messing something up I tried to create a new user, and even tried his name with underscores etc. But nothing seems to happen when I run the queries.

    Code:
    UPDATE xf_post
    SET user_id = 21, username = 'C Pav'
    WHERE username = 'Corey'
    AND user_id = 0;
    
    UPDATE xf_thread
    SET user_id = 21, username = 'C Pav'
    WHERE username = 'Corey'
    AND user_id = 0;
    Even created a test user hoping to import in there:

    Code:
    UPDATE xf_post
    SET user_id = 33, username = 'test'
    WHERE username = 'Corey'
    AND user_id = 0;
    
    UPDATE xf_thread
    SET user_id = 33, username = 'test'
    WHERE username = 'Corey'
    AND user_id = 0;
     
  17. Martok

    Martok Well-Known Member

    Why are you creating a new user? You said the user had created a new account.

    [QUOTE="nodle, post: 778235, member: 8230"He later joined under a different name.[/QUOTE]
    You should be using the details for this new user. Check their entry in the xf_user table to make sure you're using the correct user_id and username.

    This definitely works as I've done this on my site.
     
  18. nodle

    nodle Well-Known Member

    Yes I tried but it would work importing him. This was what I used for him.

    Code:
    UPDATE xf_post
    SET user_id = 21, username = 'C Pav'
    WHERE username = 'Corey'
    AND user_id = 0;
    
    UPDATE xf_thread
    SET user_id = 21, username = 'C Pav'
    WHERE username = 'Corey'
    AND user_id = 0;
    I just wonder if it can't work because it can't find the old user named "Corey" because he doesn't exist? I also believe I tried his name as C_Pav since he has a space in it.
     
  19. nodle

    nodle Well-Known Member

    Just wanted to update and tell you that I got this to work. Was running eh query in the wrong place. :whistle: It seemed to have worked fine. It affected #278 tables so I take it that's how many post that I could add to his post count? Or would this update automatically?
     

  20. Trying to make sure I understand this a bit better. We just ran an import from ip.board to xenforo and when we did a LOT of old posts from what must have been a previous import showed up. Of course, all of those old posts (there are thousands) are assigned to a user name that is no longer a user in xenforo and the title "guest" shows below each name. I would like to go through and reassign many of those guest posts to current members (when I can ID who is who).

    The thing is... there are thousands of those posts. Are you saying if I run the query listed above, the first time I run it, it will assign ALL of the posts that have guest under the user name to the first user?

    Is there a query that could be run that would do this piece by piece?
     

Share This Page