I want to add a "picture of the day" to the main page of my site, but it’s essential for me and staff to automatize the process of uploading a new picture + updating the archive of the POTDs. Could you please recommend any solutions which could simplify such process? I haven’t managed to find anything on the forum, nor in MODx resources.
Thanks.
I have a slideshow on my main page, it pulls a few random images with ditto. If you have A LOT of pictures a random approach would probably be fine.
Here is my theory;
Every hit calls a pre-load script that will pull a random image. The script will ’>’ put the random image into a server side ’cookie’ named ’potd’ along with a timestamp. A simple if / else / then with phx will then manage the potd. After the timestamp expires a new image will be inserted. This script could be easily extended to keep a history of so many days to ensure the same image is not displayed within so many days...
If I could code, I could probably do that in ten minutes but that is a bit beyond me. I could do it in bash for sure, but not in modx!
Good Luck!
I like the method proposed by ganeshXL, this would allow to prepare things ahead of time. However what happens if there is no image for a specific day? Is that what would go in the ’else // do something else...’ section?