<% $name %> Pictures

% if (defined $pictures->{$prev_year} && defined $pictures->{$prev_year}->{$prev_season}) { % } else { % } % if (defined $pictures->{$next_year} && defined $pictures->{$next_year}->{$next_season}) { % } else { % }
Main page Main picture page <% $name %> Pictures IndexPrevious PicturesPrevious PicturesNext PicturesNext Pictures

<% $season %> <% $year %>

% my $p=0; % for (my $r=0; $r<$rows; $r++) { % my $w = int(100/$columns) . "%"; % for (my $c=0; $c<$columns; $c++) { % my $pic = $pictures->{$year}->{$season}->[$p++]; % my ($y,$mo,$d) = ($pic =~ /(\d\d\d\d)_(\d\d)_(\d\d)?/); % my $date = int($mo) . "/" . ($d>0 ? int($d) . "/" : "") . substr($y,2,4); % if (defined $pic) { % } % } % }
>
<% $date %>

<%init> my $pictures = $m->comp($name . '/picture_list'); if (!defined $year || !defined $season) { YEAR: for (my $y=2005; $y>1994; $y--) { foreach my $s (reverse ('Spring','Summer','Fall','Winter')) { if (defined $pictures->{$y} && defined $pictures->{$y}->{$s}) { $year = $y; $season = $s; last YEAR; } } } } my $background = ($name eq 'Family') ? 'background' : $year . '_' . $season . '_bkg'; my $prev_year = ($season eq 'Spring') ? $year-1 : $year; my $next_year = ($season eq 'Winter') ? $year+1 : $year; my $prev_season = ($season eq 'Spring') ? 'Winter' : ($season eq 'Summer') ? 'Spring' : ($season eq 'Fall') ? 'Summer' : ($season eq 'Winter') ? 'Fall' : undef; my $next_season = ($season eq 'Spring') ? 'Summer' : ($season eq 'Summer') ? 'Fall' : ($season eq 'Fall') ? 'Winter' : ($season eq 'Winter') ? 'Spring' : undef; if (!defined $pictures->{$year} || !defined $pictures->{$year}->{$season}) { die "NO PICTURES DEFINED\n"; } my $num_pics = scalar(@{$pictures->{$year}->{$season}}); my ($columns,$rows) = ($num_pics==1) ? (1,1) : ($num_pics==2) ? (2,1) : ($num_pics==3) ? (2,2) : ($num_pics==4) ? (2,2) : ($num_pics==5) ? (3,2) : ($num_pics==6) ? (3,2) : ($num_pics==7) ? (4,2) : ($num_pics==8) ? (4,2) : ($num_pics==9) ? (3,3) : (4,3); <%args> $year => undef $season => undef $name => 'Anika'