#!/usr/local/bin/perl ############################################################################## # WWWBoard Version 2.0 ALPHA 2.1 # # Copyright 1996 Matt Wright mattw@worldwidemart.com # # Created 10/21/95 Last Modified 11/25/95 # # Security Patches/Bug Fixes: January 07, 2000 # # Scripts Archive at: http://www.worldwidemart.com/scripts/ # ############################################################################## # COPYRIGHT NOTICE # # Copyright 1996 Matthew M. Wright All Rights Reserved. # # # # WWWBoard may be used and modified free of charge by anyone so long as # # this copyright notice and the comments above remain intact. By using this # # code you agree to indemnify Matthew M. Wright from any liability that # # might arise from it's use. # # # # Selling the code for this program without prior written consent is # # expressly forbidden. In other words, please ask first before you try and # # make money off of my program. # # # # Obtain permission before redistributing this software over the Internet or # # in any other medium. In all cases copyright and header must remain intact.# ############################################################################## # Define Variables use Socket; @referers = ('www.yoyodave.com','yoyodave.com','www.nmia.com','nmia.com'); $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"; $graphicdir = "/home3/whistler/public_html/wwwboard"; $basegraphic = "/~whistler/wwwboard/graphics/custom"; $badword_file = "badwords.txt"; $mesgdir = "messages"; $datafile = "data.txt"; $mesgfile = "index_big.htm"; $faqfile = "faq.htm"; $ext = "htm"; $title = "Dave's Yo-Yo Talk"; ########################################################################### # New Variables and Multi Page Layout Information # Create by Steven Miller Jr Email: webmaster@vaultworld.com # Site http://www.vaultworld.com/cgi-scripts # Last Updated: 2 Mar 98 ########################################################################### #Config Items $use_proboard = 1; # 1 = YES; 0 = NO $pageprefix = "daves"; #This is the name of the multiply files ex polevault1.html $perpagedisplay = 35; #Display the Number of Original Post Per Page #Note qq? and qq+ same as " but eliminates all \/ /" Stuff #$pagedirectoryfaq = qq?
[ Post Message ][ FAQ ][One Page Version]\n
?; $pagedirectoryfaq = ""; #$pagedirectory = qq?
[ Post Message ][One Page Version]\n
?; $pagedirectory = ""; $counter = qq+ +; ###Ads Banner Option $show_ads = 0; #1 = Yes 0 = No $adsbanner = qq+ +; ################### No Need to Edit Below Lines ################################ $ext2 = ".html"; $pagename = ""; @page_contents = ""; $countpages = 0; # The Current Page Count $pages_needed = 0; # Total Number of Pages Needed $one = 1; $firstpagename = $pageprefix . $one . $ext2; # Done ########################################################################### #This is where you can block IPs, emails etc...for emails you MUST include the \ before the @ sign. @ipblocks = ('127.0.0.1'); @emailblocks = ('test\@test.com','blank\@blank.com'); @nameblocks = ('jiminy cricket','Jiminy Cricket','Diogenes','diogenes','Gary Sumptner','gary sumptner','Shade','shade','Tom Carlton','tom carlton'); # Done ########################################################################### ########################################################################### # Configure Options $kill_badwords = 1; # 1 = YES; 0 = NO $show_faq = 1; # 1 - YES; 0 = NO $allow_html = 0; # 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 $show_poster_ip = 1; # 1 = Show the IP of every poster; 0 = Don't $enforce_max_len = 0; # 2 = YES, error; 1 = YES, truncate; 0 = NO %max_len = ('name', 80, 'email', 70, 'subject', 80, 'url', 150, 'url_title', 80, 'img', 150, 'body', 3000, 'origsubject', 80, 'origname', 50, 'origemail', 70, 'origdate', 50); # Done ########################################################################### # Get the Data Number &get_number; &check_url; # Get Form Information &parse_form; $ip_number = $ENV{'REMOTE_ADDR'}; $ip_address = &do_dns($ip_number); $SIZE=@ipblocks; for($i=0;$i<$SIZE;$i++) { if ($ip_address =~ $ipblocks[$i] || $ENV{'REMOTE_ADDR'} =~ $ipblocks[$i]) { print "Content-type: text/html\n\n"; print "Sorry, you can't post\n"; print " \n"; print "

