SMF Support > SMF 1.1.x Support

Question about a database field in table smf_boards

(1/2) > >>

CrescentEclipse:
Hi community!

I am reconstructing a forum based on an offline copy. Therefore I analyzed the database structure of SMF as far as possible.
But I have a question about a field in the table "smf_boards". What is the field "ID_MSG_UPDATED" for?

I understand what "ID_LAST_MSG" is for, but "ID_LAST_UPDATED" is always the same ID as the last MSG.
I tried to change or delete messages and used different users, but they both remain identical. I don't get it^^
Can you please explain it to me? What is the purpose of that field? Can I safely set it to the "ID_LAST_MSG" value when inserting new rows?

I am using SMF 1.1.16 and I don't have any forum online at the moment.

Thanks ;)

Arantor:
Not exactly.

It's used for the hierarchy, when a board gets a new post, it and all its parents all get ID_MSG_UPDATED updated.

ID_LAST_MSG allows for quickly finding what the last post in a post is (for the board index) but ID_MSG_UPDATED is used for identifying whether a board or sub-boards have new posts to read.

I would not manually change that value if at all possible. Once it is up and running, simply making new posts will fix that logic anyway.

CrescentEclipse:
I have no choice. I must build the whole database from scratch.
It is a bigger project of mine. I have only a local copy of the forum in thousands of HTML Files.
I am programming a tool which reads the data from these file and writes the results back into an empty database of SMF.
I automatically want to fill the tables "categories", "boards", topics", "messages", "members" and some other tables regarding statistic stuff.
But to do that I must understand how SMF works. So far so good. But this field is the only one which I do not fully understand.
Can you please give me an example? When does it differ from the "ID_LAST_MSG" value?
I tried to figure this out myself , but I do not understand PHP good enough...
Thank you in advance! :)

Arantor:
OK, so imagine this board structure:

Board 1
  -- Board 2
      -- Board 3

Board 1 is the parent of board 2, and board 2 is the parent of board 3.

Now if you make a new topic in each board - in that order, so the first topic is in board 1, the second topic in board 2, the third topic in board 3, what will happen is this:

Board 1 will have id_last_msg of 1, as expected
Board 2 will have id_last_msg of 2 as expected
Board 3 will have id_last_msg of 3 as expected

But *all* three will have id_msg_updated of 3 because that's the last message to be posted across the entire chain.

Now if you reply to the topic in board 2, board 2's id_last_msg is 4 (the fourth message), and board 1 and 3 are unchanged as far as the id_last_msg goes. But boards 1 and 2 will get id_msg_updated of 4, because board 2 and all its parents (but note: not its children), have that as their last post for the hierarchy.

Does that make sense?

CrescentEclipse:
Yes, it perfectly makes sense ;)

But I forgot to mention that I do not have any child-boards.
Every board is on the same level, only other categories.
I think in this case id_last_msg is the same as id_msg_updated?
Any other special cases?

Navigation

[0] Message Index

[#] Next page

Go to full version