Go back to previous page
Forum URL: http://www.eyrie-productions.com/Forum/dcboard.cgi
Forum Name: Introductions
Topic ID: 1
Message ID: 18
#18, RE: Separate threads...
Posted by megazone on Apr-30-01 at 11:17 PM
In response to message #17
>OK, now you've got my geek blood going... how are the messages
>stored?<meaning, are they all independent records with some sort of
>master table, or are they like linked lists, a post has a pointer to
>it's parent {and maybe children}?>

Unfortunately messier than that - posts are stored in multiple ways:
- a flat HTML file of the entire thread (what you see with View All)
- a flat .txt file with all the posts in it in a delimited format
- a database.txt file stores the list of threads for the forum and associated data in a delimited format

So to do a move you'd probably alter the .txt file - removing the posts being moved, then adding them to the new location (or altering them in the file if staying in the same forum). You'd have to renumber them to avoid conflicts with existing posts in the new forum. There is already an ability for admins to move entire threads, so I'd imagine that'd be the starting point for this code.

Then rebuild the .html files - there is already a function to do that though. You'd want to call that once the .txt files were fixed.

And you'd need to update the database.txt file to reflect the new thread - that is probably also addressed in the current thread moving code.

Oh, and the data.txt file is a counter of posts for the forum, so if you add posts to a forum you need to incriment the counter appropriate. That's also probably handled in the same code.

Of course that all ignores things like the email notification files, etc - but there is no good way to handle those IMHO, so I'd ignore them. (Cloning them for any relocated branches would be uncool, IHMO.)

-MegaZone, megazone@megazone.org
Personal Homepage http://www.megazone.org/
Eyrie Productions FanFic http://www.eyrie-productions.com/