#!/usr/bin/perl -wT
use strict;
use CGI qw/:standard :html3/;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
my $ROOT = "/path/to/files";
# figure out where to go
if (param()){ ### Houston we have input!!! ###
if (param('preview')){ ### decide which section to preview
my $section = param('preview');
create_links($section);
}elsif (param('closeup')){ ### show closeup image ###
my $section = param('closeup');
my $image = param('image');
my @closeup_info = ($section,$image);
show_closeup(@closeup_info);
}else{
die "I'm sorry, but that is not a valid selection.\n";
}
}else{ ### script being called for first time -- show portfolio sections ###
print_header();
portfolio_main();
the_end();
}
#-------------------------------SUBROUTINES ---------------------------------------------------------------#
# portfolio main displays the different portfolio section choices
sub portfolio_main{
### PRINT PORTFOLIO BANNER ###
print div("");
print "\n";
my $class = "class = \"preview\"";
print_nav();
### PRINT MAIN PORTFOLIO SECTION PREVIEW IMAGES ###
print div(" ");
print "\n";
$id++;
if ($id > 4){
$class++;
$id = 1;
}
}
the_end();
}
sub show_closeup{ ### receives $section and $image ###
my $section = shift;
my $image = shift;
my $link_path = "/path/to/images/$section/";
print_header();
print_banner($section);
print div("");
print "\n";
the_end();
}
sub print_nav {
my $image_path = "/path/to/images";
print div({-class => 'buta'}, ""),"\n";
print div({-class => 'buts'}, ""),"\n";
print div({-class => 'butp'}, ""),"\n";
print div({-class => 'butmid'},""),"\n";
print div({-class => 'butr'}, ""),"\n";
print div({-class => 'butm'}, ""),"\n";
print div({-class => 'buty'}, ""),"\n";
}
sub print_header {
print header(),"\n",
start_html( -title => 'some site',
-style => {-src => 'http://www.site.com/site.css'}),"\n",
}
sub print_banner {
my $section = shift;
print div("");
print "\n";
}
sub print_footer{
print div("footer info"),"\n";
}
sub the_end{
# print_footer();
print end_html;
}