Author |
Topic |
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 20 May 2002 : 18:40:19
|
I'm working on a Book Review MOD. Sort of like the Links Manager, but a bit simpler, I think.
I'm a little stuck on how to solve this problem though: The access rights for adding a book, adding a review, rating, editing book entry, editing comment, deleting books, and deleting book reviews.
I originally was going to just let admins do it. Which would suit my site, but if I am to release it as a MOD that would be cumbersome for a lot of people. Then I figured that perhaps certain people may have access, such as moderators or a list of people. Hence, the question is whats the best way of assigning access. I figure there to be three ways to do this: - Hardcoded - Have the installer hardcode the info into the page. I could give instructions to this. Downside, once the files are uploaded nobody wants to download, edit, upload. bad idea, IMO
- New Table - This is an obvious choice. But I dont know if a new table in the db for a few records is worth it. I don't know how much space it will take or how it affects the db with too many tables
- Use Record 1 - I can also use the first record in one of the 3 tables I need to make. I can place a check to make sure it isn't deleted by accident. Although unorthadox this could work since I will write the code to hold the info in whatever fields I want (of course anybody looking at the code may be confused). Although this is a strange way, there wouldn't be a need for an extra table for very little information.
So what are your thoughts, 2 or 3? I get the feeling an overwhelming (if not all) will say idea 2, but I had a thought that 3 might work on the road today and am curious if this could work or if I should destroy the thought and punish myself for having such unnormalized database design ideas
|
|
alex042
Average Member
USA
631 Posts |
Posted - 21 May 2002 : 09:16:13
|
quote: New Table - This is an obvious choice. But I dont know if a new table in the db for a few records is worth it. I don't know how much space it will take or how it affects the db with too many tables
How about adding a variable to the config_new table instead of creating a whole new table?
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 21 May 2002 : 09:47:34
|
Personally (as it's what I've done to add another bunch of user levels to my forums) I would just add one additional column to FORUM_MEMBERS.
Sounds like what you want to do is actually pretty similar to the way I've done my User Levels. I have in addition to the new column in _MEMBERS a new table which contains the 'friendly names' for the values in _MEMBERS. ie I have things such as
Trial Members Full Members Officers Guild Leaders Raid Leaders etc etc etc
The extra levels give me a lot more flexibility in controlling who can or can't read particular forums on my site.
www.daoc-halo.com |
|
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 21 May 2002 : 19:07:56
|
quote:
Personally (as it's what I've done to add another bunch of user levels to my forums) I would just add one additional column to FORUM_MEMBERS.
Sounds like what you want to do is actually pretty similar to the way I've done my User Levels. I have in addition to the new column in _MEMBERS a new table which contains the 'friendly names' for the values in _MEMBERS. ie I have things such as
Trial Members Full Members Officers Guild Leaders Raid Leaders etc etc etc
The extra levels give me a lot more flexibility in controlling who can or can't read particular forums on my site.
www.daoc-halo.com
I will be doing this(the additional levels) but thats not quite what I meant. What I need to do is add access rights and moderation to the book mod as if it were a forum. In other words, who is allowed to post new books: admins, moderators, members, anyone. Who can edit: admins, members etc. Is the Book Posting moderated; so that whomever can add a book, but it must first be approved before it will show up.
These are the fields I need:
ADD BOOK | EDIT BOOKS | DELETE BOOKS | ADD REVIEW | EDIT REVIEW | DELETE REVIEW | ADD RATING | EDIT RATING | DELETE RATING | MODERATED | MODERATORS
The add\edit\delete are basically an mlev, moderated is whether the posts have to be approved, and moderators would be used depending on the selections for add/edit/delete (used like at the forum)
Now, if I were to use this for me only, I could hardcode it. But as a MOD I think some kind of interface to update the info is needed. Do I create a new table for one record (doesn't seem efficient), do I use a record in one of the tables (like described above), or am I missing a choice?
Did I explain it properly? It always makes sense to the author, albeit the rest of the world is scratching thier heads
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 21 May 2002 : 21:21:33
|
hmm I still think we are talking the same thing here, though I've not ever installed the book mod so my understanding of how thats normally integrated into a forum is probably where my confusion lies
If you create a new Table Lets calls it BOOK_ACCESSLEVELS with a layout out something like this
#UserLevel#integer #LevelDec#varchar
You'd then populate that table with your access levels creating some arbitrary usel level numbers eg
100,Add Book 200,Edit Book 300,Delete Book 400,Review Book 999,Admin Full Access
etc (would be easiest to number then in order of access ie least access to full access as that will make coding simpler downstream)
Then an additional column on FORUM_MEMBERS say called BOOK_ACCESS this new column then contains one of the UserLevels from your new table above, ie Forum Admin would have BOOK_ACCESS = 999
You then add a new dropdown box into pop_profile.asp so that you can set members with various levels of access.
Then within the book mod code you can simple put in some conditional coding to determine whether the user can do the function he wants (very similar to how the M_LEVEL field works in snitz now)
ie
select case ACCESS_LEVEL case 100 ' Can add Books ' do whatever case 200 ' Can Edit Books ' do whatever end select
I personally see no harm in having a table with only a few records in it, yes there probably is a small additional overhead in it, but it also gives you added flexibility imo.
Again I've not seen or used the book mod so I'm probably tripping up there somewhere.
www.daoc-halo.com |
|
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 22 May 2002 : 13:56:22
|
The reason you don't know about the Book_mod is because I am not done writing it I am using it on my site (when it's finished) and I'm planning on releasing it.
Gremlin, I understand the approach that you're taking. And I see how this would be easier than my plan of attack. I think I will go the route you described above, I just need to look at and see how to apply.
Thanks for REexplaining!
I guess I can use the forum_moderator table for the members that are to be moderators for the book section (i guess I have to put something as a forumid that will not be created by the forum itself, something like 999999.
|
|
|
XavierSlater
Junior Member
United Kingdom
137 Posts |
Posted - 23 May 2002 : 05:57:51
|
Why not use the User Groups MOD that Morpheus is workin gon to verify who can edit/add/delete reviews and such like......
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 23 May 2002 : 07:24:25
|
Feel free to email me if you need any more information or help on how I implemented the above into my forums.
www.daoc-halo.com |
|
|
snaayk
Senior Member
USA
1061 Posts |
Posted - 23 May 2002 : 21:39:03
|
quote:
Why not use the User Groups MOD that Morpheus is workin gon to verify who can edit/add/delete reviews and such like......
I'll have to check it out, perhaps it will be easier. Or perhaps not, since I want to release this as a MOD, I wouldn't to force nyone into having to groups MOD to install this. I'll take a look at the code though.
quote: Feel free to email me if you need any more information or help on how I implemented the above into my forums.
I might just do that, thanks.
|
|
|
|
Topic |
|