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

Insert new post before first in thread

Discussion in 'Resource and Add-on Requests' started by Jeff Fuqua, Sep 12, 2013.

  1. Jeff Fuqua

    Jeff Fuqua Well-Known Member

    I run into the occasional issue of a poster who reports some news which is quickly followed by a thread started by an RSS feed from an official source.

    I'd like to make the official source the first post in the thread and merge the threads together. When I merge, the original post remains the first one.

    Is there a way to insert a new post which becomes the first in the thread or promote an existing one in the existing thread to move to #1?

  2. Daniel Hood

    Daniel Hood Well-Known Member

    Run this query in phpmyadmin:

    SELECT * FROM `xf_post` WHERE thread_id = 1 ORDER BY position ASC
    You're going to have two rows (possibly more if more than one merge is done) with position: 0. The positions aren't re-calculated upon merging so that's where the issue lies. If you change the position on one of the rows to 1 instead of 0, it should be correct. If that's the case, a fix will be relatively simple. I think this might be better off as a bug report and fixed by @Mike instead of as an add on though.

    Unless of course I'm wrong.
  3. Mike

    Mike XenForo Developer Staff Member

    To be short, you're wrong. :)

    Posts are simply ordered chronologically when merging. Changing a position value is not a good idea.
  4. Daniel Hood

    Daniel Hood Well-Known Member

    Fair, lol.

    Regardless of the ids, the thread being merged into another one should be appended to the end though.
  5. Jeff Fuqua

    Jeff Fuqua Well-Known Member

    My head hurts.
    Daniel Hood likes this.
  6. AndyB

    AndyB Well-Known Member

    This is fairly easy to do with phpmyadmin. Are you comfortable editing the database directly using phpmyadmin?
  7. Jeff Fuqua

    Jeff Fuqua Well-Known Member

    I try to stay away from messing with the database whenever possible. I was hoping there might be interest in an add-on which would allow an admin to select a post and make it the first one of a thread.
  8. DRE

    DRE Well-Known Member

    Just merge the threads and whichever post you want to be first or second, change the posts owner with this addon: http://xenforo.com/community/resources/*******-change-threads-posts-owner.1327/
    Jeff Fuqua likes this.
  9. RobParker

    RobParker Well-Known Member

    Someone (Chris?) has an addon that changes the post time. If you used that on the RSS thread and then merged, that would work wouldn't it?
  10. AndyB

    AndyB Well-Known Member

    Yes that would work perfectly.

Share This Page