Is there a way to change images on the pet profile based on the time of day?
The general idea is as follows: If time is greater than x but less than y, use image0, else use image1 Like... if time is from 8pm to 8am, use one image, but from 8:01am to 7:59pm use the other.
Please let me know if ya'll have any ideas on trying to execute this.
I've used this PHP to randomize my profile images before, you'd need to add a little extra logic for the time windows but the base is there. That's all I can think of.
Thank you ^-^ It's some where to start! I'll update as I figure things out.
Working proof of concept.
Replace this if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}With this if (count($fileList) > 0) {
if (date('H') < 20) {
$img = $folder.$fileList[0];
} else {
$img = $folder.$fileList[1];
}
}
And you also need this right after the "end configuration" part. date_default_timezone_set('America/Detroit');