Re: Help with board archiving [Long]

From: Fizal (amustapa@GameBox.net)
Date: 10/11/00


At 10:29 PM -0700 10/10/2000, Shane P. Lee wrote:
>Todo: Add a command that archives existing boards to a "book" that other
players
>can access. He apparently doesn't like 'loosing' past posts when I clear the
>boards.

No, I haven't seen this one before. However, after reading your message a
couple of times, something came into my mind. Dunno whether it will work or
not, just to run it pass you (and everyone else for that matter).

The stock board system will allow up to a certain number of post on the
board. What I see is that we can either work with it or around it. However,
it still depends on what you mean by "archiving" : to put everything into
the book including the ones on the board or just old posts.

1. Have another file that will keep the archive for the book. When someone
wanted to post something pass the limit, just remove the last and oldest
post from the board and append it at the end of the file. When an imm
clears a board, for every post removed starting from the oldest, append it
into the file. I believe that making the archive file ascii will be much
easier. When someone uses book command to view the archive, you can use the
same method as to show wizlist/credit for this as well. Only when an
archive event is done, just remember to reload the file.


Good points:
- Less coding. Well, at least that's what I think.
- When someone issue "book mortal", just find the proper thing to display.
Bad points:
- Players have to shift thru the whole archive themselves.
- Archive is listed from old to new, since newer ones are appended at the
bottom of the file.

2. Make use of the current board system to do both. Change so that instead
of using an array to keep all the posts, use a list instead. That way, you
can keep more than allowed, but only shows up to the limit when someone is
viewing a board. When someone uses a book command, just access the part
that is above the limit. Example: The file for the mortal board contains
100 posts and limit is at 60. All of the are readed/loaded. When someone
looks at the board, just show post #1 to #60. When someone issue "book
mortal 1" then show them post #61.

Good points:
- Archive will look like the board. "Book mortal" will display all post
pass the limit, while "book mortal #' will display post #(limit + #).
Familiar and easy to shift thru.
- Archive is listed from new to old (or vice versa if you want).
Bad points:
- More codings to be done. At least compared to the 1st method I think....
- Have to take care of quite a few of things when someone issue a book
command.

Or better yet, combine them both: Use a separate file for archive and a
list for memory. When a post is archived, just remove from the board, put
into the list and save the list into file....

>The Problem So Far: [...] Since the boards are not in ASCII format, I
can't just
>copy over the new stuff to an existing board file, and edit the message
>numbers/topics with my usual text editor.

Altho the files are in binary, but it's not when it's in memory (well, not
technically). So, you can actually save the posts from the memory for the
board into the archive file as ascii.

>Also, we don't want people to write new messages in the books, so I don't
want
>the "book" to be another board anyway.

The write to board command will only work if there's a board around. If
there's none, then it will revert back to write to paper. The 2nd method
will only *look* like a board, but it won't let people write to or remove
post from it.

>If anyone out there has seen/done this sort of thing before, can you
please give
>me a few pointers before I do something stupid like re-write the stock board
>system?

If you're really serious about rewriting the board system, take a look at
Patrick's dynamic board system in the FTP site or Ceramic Mouse. Err...
you'll have to dig around a bit since it was quite some time ago when he
put it up. I did something similar, but that too was quite some time ago.
But if you need help, I'll try to throw something your way... (just hope it
won't smack you on your face and give you more headache *grin*)

G'luck! :)


---

Afizal Mustapa
Petaling Jaya, Selangor, Malaysia.
(amustapa@hotmail.com)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT