#!d:/perl/bin/perl -w ######!/usr/bin/perl -w $yeardir=$ENV{'QUERY_STRING'}; use HTMLTMPL; # Create the template object and load it. $templ = new HTMLTMPL; $templ->src('d:/wwwroot/calvarybaptist/cgi-bin/sermon/sermons.html'); #get the list of audio files from the sermons directory #for this to work correctly the files should be names xxxxxxsP.ram # replace the xxxxxx with the date ie 100399 # replace the P with G for Pastor Gerhardt or V for Guest Speaker # replace the s with M for morning sermon, e for evening sermon or w for midweek # ex 100399MG would be the sermon for October 3, 1999 Morning's Sermon by Pastor Gerhardt # if there is a technical problem with the sermon add a t or T to the end ie # ex 100399MGt #opendir(DIR, "/webpages/calvarybaptist/sermons/"); #opendir(DIR, "/home/rmserver/Content/"); #opendir(DIR, "d:/Sermons/"); opendir(DIR, "d:/wwwroot/CalvaryBaptist/Sermons/".$yeardir); @ramFiles = sort(grep(/\.wmv$/,readdir(DIR))); #@ramFiles = sort(grep(/\.rm$/,readdir(DIR))); #@ramFiles = sort(grep(/\.ram$/,readdir(DIR))); #@ramFiles = sort(grep(/\.HTML$/,readdir(DIR))); closedir(DIR); foreach $i (@ramFiles) { #MMDDYYSD #MM = Month 0-1 (2) #DD = Day 2-3 (2) #YY = Year 4-5 (2) #S = Sermon (1) # M = Morning # e = Evening # w = Wednesday # s = Sunday School # x = Special #D = Who delivered # G = Gerhardt # H = Halverson # B = Brown # V = Guest # N = None $month=substr($i,0,2); $day=substr($i,2,2); $year=substr($i,4,2); if ((substr($i,6,1) eq "m") or (substr($i,6,1) eq "M")){ $whichsermon="Morning Sermon"; } elsif ((substr($i,6,1) eq "e") or (substr($i,6,1) eq "E")){ $whichsermon="Evening Sermon"; } elsif ((substr($i,6,1) eq "w") or (substr($i,6,1) eq "W")){ $whichsermon="Midweek Sermon"; } elsif ((substr($i,6,1) eq "s") or (substr($i,6,1) eq "S")){ $whichsermon="Sunday School"; } elsif ((substr($i,6,1) eq "x") or (substr($i,6,1) eq "X")){ $whichsermon="Special"; } else { $whichsermon="ERROR Determing Sermon."; } # Determin who delivered the sermon #if ((substr($i,7,1) eq "g") or (substr($i,7,1) eq "G")){ # $speaker="Pastor Gerhardt"; #} #elsif ((substr($i,7,1) eq "b") or (substr($i,7,1) eq "B")){ # $speaker="Asst. Pastor Brown"; #} #elsif ((substr($i,7,1) eq "h") or (substr($i,7,1) eq "H")){ # $speaker="Pastor Halverson"; #} #elsif ((substr($i,7,1) eq "v") or (substr($i,7,1) eq "V")){ # $speaker="Guest Speaker"; #} #elsif ((substr($i,7,1) eq "n") or (substr($i,7,1) eq "N")){ # $speaker=""; #} #else { # $speaker="ERROR code for speaker is incorrect." #} #Check to see of there was a technical problem with the sermon. # if ((substr($i,8,1) eq "T") or (substr($i,8,1) eq "t")){ # $speaker="Technical Problems"; # } $desc=substr($i,8,length($i)-12); #.' '.(length($i)).' '.$i.'!'; $filename=$yeardir."/".$i; $test=$month.'/'.$day.'/'.$year.' '.$whichsermon.', '.$desc.' '; # $templ->filename("$i", 'x_details'); $templ->filename("$filename", 'x_details'); $templ->desc("$test", 'x_details'); } # Send the completed html document to the web server. $templ->output('Content-Type: text/html');