Your Server is Blocked. Access Denied

\n"; print " \n"; exit; } } $SIZE=@emailblocks; for($i=0;$i<$SIZE;$i++) { if ($FORM{'email'} =~ $emailblocks[$i]) { print "Content-type: text/html\n\n"; print "Sorry, you can't post\n"; print " \n"; print "

Your Server is Blocked. Access Denied

\n"; print " \n"; exit; } } $SIZE=@nameblocks; for($i=0;$i<$SIZE;$i++) { if ($FORM{'name'} =~ $nameblocks[$i]) { print "Content-type: text/html\n\n"; print "Sorry, you can't post\n"; print " \n"; print "

Your Server is Blocked. Access Denied

\n"; print " \n"; exit; } } # Put items into nice variables &get_variables; if ($kill_badwords == 1) { &CDA_filter; } &check_hit; # 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; } # Create on the fly Main WWWBoard File if($use_proboard) { &on_the_fly_main_page; } # Return the user HTML #if($use_proboard) #{ # &return_proboad; #} #else #{ &return_html; #} # Increment Number &increment_num; sub randomgraphic { opendir(DIR, $graphicdir) || die "can't opendir $some_dir: $!"; @filenames = readdir(DIR); closedir DIR; do { srand(time ^ $$); $n = rand(@filenames); # Pick a Random Number } until ($filenames[$n] =~ "logo_"); $icongraphic = "$filenames[$n]"; } sub check_url { # Localize the check_referer flag which determines if user is valid. local($check_referer) = 0; # If a referring URL was specified, for each valid referer, make sure # that a valid referring URL was passed to WWWBoard script. if ($ENV{'HTTP_REFERER'}) { foreach $referer (@referers) { if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) { $check_referer = 1; last; } } } else { $check_referer = 0; } # If the HTTP_REFERER was invalid, send back an error. if ($check_referer != 1) { &error('bad_referer') } } sub CDA_filter { $badword_found = 0; # Fetch the list of CDA bad words open(BADWORDS,"$basedir/$badword_file") || die "FILE ERROR:$badword_file\n"; @badwords = ; close(BADWORDS); foreach $badword (@badwords) { # Strip any extra CR/LF's $badword =~ s/\n//g; $badword =~ s/\r//g; if (($body =~ /$badword/i) || ($subject =~ /$badword/i) || ($name =~ /$badword/i) || ($email =~ /$badword/i) || ($message_url_title =~ /$badword/i)) { $badword_found = 1; # If a bad word is found, highlight all occurances of it $body =~ s/($badword)/$1<\/B>/ig; $subject =~ s/($badword)/$1<\/B>/ig; $name =~ s/($badword)/$1<\/B>/ig; $email =~ s/($badword)/$1<\/B>/ig; $message_url_title =~ s/($badword)/$1<\/B>/ig; } } # Be nice and give user chance to remove the bad words and repost if ($badword_found == 1) { &error(bad_words); } } sub get_number { open(NUMBER,"$basedir/$datafile"); $num = ; close(NUMBER); if ($num == 999999 || $num !~ /^\d+$/) { $num = "1"; } else { $num++; } } ####################### # Parse Form Subroutine sub parse_form { # Get the input if ( ($ENV{'REQUEST_METHOD'} eq "POST") || ($ENV{'REQUEST_METHOD'} ne "GET") ) { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; # This eliminates blank whitespaces within the field # IE. TAB to Name Field and hit the SPACEBAR with no text entry $value =~ s/^\s*//g; $value =~ s/\s*$//g; if ($allow_html != 1) { $value =~ s/

/\n\n/g; $value =~ s/
/\n/g; $value =~ s/<([^>]|\n)*>//g; } else { unless ($name eq 'body') { $value =~ s/<([^>]|\n)*>//g; } } $FORM{$name} = $value; } # If the request METHOD is invalid display the 'bad_referer' error message } else { &error('bad_referer'); } } ############### # Get Variables sub get_variables { if ($FORM{'followup'}) { $followup = "1"; @followup_num = split(/,/,$FORM{'followup'}); foreach $followupNum (@followup_num) { if ($followupNum !~ /^\d+$/) { &error('deny_post'); # Create an new error message in the &error sub routine } } $num_followups = @followups = @followup_num; $last_message = pop(@followups); $origdate = "$FORM{'origdate'}"; $origname = "$FORM{'origname'}"; $origsubject = "$FORM{'origsubject'}"; } else { $followup = "0"; } if ($FORM{'name'}) { $name = "$FORM{'name'}"; $name =~ s/"//g; $name =~ s///g; $name =~ s/\&//g; } else { &error(no_name); } if ($FORM{'email'} =~ /.*\@.*\..*/) { $email = "$FORM{'email'}"; } if ($FORM{'subject'}) { $subject = "$FORM{'subject'}"; $subject =~ s/\&/\&\;/g; $subject =~ s/"/\"\;/g; } else { &error(no_subject); } if ($FORM{'url'} =~ /.*\:.*\..*/ && $FORM{'url_title'}) { $message_url = "$FORM{'url'}"; $message_url_title = "$FORM{'url_title'}"; } if ($FORM{'img'} =~ /.*tp:\/\/.*\..*/) { $message_img = "$FORM{'img'}"; } if ($FORM{'body'}) { $body = "$FORM{'body'}"; $body =~ s/\cM//g; $body =~ s/\n\n/

/g; $body =~ s/\n/
/g; $body =~ s/<//g; $body =~ s/"/"/g; $mesg_size = length($body); } else { &error(no_body); } if ($FORM{'subject'}) { $subject = "$FORM{'subject'}"; $subject =~ s/\&/\&\;/g; $subject =~ s/"/\"\;/g; $subject_length = length($subject); } else { &error(no_subject); } # Added to check the subject character length not to # exceed 50 maxlength characters if ($subject_length > 80) { &error(too_long); } if ($FORM{'name'}) { $name = "$FORM{'name'}"; $name_length = length($name); } else { &error(no_name); } # Added to check the subject character length not to # exceed 50 maxlength characters if ($name_length > 50) { &error(too_long); } if ($quote_text == 1) { $hidden_body = "$body"; $hidden_body =~ s//>/g; $hidden_body =~ s/"/"/g; } ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $month = ($mon + 1); @months = ("January","February","March","April","May","June","July","August","September","October","November","December"); $year += 1900; $long_date = sprintf("%s %02d, %4d at %02d:%02d:%02d",$months[$mon],$mday,$year,$hour,$min,$sec); $year %= 100; if ($use_time == 1) { $date = sprintf("%02d:%02d:%02d %02d/%02d/%02d",$hour,$min,$sec,$month,$mday,$year); } else { $date = sprintf("%02d/%02d/%02d",$month,$mday,$year); } } sub check_hit { $hit_log = "dbl-post.txt"; $ip_hit_addr = "$ENV{'REMOTE_ADDR'}"; $ip_hit = "$ip_hit_addr-$mesg_size"; open(HITLOG,"$basedir/$hit_log") || die "FILE ERROR: $hit_log\n"; $IP_NUM = ; close(HITLOG); if ($ip_hit eq $IP_NUM) { &error(dbl_post); } else { open(HITLOG,">$basedir/$hit_log") || die "FILE ERROR: $hit_log\n"; print HITLOG "$ip_hit"; close(HITLOG); } } ##################### # New File Subroutine sub new_file { if (-e "$basedir/$mesgdir/$num\.$ext") { $num++; } open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!; print NEWFILE "\n"; print NEWFILE " \n"; print NEWFILE " $subject\n"; print NEWFILE " \n"; print NEWFILE " \n"; print NEWFILE "

\n"; print NEWFILE "

$subject

\n"; print NEWFILE "
\n"; print NEWFILE "
\n"; if ($show_faq == 1) { print NEWFILE "
\n"; } else { print NEWFILE "
\n"; } print NEWFILE "

