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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.