digitalgod Posted July 8, 2006 Share Posted July 8, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/14037-banning-suggestions/ Share on other sites More sharing options...
effigy Posted July 8, 2006 Share Posted July 8, 2006 What about one table that has a bit field to indicate who enacted the ban? Quote Link to comment https://forums.phpfreaks.com/topic/14037-banning-suggestions/#findComment-54859 Share on other sites More sharing options...
digitalgod Posted July 8, 2006 Author Share Posted July 8, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/14037-banning-suggestions/#findComment-54862 Share on other sites More sharing options...
effigy Posted July 8, 2006 Share Posted July 8, 2006 ...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. Quote Link to comment https://forums.phpfreaks.com/topic/14037-banning-suggestions/#findComment-54869 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.