#!/usr/local/bin/perl -- -*-perl-*-
# -----------------------------------------------------------------
# tour.cgi |
# by Peter Edstrom |
# pedstrom@d.umn.edu |
# http://www.d.umn.edu/~pedstrom |
# Last modified 12/14/98 |
# -----------------------------------------------------------------
# Generates a page for whatever image you like |
# -----------------------------------------------------------------
use ::web::murphy::includes::htmlio ();
use ::web::murphy::includes::readdata ();
%WEB = &htmlio::get_input;
$web_http = &readdata::get("web");
@section = &readdata::get_array("tour");
# --------------------------------- Program Flow ------------------
# -----------------------------------------------------------------
&htmlio::header;
&solve_next;
&solve_prev;
&print_frame;
exit;
# --------------------------------- Functions ---------------------
# -----------------------------------------------------------------
sub solve_prev {
$prev_image = $WEB{'image'} - 1;
$prev_section = $WEB{'section'};
$i=0;
foreach $txt (@section) {
chomp $txt;
($sect, $total) = split(/::/,$txt,2);
if (($sect eq $WEB{'section'}) and ($prev_image <= 0)) {
$prev_image = @section[$i-1];
($trash, $prev_image) = split(/::/,$prev_image,2);
$prev_section = @section[$i-1];
($prev_section, $trash) = split(/::/,$prev_section,2);
}
$i++;
}
}
sub solve_next {
$next_image = $WEB{'image'} + 1;
$next_section = $WEB{'section'};
$i=0;
foreach $txt (@section) {
chomp $txt;
($sect, $total) = split(/::/,$txt,2);
if (($sect eq $WEB{'section'}) and ($next_image > $total)) {
$next_image = 1;
$next_section = @section[$i+1];
if ($next_section eq "") {
$next_section = @section[0]; }
($next_section, $trash) = split(/::/,$next_section,2);
}
$i++;
}
}
sub print_frame {
&htmlio::get_virtual("../virtual/tour_top.html");
print <<__FRAME__;