#!/usr/bin/perl #------------------------------------------------------------------ # required modules #------------------------------------------------------------------ use strict; use warnings; use CGI; #------------------------------------------------------------------ # the global constants #------------------------------------------------------------------ my $TRUE = -1; my $FALSE = 0; #------------------------------------------------------------------ # the global objects #------------------------------------------------------------------ my $g_oCGI = new CGI; #------------------------------------------------------------------ # expected form variables #------------------------------------------------------------------ my $lImageID = getRequestString( 'image_id', '0' ); my $sAction = getRequestString( 'action', 'view' ); #------------------------------------------------------------------ # the gallery images #------------------------------------------------------------------ my @g_aGallery = ( #============================================================== # Image 1 #============================================================== { Caption => q{ Legolas (Orlando Bloom) and Aragorn (Viggo Mortensen) escort Gandalf (Ian McKellen) to the stables of Edoras in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 2 #============================================================== { Caption => q{ (left) Legolas (Orlando Bloom) and Aragorn (Viggo Mortensen) brace themselves for a dangerous confrontation in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 3 #============================================================== { Caption => q{ Gandalf (Ian McKellen) is determined that evil will not prevail in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 4 #============================================================== { Caption => q{ Frodo (Elijah Wood) makes his way through Minas Morgul in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 5 #============================================================== { Caption => q{ Arwen (Liv Tyler) must decide between living an immortal life or staying with Aragorn for the final struggle in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 6 #============================================================== { Caption => q{ Gimli (John Rhys-Davies) stands firmly by Aragorn's side in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 7 #============================================================== { Caption => q{ Sam (Sean Astin) uses Galadriel's gift to light the way in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 8 #============================================================== { Caption => q{ Eomer (Karl Urban) heads up a contingency of Rohan soldiers in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 9 #============================================================== { Caption => q{ Denethor, the Steward of Gondor, (John Noble) rules over Minas Tirith in the absence of the true king in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 10 #============================================================== { Caption => q{ Merry (Dominic Monoghan) will be pulled into the thick of battle in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 11 #============================================================== { Caption => q{ Pippin (Billy Boyd) must make life altering decisions in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 12 #============================================================== { Caption => q{ Aragorn (Viggo Mortensen) knows he must face his ultimate test of courage in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 13 #============================================================== { Caption => q{ (left) Elrond (Hugo Weaving) comforts his daughter Arwen (Liv Tyler) in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 14 #============================================================== { Caption => q{ Legolas (Orlando Bloom) reassures Aragorn (Viggo Mortensen) that he will triumph in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 15 #============================================================== { Caption => q{ Theoden (Bernard Hill) rallies his Rohan soldiers to battle in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 16 #============================================================== { Caption => q{ Gondorian and Rohan soldiers will need to unite to save Middle-earth in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 17 #============================================================== { Caption => q{ Peter Jackson give direction at Edoras in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 18 #============================================================== { Caption => q{ (left) Aragorn (Viggo Mortensen) comforts Eowyn (Miranda Otto) in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 19 #============================================================== { Caption => q{ Frodo (Elijah Wood) is determined to finish his quest in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 20 #============================================================== { Caption => q{ To please his father Denethor, Faramir (David Wenham) valiantly defends Gondor in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 21 #============================================================== { Caption => q{ Arwen (Liv Tyler) knows she may never see Aragorn (Viggo Mortensen) again in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 22 #============================================================== { Caption => q{ Peter Jackson (left) reviews an upcoming scene with Viggo Mortensen (Aragorn) in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 23 #============================================================== { Caption => q{ Aragorn (Viggo Mortensen) readies to face Sauron's forces of evil in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 24 #============================================================== { Caption => q{ (right) Legolas (Orlando Bloom) joins with Rohan warriors to fight against Sauron in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 25 #============================================================== { Caption => q{ Peter Jackson (left) demonstrates to Sean Astin (Sam) in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } }, #============================================================== # Image 26 #============================================================== { Caption => q{ Peter Jackson takes charge in New Line Cinema's epic adventure, The Lord of the Rings: The Return of the King. }, ImageName => q{ } } ); #------------------------------------------------------------------ # format the image send form #------------------------------------------------------------------ sub formatImageSendForm { my $lImageID = shift; my $sTemplate =<<_HTML_EOF_;
_HTML_EOF_ return $sTemplate; } #------------------------------------------------------------------ # format the image sent #------------------------------------------------------------------ sub formatImageSent { my $lImageID = shift; my $lNextImageID = $lImageID + 1; my $lPrevImageID = $lImageID - 1; my $sImage = $g_aGallery[ $lImageID ]{ "Caption" }; my $sCaption = "Thank you.
$sCaption
![]()
$sCaption
_HTML_EOF_ return $sTemplate; } #------------------------------------------------------------------ # format the image #------------------------------------------------------------------ sub formatGalleryImage { my $lImageID = shift; my $sMode = shift; my $sCaption = ''; if( $sMode eq 'send' ) { $sCaption = formatImageSendForm( $lImageID ); } elsif( $sMode eq 'sent' ) { $sCaption = formatImageSent( $lImageID ); } else { $sCaption = formatImageView( $lImageID ); } my $sTemplate =<<_HTML_EOF_;![]() |
$sCaption |