Author Topic: Nivo-Slider Photo Refresh  (Read 3846 times)

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Nivo-Slider Photo Refresh
« on: July 31, 2012, 10:53:04 AM »
I plan on changing out the 4 photos that rotate at the top of my page during each season (spring/summer/winter/fall). Is there a relatively easy way I can do it automatically (via htm) instead of manually swapping out the images on my server every three months?

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Nivo-Slider Photo Refresh
« Reply #1 on: July 31, 2012, 11:56:40 AM »
Hi Tom,

In html, there is no "interactivity" possible; we have to rely on javascript for that!
But javascript doen't work on files (on disk), we have to extend it with Ajax or others,

Finally, we have to think performance, as it is not a good idea to run a script each
and every time a visitor see your index page (as example)... for something occurs
only 4 times a year!

But, one thing I think of is a Cron job, I don't know more about that to see if we can
specify a date! Cron is a "scheduler" that can do reapeated task; at "5 min" interval,
each hour, each thursday night... but I don't know for a specific date.

Could be something to check, usualy every server have Cron

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: Nivo-Slider Photo Refresh
« Reply #2 on: August 01, 2012, 02:21:52 PM »
I suppose it would be simple enough to do something similar to what we did with the forecast icons. I don't remember the web tag for the current month, but something like:

<img src="images/<#month>_header.jpg" alt="" />

If I had 3 pictures to rotate, and 4 sets of picture (one for each season), I would just need to have 12 images uploaded to my server for each "header" picture. Months 12,1,2 could all be for my winter picture, 3,4 5 for spring, etc. Same for header2.jpg, header3.jpg.

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1116
    • http://www.meteostours.ca
Re: Nivo-Slider Photo Refresh
« Reply #3 on: August 01, 2012, 03:19:42 PM »
Hi Tom,

Yes, it could be best easiest solution in plain html!
This is not giving the right date (21st)... but in december... it's cold!  :D

Good idea Tom!

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: Nivo-Slider Photo Refresh
« Reply #4 on: August 01, 2012, 03:25:04 PM »
I tend to use the meteorological seasons rather than the literal dates: winter is dec-feb, spring is mar-may, summer is jun-aug, and autumn is sep-nov.
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: Nivo-Slider Photo Refresh
« Reply #5 on: August 01, 2012, 09:58:33 PM »
Worked like a charm. Now I can just sit back and watch the pictures change with the seasons:

<div class="header">
<div id="wrapper">
<div id="slider-wrapper">        
<div id="slider" class="nivoSlider">
<img src="images/<#month>_header.jpg" alt="" />
<img src="images/<#month>_header2.jpg" alt=""/>
<img src="images/<#month>_header3.jpg" alt="" />
</div>
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA