#!/usr/local/bin/perl
##############################################################################
WWWBoard Version 2.0 ALPHA 2
Copyright 1996 Matt Wright mattw@worldwidemart.com
Created 10/21/95 Last Modified 11/25/95
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
$basedir = "/path/to/wwwboard";
$baseurl = "http://www.tbls.d2g.com/cmcclan/pages/wwwboard";
$cgi_url = "http://www.tbls.d2g.com/cgi-bin/wwwboard.pl";
$mesgdir = "messages";
$datafile = "data.txt";
$mesgfile = "wwwboard.html";
$faqfile = "faq.html";
$ext = "html";
$title = "WWWBoard Version 2.0 Test";
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 = <NUMBER>;
close(NUMBER);
if ($num == 99999) {
$num = "1";
}
else {
$num++;
}
}
#######################
Parse Form Subroutine
sub parse_form {
# Get the input
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/<!--(.|\n)*-->//g;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
else {
unless ($name eq 'body') {
$value =~ s/<([^>]|\n)*>//g;
}
}
$FORM{$name} = $value;
}
}
###############
Get Variables
sub get_variables {
if ($FORM{'followup'}) {
rest kann ich net posten