PDA

View Full Version : Dateline and Flood Control


inthezone
03-15-2003, 09:20 PM
I am making a section on my site that uses vBulletin's global.php for login, member permissions, etc. but has users post entries into a custom table located in the vB database. I am trying to figure out a way to implement flood control for this section, and was wondering how the dateline system works in vBulletin, as far as which MySQL function vB uses to get that number, how it is converted into time using PHP, and how it can be used for flood control.

Issvar
03-15-2003, 11:37 PM
It's the number of seconds since 1/1/1970. You can get this number using the time() function in php.

Example, user submits data, get time(), check if time from last data is at least 10 smaller, and either save data or not. Now user can submit only once every 10 seconds.

filburt1
03-15-2003, 11:54 PM
In MySQL, the function is UNIX_TIMESTAMP.