Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expiring Image?

Status
Not open for further replies.

jdgti

Technical User
Jun 25, 2008
10
US
I want to make an image on my website that expires every day at 5pm. I am assuming it will have nothing to do with the image and everything to do with some sort of script.

I was wondering what sort of ways you can even expire and image. I guess one way is to print a line over it that says it has expired.

I also don't want it to start over every day at 12 am, I want it to be where I have to reupload another one for it to restart, and then once its on there, it will expire by 5pm that day.

So... I have been kind of specific, and I don't expect a real answer, but more of where to look, or what language to look in to for this project. Also, where to look for embedding, and where to look for different types of image expiration.
 
Like you realized yourself, there are no settings in pictures to make them expired. I suppose you could do two things:

1. Use PHP image manipulation functions to add expired to the picture if certain conditions are met.
2. Have another image, which will replace the non-expired one with the expired one when the conditions are met. Since we don't know enough about your project, it's hard to say but you could either:
2a. Have this expired picture replace every other picture (this is good if expired picture is always the same)
2b. Use a transparent image (expired picture) and place it over the actual picture that expires (this is a good method if your expired pictures will be different).

I would probably choose 2b for simplicity. The solution is a simple php script to determine the time and which photo should be shown and the rest is html and css. But without knowing why you need this, it is hard to pick the best method.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
You could also envision a cron job
that will at a defined time and day move the previously loaded image and save it to a "stock" directory
and replace it with a temp img awaiting for the new img
or
Have ahead of time a pile of new img with a DB id and another col "posted"
the cron will pilot a script that will query in your DB a new image that is not marked "posted" and load it up
 
Well, how would I make it expire if I didn't have control over the database? For instance, if someone stole my image, I would want it to expire by a certain time. Is this possible?
 
Don't forget that you could also watermark it
a quick search for "gd watermark image" renders many tutorials
 
Well, how would I make it expire if I didn't have control over the database? For instance, if someone stole my image, I would want it to expire by a certain time. Is this possible?

How would it be? If someone stole your image then its no longer on your server and so you have no control over it.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top