| Topic: | User specific data in a module, where to put it? |
|---|---|
|
Paustian
Helper
Posts: 132 Posted: |
I am just about finished with my first book that I made with the Book module. So it's time to go back and clean up a few bugs in the Book module and then add a few features. (The Book module is a shell that keeps a large amount of content -- text, images, animations, etc. -- organized in a PostNuke site.) I have thought of several features I would like to add to the Book module, but some of them will be user specific. For example, I am thinking of adding a highlighting feature, so a reader could highlight a passage of text. This marking would be specific to them, and would be unique for every user of the book. So the question becomes, where is the most appropriate place to store the user data for this? I will need to store the id of the article they are looking at, and then have a table of offsets in the text that delineate the starts and ends of the highlighting. Should I create a Book module specific table to store this user information, or should I try to keep it in the pnUser tables? I have explored the API for user data and I don't know if it is really designed to keep track of this type of information. Also, I hesitate to muck around with the Core tables as they may change with upgrades (esp. 0.76+ to 0.8). Any thoughts on this are appreciated. Tim P.S. I have checked out 0.8 and it is looking really nice! P.P.S. Yes I did a search of the forum and could not find anything that addressed this point. edited by: Paustian, Sep 15, 2006 - 05:56 PM |
|
rgasch
Professional
Posts: 573 Posted: |
QuoteShould I create a Book module specific table to store this user information, or should I try to keep it in the pnUser tables? Yes, create a module-specific table for this. This means that you have total control over fields, indexing, etc. and can remove the relevant data when you remove the module. For anything other than the most basic data, a custom table is probably the best solution. Greetings R |
|
jediping
Helper
Posts: 387 Posted: |
For highlighting, I would say make another table. This table would have the ID of the book, the ID of the user, and however you determine what section is highlighted. What you might want to do is create a hook module, like pnBBCode, but a bit more featured. It seems at first glance that this might be the best way to go. [ETA] Unless, of course, you wrote the Book module. If it's someone else's code, that's always tricky. If it's just yours, no problem. :) edited by: jediping, Sep 15, 2006 - 11:19 AM |
|
Paustian
Helper
Posts: 132 Posted: |
Thanks very much for your replies. It is my module, so I won't have any problem with the developer. |