View Single Post
Old 2005-05-01, 04:56 PM   #3
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
dayrotate.pl
Code:
#!/usr/bin/perl

use File::Copy;

@weekdays = ('sunday.jpg','monday.jpg','tuesday.jpg','wednesday.jpg',
             'thursday.jpg','friday.jpg','saturday.jpg');

my ($sec,$min,$hour,$mday,$mon,$year,
          $wday,$yday,$isdst) = localtime time;

  copy($weekdays[$wday],'today.jpg');
  copy($weekdays[($wday==0?7:($wday-1))],'yesterday.jpg');
  copy($weekdays[($wday<1?($wday+6):($wday-2))],'twodaysago.jpg');
  copy($weekdays[($wday<2?($wday+5):($wday-3))],'threedaysago.jpg');
cron entry:
Code:
0 0 * * * cd /var/www/domain.com/images/;/usr/bin/perl /var/www/domain.com/images/dayrotate.pl > /dev/null
Your 'day' images will be sunday.jpg, monday.jpg, etc.

in your html, you refer to

today.jpg, yesterday.jpg, twodaysago.jpg and threedaysago.jpg
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote