Image change by time and day of week.
Moderator: General Moderators
-
srednatonmi
- Forum Newbie
- Posts: 15
- Joined: Wed Mar 19, 2008 10:01 pm
Image change by time and day of week.
I've searched all over the internet for a script to do this, but haven't found one although I'm sure they are out there. The point is to display an open sign on a company website when they are open for business and closed when they are closed. Day of week must also be included so that it doesn't display open on Sunday. If you have any knowledge of something like this or can help in any way let me know? This is even a script I would pay for if someone here has the skills to develop it.
Thanks,
Anders Haig
Thanks,
Anders Haig
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Image change by time and day of week.
I could make that extremely easily. If you're willing to pay, I'm willing to work. 
If not, look into the date() function of PHP. It does everything that you're after.
If not, look into the date() function of PHP. It does everything that you're after.
-
srednatonmi
- Forum Newbie
- Posts: 15
- Joined: Wed Mar 19, 2008 10:01 pm
Re: Image change by time and day of week.
What would you charge? I am definatly willing to pay, depending on price, I'm not a cheapskate but I don't know how much some of you guys charge
. I would have the two images created and I just need the hours put into a script, which I'm guessing I can just add to the website with a php include. If implementation is more difficult I'd need help with that as well.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Image change by time and day of week.
Okay then, I've sent you a PM with my rates.
Re: Image change by time and day of week.
You don't need to pay for something this simple.
It's a tiny bit trickier if you want to open at different times on different days, or if you close at a time that isn't on an hour, but that's just a case of adding more if..else clauses really.
Code: Select all
$opening_time = 9;
$closeing_time = 17;
$day = date("w");
$hour = date("G");
//$time = date("m");
if (date("w")==0) {
$image = "closed.jpg";
} elseif ($hour < $opening_time or $hour > $closing_time) {
$image = "closed.jpg";
} else {
$image = "open.jpg";
}
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Image change by time and day of week.
;_;onion2k wrote:You don't need to pay for something this simple.
Re: Image change by time and day of week.
Well, unless you charge by the minute I don't see how you'd come up with a sensible estimate for this...superdezign wrote:;_;onion2k wrote:You don't need to pay for something this simple.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Image change by time and day of week.
Hehe. Throwing in a few extra graphics... Implementing it into a system that's likely unfamiliar... I'd make it into an hour.onion2k wrote:Well, unless you charge by the minute I don't see how you'd come up with a sensible estimate for this...
-
srednatonmi
- Forum Newbie
- Posts: 15
- Joined: Wed Mar 19, 2008 10:01 pm
Re: Image change by time and day of week.
I'm not a php guy, so spending a little money instead of learning how to add if then clauses is worth it to me.