#!/usr/bin/perl # Define Variables $basedir = "/home3/whistler/public_html/wwwboard/"; $baseurl = "http://www.nmia.com/~whistler/wwwboard"; $cgi_url = "http://www.nmia.com/cgi-bin/cgiwrap/whistler/wwwboard.pl"; $mesgdir = "messages"; $datafile = "data.txt"; $mesgfile = "index.htm"; $faqfile = "faq.htm"; $ext = "htm"; $date_command = "Tue 06 Jan 1998 16:22:30 GMT"; $title = "Return to Bulletin Board"; $background = "
"; # Done ########################################################################### ########################################################################### # Configure Options $show_faq = 1; # 1 - YES; 0 = NO $allow_html = 1; # 1 = YES; 0 = NO $quote_text = 1; # 1 = YES; 0 = NO $subject_line = 0; # 0 = Quote Subject Editable; 1 = Quote Subject # UnEditable; 2 = Don't Quote Subject, Editable. $use_time = 1; # 1 = YES; 0 = NO # Done ########################################################################### # Get the Data Number &get_number; # Get Form Information &parse_form; # Put items into nice variables &get_variables; # Open the new file and write information to it. &new_file; # Open the Main WWWBoard File to add link &main_page; # Now Add Thread to Individual Pages if ($num_followups >= 1) { &thread_pages; } # Return the user HTML &return_html; # Increment Number &increment_num; ############################ # Get Data Number Subroutine sub get_number { open(NUMBER,"$basedir/$datafile"); $num =/g;
$body =~ s/\n/
/g;
$body =~ s/<//g;
$body =~ s/"/"/g;
}
else {
&error(no_body);
}
if ($quote_text == 1) {
$hidden_body = "$body";
$hidden_body =~ s/</g;
$hidden_body =~ s/>/>/g;
$hidden_body =~ s/"/"/g;
}
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($sec < 10) {
$sec = "0$sec";
}
if ($min < 10) {
$min = "0$min";
}
if ($hour < 10) {
$hour = "0$hour";
}
if ($mon < 10) {
$mon = "0$mon";
}
if ($mday < 10) {
$mday = "0$mday";
}
$month = ($mon + 1);
@months = ("January","February","March","April","May","June","July","August","September","October","November","December");
if ($use_time == 1) {
$date = "$hour\:$min\:$sec $month/$mday/$year";
}
else {
$date = "$month/$mday/$year";
}
chop($date) if ($date =~ /\n$/);
$long_date = "$months[$mon] $mday, 19$year at $hour\:$min\:$sec";
}
#####################
# New File Subroutine
sub new_file {
open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
print NEWFILE "\n";
print NEWFILE "
\n"; print NEWFILE "Posted by "; if ($email) { print NEWFILE "$name on $long_date:
\n"; } else { print NEWFILE "$name on $long_date:
\n"; } if ($followup == 1) { print NEWFILE "In Reply to: $origsubject posted by "; if ($origemail) { print NEWFILE "$origname on $origdate:
\n"; } else { print NEWFILE "$origname on $origdate:
\n"; } } if ($message_img) { print NEWFILE "
\n";
}
print NEWFILE "$body\n";
print NEWFILE "
\n";
if ($message_url) {
print NEWFILE "
\n";
print NEWFILE "Follow Ups:
\n";
print NEWFILE "
\n"; print NEWFILE "Post a Followup
\n"; print NEWFILE "