#! /usr/bin/perl -w
#
########################################
#
# displays prayer page for DTN site
# written by benjamin ramey
# bsr@rameydesign.net
# april, 2004
#
########################################
$data_file = "./data/prayer_data.txt";
print "Content-type: text/html\n\n";
&Print_Top_HTML;
&Carters_Min_Cal;
&Email_Updates;
&Prayer_Letters;
&Print_Bottom_HTML;
################################################################################################################################################
# SUB ROUTINES FOR DYNAMIC HTML
################################################################################################################################################
sub Carters_Min_Cal
{
my $travel_data = './data/travel_data.txt';
my $in_section = 0;
my $moment_counter = 0;
my $cur_date = 0;
print <<"HTML";
HTML
opendir( PL_DIR, "./prayer_pages/prayer_letters/" ) or print "ERROR: Could not open correct directory.";
my @letters = readdir PL_DIR;
my $newest_date = 'first';
my $youngest_file = 0;
foreach my $letter ( @letters )
{
my $cur_date = -M $letter;
if( ($newest_date > $cur_date) || ($newest_date eq 'first') ) { $newest_date = $cur_date; $youngest_file = $letter; }
}
print "Click here to read the latest prayer letter.\n";
closedir( PL_DIR );
print <<"HTML";
HTML
}
################################################################################################################################################
# SUB ROUTINES FOR PRINTING GENERIC HTML
################################################################################################################################################
##############displays top of media page##############
sub Print_Top_HTML
{
print <<"HTML";
Disciple the Nations - Prayer Requests