\n"; print NEWFILE "

    Posted by "; if ($email) { print NEWFILE "$name "; } else { print NEWFILE "$name \n"; } if ($show_poster_ip) { $ip_number = $ENV{'REMOTE_ADDR'}; #$ip_address = &do_dns($ip_number); #if ($ip_number eq $ip_address) #{ # $ip_address = $ip_number; #} print NEWFILE "from ($ip_number) "; } print NEWFILE "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 "\n"; print NEWFILE "\n"; print NEWFILE "

    \n"; print NEWFILE "Follow Ups:
    \n"; print NEWFILE "

      \n"; print NEWFILE "
    \n"; print NEWFILE "

    \n"; print NEWFILE "Post a Followup

    \n"; print NEWFILE "

    \n"; print NEWFILE "\n"; print NEWFILE "\n"; if ($email) { print NEWFILE "\n"; } print NEWFILE "\n"; print NEWFILE "\n"; print NEWFILE "Name:
    \n"; print NEWFILE "E-Mail:

    \n"; if ($subject_line == 1) { if ($subject_line =~ /^Re:/) { print NEWFILE "\n"; print NEWFILE "Subject: $subject

    \n"; } else { print NEWFILE "\n"; print NEWFILE "Subject: Re: $subject

    \n"; } } elsif ($subject_line == 2) { print NEWFILE "Subject:

    \n"; } else { if ($subject =~ /^Re:/) { print NEWFILE "Subject:

    \n"; } else { print NEWFILE "Subject:

    \n"; } } print NEWFILE "Comments:
    \n"; print NEWFILE "\n"; print NEWFILE "

    \n"; print NEWFILE "Optional Link URL:
    \n"; print NEWFILE "Link Title:
    \n"; print NEWFILE "Optional Image URL:

    \n"; print NEWFILE " \n"; print NEWFILE "


