Hi guys,
I have a custom module which was developed for me, for women to chart their fertility cycles and the data is updated daily by the user and a chart is generated based on what data they enter. The image of each individual chart is displayed on a custom page and only each user can view their own chart. i want to make this so others can view their chart as well and have a link to it within a users profile like their blogs. The only thing is the images are named as to the last time they were updated so for example my image might be called 080317081008.png with the 08 at the start being 2008, the 03 next being march, the 17 next being the 17th and the rest being the time of that day it was updated, so the next day when i add data the name will change to 080318etc.....
My question is, how do i add the link to an image that keeps changing names every day, is there a specific code to use?
Any help would be greatly appreciated.

Comments

trying’s picture

Anybody have any ideas at all that i can try? Please!

leadstudios’s picture

Do you store the last date updated somewhere in your database? If so, then you can dynamically generate the image name each time by querying the database to get the value.

Just off the top of my head, something like:

Get the modDate: select modDate from table where userid=x

Then in the code, create the image link using the modDate

<img src="<php print $modDate ?>.png" />

Obviously some quick pseudo code but that's the general idea.

trying’s picture

Thanks for the suggestion, i'll give it a try when i get a chance and let you know how it goes.
Thanks for replying.