Jump to content


Photo

banning suggestions?


  • Please log in to reply
3 replies to this topic

#1 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 08 July 2006 - 06:22 PM

hey guys,

I'm trying to find the best way I can do this, right now an admin can ban user from using categories and a moderator can do the same thing but what 'm trying to figure out is what would be the best way to check if a user has been banned from a category.

Once a user has been banned 3 times from a moderator he's moved to the block_list and can't access his account anymore. But an admin can ban a user from categories as many times as he wishes without having the user being moved to the block list.

What would be the best way of doing this? Making 2 seperate tables one for the bans from the admin and the other for the bans from the moderators? Or adding 2 rows in the user table?

I'm thinking the seperate tables but how do I validate the user, is there a way to check 2 different tables just by using a single line?

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 08 July 2006 - 06:50 PM

What about one table that has a bit field to indicate who enacted the ban?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 08 July 2006 - 07:01 PM

can you give me an example? I tried reading on BIT fields but I'm not sure how to use it in m case.

What I'm trying to do is that when a user goes on a certain page, he doesn't see the categories that he was banned from. If he got banned from a moderator 3 times he's automaticaly on the block list

#4 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 08 July 2006 - 07:31 PM

...or you don't even need the bit field if you store the user id of the moderator/admin with the person who was banned. Therefore, when you join the banned table with the user table, you'll already have the moderator/admin status.

Something like this should give you a category ban status:

select user_id, category_id, count(*) as bans from banned_table where user_id = their_id group by bans.

If "bans" is greater than 2, they cannot access the category.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users