![]() |
Time
I want to use an if statement like this
if ($action==time) { eval (blah blah) for 6 hours; } i know theres time but ii dunno how to use it... so if i want an action to do something for a certain amount of time what do i do? |
I'm not quite sure what you want.
Do you want to adjust the timeout setting? |
i want to say like.... if $away=1 then bla blah....
but i want to program that if ($action=="away") { $away=1 for 6 hours } i just need to be able to have it changed for 6 hours.. then after that time its changed back |
You want a variable to have a value for 6 hours?
Why? That won't do you any good unless you've got this one script running for that long (like a shell script, or daemon). If you want to change the configuration of a program globally, try setting a flag in a database with a timestamp for it to revert. Everytime you access the flag in the DB, check the timestamp. If time()==timestamp, then revert the flag. |
umm i dont understand that...
but... hmm lets say i wanted a user away kind of thing so if the user clicks this "I'm away button" there account would be inaccessible for like 6 hours |
You would have to store the time somewhere, e.g. in a database, then check it against the current time.
PHP Code:
See? |
All times are GMT. The time now is 01:37 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|