#! #use CGI; # use Fcntl; #$query = new CGI; $document_root = "/var/www/vhosts/the-jacobs.org/httpdocs"; $photo_gallery_dir = "/var/www/vhosts/the-jacobs.org/httpdocs/diving/photo_gallery/"; $photo_gallery_href = "http://www.the-jacobs.org/diving/photo_gallery"; $diving_flag = ""; print <Diving Photo Gallery EOF open (INPUT, "$document_root/tank_menu\.shtml"); while () { print; } close INPUT; print <
$diving_flag Scuba Diving
Photo Gallery
$diving_flag

EOF @dir_listing = (); opendir (DIR, $photo_gallery_dir); while (defined ($_ = readdir DIR)) { chomp; next if m/^\.$/ or m/^\.\.$/ or m/^index.cgi$/; push (@dir_listing, $_); } foreach $the_folder (sort(@dir_listing)) { print "
  • $the_folder

    "; } print <
  • EOF open (INPUT, "$document_root/tank_menu_end\.shtml"); while () { print; } close INPUT; exit; $global_photos_to_display = 50; if ($global_starting gt "") { $global_ending = $global_starting + $global_photos_to_display - 1; } #print < #global_selection: '$global_selection'
    #global_starting: '$global_starting'
    #EOF # print "\n"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}

    "; } # $cgi_bin_dir = "/var/www/vhosts/maysville.org/cgi-bin"; if ($global_category eq "y") { $base_dir = "$DOCUMENT_ROOT/photo_gallery/youth"; $photo_gallery_dir = "/var/www/vhosts/maysville.org/httpdocs/photo_gallery/youth/$global_selection"; $photo_gallery_href = "http://www.maysville.org/photo_gallery/youth/$global_selection"; } elsif ($global_category eq "c") { $base_dir = "$DOCUMENT_ROOT/photo_gallery/congregation"; $photo_gallery_dir = "/var/www/vhosts/maysville.org/httpdocs/photo_gallery/congregation/$global_selection"; $photo_gallery_href = "http://www.maysville.org/photo_gallery/congregation/$global_selection"; } if ($global_selection eq "") { &Select_Photo_Gallery; &Display_Youth_Footer; exit; } open (FILE_IN, "$photo_gallery_dir/a_title.txt"); @the_title = ; close (FILE_IN); if ($#the_title == -1) { @the_title[0] = "$global_selection"; } &Display_Photo_Gallery ($the_title[0], 5); &Display_Youth_Footer; # --------------------------------------------------------------------------- sub Select_Photo_Gallery # --------------------------------------------------------------------------- { &Display_Header; if ($global_category eq "y") {$category_string = "Youth";} else {$category_string = "Congregation";} print <

    EOF open (DIR_IN, "ls $base_dir |"); @temp_directory = ; close (DIR_IN); foreach $pdir (@temp_directory) { $pname = $pdir; $pname =~ s/_/ /g; print <$pname

    EOF } # print < #EOF print <


    Maysville Home Page

    Maysville Youth Home Page
    EOF } # --------------------------------------------------------------------------- sub Display_Photo_Gallery # --------------------------------------------------------------------------- { my ($page_title, $column_count) = @_; open (DIR_IN, "ls $photo_gallery_dir |"); @temp_directory = ; close (DIR_IN); &Display_Header; print <
    $page_title

    EOF opendir (DIR, $photo_gallery_dir); while (defined ($_ = readdir DIR)) { chomp; if (rindex ($_, "_tn.") > -1) {push (@temp_thumbnails, $_);} } foreach $thumb (sort (@temp_thumbnails)) {push (@thumbnails, $thumb);} $td_count = 0; for $photo_index ($global_starting..$global_ending) { if ($photo_index <= $#thumbnails) { $photo_large = @thumbnails[$photo_index]; $photo_large =~ s/_tn\./\./; $suffix = rindex ($photo_large, "."); $photo_title = substr ($photo_large, 0, $suffix); print <
    $photo_title
    EOF $th_count += 1; if ($th_count == $column_count) { print "
    "; $th_count = 0; } } } $global_starting = $global_ending + 1; $global_ending = $global_starting + $global_photos_to_display - 1; if ($global_starting > $#thumbnails) { $global_starting = 0; } print <
    Maysville
    Home Page
    Maysville Youth
    Home Page
    View next
    $global_photos_to_display photos . . .

      EOF } # --------------------------------------------------------------------------- sub Display_Header # --------------------------------------------------------------------------- { print <Maysville Church of Christ - Photo Gallery EOF # # Display youth page format # if ($global_category eq "y") { &Display_Youth_Header; } elsif ($global_category eq "c") { print <

    EOF } } # --------------------------------------------------------------------------- sub Display_Youth_Header # --------------------------------------------------------------------------- { open (FILE_IN, "$DOCUMENT_ROOT/youth/page_border1.shtml") or die ("Cannot read $DOCUMENT_ROOT/youth/page_border1.shtml"); @temp_array = ; close (FILE_IN); foreach $temp_rec (@temp_array) {$temp_rec =~ s/Page Title/Youth Photo Gallery/;} foreach $file_line (@temp_array) { if (index ($file_line, "Youth Menu") > -1 && $global_page_title ne "Home Page") {&Youth_Header_Menus;} else {print $file_line;} } } # ------------------------------------------------------------------------------ sub Youth_Header_Menus # ------------------------------------------------------------------------------ { # open (FILE_IN, "$DOCUMENT_ROOT/youth/youth_menu.inc") # or die ("Cannot read $DOCUMENT_ROOT/youth/youth_menu.inc"); # @youth_menu = ; # close FILE_IN; # print "@youth_menu\n
    "; } # --------------------------------------------------------------------------- sub Display_Youth_Footer # --------------------------------------------------------------------------- { if ($global_category eq "y") { # # Display end format of youth page # open (FILE_IN, "$DOCUMENT_ROOT/youth/page_border2.shtml") or die ("Cannot read $DOCUMENT_ROOT/youth/page_border2.shtml"); @temp_array = ; close (FILE_IN); print @temp_array; } } #! #Creates a prettier index of a directory, especiallly #when the file names are as long as those in CMS_BODIES # # open (BUTTONS1, "/usr/local/apache/mayfair.org/images/buttons_1.htm"); $| = 1; use Cwd qw(chdir); chdir ("."); print < Perry Greene's Wednesday Night Class Notes EOF open (INPUT, "/usr/local/apache/jacobs.org/tank_menu\.shtml"); while () { print; } close INPUT; print <
    Wednesday Night Class Notes

    "Myth-Understandings of the Bible"
    with
    Perry Greene



    EOF opendir (DIR, "/usr/local/apache/jacobs.org/diving/photo_gallery/"); while (defined ($_ = readdir DIR)) { chomp; @data = stat ($_); # print "data available is @data\nwhole line is =$_=\n"; print "
  • Parent Directory\n" if m/^\.\.$/; next if m/^\.$/ or m/^\.\.$/ or m/^index.cgi$/; @_ = split; push @files, $_[0]; } foreach (sort @files) { print "
  • $_\n"; } print <
  • EOF open (INPUT, "/usr/local/apache/jacobs.org/tank_menu_end\.shtml"); while () { print; } close INPUT;