Skip to main content
Topic: Add a first post to a topic (Read 2098 times) previous topic - next topic - Topic derived from Rename topic
0 Members and 1 Guest are viewing this topic.

Add a first post to a topic

Oh, and another request! Sometimes it is neccessary to post a post (lol) at the first position of a thread, for example when splitting a topic. As Admin or Mod it would be great to have the chance to create a post as first post of a topic anytime.  O:-)

Re: Add a first post to a topic

Reply #1

With the current way sorting posts is implemented, this is rather tricky without rely on... tricks.
The posts (and messages) are sorted by default based on the message/topic id, and these ids are automatically and sequentially assigned by mysql/postgresql when the message/topic is created. So the only way to achieve that would be the way I used for the sticky first message (i.e. another query), but in that case it would likely require at least another column, maybe another table...
Bugs creator.
Features destroyer.
Template killer.

Re: Add a first post to a topic

Reply #2

Hm... Does this mean "sorry, much to complicated"?

Re: Add a first post to a topic

Reply #3

Second thoughts on this? It seems other software can do this. It would be really helpful when splitting, moving and bring threads together.

Maybe we can use a trick? Give the (new) first post of the thread a date and time before the following? Give it a negative ID (if even possible)? Make it sticky like threads can be?

 

Re: Add a first post to a topic

Reply #4

IDs are signed, so negative is a no go. Not sure what @emanuele has in mind.

One solution I had in mind is to modify id_first_msg to the new message that the moderator made while splitting the topic. I have no idea how this will work. The board and message indexes will be fine I think, but message order (in portal, display template) will get that message appended to the topic.

Or we could duplicate the split topic, delete the first split, and steal one of those for the moderator's note. This will unfortunately leave many gaps in the database ID increment order. But the final display is probably going to be fine... I think messages are sorted by ID and not date...  @Spuds can correct me on this.
LiveGallery - Simple gallery addon for ElkArte

Re: Add a first post to a topic

Reply #5

My idea there was very simply not to use tricks with ids/dates and really just have another table with the "first messages" that would go on top of everything else.
Bugs creator.
Features destroyer.
Template killer.