else { $row = qq(
##
#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use CGI;
my $q = new CGI;
my $status = $q->param('status');
my $album = $q->param('album') ;
my $page = $q->param('page') ;
my $img = $q->param('pic') ;
my $user = $q->param('user') ;
my @html;
my $row;
my $src;
my $pic;
my $html;
my $viewersrc = "http://eoinmurphy00.netfirms.com/albums/$album/$img";
my $nextpage_html = qq();
if ($status eq "viewall"){
$html = viewall($page);
}
elsif ($status eq "viewer"){
$html = viewer($viewersrc, $user);
}
print qq(Content-type: text/html\n
$html);
sub viewall{
my $pic;
my $dir = "../www/albums/$album";
my( $page )= @_;
if ($page == undef)
{$page=0;}
else
{}
opendir DIR, "$dir" or die $!;
my @images= grep /\.jpg/, readdir DIR;
closedir DIR;
if ($page == "0"){
my $nextpage = "1";
my $ttlcounter = "0";
my $tmpcounter = "0";
foreach $pic (@images)
{
$src = "http://eoinmurphy00.netfirms.com/albums/$album/$pic";
if ($ttlcounter <= "24")
{
if ($tmpcounter eq "3")
{
$tmpcounter = "0";
$row = qq(
\

\
\ );
push @html, $row;
$tmpcounter++;
$ttlcounter++;
}
else
{
$row = qq(\

\
\ );
push @html, $row;
$tmpcounter++;
$ttlcounter++;
}
}
}
else
{
$nextpage_html = qq(Next page);
}
}
elsif($page eq "1"){
my $nextpage = "2";
my $ttlcounter = "0";
my $tmpcounter = "0";
my $counter = "0";
my $img;
my @images;
for ($counter = "25", $counter =< "48", $counter++)
{
$img = "img$counter.jpg";
@images = push($img);
}
foreach $pic (@images)
{
$src = "http://eoinmurphy00.netfirms.com/albums/$album/$pic";
if ($ttlcounter =< "24")
{
if ($tmpcounter == "3")
{
$tmpcounter = "0";
$row = qq(
\

\
\ );
push @html, $row;
$tmpcounter++;
$ttlcounter++;
}
else
{
$row = qq(\

\
\ );
push @html, $row;
$tmpcounter++;
$ttlcounter++;
}
}
}
else
{
$nextpage_html = qq(Next page);
}
my $album_html = qq(
Apres Bonne Anse Plage
);
return $album_html
}
sub viewer{
my( $src, $user ) = @_;
my @splitsrc = split(/\//, $src);
my $currentpic = pop(@splitsrc);
my @imgnmbr = ($currentpic =~ /\d+/g);
my $nextimgnmbr = $imgnmbr[0];
my $previmgnmbr = $imgnmbr[0];
$nextimgnmbr++;
$previmgnmbr--;
my $nextpic = "pic$nextimgnmbr.jpg";
my $prevpic = "pic$previmgnmbr.jpg";
my $next_html = "http://eoinmurphy00.netfirms.com/cgi-bin/albums.cgi?status=viewer&album=$album&pic=$nextpic&user=$user";
my $previous_html = "http://eoinmurphy00.netfirms.com/cgi-bin/albums.cgi?status=viewer&album=$album&pic=$prevpic&user=$user";
my $viewer_html = qq(
Apres Bonne Anse Plage
);
return $viewer_html
}