Photo/Image of the day
18 posts by 2 authors in: Forums > CMS Builder
Last Post: October 7, 2008 (RSS)
By grauchut - August 20, 2008
Re: [grauchut] Photo/Image of the day
By Dave - August 21, 2008
Do you want to have a separate section for photos of the day or pull images from all sections? All if you have a separate section will you have a record for each 365 days of the year or will you want it to rotate through however many images are there?
If you had a separate section you could have a field for "day of year" with a value between 1 and 365 and then use this where to load the right record for that day:
'where' => 'dayOfYear = DAYOFYEAR(NOW())',
The DAYOFYEAR(NOW()) gets the current day number of the year from MySQL. Currently 234.
Hope that helps!
interactivetools.com
Re: [Dave] Photo/Image of the day
By grauchut - August 21, 2008
Here is a site with an example. The photo of the day shows the picture and above it the Date and below the caption for the photo.
http://www.maytownedfd.com/
Re: [grauchut] Photo/Image of the day
By Dave - August 22, 2008
You just need to figure out the details of how it should work. When there are more than one image which one should be shown, etc.
If you haven't already created a mockup of how it would look that would be a good first step.
interactivetools.com
Re: [Dave] Photo/Image of the day
By grauchut - August 22, 2008
I guess the easiest thing to do it set up a whole new section. Here is what I was thinking (Hopefully Easy) Have a new section called (Photo of the day)
The client can add photos with a caption to that section. When it shows on the page have it so the image when clicked on will expand to whatever I set in that section. Now the fun part. How can i set it to change on a daily basis, and will the client need to add 365 pictures or can it cycle through what is available?
Top will have todays date. (Will need code so it gets the date automatically)
Image
And Caption
Thanks
Re: [grauchut] Photo/Image of the day
By Dave - August 25, 2008
To have a record for each day of the year and then look them up by day of year with this mysql:
'where' => 'dayOfYear = DAYOFYEAR(NOW())',
Or have it sort them in random order like this:
'orderBy' => "RAND()",
And then have a cron job and/or some custom code to save the output to a html page once a day.
interactivetools.com
Re: [Dave] Photo/Image of the day
By grauchut - August 25, 2008
I have been searching for some photo of the day scripts and was wondering if I sent you one that looks like it will work with changes (Cms php codes) can you help me figure it out. Thanks
Re: [grauchut] Photo/Image of the day
By Dave - August 26, 2008
Hope that helps!
interactivetools.com
Re: [Dave] Photo/Image of the day
By grauchut - September 15, 2008 - edited: September 15, 2008
You just need to figure out the details of how it should work. When there are more than one image which one should be shown, etc.
If you haven't already created a mockup of how it would look that would be a good first step.
Dave Edis - Senior Developer
interactivetools.com
Dave can we try to set it up the way you described above. Thanks Glenn
Re: [grauchut] Photo/Image of the day
By Dave - September 16, 2008
Showing a random photo is pretty straightforward. You just load a single record and set the order by to RAND(), like this:
'orderBy' => 'RAND()',
Do you want to give that a try and let me know how it goes?
Hope that helps!
interactivetools.com