home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Fujitsu- / GJ / americas / makesubsite < prev    next >
Encoding:
Text File  |  2017-09-21  |  12.6 KB  |  283 lines

  1. #!/usr/local/bin/perl
  2. #
  3. use Guppy;
  4. $Pwhere = "http://japan.park.org/Japan/Fujitsu/GJ";
  5. $Iwhere = "../../i";
  6. $path = `pwd`;
  7. chop $path;
  8. unless ($Pwhere) {
  9.     print("The pdocs path has not been established. Please enter its value: ");
  10.     $Pwhere = <STDIN>;
  11.     chop $Pwhere;
  12. }
  13. unless ($Iwhere) {
  14.     print("The idocs path has not been established. Please enter its value: ");
  15.     $Iwhere = <STDIN>;
  16.     chop $Iwhere;
  17. }
  18. print("Enter File Name of List: ");
  19. $InputFile = <STDIN>;
  20. chop $InputFile;
  21. if (-e "$path/$InputFile") {
  22.     $data = &Guppy::ReadVarAsText(&Guppy::ReadFile("$path/$InputFile")) || die ("Can't open file $InputFile for read.\n");
  23. } else {
  24.     die ("File $path/$InputFile does not exist.\n");
  25. }
  26. print("Running with pdocs as $Pwhere\n\t and idocs as $Iwhere\n");
  27. print("\tReading Input File $InputFile\n\n");
  28. # print("\t\t\tIs this correct? (y/n) ");
  29. # $ans = <STDIN>;
  30.  
  31. # unless ($ans =~ /y/) {
  32. #    die ("\tOkay, then change it, buster!\n\n");
  33. # }
  34.  
  35. print "Working...\n";
  36.  
  37. sub NAVLINE {
  38.     my $now = shift;
  39.     $Itemp = $Iwhere;
  40. #    $Itemp = "../$Iwhere" if ($now eq "pix");
  41.     my $pageURL = $MachineURL.$StateURL;
  42.     $topP   = &Guppy::HtmlTarget("pix");
  43.     $topT   = &Guppy::HtmlTarget('_top');
  44.     my $out;
  45.     $out = "<TABLE BORDER=0 WIDTH=60%>\n";
  46.     unless ($now eq "pix" || $now eq "anthro")  {
  47.         $out .= "<TR>\n<TD ALIGN=CENTER><img src=\"$Itemp/java/classes/images/lowerfiller.gif\" border=0 width=95 height=26></TD></TR>\n";
  48.     }
  49.     $out .= "<TR><TD ALIGN=CENTER VALIGN=TOP><TABLE BORDER=0><TR>\n";
  50.     if ($now eq "pix" || $now eq "anthro") {
  51.         $out .= "<TD ALIGN=CENTER VALIGN=TOP WIDTH=50%>\n";
  52.         $out .= "<applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  53.         $out .= "<param name=image value = \"sekr\">\n";
  54.         $out .= "<param name=txt value = \"sekrtxt\">\n";
  55.         $out .= "<param name=bakg value = \"lowerfiller\">\n";
  56.         $out .= "<param name=xmin value = \"36\">\n";
  57.         $out .= "<param name=xmax value = \"72\">\n";
  58.         $out .= "<param name=ymin value = \"5\">\n";
  59.         $out .= "<param name=ymax value = \"36\">\n";
  60.         $out .= "<param name=xposimage value = \"0\">\n";
  61.         $out .= "<param name=xpostxt value = \"0\">\n";
  62.         $out .= "<param name=URL value = \"$Pwhere/americas/$DirectoryName/sekino.html\">\n";
  63.         $out .= "<param name=target value=\"_self\">\n";
  64.         $out .= "<A HREF = \"$Pwhere/americas/$DirectoryName/sekino.html\">\n";
  65.         $out .= "<img src=\"$Itemp/java/classes/images/sekr.gif\" border=0 width=95 height=26><br>\n";
  66.         $out .= "<img src=\"$Itemp/java/classes/images/sekrtxt.gif\" border=0 width=95 height=28></A></applet>\n";
  67.         $out .= "<P></TD>\n";
  68.     }
  69.     if (($AnthroReport) && $now ne "anthro") {
  70.         $out .= "<TD ALIGN=CENTER VALIGN=TOP WIDTH=50%>\n";
  71.         $out .= "<center><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  72.         $out .= "<param name=image value = \"anthro\">\n";
  73.         $out .= "<param name=txt value = \"anthrotxt\">\n";
  74.         $out .= "<param name=bakg value = \"lowerfiller\">\n";
  75.         $out .= "<param name=xmin value = \"36\">\n";
  76.         $out .= "<param name=xmax value = \"72\">\n";
  77.         $out .= "<param name=ymin value = \"5\">\n";
  78.         $out .= "<param name=ymax value = \"36\">\n";
  79.         $out .= "<param name=xposimage value = \"0\">\n";
  80.         $out .= "<param name=xpostxt value = \"0\">\n";
  81.         $out .= "<param name=URL value = \"$Pwhere/americas/$DirectoryName/anthro.html\">\n";
  82.         $out .= "<param name=target value=\"_self\">\n";
  83.         $out .= "<A HREF = \"$Pwhere/americas/$DirectoryName/anthro.html\">\n";
  84.         $out .= "<img src=\"$Itemp/java/classes/images/anthro.gif\" border=0 width=95 height=26><br>\n";
  85.         $out .= "<img src=\"$Itemp/java/classes/images/anthrotxt.gif\" border=0 width=95 height=28></A></applet>\n";
  86.         $out .= "<P></TD>\n";
  87.     }
  88.     $out .= "</TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>\n<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR>\n";
  89.     $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  90.     $out .= "<param name=image value = \"intro\">\n";
  91.     $out .= "<param name=txt value = \"introtxt\">\n";
  92.     $out .= "<param name=bakg value = \"lowerfiller\">\n";
  93.     $out .= "<param name=xmin value = \"36\">\n";
  94.     $out .= "<param name=xmax value = \"72\">\n";
  95.     $out .= "<param name=ymin value = \"5\">\n";
  96.     $out .= "<param name=ymax value = \"36\">\n";
  97.     $out .= "<param name=xposimage value = \"0\">\n";
  98.     $out .= "<param name=xpostxt value = \"0\">\n";
  99.     $out .= "<param name=URL value = \"$Pwhere/intro.html\">\n";
  100.     $out .= "<param name=target value=\"_top\">\n";
  101.     $out .= "<A HREF = \"$Pwhere/intro.html\"  TARGET=\"_top\">\n";
  102.     $out .= "<img src=\"$Itemp/java/classes/images/intro.gif\" border=0 width=95 height=26><br>\n";
  103.     $out .= "<img src=\"$Itemp/java/classes/images/introtxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
  104.     
  105.     
  106.     $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  107.     $out .= "<param name=image value = \"home\">\n";
  108.     $out .= "<param name=txt value = \"hometxt\">\n";
  109.     $out .= "<param name=bakg value = \"lowerfiller\">\n";
  110.     $out .= "<param name=xmin value = \"36\">\n";
  111.     $out .= "<param name=xmax value = \"72\">\n";
  112.     $out .= "<param name=ymin value = \"5\">\n";
  113.     $out .= "<param name=ymax value = \"36\">\n";
  114.     $out .= "<param name=xposimage value = \"0\">\n";
  115.     $out .= "<param name=xpostxt value = \"0\">\n";
  116.     $out .= "<param name=URL value = \"$Pwhere/home.html\">\n";
  117.     $out .= "<param name=target value=\"_top\">\n";
  118.     $out .= "<A HREF = \"$Pwhere/home.html\"  TARGET=\"_top\">\n";
  119.     $out .= "<img src=\"$Itemp/java/classes/images/home.gif\" border=0 width=95 height=26><br>\n";
  120.     $out .= "<img src=\"$Itemp/java/classes/images/hometxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
  121.     
  122.  
  123.     $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  124.     $out .= "<param name=image value = \"sek\">\n";
  125.     $out .= "<param name=txt value = \"sektxt\">\n";
  126.     $out .= "<param name=bakg value = \"lowerfiller\">\n";
  127.     $out .= "<param name=xmin value = \"36\">\n";
  128.     $out .= "<param name=xmax value = \"72\">\n";
  129.     $out .= "<param name=ymin value = \"5\">\n";
  130.     $out .= "<param name=ymax value = \"36\">\n";
  131.     $out .= "<param name=xposimage value = \"0\">\n";
  132.     $out .= "<param name=xpostxt value = \"0\">\n";
  133.     $out .= "<param name=URL value = \"$Pwhere/sekino/\">\n";
  134.     $out .= "<param name=target value=\"_top\">\n";
  135.     $out .= "<A HREF = \"$Pwhere/sekino/\"  TARGET=\"_top\">\n";
  136.     $out .= "<img src=\"$Itemp/java/classes/images/sek.gif\" border=0 width=95 height=26><br>\n";
  137.     $out .= "<img src=\"$Itemp/java/classes/images/sektxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
  138.     
  139.  
  140.     $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  141.     $out .= "<param name=image value = \"amer\">\n";
  142.     $out .= "<param name=txt value = \"amertxt\">\n";
  143.     $out .= "<param name=bakg value = \"lowerfiller\">\n";
  144.     $out .= "<param name=xmin value = \"36\">\n";
  145.     $out .= "<param name=xmax value = \"72\">\n";
  146.     $out .= "<param name=ymin value = \"5\">\n";
  147.     $out .= "<param name=ymax value = \"36\">\n";
  148.     $out .= "<param name=xposimage value = \"0\">\n";
  149.     $out .= "<param name=xpostxt value = \"0\">\n";
  150.     $out .= "<param name=URL value = \"$Pwhere/americas/\">\n";
  151.     $out .= "<param name=target value=\"_top\">\n";
  152.     $out .= "<A HREF = \"$Pwhere/americas/\"  TARGET=\"_top\">\n";
  153.     $out .= "<img src=\"$Itemp/java/classes/images/amer.gif\" border=0 width=95 height=26><br>\n";
  154.     $out .= "<img src=\"$Itemp/java/classes/images/amertxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
  155.  
  156.  
  157.     $out .= "<TD ALIGN=CENTER><applet codebase = \"$Itemp/java/classes/\" code=\"navIcon.class\" width=95 height=54>\n";
  158.     $out .= "<param name=image value = \"human\">\n";
  159.     $out .= "<param name=txt value = \"humantxt\">\n";
  160.     $out .= "<param name=bakg value = \"lowerfiller\">\n";
  161.     $out .= "<param name=xmin value = \"36\">\n";
  162.     $out .= "<param name=xmax value = \"72\">\n";
  163.     $out .= "<param name=ymin value = \"5\">\n";
  164.     $out .= "<param name=ymax value = \"36\">\n";
  165.     $out .= "<param name=xposimage value = \"0\">\n";
  166.     $out .= "<param name=xpostxt value = \"0\">\n";
  167.     $out .= "<param name=URL value = \"$Pwhere/hmap/\">\n";
  168.     $out .= "<param name=target value=\"_top\">\n";
  169.     $out .= "<A HREF = \"$Pwhere/hmap/\"  TARGET=\"_top\">\n";
  170.     $out .= "<img src=\"$Itemp/java/classes/images/human.gif\" border=0 width=95 height=26><br>\n";
  171.     $out .= "<img src=\"$Itemp/java/classes/images/humantxt.gif\" border=0 width=95 height=28></A></applet></TD>\n";
  172.      $out .= "</TR><TR>\n";
  173.      $out .= "<TD ALIGN=CENTER><img src=\"$Itemp/java/classes/images/lowerfiller.gif\" border=0 width=95 height=26></TD>\n";
  174.     $out .= "</TR></TABLE></TD></TR></TABLE>\n";
  175.     $out;
  176. }
  177.  
  178. sub MakeHeader {
  179.     my $title = shift;
  180.     my $out;
  181.     $out = "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n";
  182.     $out .= "<BODY BGCOLOR=\"#000000\" TEXT=\"#FFFFFF\" LINK=\"#BB0000\" ALINK=\"#000000\" VLINK=\"#925656\">\n\n";
  183.     $out;
  184. }
  185.  
  186. sub MakeFooter {
  187.     my $type = shift;
  188.     my $out;
  189.     $out = &NAVLINE($type);
  190.     $out .= "\n\n</BODY></HTML>";
  191.     $out;
  192. }
  193.  
  194. foreach $c (@{$data}) {
  195.     $LocationName         = $c->{'LocationName'};
  196.     $DirectoryName        = $c->{'DirectoryName'};
  197.     $SekinoReport        = $c->{'SekinoReport'};
  198.     $AnthroReport        = $c->{'AnthroReport'};
  199.     $DescriptionFile     = $c->{'DescriptionFile'};
  200.     $NumberOfPictures    = $c->{'NumberOfPictures'};
  201.     
  202.     print "Working on $DirectoryName:\n";
  203.  
  204.     #  MAKE THE CORRECTLY NAMED DIRECTORY
  205.  
  206.     if (-e "$path/$DirectoryName") {
  207.         die ("Error: the directory $DirectoryName already exists.\n");
  208.     } else {
  209.         mkdir ("$path/$DirectoryName", 0754) || die ("Can't make directory $DirectoryName.\n");
  210.     }
  211.  
  212.     #  READ TEXT SEKINO'S REPORT AND MAKE THE HTML VERSION
  213.  
  214.     $FileContents = &Guppy::ReadFile("$path/textdata/$SekinoReport") || die ("Error: not reading Sekino's Report File $SekinoReport.\n");
  215.     $header = &MakeHeader("$LocationName");
  216.     $footer = &MakeFooter('report');
  217.     $FileContents = "$header$FileContents\n\n$footer";
  218.     open (OUTPUT, ">$path/$DirectoryName/sekino.html") || die ("Error: can't open sekino.html in $DirectoryName.\n");
  219.     print OUTPUT ("$FileContents");
  220.     close OUTPUT;
  221.  
  222.     #  READ TEXT ANTHRO REPORT AND MAKE THE HTML VERSION
  223.  
  224.     $FileContents = &Guppy::ReadFile("$path/textdata/$AnthroReport") || die ("Error: not reading Sekino's Report File $SekinoReport.\n");
  225.     $header = &MakeHeader("$LocationName");
  226.     $footer = &MakeFooter('anthro');
  227.     $FileContents = "$header\n\n$FileContents\n\n$footer";
  228.     open (OUTPUT, ">$path/$DirectoryName/anthro.html") || die ("Error: can't open anthro.html in $DirectoryName.\n");
  229.     print OUTPUT ("$FileContents");
  230.     close OUTPUT;
  231.  
  232.     #  MAKE FRAMESET PAGES
  233.  
  234.     open (OUTPUT, ">$path/$DirectoryName/index.html") || die ("Error: can't open index.html (frameset page) in $DirectoryName.\n");
  235.     print OUTPUT ("<HTML>\n<HEAD><TITLE>$LocationName</TITLE></HEAD>\n<FRAMESET rows=\"*,120\">\n<FRAME NAME=\"pix\" MARGINWIDTH=0 MARGINHEIGHT=0 SRC=\"sekino.html\">\n");
  236.     print OUTPUT ("<FRAME NAME=\"list\" MARGINWIDTH=0 MARGINHEIGHT=0 noresize SRC=\"filmstrip.html\">\n");
  237.     print OUTPUT ("</FRAMESET></HTML>");
  238.     close OUTPUT;
  239.  
  240.     #  MAKE FILMSTIP PAGES
  241.  
  242.     $header = &MakeHeader("$LocationName");
  243.     open (OUTPUT, ">$path/$DirectoryName/filmstrip.html") || die ("Error: can't open filmstrip.html in $DirectoryName.\n");
  244.     print OUTPUT ("$header");
  245.     print OUTPUT ("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR>\n");
  246.     print OUTPUT ("<TD VALIGN=TOP><img src=\"$Iwhere/americas/$DirectoryName/icons/title.gif\" border=0 alt=\"\" width=108 height=100></TD>\n");
  247.     $count = 1;
  248.     while ($count<=$NumberOfPictures) {
  249.         print OUTPUT ("<TD VALIGN=TOP><a href=\"$count.html\" target=\"pix\"><img BORDER=0 ALIGN=LEFT HSPACE=0 src=\"$Iwhere/americas/$DirectoryName/icons/$count.gif\" alt=\"\" width=108 height=100></a></TD>\n");
  250.         $count++;
  251.     }
  252.     print OUTPUT ("<TD NOWRAP>more REPORTS....</TD>\n");
  253.     print OUTPUT ("</TR></TABLE>\n<\BODY><\HTML>");
  254.     close OUTPUT;
  255.  
  256.     #  MAKE EACH PICTURE PAGE
  257.  
  258.     $header = &MakeHeader("$LocationName");
  259.     $footer = &MakeFooter('pix');
  260.     open (INPUT, "$path/textdata/$DescriptionFile") || die ("Can't open file $DescriptionFile for read.\n");
  261.     $line = <INPUT>;
  262.     @lines = split("\n", $line);
  263.     mkdir ("$path/$DirectoryName/pix", 0754) || die ("Can't make directory $DirectoryName/pix.\n");
  264.     $count = 1;
  265.     while ($count<=$NumberOfPictures) {
  266.         open (OUTPUT, ">$path/$DirectoryName/$count.html") || die ("Error: can't open picture page $count.html for write.\n");
  267.         print OUTPUT ("$header");
  268.         print OUTPUT ("<CENTER><P><BR>\n");
  269.         print OUTPUT ("$LocationName\n<TABLE BORDER=0 HEIGHT=70% WIDTH=384><TR><TD ALIGN=CENTER>\n");
  270.         print OUTPUT ("<IMG BORDER=0 SRC=\"$Iwhere/americas/$DirectoryName/$count.jpeg\"><BR>\n");
  271.         print OUTPUT ("<FONT SIZE=-1>$lines[$count-1]</FONT>\n");
  272.         print OUTPUT ("</TD></TR></TABLE>\n");
  273.         print OUTPUT ("$footer");
  274.         close OUTPUT;
  275.         $count++;
  276.     }
  277.     close INPUT;
  278.  
  279. }
  280.  
  281. print ("No Errors Encountered. Subsite Complete.\n");
  282. exit(0);
  283.