News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Merging topics and changing first_post

Started by HunterP, April 27, 2011, 01:12:50 AM

Previous topic - Next topic

HunterP


Hi,

Maybe I'm trying something stupid or even against all SMF-rules, but I want to merge two topics. One topic contains only one posting with some information about a certain subject. The other topic contains a discussion about that subject. I would like to merge these topics, but since the topic with the single posting is more recent, it doesn't show where I want it to, I want it to be the first posting.

So I hacked the DB and changed the id_msg to an older (free) one, which did move it to the beginning. So far, so good. But the weird part is that the topic doesn't show up in the message index. It can only be accessed by entering the link directly. So I looked at smf_topics and noticed id_first_msg. Changing this ID to the "new" first posting didn't make any difference.

Any suggestions please? :)

live627

Hm, this kind of molestation doesn't happen every day lol

So the two fields you mentioned are both in smf_topics? The message has an id_topic which must be updated too.

HunterP

Quote from: live627 on April 27, 2011, 01:33:02 AM
So the two fields you mentioned are both in smf_topics? The message has an id_topic which must be updated too.

First, I updated id_msg of the message to be shown first in smf_messages
Then, I updated id_first_msg for this topic.

No, I don't have to change id_topic, since I have merged two topics, resulting in one topic :)

live627

The topic ID changed from two individual numbers to one when merging. Therefore, all messages using the old id_topic must be updated to use the new id_topic.

HunterP

Quote from: live627 on April 27, 2011, 03:05:39 AM
The topic ID changed from two individual numbers to one when merging. Therefore, all messages using the old id_topic must be updated to use the new id_topic.

You're confusing me. When I merge one topic (via SMF, not via the database), only one topic remains??

Let's make it more clear, I have two topics :

Topic #1, has id_topic=1 and 9 postings, numbered id_msg=2to10 (in smf_topics id_first_msg=2)
Topic #2 has id_topic-2 and 1 posting; id_msg=11 (in smf_topics id_first_msg=11)

When merging these topics (in SMF), I'm not 100% sure what ID remains, does this depend on the selected subject, or is it allways the highest or lowest? Anyway, Let's say that id=1 remains :

Topic #1, has id_topic=1 and 10 postings, numbered id_msg=2to11 (in smf_topics id_first_msg=2)

The merged (added) topic (one posting) is shown as last, as it's ID is the highest.

As you can see, id_msg=1 is unused, this message could have been removed in the past. I want to use that ID for the message which has to be shown first.

So I edited id_msg=11 to id_msg=1in smf_messages

This caused this posting to be shown first. So far so good, but that was just when I refreshed the page in my browser. When viewing the message-index, the board, the topic wasn't visible?? (the board only contains a few topics, so it's not difficult to see it the topic is visible or not). So I went to this topic in smf_topics and set id_first_msg to 1 in stead of 2. Nothing happened. Now I'm thinking, the only thing I haven't tried was to edit id_last_msg. In my example this remained 11, where it should be 10.

Could that be the problem? Like to know for sure before I give it another try. The only thing I can imagine it that the wrong message is being shown as last message, but that is not the case, the topic is not visible :(

HunterP


Ok, think I've found a solution.

#1 First I edit the second topic (with the single posting) to an older (lower) id_msg.
#2 Then I set the id_first_msg and id_last_msg to the same id_msg
#3 I merge the topics

Problem solved. Not really sure if #2 is necessary because #3 might fix this, will try this with another topic.

Example: http://www.scannerforum.nl/index.php?board=81.0

The three locked/sticky "Capcodes" topics. The first posting has a more recent date than its replies, but that shouldn't be a problem  8)

Advertisement: