0

I'm trying to make a ban system for my website with the following features:


-Tell user reason for the ban
-Tell user date it'll expire
-Tell user date it was issued
-Tell user who they where banned by
-Auto perma if user has been banned a total of 3 times
-Auto expire bans

Note: I this is for a simple members system I already have up and running.

But to be honest I'm not that great at php and don't know where to start, I'm not sure how to get the bans to auto expire.

All help is greatly appreciated.

Thanks in advance.

-Tim

4
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by MagicMedia
0

How do you keep track of your members? Via mysql or another database? Or with plain text files? Or are they system users?

0

each time user logs in check if he is banned and if yes check if ban time is expired. If yes then allow him to do thing other can do. if no redirect him to ban info page.Also when he logs in and ban time is passed, reset his ban status.
There you know what to put into database right?

0

It's all in a database. And @evstevemd I don't know how to do that that's the problem.

0

Put a column in your database for ban expiration. When you ban someone, put the expiration date in timestamp format. On every page, check if the banned time is higher than the current time.

// grab user data

if (time() < $ban) {
     die ('You are banned. Get Out!');
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.