\n"; if ($show_faq == 1) { print NEWFILE "
\n"; } else { print NEWFILE "
\n"; } print NEWFILE "\n"; close(NEWFILE); $mode = 0644; $file = "$basedir/$mesgdir/$num\.$ext"; chmod $mode, $file; } ############################### # Main WWWBoard Page Subroutine sub main_page { open(MAIN,"$basedir/$mesgfile") || die $!; @main =
; close(MAIN); open(MAIN,">$basedir/$mesgfile") || die $!; if ($followup == 0) { foreach $main_line (@main) { if ($main_line =~ //) { print MAIN "\n"; if ($name eq "Steve Brown") { $icongraphic = "$basegraphic/albino.gif"; } elsif ($name eq "Gibberish*") { $icongraphic = "$basegraphic/bpt.gif"; } elsif ($name eq "John Higby") { $icongraphic = "$basegraphic/higby.gif"; } elsif ($name eq "Abejero") { $icongraphic = "$basegraphic/abejero.gif"; } elsif ($name eq "Scarecrow") { $icongraphic = "$basegraphic/craft1.gif"; } elsif ($name eq "David Hall") { $icongraphic = "$basegraphic/dave.gif"; } else { &randomgraphic; } print MAIN "
  •   $subject - $name $date\n"; print MAIN "(0)\n"; print MAIN "
      \n"; print MAIN "
    \n"; } else { print MAIN "$main_line"; } } } else { foreach $main_line (@main) { $work = 0; if ($main_line =~ /
      /) { print MAIN "
        \n"; if ($name eq "Steve Brown") { $icongraphic = "$basegraphic/albino.gif"; } elsif ($name eq "Gibberish*") { $icongraphic = "$basegraphic/bpt.gif"; } elsif ($name eq "John Higby") { $icongraphic = "$basegraphic/higby.gif"; } elsif ($name eq "Abejero") { $icongraphic = "$basegraphic/abejero.gif"; } elsif ($name eq "Scarecrow") { $icongraphic = "$basegraphic/craft1.gif"; } elsif ($name eq "David Hall") { $icongraphic = "$basegraphic/dave.gif"; } else { &randomgraphic; } print MAIN "
      •   $subject - $name $date\n"; print MAIN "(0)\n"; print MAIN "
          \n"; print MAIN "
        \n"; } elsif ($main_line =~ /\((.*)\)/) { $response_num = $1; $num_responses = $2; $num_responses++; foreach $followup_num (@followup_num) { if ($followup_num == $response_num) { print MAIN "($num_responses)\n"; $work = 1; } } if ($work != 1) { print MAIN "$main_line"; } } else { print MAIN "$main_line"; } } } close(MAIN); } ############################################ # Add Followup Threading to Individual Pages sub thread_pages { foreach $followup_num (@followup_num) { # IF the follow up is valid the script will go on as normal if (-e "$basedir/$mesgdir/$followup_num\.$ext") { open(FOLLOWUP,"$basedir/$mesgdir/$followup_num\.$ext"); @followup_lines = ; close(FOLLOWUP); open(FOLLOWUP,">$basedir/$mesgdir/$followup_num\.$ext"); foreach $followup_line (@followup_lines) { $work = 0; if ($followup_line =~ /
          /) { print FOLLOWUP "
            \n"; if ($name eq "Steve Brown") { $icongraphic = "$basegraphic/albino.gif"; } elsif ($name eq "Gibberish*") { $icongraphic = "$basegraphic/bpt.gif"; } elsif ($name eq "John Higby") { $icongraphic = "$basegraphic/higby.gif"; } elsif ($name eq "Abejero") { $icongraphic = "$basegraphic/abejero.gif"; } elsif ($name eq "Scarecrow") { $icongraphic = "$basegraphic/craft1.gif"; } elsif ($name eq "David Hall") { $icongraphic = "$basegraphic/dave.gif"; } else { &randomgraphic; } print FOLLOWUP "
          •   $subject $name $date\n"; print FOLLOWUP "(0)\n"; print FOLLOWUP "
              \n"; print FOLLOWUP "
            \n"; } elsif ($followup_line =~ /\((.*)\)/) { $response_num = $1; $num_responses = $2; $num_responses++; foreach $followup_num (@followup_num) { if ($followup_num == $response_num) { print FOLLOWUP "($num_responses)\n"; $work = 1; } } if ($work != 1) { print FOLLOWUP "$followup_line"; } } else { print FOLLOWUP "$followup_line"; } } close(FOLLOWUP); # If it is NOT the script will generate an error message "deny_post" # You will need to again, create another custom error message in the # sub routine "sub error" with the } elsif ($error eq 'deny_post') { # and use the "exit;" call to halt the script. } else { # Else we have a bogies message posted. &error('deny_post'); } } } sub return_html { print "Content-type: text/html\n\n"; print "Message Added: $subject\n"; print "

            Message Added: $subject

            \n"; print "
              The following information was added to the message board:


              \n"; print "Name: $name
              \n"; print "E-Mail: $email
              \n"; print "Subject: $subject
              \n"; print "Body of Message:

              \n"; print "$body

              \n"; if ($message_url) { print "Link: $message_url_title
              \n"; } if ($message_img) { print "Image:
              \n"; } print "Added on Date: $date

              \n"; print "


              \n"; print "
            [ Go to Your Message ] [ $title ]
            \n"; print "\n"; } sub increment_num { open(NUM,">$basedir/$datafile") || die $!; print NUM "$num"; close(NUM); } sub error { $error = $_[0]; print "Content-type: text/html\n\n"; if ($error eq 'no_name') { print "$title ERROR: No Name\n"; print "

            ERROR: No Name

            \n"; print "You forgot to fill in the 'Name' field in your posting. Correct it below and re-submit. The necessary fields are: Name, Subject and Message.


            \n"; &rest_of_form; } elsif ($error eq 'no_subject') { print "$title ERROR: No Subject\n"; print "

            ERROR: No Subject

            \n"; print "You forgot to fill in the 'Subject' field in your posting. Correct it below and re-submit. The necessary fields are: Name, Subject and Message.


            \n"; &rest_of_form; } elsif ($error eq 'no_body') { print "$title ERROR: No Message\n"; print "

            ERROR: No Message

            \n"; print "You forgot to fill in the 'Message' field in your posting. Correct it below and re-submit. The necessary fields are: Name, Subject and Message.


            \n"; &rest_of_form; } elsif ($error eq 'field_size') { printf "$title ERROR: Field too Long\n"; print "

            ERROR: Field too Long

            \n"; print "One of the form fields in the message submission was too long. The following are the limits on the size of each field (in characters):

              \n"; print "
            • Name: $max_len{'name'}\n"; print "
            • E-Mail: $max_len{'email'}\n"; print "
            • Subject: $max_len{'subject'}\n"; print "
            • Body: $max_len{'body'}\n"; print "
            • URL: $max_len{'url'}\n"; print "
            • URL Title: $max_len{'url_title'}\n"; print "
            • Image URL: $max_len{'img'}\n"; print "
            Please modify the form data and resubmit.


            \n"; &rest_of_form; } elsif ($error eq 'dbl_post') { print "$title ERROR: Multiple Postings Abuse!\n"; print "

            ERROR: MULTIPLE POSTING DECTECTED!

            \n"; print "

            A multiple posting has been detected!

            \n"; print "
            The program has detected that you tried to submit the same message twice.\n"; print "Please be more careful :-)
            \n"; print "
            Thank you for your cooperation.
            Administrator for the $title

            \n"; print "

            \n"; exit; } elsif ($error eq 'bad_words') { print "$title ERROR: CDA Censor Activated!\n"; print "
            ERROR: CDA Censor Activated!
            \n"; print "

            Your text contains one or more words that the U.S. Congress might find offensive.

            \n"; print "

            The unacceptable words are highlighted in bold below:


            \n"; print "FROM: $name
            \n"; print "EMAIL: $email
            \n"; print "URL TITLE: $message_url_title
            \n"; print "SUBJECT: $subject

            \n"; print "BODY OF MESSAGE: $body


            \n"; print "

            Please use your browser's BACK button to edit your text and make it suitable for everyone.

            \n"; print "\n"; exit; } elsif ($error eq 'bad_referer') { print "$title ERROR!\n"; print "
            ERROR!
            \n"; print "

            You are trying to post to this board from an unauthorized server.



            \n"; print "\n"; exit; } elsif ($error eq 'deny_post') { print "$title ERROR!\n"; print "

            ERROR!
            \n"; print "

            You are trying to post a message that will cause server errors, so your message will not be posted.



            \n"; print "\n"; exit; } elsif ($error eq 'too_long') { print "$title ERROR!\n"; print "

            ERROR!
            \n"; print "

            Sorry, either your name or subject is too long, please hit back and fix it.



            \n"; print "\n"; exit; } else { print "ERROR! Undefined.\n"; } exit; } sub PrintHeader { return "Content-type: text/html\n\n"; } sub do_dns { my($ip_addr) = shift; my($host); if ($ip_addr =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) { if (($host = $DNS{$ip_addr}) eq '') { if (($host = (gethostbyaddr(pack('C4', $1, $2, $3, $4), &AF_INET))[0]) eq '') { $DNS{$ip_addr} = $host = $ip_addr; } else { $DNS{$ip_addr} = $host; } $DNS{"$ip_addr:time"} = time; } return($host); } return($ip_addr); } sub rest_of_form { print "\n"; if ($followup == 1) { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "Name:
            \n"; print "E-Mail:

            \n"; if ($subject_line == 1) { print "\n"; print "Subject: $FORM{'subject'}

            \n"; } else { print "Subject:

            \n"; } print "Message:
            \n"; print "

            \n"; print "Optional Link URL:
            \n"; print "Link Title:
            \n"; print "Optional Image URL:

            \n"; print " \n"; print "\n"; print "


            \n"; if ($show_faq == 1) { print "
            \n"; } else { print "
            \n"; } print "\n"; } ######################################################################################### # Multi Board Additions ############################ # On the Fly main page sub on_the_fly_main_page { $numofmainresponses = 0; open(MAIN,"$basedir/$mesgfile") || die $!; @maincopy =
            ; close(MAIN); $number_of_lines_maincopy = @maincopy; #determine the number of main responses not replies for ($count = 0; $count < $number_of_lines_maincopy; $count++) { if ($maincopy[$count] =~ /*/) { $numofmainresponses++; $topvalue = $1; $count++; do { $count++; }while($maincopy[$count] !~ /*/); } } #determine the interger number of pages $pages_needed = $numofmainresponses / $perpagedisplay; $pages_needed_remander = $numofmainresponses % $perpagedisplay; #Store In Interger Format $pages_needed = ($pages_needed - ($pages_needed_remander/$perpagedisplay)); #Added one because a remainder if ($pages_needed_remander) { $pages_needed++; } #determine what type of pages to type if($numofmainresponses < $perpagedisplay) { #print only one page # Logic: Begin Storing Lines after first top and until bottom tag is found $detect = 0; $countpages = 1; for ($count = 0; $count < $number_of_lines_maincopy; $count++) { if ($maincopy[$count] =~ /*/) { $topvalue = $1; $counttops++; $detect = 1; splice(@page_contents, -1, 0, $maincopy[$count]); #read and store until next top $count++; while($maincopy[$count] !~ /*/) { splice(@page_contents, -1, 0, $maincopy[$count]); $count++; last if ($count == $maincopylength); last if ($maincopy[$count] =~ /