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

I am looking for a script that I can use to pull images from the cmsAdmin upload folder and change them on a daily basis. I also want to be able to add the caption below the photo. Does anyone know where I can find a good and easy script. Thanks Glenn
Glenn Rauchut (Owner) Emergency Designz

Re: [grauchut] Photo/Image of the day

By Dave - August 21, 2008

Hi Glenn,

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!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Photo/Image of the day

By grauchut - August 21, 2008

I would like it to pull images from the cmsAdmin/uploads folder. The client wants it to link back to the incident when that photo was taken if possible. If I cannot get it to go to the incident the picture came from that is fine.

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/
Glenn Rauchut (Owner) Emergency Designz

Re: [grauchut] Photo/Image of the day

By Dave - August 22, 2008

What if it just showed a random photo from the incidents section with a link? Would that work?

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

Re: [Dave] Photo/Image of the day

By grauchut - August 22, 2008

Dave,

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
Glenn Rauchut (Owner) Emergency Designz

Re: [grauchut] Photo/Image of the day

By Dave - August 25, 2008

It's a bit of tricky one. The two easiest ways I can think of would be either:

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.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Photo/Image of the day

By grauchut - August 25, 2008

Dave,

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
Glenn Rauchut (Owner) Emergency Designz

Re: [Dave] Photo/Image of the day

By grauchut - September 15, 2008 - edited: September 15, 2008

What if it just showed a random photo from the incidents section with a link? Would that work?

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
Glenn Rauchut (Owner) Emergency Designz

Re: [grauchut] Photo/Image of the day

By Dave - September 16, 2008

Hi Glenn,

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!
Dave Edis - Senior Developer
interactivetools.com