Jump to content


Photo

Time Blocking...


  • Please log in to reply
2 replies to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 17 September 2006 - 04:57 PM

Hii
I've got a mini problem, but I kinda need advice.
I have an idea of blocking naughty members from
my website, and to do this I thought I'd make a timed
ban.

I wanted the whole thing to be optional like, from 1 minute
to 7 years... obviously in the way like x minutes, xhours,
x days, etc...

I thought Making a database and adding the "Number" and
the "Lengeth" into the database and using:

strtotime("today -$TimeVar $Lengthvar");

to extract that information :/ But it's confused me
because I don't think it will work with minutes or that.

#2 Wintergreen

Wintergreen
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 17 September 2006 - 05:19 PM

Just thinking, not fully sure how you'd implement it, but you could create another column in your users table along the lines of is_banned, making it DATETIME format (0000-00-00), the default being empty.  Then if you want to ban someone you can make yourself a form allowing you to ban for however many days or whatever you'd like, and then use date functions to get the current date and add your ban time to it.  Then make a check when users log in to see if they're banned by comparing the current date to the is_banned row, and if their ban time isn't up just exit out of the login or print a message saying what's up. 

#3 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 17 September 2006 - 08:45 PM

i was thiking something of that, i'll have a little go.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users