#!/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?
/\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;
$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/ \n";
print NEWFILE " \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";
print NEWFILE "Follow Ups: \n";
print NEWFILE "Post a Followup \n";
print NEWFILE "
/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;
$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 = $subject
\n";
print NEWFILE "
\n";
if ($show_faq == 1) {
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 ($message_url) {
print NEWFILE "
\n";
print NEWFILE "\n";
print NEWFILE "
\n";
print NEWFILE "