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

Can I change thread author by altering user ID of first post?

Discussion in 'XenForo Questions and Support' started by CyclingTribe, Feb 27, 2012.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    I have given up on trying to integrate CycleChat with Wordpress and decided to import all my old IPB blog articles into a specific forum.

    To ensure they belong to the originator I need to change the author of the first post/thread.

    Can I do this simply by changing the user ID in the XF post table, or are there other places I would need to edit?

    Shaun :D

    PS. I'm aware of the add-on for doing this, but at the moment it doesn't work. :(
  2. Nudaii

    Nudaii Well-Known Member

    Well there is a way to get it working.. a rather rough work around I used at my own forum

    1. Post in thread you want to change
    2. Change that post to member you want first post to belong to
    3. Merge that post with first post selecting to merge into latest post (not new into old but old into new)
    4. Change time stamp of the new/merged post to match original first post date (using same add-on)
    GeeksChat likes this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    There are a few tables you would need to edit: xf_thread, xf_post, xf_liked_content are the main ones.
    You would also need to update the post counts, Likes, search index, etc.

    You would also have issues with IP addresses being logged against incorrect users.

    I haven't really looked into this in any detail though.
    GeeksChat likes this.
  4. CyclingTribe

    CyclingTribe Well-Known Member

    Thanks - that makes sense and will get around the problems Brogan has described (which does look awfully fiddly and possibly prohibitive).

    I'll be putting them together in a private forum so I'll have complete control over the content and there won't be any likes etc. to worry about so I'll give it a go and see how easy it is to put into practice (I've got quite a few hundred articles to copy 'n' paste ... :eek: ).

    Shaun :D
  5. Ladegro

    Ladegro Member

    Any luck on this? I'm facing the same question.
    Created the forum, now still in private-/closed mode. I've migrated all discussions from our old LinkedIn group and posted them under my own login. Right now, I'm the only user on the forum (super admin), but when every other user has made his account, I'd like to change the posts according to whom they belong (i've prepended them all with "[nameOfCreator]").

    Looking for an easy way, but that might be too much too ask I suppose?

    p.s. about step 2: how do I change the member / author of a post?
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can change ownership of a thread / post manually by editing the associated xf_thread / xf_post record. Just change the user_id and username.

    If the desired author usernames are in the record somewhere then it may be possible to automate the process with a query, but I would need to see your data to know that.
  7. Ladegro

    Ladegro Member

    Are you talking about changing the database? Just to understand you correctly.
    What kind of data do you need to see in order to be able to answer such a question?

    Thanks for your help.

    As attach: this is how i've done it. Thread owner is between [ ] and every reply begins with the name of the author of that reply. linkedIn-copied.png
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes, the records in the database.

    I would need access to phpmyadmin ideally. That is a program to manage your database which many hosts preinstall for you. It will allow me to see all of the information in your database.
  9. Ladegro

    Ladegro Member

    I'm gonna try and do that myself first, but thanks. As you can imagine opening up the complete configuration could impose security issues which not every one of our staff would be happy with... Should I not succeed, ....then I'll be back :)
  10. Ladegro

    Ladegro Member

    Ok that worked great. Limited the query to the one node_id it was affecting, thereby limiting the risk of f**ng up the rest of the forum. Thanks for your help.

Share This Page