Posted 08 July 2006 - 06:22 PM
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?
Posted 08 July 2006 - 07:01 PM
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
Posted 08 July 2006 - 07:31 PM
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users