Jump to content

Code to display certain data and certain times?


TomFromKWD

Recommended Posts

Hey guys

 

I have a client who wants to upload images then have them display on his page... obviously that process is not an issue at all.

The catch is he wants the image to change at midnight and display the next image in the sequence, then display it until midnight strikes, and then the next in the sequence is displayed.

 

Is there any code type that will recognise a set time/date and display coressponding images in a database?

I realise I made need to add a field for an ID number/date ID for the code to identify which image to display, but not sure what code will/wont work

 

Can some one point me in the right direction

would be much appreciated :)

 

 

Thanks

Tom

This can be done without a cron job, somethings to take into consideration is sequence order of images, if the client uploads the images in the order they want them displayed then this is fairly easy to handle, you simply add a  timestamp field or rename the images to the timestamp of the time you want them to finish each day on upload to the server.

Then just have your script on the page that displays the image work out which image to display based on the current timestamp when page is loaded and the timestamp of the image that is due to expire before that with its end time stamp.

 

If the user uploads the images randomly then you will need to implement an ordering feature to shuffle the images and the timestamps around.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.