#!/usr/bin/perl ############################################################################## # Cliff's Message Board Script Version 1.51 # # Copyright 1998 Shaven Ferret Productions # # Created 6/4/98 Last Modified 1/6/2000 # # Available at http://www.shavenferret.com/scripts # ############################################################################## # COPYRIGHT NOTICE # # Copyright 1998 Shaven Ferret Productions All Rights Reserved. # # # # This script can be used\modified free of charge as long as you don't # # change this header, the parts that generate the return link, or the parts # # that mention me in the e-mail. If you really need to change these parts, # # go to http://www.shaveneferret.com/scripts/register.shtml . By using this # # script you agree to indemnify me from any liability that might arise from # # its use. In simple English, if this script somehow makes your computer # # run amuck and kill the pope, it's not my fault. # # # # Redistributing\selling the code for this program without prior written # # consent is expressly forbidden. # ############################################################################## # Paths ############################################################################## # Set this to the path of the directory where the forums will be kept. Do not # include a trailing slash. $path = "/server/path/to/message"; # Set this to the path of the directory where all the messages will be kept. # Do not include a trailing slash. Do not make this the same directory # as the forums directory. $post = "/server/path/to/message/posts"; # Set this to the path of the admin.html file. You should put this where # no one will find it. $adminpath = "/server/path/to/admin.html"; ############################################################################## # URLs ############################################################################## # Set this to the URL of the message board directory. Do not include a # trailing slash $mainurl = "http://www.yourdomain.com/message"; # Set this to the URL of the directory where all the messages will be kept. # Do not include a trailing slash. $posturl = "http://www.yourdomain.com/message/posts"; # Set this to the file name of the main message page $mainpage = "index.html"; # Set this to the URL of the message.cgi file once uploaded $script_url = "/cgi-bin/message.cgi"; ############################################################################## # Mail Stuff ############################################################################## # Enter the location of your mail program. $mailprogram = "/usr/lib/sendmail"; # Enter your e-mail address. Be sure to put a \ in front of the @. # (user@domain.com becomes user\@domain.com) $youremail = "you\@yourdomain.com"; # If you don't want to be notified every time someone posts a message, put a # # in front of the next line. $notifyme = -1; ############################################################################## # Other Stuff ############################################################################## # Set the next variable to whatever you want your password to be. You will # need the password to create\delete forums and message. $password = "shavenferret.com"; # Enter the name of your message board $title = "My Message Board"; # If you'd like to lock out HTML, leave this next variable as 1. If you'd # like to allow HTML, change it to 0. If you leave it as 1, anything in # a message between < and > will be removed. $nohtml = 1; ############################################################################## # Congratulations! You've finished defining the variables. If you want to, # # you can continue screwing with the script, but it isn't necessary. # ############################################################################## # Put the posted data into variables read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if ($nohtml == 1) { $value =~ s/<([^>]|\n)*>//g; $value =~ s//g; $value =~ s/>//g; } $value =~ s/"/'/g; $FORM{$name} = $value; } # Define $date and $time @months = ('January','February','March','April','May','June','July','August','September','October','November','December'); @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; if ($sec < 10) { $sec = "0$sec"; } if ($min < 10) { $min = "0$min"; } if ($hour < 10) { $hour = "0$hour"; } if ($mday < 10) { $mday = "0$mday"; } $year += 1900; $date = "$days[$wday], $months[$mon] $mday, $year"; $time = "$hour:$min:$sec"; # This script runs every part of the message board. To find out what it is # doing, it looks at $FORM{'action'}, which is a hidden input thing in all # the files it creates. The next line examines $FORM{'action'} to find out # what to do. print "Content-type: text/html\n\n"; if ($FORM{'action'} eq "new_forum") { &new_forum; } if ($FORM{'action'} eq "add_music") { &new_songicon("song"); } if ($FORM{'action'} eq "add_icon") { &new_songicon("icon"); } if ($FORM{'action'} eq "new_message") { &new_message; } if ($FORM{'action'} eq "preview_message") { &preview_message; } if ($FORM{'action'} eq "del_songicon") { &delmi; } if ($FORM{'action'} eq "remove_message") { &delmessage; } # If nothing has been done, then the action thing has been removed, # implying that the file has been corrupted. The next few lines print a # message that lets the user know this. print "
\n"; print FILE "Messages: (click here to post a message.)\n"; print FILE "