#!/usr/bin/perl ############################################################################## # RPGBoard Admin version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## $SIG{__DIE__} = \&tech_error; sub tech_error { print "Content-type: text/plain; charset=$charset\n\n"; print "ERROR: $_[0]"; exit; } for $j ("rpgvariables.h", "rpgglobal.h", "rpgerrors.h", "rpgheaders.h") { unless ($k = do $j) { &tech_error("Couldn't parse $j: $@") if $@; &tech_error("Couldn't do $j: $!") unless defined $k; } } if ($COOKIE{'Name'}) { $name = $COOKIE{'Name'}; } &calc_expire_time; &get_default; &get_master_default; &get_variables; unless (&validate_password >= 2 || $querydate) { &request_password; } &print_cookies; if ($special_option eq "M") { &moderate_msg; } elsif ($FORM{'action'} eq 'remove') { &remove_msgs; } elsif ($forum) { &display_remove; } else { &display_main; } sub get_variables { if ($FORM{'expire'}) { $expire_time = $FORM{'expire'}; } if ($querydate && $special_option ne "M") { $FORM{'action'} = "remove"; $FORM{&dec2hex($querydate).&dec2hex($querynum)} = "1"; } } sub display_main { print "Content-type: text/html; charset=$charset\n\n"; print " RPGAdmin For RPGBoard\n"; print "


\n"; print "

".$headerfont."RPGAdmin For RPGBoard\n"; print "

\n"; foreach $j (sort keys %indexfile) { print "Remove Messages from $title{$j}
\n"; } print "

\n"; &print_credits; } sub display_remove { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Remove Messages From $title\n"; print "\n"; print "

\n"; print "$headerfont
Remove Messages From $title
\n"; print "

NOTE: Deleting a message will delete all replies below it.  Undeleting a message will undelete\n"; print "all parent messages above it.\n"; print "

$forumline
\n"; print "
Main Screen - $title
\n"; print "
\n"; print "\n"; unless (&validate_password >= 2) { print "
$forumline
\n"; print "

Password:

\n"; } print "
$forumline
\n"; &display_headers; print "
$forumline
\n"; print "
\n"; print "
\n"; print "

\n"; print "Display messages from: \ \n"; print "\ \n"; print "

\n"; &print_credits } sub remove_msgs { @msgs = reverse sort grep { /^[0-9A-F]{16}$/ } keys %FORM; $prevdate = &convert_date(&hex2dec(substr($msgs[0], 0, 8)), " 0000", 0); open(INDEXFILE,&read_datefile(&lock_datefile("$prevdate.index"))) || &tech_error("Can't read $prevdate.index while (un)deleting headers! (Read method: ".&read_datefile("$prevdate.index").")"); @headers = ; close(INDEXFILE); unless (&validate_password >= 2) { unless (scalar(@msgs) == 1) { &unlock_datefile("$prevdate.index") &error(no_rpgadmin); } $currentgmt = &hex2dec(substr($msgs[0], 0, 8)); $currentnum = &hex2dec(substr($msgs[0], 8)); for ($k = 0; $k < @headers; $k++) { if ($headers[$k] =~ /^([\ ]*)\d+\xff.+\xff.?\xff.*\xff(.+)\xff$currentnum(D|M[-\+]+\d+)?$/) { $spaces = $1; $name = $2; $indexoption = $3; &get_default; unless (&validate_password) { &unlock_datefile("$prevdate.index") &error(bad_password); } if ($indexoption eq "D") { &unlock_datefile("$prevdate.index") &error(no_undelete); } if ($headers[$k + 1] =~ /^$spaces[\ ]+/) { &unlock_datefile("$prevdate.index"); &error(too_many); } last; } } } $| = 1; print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Messages Deleted/Undeleted\n"; print "\n"; print "

\n"; print "$header\n"; print "

".$headerfont."Messages Deleted/Undeleted
\n"; print "$forumline

\n"; if ($header_style == 3) { print "

$headertable\n"; print " \n"; print " ".$rpgheadersfont."Subject\n"; print " ".$rpgheadersfont."Name\n"; print " ".$rpgheadersfont."Date\n"; print " \n"; } else { print "$rpgheadersfont\n\n"; print "

    "; } for ($j = 0; $j < @msgs; $j++) { $currentgmt = &hex2dec(substr($msgs[$j], 0, 8)); $currentnum = &hex2dec(substr($msgs[$j], 8)); $currentdate = &convert_date($currentgmt, " 0000", 0); if (&read_datefile("$prevdate.index") ne &read_datefile("$currentdate.index")) { open(INDEXFILE,&write_datefile("$prevdate.index")) || &tech_error("Can't write $prevdate.index while (un)deleting headers! (Read method: ".&read_datefile("$prevdate.index").")"); print INDEXFILE @headers; close(INDEXFILE); &unlock_datefile("$prevdate.index"); open(INDEXFILE,&read_datefile(&lock_datefile("$currentdate.index"))) || &tech_error("Can't read $currentdate.index while (un)deleting headers! (Read method: ".&read_datefile("$currentdate.index").")"); @headers = ; close(INDEXFILE); $prevdate = $currentdate; } for ($k = 0; $k < @headers; $k++) { if ($headers[$k] =~ /^([\ ]*)\d+\xff.+\xff.?\xff.*\xff.+\xff$currentnum(D|M[-\+]+\d+)?$/) { $spaces = $1; $indexoption = $2; unless ($indexoption eq "D") { for ($l = $k; $l < @headers; $l++) { if ($headers[$l] =~ /^([\ ]*)(\d+)\xff(.+)\xff.?\xff.*\xff(.+)\xff(\d+)(D|M[-\+]+\d+)?$/) { $headerspaces = $1; $headerdate = $2; $headersubject = $3; $headername = $4; $headernum = $5; $headeroption = $6; if ($l != $k && length($headerspaces) <= length($spaces)) { last; } unless ($headeroption eq "D") { open(LOCFILE,&read_datefile(&lock_datefile(&convert_date($headerdate, " 0000", 0).".loc"))) || &tech_error("Can't read ".&convert_date($headerdate, " 0000", 0).".loc while deleting headers! (Read method: ".&read_datefile(&convert_date($headerdate, " 0000", 0).".loc").")"); $loc = join('', ); close(LOCFILE); $num = unpack("L", substr($loc, 0, 4)); $msgoffset = unpack("L", substr($loc, ($headernum - $num + 1) * 4, 4)); $msgoffset += 2 ** 31; $newloc = substr($loc, 0, ($headernum - $num + 1) * 4).pack("L", $msgoffset).substr($loc, ($headernum - $num + 2) * 4); open(LOCFILE,&write_datefile(&convert_date($headerdate, " 0000", 0).".loc")) || &tech_error("Can't write ".&convert_date($headerdate, " 0000", 0).".loc while deleting headers! (Write method: ".&read_datefile(&convert_date($headerdate, " 0000", 0).".loc").")"); print LOCFILE $newloc; close(LOCFILE); &unlock_datefile(&convert_date($headerdate, " 0000", 0).".loc"); $headers[$l] = substr($headers[$l], 0, -1 - length($headeroption))."D\n"; $headeroption = "D"; $num_directreplies = 0; $num_replies = 0; &print_header; open(LOGFILE,">>$basedir/$mesgdir/adminlog.txt"); print LOGFILE "[".&convert_date($gmt_epoch, $timezone, -1)."] $name "; if (&validate_password == 2) { print LOGFILE "(Admin) "; } elsif (&validate_password == 3) { print LOGFILE "(Superuser) "; } print LOGFILE "deleted message ID ".&dec2hex($headerdate).&dec2hex($headernum)."\n"; close(LOGFILE); } } } last; } else { $undeletespaces = $spaces; for ($l = $k; $l >= 0; $l--) { if ($headers[$l] =~ /^([\ ]*)(\d+)\xff(.+)\xff.?\xff.*\xff(.+)\xff(\d+)(D|M[-\+]+\d+)?$/) { $headerspaces = $1; $headerdate = $2; $headersubject = $3; $headername = $4; $headernum = $5; $headeroption = $6; if ($headeroption eq "D" && (length($headerspaces) < length($undeletespaces) || $k == $l)) { open(LOCFILE,&read_datefile(&lock_datefile(&convert_date($headerdate, " 0000", 0).".loc"))) || &tech_error("Can't read ".&convert_date($headerdate, " 0000", 0).".loc while undeleting headers! (Read method: ".&read_datefile(&convert_date($headerdate, " 0000", 0).".loc").")"); $loc = join('', ); close(LOCFILE); $num = unpack("L", substr($loc, 0, 4)); $msgoffset = unpack("L", substr($loc, ($headernum - $num + 1) * 4, 4)); $msgoffset -= 2 ** 31; $newloc = substr($loc, 0, ($headernum - $num + 1) * 4).pack("L", $msgoffset).substr($loc, ($headernum - $num + 2) * 4); open(LOCFILE,&write_datefile(&convert_date($headerdate, " 0000", 0).".loc")) || &tech_error("Can't write ".&convert_date($headerdate, " 0000", 0).".loc while undeleting headers! (Write method: ".&read_datefile(&convert_date($headerdate, " 0000", 0).".loc").")"); print LOCFILE $newloc; close(LOCFILE); &unlock_datefile(&convert_date($headerdate, " 0000", 0).".loc"); chop($headers[$l]); chop($headers[$l]); $headers[$l] = $headers[$l]."\n"; undef $headeroption; undef $num_directreplies; undef $num_replies; for ($m = $l + 1; $m < @headers; $m++) { if ($headers[$m] =~ /^([\ ]*)\d+\xff.+\xff.?\xff.*\xff.+\xff\d+(D|M[-\+]+\d+)?$/) { if (length($1) <= length($spaces)) { last; } elsif (length($1) == length($spaces) + 2 && $2 ne "D") { $num_directreplies++; } if ($2 ne "D") { $num_replies++; } } } $num_directreplies = int($num_directreplies); $num_replies = int($num_replies); &print_header; $undeletespaces = $headerspaces; open(LOGFILE,">>$basedir/$mesgdir/adminlog.txt"); print LOGFILE "[".&convert_date($gmt_epoch, $timezone, -1)."] $name "; if (&validate_password == 2) { print LOGFILE "(Admin) "; } elsif (&validate_password == 3) { print LOGFILE "(Superuser) "; } print LOGFILE "undeleted message ID ".&dec2hex($headerdate).&dec2hex($headernum)."\n";; close(LOGFILE); } unless ($headerspaces) { last; } } } last; } } } } open(INDEXFILE,&write_datefile("$prevdate.index")) || &tech_error("Can't write $prevdate.index while (un)deleting headers! (Write method: ".&write_datefile("$prevdate.index").")"); print INDEXFILE @headers; close(INDEXFILE); &unlock_datefile("$prevdate.index"); if ($header_style == 3) { print "

    \n"; } else { print "
\n\n"; } print "
Back to $title
"; &print_credits; } sub moderate_msg { if (&validate_password == 1 && $moderated{"$forum;$querynum"}) { &error(already_moderated); } open(INDEXFILE,&read_datefile(&lock_datefile(&convert_date($querydate, " 0000", 0).".index"))) || &tech_error("Can't read ".&convert_date($querydate, " 0000", 0).".index while moderating a message! (Read method: ".&read_datefile(&convert_date($querydate, " 0000", 0).".index").")"); @headers = ; close(INDEXFILE); for ($k = 0; $k < @headers; $k++) { if ($headers[$k] =~ /^[\ ]*(\d+)\xff.+\xff.?\xff.*\xff(.+)\xff$querynum(D|M[-\+]+\d+)?$/) { $indexdate = $1; $indexname = $2; $indexoption = $3; if ($indexoption eq "D") { &unlock_datefile(&convert_date($querydate, " 0000", 0).".index"); &error(msg_deleted); } if (&validate_password >= 2) { if ($FORM{'score'} == $msg_points) { undef $l; } elsif ($FORM{'score'} > $msg_points) { $l = "M+".int($FORM{'score'} - $msg_points); } elsif ($FORM{'score'} < $msg_points) { $l = "M-".int($msg_points - $FORM{'score'}); } else { &unlock_datefile(&convert_date($querydate, " 0000", 0).".index"); &tech_error("Broken logic when calculating score...very strange..."); } $headers[$k] = substr($headers[$k], 0, -1 - length($indexoption))."$l\n"; open(LOGFILE,">>$basedir/$mesgdir/adminlog.txt"); print LOGFILE "[".&convert_date($gmt_epoch, $timezone, -1)."] $name "; if (&validate_password == 2) { print LOGFILE "(Admin) "; } elsif (&validate_password == 3) { print LOGFILE "(Superuser) "; } print LOGFILE "moderated message ID ".&dec2hex($querydate).&dec2hex($querynum)." to $l\n"; close(LOGFILE); } elsif ($stats_msgs{$forum} >= $min_msgs && &validate_password == 1 && !$moderated{"$forum;$querynum"} && $name ne $indexname) { if ($FORM{'score_diff'} > 1 || $FORM{'score_diff'} < -1) { &unlock_datefile(&convert_date($querydate, " 0000", 0).".index"); &tech_error("Illegal score difference! Don't even THINK of modifying the HTML form code!"); } if ($indexoption =~ /^M\+(\d+)$/) { $l = $1 + int($FORM{'score_diff'}); } elsif ($indexoption =~ /^M\-(\d+)$/) { $l = -$1 + int($FORM{'score_diff'}); } else { $l = int($FORM{'score_diff'}); } if ($l > $msg_points || $l < -$msg_points * 2) { &unlock_datefile(&convert_date($querydate, " 0000", 0).".index"); &tech_error("Score is out-of-bounds! Don't even THINK of modifying the HTML form code!"); } if ($l == 0) { undef $m; } elsif ($l > 0) { $m = "M+".int($l); } elsif ($l < 0) { $m = "M".int($l); } $headers[$k] = substr($headers[$k], 0, -1 - length($indexoption))."$m\n"; $moderated{"$forum;$querynum"} = $querydate; &add_default; open(LOGFILE,">>$basedir/$mesgdir/adminlog.txt"); print LOGFILE "[".&convert_date($gmt_epoch, $timezone, -1)."] $name moderated message ID ".&dec2hex($querydate).&dec2hex($querynum)." to $m\n"; close(LOGFILE); } else { &unlock_datefile(&convert_date($querydate, " 0000", 0).".index"); &tech_error("You can't moderate this message!"); } last; } } open(INDEXFILE,&write_datefile(&convert_date($querydate, " 0000", 0).".index")) || &tech_error("Can't write ".&convert_date($querydate, " 0000", 0).".index while moderating a message! (Write method: ".&write_datefile(&convert_date($querydate, " 0000", 0).".index").")"); print INDEXFILE @headers; close(INDEXFILE); &unlock_datefile(&convert_date($querydate, " 0000", 0).".index"); if ($indexdate) { &error(moderated); } else { &tech_error("Can't find message header that matches Date/ID!"); } } #!/usr/bin/perl ############################################################################## # RPGBoard Mini-Biography Viewer version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## $SIG{__DIE__} = \&tech_error; sub tech_error { print "Content-type: text/plain; charset=$charset\n\n"; print "ERROR: $_[0]"; exit; } for $j ("rpgvariables.h", "rpgglobal.h", "rpgerrors.h") { unless ($k = do $j) { &tech_error("Couldn't parse $j: $@") if $@; &tech_error("Couldn't do $j: $!") unless defined $k; } } if ($name = $forum) { unless (-e "$basedir/$defaultdir/$name.txt") { &error(record_not_found); } &get_default; &get_variables; &display_bio; } else { &display_names; } sub get_variables { if ($date_of_birth =~ /^(\d{2})\/(\d{2})\/(\d{4})$/) { $age = int(&convert_date($gmt_epoch, $timezone, 0) / 10000 - "$3.$1$2"); $date_of_birth = "$months[$1] ".int($2).", $3"; } if ($first_post_date) { $msgdays = int(($gmt_epoch - $first_post_date) / 86400); } if ($last_post_subject) { $last_post = "$last_post_subject on $title{$last_post_forum}"; } } sub display_bio { if ($use_backgrounds) { $j = $bgcolor[$bgtype]; } else { $j = $bgcolor; } print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Mini-Biography of $name\n"; print "\n"; if ($use_backgrounds) { print "

\n"; } elsif ($standardbg) { print "

\n"; } else { print "

\n"; } print "$header\n"; print "

Back

\n"; print "

$statstable\n"; if ($portrait) { print " \n"; print " \n"; print " \n"; } if ($realname ne $name) { print " \n"; print " $titlefontNick: \n"; print " $name\n"; print " \n"; } if ($realname) { print " \n"; print " $titlefontReal Name: \n"; print " $realname\n"; print " \n"; } if ($email) { print " \n"; print " $titlefontE-Mail: \n"; if ($realname && $realname ne $name) { print " \">$realname/$name <$email>\n"; } else { print " \">$name <$email>\n"; } print " \n"; } if ($sex && $age) { print " \n"; print " $titlefontAge/Sex: \n"; print " $age/$sex\n"; print " \n"; } elsif ($sex) { print " \n"; print " $titlefontSex: \n"; if ($sex eq "M") { print " Male\n"; } else { print " Female\n"; } print " \n"; } elsif ($age) { print " \n"; print " $titlefontAge: \n"; print " $age\n"; print " \n"; } if ($date_of_birth) { print " \n"; print " $titlefontDate of Birth: \n"; print " $date_of_birth\n"; print " \n"; } if ($current_residence) { print " \n"; print " $titlefontCurrent Residence: \n"; print " $current_residence\n"; print " \n"; } if ($occupation) { print " \n"; print " $titlefontOccupation: \n"; print " $occupation\n"; print " \n"; } if ($homepage) { print " \n"; print " $titlefontHome Page: \n"; print " $homepage\n"; print " \n"; } if ($interests) { print " \n"; print " $titlefontInterests: \n"; print " $interests\n"; print " \n"; } for ($k = 1;$k < @custom_entry_description;$k++) { if ($custom_entry_description[$k] =~ /^ICQ/i && int($custom_entry[$k])) { print " \n"; print " $titlefont$custom_entry_description[$k]: \n"; print " $custom_entry[$k] \"$custom_entry[$k]\"\n"; print " \n"; } elsif ($custom_entry[$k]) { print " \n"; print " $titlefont$custom_entry_description[$k]: \n"; print " $custom_entry[$k]\n"; print " \n"; } } if ($description) { print " \n"; print " $titlefontDescription: \n"; print " \n"; print " \n"; print " $description\n"; print " \n"; } if ($last_post) { print " \n"; print " $titlefontLast Post: \n"; print " $last_post\n"; print " \n"; } if (%stats_ip && ($use_ip_display || &validate_password >= 2)) { print " \n"; print " $titlefontTop 5 IP Addresses: \n"; print " \n"; print " \n"; print "

    \n"; $k = 0; foreach $l (sort { $stats_ip{$b} <=> $stats_ip{$a} } keys %stats_ip) { print "
  1. $l ($stats_ip{$l})
  2. \n"; if (++$k == 5) { last; } } print " \n"; print " \n"; } if (%stats_browser) { print " \n"; print " $titlefontTop 5 Browsers/OSs: \n"; print " \n"; print " \n"; print "
      \n"; $k = 0; foreach $l (sort { $stats_browser{$b} <=> $stats_browser{$a} } keys %stats_browser) { print "
    1. ".&get_browser_info($l)." ($stats_browser{$l})
    2. \n"; if (++$k == 5) { last; } } print " \n"; print " \n"; } print "

      \n\n"; print "

      TM = Total Messages
      \n"; print "RM = Real Messages
      \n"; print "NTM = No Text Messages
      \n"; print "AMD = Average Messages per Day
      \n"; print "TW = Total Words
      \n"; print "AWM = Average Words per Message
      \n"; print "Score = sqrt(TM * TW)

      \n\n"; print "

      $statstable\n"; print " \n"; print " $titlefontForum \n"; print " $titlefontTM \n"; print " $titlefontRM \n"; print " $titlefontNTM \n"; print " $titlefontRM% \n"; print " $titlefontNTM% \n"; print " $titlefontAMD \n"; print " $titlefontTW \n"; print " $titlefontAWM \n"; print " $titlefontScore \n"; print " \n"; foreach $k (sort keys %indexfile) { if ($option{$k}) { next; } print " \n"; print " $titlefont$title{$k} \n"; print "  ".int($stats_msgs{$k})."\n"; if ($stats_msgs{$k}) { print "  ".int($stats_msgs{$k} - $stats_ntmsgs{$k})."\n"; print "  ".int($stats_ntmsgs{$k})."\n"; print "  ".int(($stats_msgs{$k} - $stats_ntmsgs{$k}) / $stats_msgs{$k} * 100 + .5)."%\n"; print "  ".int($stats_ntmsgs{$k} / $stats_msgs{$k} * 100 + .5)."%\n"; } else { print "  0\n"; print "  0\n"; print "  0%\n"; print "  0%\n"; } if ($msgdays) { print "  ".(int($stats_msgs{$k} / $msgdays * 100 + .5) / 100)."\n"; } else { print "  ---\n"; } print "  ".int($stats_words{$k})."\n"; if ($stats_msgs{$k}) { print "  ".int($stats_words{$k} / $stats_msgs{$k} + .5)."\n"; } else { print "  ---\n"; } print "  ".int(sqrt($stats_words{$k} * $stats_msgs{$k}))."\n"; print " \n"; $total_msgs += $stats_msgs{$k}; $total_ntmsgs += $stats_ntmsgs{$k}; $total_words += $stats_words{$k}; } print " \n"; print " $titlefont$title{'Default'} \n"; print "  ".int($total_msgs)."\n"; if ($total_msgs) { print "  ".int($total_msgs - $total_ntmsgs)."\n"; print "  ".int($total_ntmsgs)."\n"; print "  ".int(($total_msgs - $total_ntmsgs) / $total_msgs * 100 + .5)."%\n"; print "  ".int($total_ntmsgs / $total_msgs * 100 + .5)."%\n"; } else { print "  0\n"; print "  0\n"; print "  0%\n"; print "  0%\n"; } if ($msgdays) { print "  ".(int($total_msgs / $msgdays * 100 + .5) / 100)."\n"; } else { print "  ---\n"; } print "  ".int($total_words)."\n"; if ($total_msgs) { print "  ".int($total_words / $total_msgs + .5)."\n"; } else { print "  ---\n"; } print "  ".int(sqrt($total_words * $total_msgs))."\n"; print " \n"; print "

      \n\n"; &print_credits; } sub display_names { opendir(DEFAULTLIST,"$basedir/$defaultdir") || &tech_error("Can't open listing for $basedir/$defaultdir"); @defaultlist = sort grep { /^\w*\.txt$/ } readdir(DEFAULTLIST); closedir(DEFAULTLIST); print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Mini-Biographies\n"; print "\n"; if ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont

      Mini-Biographies

      \n"; print "

      "; foreach $filename (@defaultlist) { if ($filename =~ /^(\w*)\.txt$/) { $name = $1; &get_default; print "$name
      \n"; } } print "

      \n\n"; &print_credits; } #!/usr/bin/perl ############################################################################## # RPGBoard version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## $SIG{__DIE__} = \&tech_error; sub tech_error { print "Content-type: text/plain; charset=$charset\n\n"; print "ERROR: $_[0]"; exit; } require 5.004; for $j ("rpgvariables.h", "rpgglobal.h", "rpgerrors.h", "rpgmessage.h") { unless ($k = do $j) { &tech_error("Couldn't parse $j: $@") if $@; &tech_error("Couldn't do $j: $!") unless defined $k; } } unless ($forum) { print "Content-type: text/html; charset=$charset\n\n"; &get_default; &get_master_default; &rest_of_form; } else { &calc_expire_time; &get_variables; &check_banlist; &get_default; &get_master_default; if ($forum && $force_registeration && !($recordfound)) { &error(need_register); } elsif (($force_registeration || $recordfound) && !(&validate_password)) { &error(bad_password); } &print_cookies; if ($FORM{'action'} eq "post" || $FORM{'msgtags'} eq "N") { &get_number; &main_page; &create_headers; &new_file; unless ($option == 2) { &change_stats; } &add_default; if (($mailto || $auto_email{$forum}) && $use_email) { &email_message; } if ($auto_save eq "Y") { &save_message; } &error(success); } else { &create_headers; if ($FORM{'action'} eq "spellcheck") { &spell_check; } else { $spellbody = $body; } if ($auto_save eq "Y") { &save_message; } &view_post; } } ############################ # Get Data Number Subroutine sub get_number { $filename = "$basedir/$mesgdir/".&convert_date($gmt_epoch, " 0000", 0); unless (-e "$filename.loc") { &delete_datafiles; &archive_datafiles; &compress_datafiles; opendir(INDEXLIST,"$basedir/$mesgdir") || &tech_error("Can't open listing for $basedir/$mesgdir while retrieving the current MessageID!"); @indexlist = reverse sort grep { /\.loc$/ } readdir(INDEXLIST); closedir(INDEXLIST); unless ($indexlist[0]) { open(LOCFILE,">$filename.loc") || &tech_error("Can't create $filename.loc!"); print LOCFILE pack("L", "1"); close(LOCFILE); open(MSGFILE,">$filename.msg") || &tech_error("Can't create $filename.msg!"); close(MSGFILE); open(INDEXFILE,">$filename.index") || &tech_error("Can't create $filename.index!"); close(INDEXFILE); chmod $chmod_num, "$filename.loc"; chmod $chmod_num, "$filename.msg"; chmod $chmod_num, "$filename.index"; $num = 1; } else { open(LOCFILE,"$basedir/$mesgdir/".$indexlist[0]) || &tech_error("Can't read $basedir/$mesgdir/".$indexlist[0]." while looking for MessageID!"); read(LOCFILE,$num,4); $num = unpack("L", $num); $num += (length(join('', )) / 4); close(LOCFILE); open(LOCFILE,">$filename.loc") || &tech_error("Can't create $filename.loc!"); print LOCFILE pack("L", $num); close(LOCFILE); open(MSGFILE,">$filename.msg") || &tech_error("Can't create $filename.msg!"); close(MSGFILE); open(INDEXFILE,">$filename.index") || &tech_error("Can't create $filename.index!"); close(INDEXFILE); chmod $chmod_num, "$filename.loc"; chmod $chmod_num, "$filename.msg"; chmod $chmod_num, "$filename.index"; &lock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); } } else { open(LOCFILE,&read_datefile(&lock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"))) || &tech_error("Can't read ".&convert_date($gmt_epoch, " 0000", 0).".loc while looking for MessageID!"); read(LOCFILE,$num,4); $num = unpack("L", $num); $num += (length(join('', )) / 4); close(LOCFILE); } unless ($querydate) { $rootnum = $num; $rootdate = $gmt_epoch; $HEADER{"Root MessageID"} = $rootnum; $HEADER{"Root Date"} = $rootdate; } } ############### # Get Variables sub get_variables { # Follow-up variables if ($FORM{'rootnum'}) { $rootnum = $FORM{'rootnum'}; $rootdate = $FORM{'rootdate'}; $HEADER{"Root MessageID"} = $rootnum; $HEADER{"Root Date"} = $rootdate; if (($rootdate + $expire_time * 3600) < $gmt_epoch) { &error(too_old); } } # Get name if ($FORM{'name'}) { $name = "$FORM{'name'}"; $name =~ s/"//g; $name =~ s///g; $name =~ s/\&//g; } else { &error(no_name); } # Load message (if clicked) if ($FORM{'submit'} eq "Load") { &load_message; &error(loaded); } # Quote message (if clicked) if ($FORM{'submit'} eq "Quote") { "e_message; &error(quoted); } # Get e-mail if ($FORM{'email'} =~ /\@.*\./) { $email = $FORM{'email'}; } # Check if the author of this message wants e-mail responses if ($FORM{'mailto'}) { $mailto = $FORM{'mailto'}; } # Correct/add SpellCheck words foreach $formkey (keys %FORM) { if ($formkey =~ /spellcheck-(.*)/) { $word = $1; unless ($FORM{$formkey} eq "+") { $FORM{'body'} =~ s/>$word$FORM{$formkey}$word([^\w<>=\"])/>$FORM{$formkey}$1/g; $FORM{'body'} =~ s/([^\w<>=\"])$word=\"])/$FORM{$formkey}$1/g; $FORM{'body'} =~ s/([^\w<>=\"])$word$/$1$FORM{$formkey}/g; $FORM{'body'} =~ s/([^\w<>=\"])$word([^\w<>=\"])/$1$FORM{$formkey}$2/g; $FORM{'body'} =~ s/([^\w<>=\"])$word([^\w<>=\"])/$1$FORM{$formkey}$2/g; } else { $soundex = uc(substr($word,0,1)); $soundexnum = lc(substr($word,1)); $soundexnum =~ s/[aehiouwy]//g; $soundex = $soundex.uc(substr($soundexnum,0,1)); $soundexnum =~ tr/bfpv/1/; $soundexnum =~ tr/cgjkqsxz/2/; $soundexnum =~ tr/dt/3/; $soundexnum =~ tr/l/4/; $soundexnum =~ tr/mn/5/; $soundexnum =~ tr/r/6/; $soundex = $soundex.substr($soundexnum,1,2).uc(substr($word,-1,1)); open(DICTIONARY,">>$basedir/$slangfile") || &tech_error("Can't append to slang dictionary file, $basedir/$slangfile!"); print DICTIONARY "$word=$soundex\n"; close(DICTIONARY); } } } # Filter words if ($use_filter) { foreach $word (keys %filter) { $word_lower = $word; $word_lower =~ tr/A-Z/a-z/; $word_lower =~ tr/À-Ö/à-ö/; $word_lower =~ tr/Ù-Ý/ù-ý/; $word_upper = $word; $word_upper =~ tr/a-z/A-Z/; $word_upper =~ tr/à-ö/À-Ö/; $word_upper =~ tr/ù-ý/Ù-Ý/; $word_capital = substr($word_upper, 0, 1).substr($word_lower, 1); $replace_lower = $filter{$word}; $replace_lower =~ tr/A-Z/a-z/; $replace_lower =~ tr/À-Ö/à-ö/; $replace_lower =~ tr/Ù-Ý/ù-ý/; $replace_upper = $filter{$word}; $replace_upper =~ tr/a-z/A-Z/; $replace_upper =~ tr/à-ö/À-Ö/; $replace_upper =~ tr/ù-ý/Ù-Ý/; $replace_capital = substr($replace_upper, 0, 1).substr($replace_lower, 1); $FORM{'subject'} =~ s/\Q$word_lower/$replace_lower/g; $FORM{'subject'} =~ s/\Q$word_upper/$replace_upper/g; $FORM{'subject'} =~ s/\Q$word_capital/$replace_capital/g; $FORM{'subject'} =~ s/\Q$word/$filter{$word}/gi; $FORM{'body'} =~ s/\Q$word_lower/$replace_lower/g; $FORM{'body'} =~ s/\Q$word_upper/$replace_upper/g; $FORM{'body'} =~ s/\Q$word_capital/$replace_capital/g; $FORM{'body'} =~ s/\Q$word/$filter{$word}/gi; $FORM{'spoilbody'} =~ s/\Q$word_lower/$replace_lower/g; $FORM{'spoilbody'} =~ s/\Q$word_upper/$replace_upper/g; $FORM{'spoilbody'} =~ s/\Q$word_capital/$replace_capital/g; $FORM{'spoilbody'} =~ s/\Q$word/$filter{$word}/gi; } } # Subjectline $FORM{'subject'} = substr($FORM{'subject'}, 0, $subjectline_length); $FORM{'subject'} =~ s/\s*$//g; if ($FORM{'subject'}) { $subject = "$FORM{'subject'}"; $subject =~ s/&/&/g; $subject =~ s/"/"/g; $subject =~ s//>/g; $subject =~ s/ /  /g; $subject =~ s/ /  /g; } else { &error(no_subject); } if ($subject =~ /(.*)[\(\*\-\/\\]nt[\\\/\-\*\)]$/i) { $subject = $1; $subject =~ s/\s*$//g; $FORM{'msgtags'} = "N"; } if ($FORM{'submit'} eq "*nt*") { $FORM{'msgtags'} = "N"; } # Optional link if ($FORM{'url'} =~ /\:.+\..+\// && $FORM{'url_title'}) { $message_url = "$FORM{'url'}"; $message_url =~ s///g; $message_url_title = "$FORM{'url_title'}"; $message_url_title =~ s///g; } # Optional image if ($FORM{'img'} =~ /\:.+\..+\// && $use_html >= 2) { $message_img = "$FORM{'img'}"; $message_img =~ s///g; } # Background if ($FORM{'bgtype'}) { $bgtype = "$FORM{'bgtype'}"; } # Message tags if ($FORM{'msgtags'}) { $msgtag = "$FORM{'msgtags'}"; } # Game/Section information if ($FORM{'section'}) { $section = "$FORM{'section'}"; $section =~ s///g; } if ($msgtag eq "N") { if ($message_url && $message_img) { $section = "Link/Image Inside" } elsif ($message_url) { $section = "Link Inside" } elsif ($message_img) { $section = "Image Inside" } else { undef $section; } } # Message/spoiler body $FORM{'body'} =~ s/^[\s\n]*$//g; $FORM{'spoilbody'} =~ s/^[\s\n]*$//g; unless ($use_html) { $FORM{'body'} =~ s/<(.*?)>/$1/g; $FORM{'spoilbody'} =~ s/<(.*?)>/$1/g; } elsif ($use_html == 1) { $FORM{'body'} =~ s/<[\s]*IMG(.*?)>//gi; $FORM{'body'} =~ s/<[\s]*EMBED(.*?)>//gi; $FORM{'body'} =~ s/<[\s]*[\/]?TABLE(.*?)>//gi; $FORM{'body'} =~ s/<[\s]*[\/]?T[DHR](.*?)>//gi; $FORM{'spoilbody'} =~ s/<[\s]*IMG(.*?)>//gi; $FORM{'spoilbody'} =~ s/<[\s]*EMBED(.*?)>//gi; $FORM{'spoilbody'} =~ s/<[\s]*[\/]?TABLE(.*?)>//gi; $FORM{'spoilbody'} =~ s/<[\s]*[\/]?T[DHR](.*?)>//gi; } elsif ($use_html == 2) { $FORM{'body'} =~ s/<[\s]*[\/]?TABLE(.*?)>//gi; $FORM{'body'} =~ s/<[\s]*[\/]?T[DHR](.*?)>//gi; $FORM{'spoilbody'} =~ s/<[\s]*[\/]?TABLE(.*?)>//gi; $FORM{'spoilbody'} =~ s/<[\s]*[\/]?T[DHR](.*?)>//gi; } if ($FORM{'body'}) { $body = "$FORM{'body'}"; $body =~ s/\cM//g; if ($FORM{'convert_html'} || !($use_html)) { $body =~ s/\n\n/

      /g; $body =~ s/\n/
      /g; $body =~ s/ /  /g; $body =~ s/ /  /g; $body =~ s/(.{80})(.*?) /$1$2\n/g } } elsif ($msgtag ne "N") { &error(no_body); } if ($FORM{'spoilbody'}) { $spoilbody = "$FORM{'spoilbody'}"; $spoilbody =~ s/\cM//g; if ($FORM{'convert_html'} || !($use_html)) { $spoilbody =~ s/\n\n/

      /g; $spoilbody =~ s/\n/
      /g; $spoilbody =~ s/ /  /g; $spoilbody =~ s/ /  /g; $spoilbody =~ s/(.{80})(.*?) /$1$2\n/g } } if ($msgtag eq "N" && $body) { &error(body_with_notext); } # E-Mail response switch if ($FORM{'email_responses'} && $use_email) { if ($email) { $email_responses = "1"; } else { &error(no_email); } } # Save message (if clicked) if ($FORM{'submit'} eq "Save") { &save_message; &error(saved); } } ############################# # Check for banned IP numbers sub check_banlist { open(BANLIST,"$basedir/$banfile") || &tech_error("Can't read ban file, $basedir/$banfile! Does it exist?"); @banlist = ; close(BANLIST); foreach $ban_line (@banlist) { if ($ban_line =~ /^(.+?)\s.*$/) { $regexpr = $1; $regexpr =~ s/^\s*//g; $regexpr =~ s/\s*$//g; $regexpr =~ s/\./\\\./g; $regexpr =~ s/\*/\.\+/g; $regexpr = "^".$regexpr."\$"; if ($remotehost =~ /$regexpr/) { &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); &error(banned); } elsif ($ENV{'REMOTE_ADDR'} =~ /$regexpr/) { &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); &error(banned); } elsif ($ENV{'HTTP_X_FORWARDED_FOR'} =~ /$regexpr/) { &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); &error(banned); } } } } ################ # Spell Checker! sub spell_check { if ($dictionaryfile =~ /\.bz2$/) { open(DICTIONARY,"/usr/bin/bzip2 -cd $basedir/$dictionaryfile |") || &tech_error("Can't unbzip and/or read dictionary file $basedir/$dictionaryfile!"); } elsif ($dictionaryfile =~ /\.gz$/) { open(DICTIONARY,"/bin/gzip -cd $basedir/$dictionaryfile |") || &tech_error("Can't ungzip and/or read dictionary file $basedir/$dictionaryfile!"); } else { open(DICTIONARY,"$basedir/$dictionaryfile") || &tech_error("Can't read dictionary file $basedir/$dictionaryfile!"); } @dictionary = split(/\n/,join('',)); close(DICTIONARY); foreach $wordpair (@dictionary) { ($word,$soundex) = split(/=/,$wordpair); $dictionary{$word} = $soundex; $soundex{$soundex} = $soundex{$soundex}.$word." "; } open(DICTIONARY,"$basedir/$slangfile"); @dictionary = split(/\n/,join('',)); close(DICTIONARY); foreach $wordpair (@dictionary) { ($word,$soundex) = split(/=/,$wordpair); $dictionary{$word} = $soundex; $soundex{$soundex} = $soundex{$soundex}." ".$word; } $wordbody = $FORM{'body'}; $wordbody =~ s/\n/ /g; $wordbody =~ s/<(.*?)>//g; $wordbody =~ s/\.\.\./ /g; $wordbody =~ s/\-/ /g; $wordbody =~ s/[^\w\s]//g; $wordbody =~ s/\d//g; $wordbody =~ s/\_//g; $wordbody =~ s/[\s]+/ /g; $wordbody =~ s/^[\s]+//g; @words = split(/ /,$wordbody); foreach $word (@words) { $soundex = uc(substr($word,0,1)); $soundexnum = lc(substr($word,1)); $soundexnum =~ s/[aehiouwy]//g; $soundex = $soundex.uc(substr($soundexnum,0,1)); $soundexnum =~ tr/bfpv/1/; $soundexnum =~ tr/cgjkqsxz/2/; $soundexnum =~ tr/dt/3/; $soundexnum =~ tr/l/4/; $soundexnum =~ tr/mn/5/; $soundexnum =~ tr/r/6/; $soundex = $soundex.substr($soundexnum,1,2).uc(substr($word,-1,1)); $words{$word} = $soundex; } foreach $msgword (keys %words) { if ($dictionary{lc($msgword)}) { next; } unless ($dictionary{$msgword}) { $selectline = "

      \n$footerbody"; if ($use_backgrounds) { $j = $bgcolor[$bgtype]; } else { $j = $bgcolor; } if ($spoilbody) { $spoilbody = "$mesgfont\"$spoilbody\""; } print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " View Your Message\n"; print "\n"; if ($use_backgrounds) { print "


      \n"; } elsif ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      View Your Message
      \n"; print "

      $forumline

      \n"; print "

      This is your message.  If you have an error, make your changes below.  Any words you select from the SpellCheck will be changed on the next preview, so you don't need to worry about changing them in the message box.

      \n"; print "
      \n"; &message_table; print "

      $forumline

      \n"; print $headerfont."Make Your Changes

      \n"; &rest_of_form; exit; } sub create_headers { $HEADER{"MessageID"} = $num; $HEADER{"Date"} = $gmt_epoch; $HEADER{"Time Zone"} = $timezone; $HEADER{"Name"} = $name; if ($email) { $HEADER{"E-Mail"} = $email; } if ($mailto) { $HEADER{"Mail to"} = "$mailto"; } $HEADER{"IP Address"} = $ENV{'REMOTE_ADDR'}; $HEADER{"IP Name"} = $remotehost; $HEADER{"Image"} = $message_img; $HEADER{"Link URL"} = $message_url; $HEADER{"Link Title"} = $message_url_title; if ($ENV{'HTTP_X_FORWARDED_FOR'}) { $HEADER{"Proxy Destination"} = $ENV{'HTTP_X_FORWARDED_FOR'}; } $HEADER{"HTTP_USER_AGENT"} = $ENV{'HTTP_USER_AGENT'}; $HEADER{"Root MessageID"} = $rootnum; $HEADER{"Root Date"} = $rootdate; if ($use_backgrounds) { $HEADER{"Background"} = $bgtype; } if ($msgtag) { $HEADER{"Tag"} = $msgtag; if ($section) { $HEADER{"Spoiler Text"} = $section; } } $HEADER{"Subject"} = $subject; } ##################### # New File Subroutine sub new_file { &lock_datefile(&convert_date($gmt_epoch, " 0000", 0).".msg"); $filename = "$basedir/$mesgdir/".&convert_date($gmt_epoch, " 0000", 0); open(MSGFILE,"$filename.msg") || &tech_error("Can't read $filename.msg while looking for message offset!"); $msgoffset = length(join('', )); close(MSGFILE); open(MSGFILE,">>$filename.msg") || &tech_error("Can't append to $filename.msg!"); print MSGFILE "MessageID: ".$HEADER{"MessageID"}."\n"; print MSGFILE "Date: ".$HEADER{"Date"}."\n"; print MSGFILE "Time Zone: ".$HEADER{"Time Zone"}."\n"; print MSGFILE "Name: ".$HEADER{"Name"}."\n"; if ($HEADER{"E-Mail"}) { print MSGFILE "E-Mail: ".$HEADER{"E-Mail"}."\n"; } if ($email_responses) { if ($realname && $realname ne $name) { print MSGFILE "Mail to: $realname/$name <$email>\n"; } else { print MSGFILE "Mail to: $name <$email>\n"; } } print MSGFILE "IP Address: ".$HEADER{"IP Address"}."\n"; print MSGFILE "IP Name: ".$HEADER{"IP Name"}."\n"; if ($HEADER{"Image"}) { print MSGFILE "Image: ".$HEADER{"Image"}."\n"; } if ($HEADER{"Link URL"}) { print MSGFILE "Link URL: ".$HEADER{"Link URL"}."\n"; print MSGFILE "Link Title: ".$HEADER{"Link Title"}."\n"; } if ($HEADER{"Proxy Destination"}) { print MSGFILE "Proxy Destination: ".$HEADER{"Proxy Destination"}."\n"; } print MSGFILE "HTTP_USER_AGENT: ".$HEADER{"HTTP_USER_AGENT"}."\n"; print MSGFILE "Root MessageID: ".$HEADER{"Root MessageID"}."\n"; print MSGFILE "Root Date: ".$HEADER{"Root Date"}."\n"; if ($use_backgrounds) { print MSGFILE "Background: ".$HEADER{"Background"}."\n"; } if ($HEADER{"Tag"}) { print MSGFILE "Tag: ".$HEADER{"Tag"}."\n"; if ($HEADER{"Spoiler Text"}) { print MSGFILE "Spoiler Text: ".$HEADER{"Spoiler Text"}."\n"; } } print MSGFILE "Subject: $subject\n"; $j = $footerbody; $j =~ s/\n/\\n/g; print MSGFILE "Footer: $j\n"; print MSGFILE "\xff\n"; unless ($HEADER{"Tag"} eq "N") { print MSGFILE "$mesgfont$body\n"; } else { print MSGFILE "$mesgfont".$HEADER{"Subject"}."\n"; } print MSGFILE "\xff\n"; unless ($HEADER{"Tag"} eq "N" || !($use_spoilermsg) || !($spoilbody)) { if ($use_backgrounds) { $j = $bgcolor[$HEADER{"Background"}]; } else { $j = $bgcolor; } print MSGFILE "$mesgfont\"$spoilbody\"\n"; } print MSGFILE "\xff\xff\xff\n"; close(MSGFILE); open(LOCFILE,">>$filename.loc") || &tech_error("Can't append to $filename.loc!"); print (LOCFILE pack("L", $msgoffset)) || &tech_error("Can't print to $filename.loc! (Possibly out of disk space; file may be corrupt.)"); close(LOCFILE); &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".msg"); &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); } ############################### # Main RPGBoard Page Subroutine sub main_page { open(MAIN,&read_datefile(&lock_datefile(&convert_date($rootdate, " 0000", 0).".index"))) || &tech_error("Can't read ".&convert_date($rootdate, " 0000", 0).".index while adding a header! (Read method: ".&read_datefile(&convert_date($rootdate, " 0000", 0).".index").")"); @main =

      ; close(MAIN); unless ($querydate) { if ($main[0] =~ /\xff\Q$subject\E\xff.*\xff.*\xff\Q$name\E\xff\d*D/) { unshift(@main,"$gmt_epoch\xff$subject\xff$msgtag\xff$section\xff$name\xff$num\n"); } elsif ($main[0] =~ /\xff\Q$subject\E\xff.*\xff.*\xff\Q$name\E\xff/) { &unlock_datefile(&convert_date($rootdate, " 0000", 0).".index"); &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); &error(dupe_msg); } else { unshift(@main,"$gmt_epoch\xff$subject\xff$msgtag\xff$section\xff$name\xff$num\n"); } } else { for ($j = 0;$j < @main;$j++) { if ($main[$j] =~ /^([\ ]*).*\xff.*\xff.*\xff.*\xff.*\xff$querynum(D|M[-\+]+\d+)?$/) { $spaces = $1; if ($2 eq "D") { &unlock_datefile(&convert_date($rootdate, " 0000", 0).".index"); &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); &error(msg_deleted); } elsif ($main[$j+1] =~ /\xff\Q$subject\E\xff.*\xff.*\xff\Q$name\E\xff\d*D/) { splice(@main,++$j,0,"$spaces $gmt_epoch\xff$subject\xff$msgtag\xff$section\xff$name\xff$num\n"); } elsif ($main[$j+1] =~ /\xff\Q$subject\E\xff.*\xff.*\xff\Q$name\E\xff/) { &unlock_datefile(&convert_date($rootdate, " 0000", 0).".index"); &unlock_datefile(&convert_date($gmt_epoch, " 0000", 0).".loc"); &error(dupe_msg); } else { splice(@main,++$j,0,"$spaces $gmt_epoch\xff$subject\xff$msgtag\xff$section\xff$name\xff$num\n"); } last; } } } open(MAIN,&write_datefile(&convert_date($rootdate, " 0000", 0).".index")) || &tech_error("Can't write ".&convert_date($rootdate, " 0000", 0).".index while adding a header! (Write method: ".&read_datefile(&convert_date($rootdate, " 0000", 0).".index").")"); print (MAIN @main) || &tech_error("Can't print to ".&convert_date($rootdate, " 0000", 0).".index! (Possibly out of disk space; file may be corrupt.)"); close(MAIN); &unlock_datefile(&convert_date($rootdate, " 0000", 0).".index"); } sub change_stats { # Last post info $last_post_subject = $HEADER{"Subject"}; $last_post_msg = $num; $last_post_forum = $forum; $last_post_date = $gmt_epoch; # IP name/number unless ($remotehost eq "???") { @ip_sections = split (/\./, $remotehost); } else { @ip_sections = split (/\./, $ENV{'REMOTE_ADDR'}); } if ($ENV{'HTTP_X_FORWARDED_FOR'}) { $ip_sections[$#ip_sections] = "$ip_sections[$#ip_sections]/$ENV{'HTTP_X_FORWARDED_FOR'}"; } for ($j = 0; $j < (@ip_sections - 1); $j++) { @ip_compare = @ip_sections; for ($k = 1; $k <= $j; $k++) { shift(@ip_compare); } $ip_compare = join(".", @ip_compare); foreach $k (keys %stats_ip) { if ($k =~ /\Q$ip_compare\E$/) { $l = $stats_ip{$k} + 1; delete $stats_ip{$k}; if ($j == 0) { $stats_ip{$ip_compare} = $l; } else { $stats_ip{"*.$ip_compare"} = $l; } $ipnamefound = "yes"; last; } } if ($ipnamefound) { last; } } unless ($ipnamefound) { @j = sort { $stats_ip{$a} <=> $stats_ip{$b} } keys %stats_ip; if (scalar(@j) >= 10) { undef $stats_ip{$j[0]}; } $stats_ip{join(".", @ip_sections)}++; } # Browser/OS foreach $j (keys %stats_browser) { if ($j eq $ENV{'HTTP_USER_AGENT'}) { $stats_browser{$j}++; $browserfound = "yes"; last; } } unless ($browserfound) { @j = sort { $stats_ip{$a} <=> $stats_ip{$b} } keys %stats_ip; if (scalar(@j) >= 10) { undef $stats_ip{$j[0]}; } $stats_browser{$ENV{'HTTP_USER_AGENT'}}++; } # Message counts $stats_msgs{$forum}++; if ($HEADER{"Tag"} eq "N") { $stats_ntmsgs{$forum}++; } $wordbody = "$subject $FORM{'body'} $FORM{'spoilbody'}"; $wordbody =~ s/\n/ /g; $wordbody =~ s/<.*?>//g; $wordbody =~ s/\.\.\./ /g; $wordbody =~ s/\-/ /g; $wordbody =~ s/[^\w\s]//g; $wordbody =~ s/\d//g; $wordbody =~ s/\_//g; $wordbody =~ s/[\s]+/ /g; $wordbody =~ s/^[\s]+//g; while ($wordbody =~ /\b\w+\b/gc) { $stats_words{$forum}++; } } sub delete_datafiles { unless ($delete_days) { return; } $border_date = &convert_date($gmt_epoch - $delete_days * 86400, " 0000", 0); opendir(INDEXLIST,"$basedir/$mesgdir") || &tech_error("Can't open listing for $basedir/$mesgdir while deleting old data files!"); @indexlist = reverse sort grep { /\.index(?:\.gz|\.bz2)?$/ } readdir(INDEXLIST); closedir(INDEXLIST); for ($j = shift(@indexlist); $j; $j = shift(@indexlist)) { if ($j =~ /(\d*)\.index/) { $filedate = $1; if (length($filedate) == 4) { $sortfiledate = $filedate."9999"; } elsif (length($filedate) == 6) { $sortfiledate = $filedate."99"; } else { $sortfiledate = $filedate; } if (($sortfiledate cmp $border_date) == -1) { unlink "$basedir/$mesgdir/$filedate.index"; unlink "$basedir/$mesgdir/$filedate.index.gz"; unlink "$basedir/$mesgdir/$filedate.msg"; unlink "$basedir/$mesgdir/$filedate.msg.gz"; unlink "$basedir/$mesgdir/$filedate.loc"; unlink "$basedir/$mesgdir/$filedate.loc.gz"; } } } opendir(INDEXLIST,"$basedir/$defaultdir") || &tech_error("Can't open listing for $basedir/$defaultdir while deleting old default files!"); @indexlist = reverse sort grep { /\.txt$/ } readdir(INDEXLIST); closedir(INDEXLIST); for ($j = shift(@indexlist); $j; $j = shift(@indexlist)) { if ($j eq "!!default.txt" || $j eq "sineswiper.txt") { next; } ($z,$z,$z,$z,$z,$z,$z,$z,$z,$mtime,$z,$z,$z) = stat("$basedir/$defaultdir/$j"); if ($mtime < $gmt_epoch - $delete_days * 86400 * 2) { unlink "$basedir/$defaultdir/$j"; } } } sub archive_datafiles { unless ($archive_days) { return; } $border_date = &convert_date($gmt_epoch - $archive_days * 86400, " 0000", 0); opendir(INDEXLIST,"$basedir/$mesgdir") || &tech_error("Can't open listing for $basedir/$mesgdir while archiving old data files!"); @indexlist = reverse sort grep { /\.index(?:\.gz|\.bz2)?$/ } readdir(INDEXLIST); closedir(INDEXLIST); for ($j = shift(@indexlist); $j; $j = shift(@indexlist)) { if ($j =~ /(\d*)\.index/) { $filedate = $1; if (length($filedate) == 4) { next; } elsif (length($filedate) == 6) { $sortfiledate = substr($filedate, 0, -2)."9999"; } else { $sortfiledate = substr($filedate, 0, -2)."99"; } if (($sortfiledate cmp $border_date) == -1) { $newfiledate = substr($filedate, 0, -2); $newfilename = "$basedir/$mesgdir/$newfiledate"; opendir(INDEXLIST,"$basedir/$mesgdir") || &tech_error("Can't open listing for $basedir/$mesgdir while archiving to $newfilename.*!"); @archive_indexlist = sort grep { /$newfiledate\d+\.index(\.gz)?$/ } readdir(INDEXLIST); closedir(INDEXLIST); for ($k = 0; $k < @archive_indexlist; $k++) { if ($archive_indexlist[$k] =~ /(\d*)\.index/) { if ((length($1) == 6 && ($1."99" cmp $border_date) == -1) || (length($1) == 8 && ($1 cmp $border_date) == -1)) { $archive_indexlist[$k] = $1; } else { splice(@archive_indexlist, $k--, 1); } } } unless (-e "$newfilename.loc") { open(LOCFILE,&read_datefile($archive_indexlist[0].".loc")) || &tech_error("Can't read".$archive_indexlist[0].".loc while archiving to $newfilename.*! (Read method: ".&read_datefile($archive_indexlist[0].".loc").")"); open(NEWLOCFILE,">$newfilename.loc") || &tech_error("Can't create $newfilename.loc while archiving!"); read(LOCFILE,$newnum,4); $newnum = unpack("L", $newnum); print NEWLOCFILE pack("L", $newnum); close(NEWLOCFILE); close(LOCFILE); open(NEWMSGFILE,">$newfilename.msg") || &tech_error("Can't create $newfilename.msg while archiving!"); close(NEWMSGFILE); open(NEWINDEXFILE,">$newfilename.index") || &tech_error("Can't create $newfilename.index while archiving!"); close(NEWINDEXFILE); } &lock_datefile("$sortfiledate.index"); &lock_datefile("$sortfiledate.msg"); &lock_datefile("$sortfiledate.loc"); foreach $archive_indexfile (@archive_indexlist) { $currentfiledate = $archive_indexfile; $offsetcorrection = 0; undef $lastdeleted; if (length($currentfiledate) == 6) { $j = $currentfiledate."99"; } else { $j = $currentfiledate; } open(NEWMSGFILE,"$newfilename.msg") || &tech_error("Can't read $newfilename.msg while archiving!"); $newmsgoffset = length(join('', )); close(NEWMSGFILE); open(LOCFILE,&read_datefile("$j.loc")) || &tech_error("Can't read $j.loc while archiving! (Read method: ".&read_datefile("$j.loc").")"); $loclength = length(join('', )); close(LOCFILE); open(LOCFILE,&read_datefile("$j.loc")) || &tech_error("Can't read $j.loc while archiving! (Read method: ".&read_datefile("$j.loc").")"); open(MSGFILE,&read_datefile("$j.msg")) || &tech_error("Can't read $j.msg while archiving! (Read method: ".&read_datefile("$j.msg").")"); read(LOCFILE,$j,4); for ($j = 4; $j < $loclength; $j += 4) { read(LOCFILE,$msgoffset,4); $msgoffset = unpack("L", $msgoffset); if ($msgoffset == (2 ** 32 - 1)) { $alreadydeleted = "yes"; } elsif ($msgoffset >= (2 ** 31)) { if ($lastdeleted) { $offsetcorrection += ($msgoffset - (2 ** 31)) - $offsetdeleted; } $lastdeleted = "yes"; $offsetdeleted = $msgoffset - (2 ** 31); $msgoffset = (2 ** 32 - 1); } else { if ($lastdeleted) { $offsetcorrection += $msgoffset - $offsetdeleted; undef $lastdeleted; } $msgoffset -= $offsetcorrection; } unless ($msgoffset == (2 ** 32 - 1)) { $msgoffset += $newmsgoffset; } open(NEWLOCFILE,">>$newfilename.loc") || &tech_error("Can't append to $newfilename.loc while archiving!"); print NEWLOCFILE pack("L", $msgoffset); close(NEWLOCFILE); unless ($alreadydeleted) { open(NEWMSGFILE,">>$newfilename.msg") || &tech_error("Can't append to $newfilename.msg while archiving!"); while ($msgline = ) { unless ($lastdeleted) { print NEWMSGFILE $msgline; } if ($msgline eq "\xff\xff\xff\n") { last; } }; close(NEWMSGFILE); } undef $alreadydeleted; } close(MSGFILE); close(LOCFILE); opendir(INDEXLIST,"$basedir/$mesgdir") || &tech_error("Can't open listing for $basedir/$mesgdir while deleting $currentfiledate.[loc|msg] files!"); @delete_indexlist = grep { /^$currentfiledate.[loc|msg](\.gz)?$/ } readdir(INDEXLIST); closedir(INDEXLIST); foreach $deletefile (@delete_indexlist) { unlink "$basedir/$mesgdir/$deletefile"; } } foreach $archive_indexfile (reverse @archive_indexlist) { open(INDEXFILE,&read_datefile("$archive_indexfile.index")) || &tech_error("Can't read $archive_indexfile.index while archiving! (Read method: ".&read_datefile("$archive_indexfile.index").")"); open(NEWINDEXFILE,">>$newfilename.index") || &tech_error("Can't append to $newfilename.index while archiving!"); while ($indexline = ) { unless ($indexline =~ /D\n$/) { print NEWINDEXFILE $indexline; } } unlink "$basedir/$mesgdir/$archive_indexfile.index"; unlink "$basedir/$mesgdir/$archive_indexfile.index.gz"; } splice(@indexlist, 0, @archive_indexlist - 1, "$newfiledate.index"); &unlock_datefile("$sortfiledate.index"); &unlock_datefile("$sortfiledate.msg"); &unlock_datefile("$sortfiledate.loc"); } } } } sub compress_datafiles { unless ($compress_days) { return; } $border_date = &convert_date($gmt_epoch - $compress_days * 86400, " 0000", 0); opendir(INDEXLIST,"$basedir/$mesgdir") || &tech_error("Can't open listing for $basedir/$mesgdir while compressing old data files!"); @indexlist = reverse sort grep { /\.index$/ } readdir(INDEXLIST); closedir(INDEXLIST); for ($j = shift(@indexlist); $j; $j = shift(@indexlist)) { if ($j =~ /(\d*)\.index/) { $filedate = $1; if (length($filedate) == 4) { $sortfiledate = $filedate."9999"; } elsif (length($filedate) == 6) { $sortfiledate = $filedate."99"; } else { $sortfiledate = $filedate; } if (($sortfiledate cmp $border_date) == -1) { &lock_datefile("$sortfiledate.index"); if (-x "/usr/bin/bzip2") { $k = system "/usr/bin/bzip2 -f \"$basedir/$mesgdir/$filedate.index\""; if ($k) { &tech_error("Can't bzip $basedir/$mesgdir/$filedate.index!"); } } elsif (-x "/bin/gzip") { $k = system "/bin/gzip -fS \".gz\" \"$basedir/$mesgdir/$filedate.index\""; if ($k) { &tech_error("Can't gzip $basedir/$mesgdir/$filedate.index!"); } } else { return; } &unlock_datefile("$sortfiledate.index"); &lock_datefile("$sortfiledate.loc"); if (-x "/usr/bin/bzip2") { $k = system "/usr/bin/bzip2 -f \"$basedir/$mesgdir/$filedate.loc\""; if ($k) { &tech_error("Can't bzip $basedir/$mesgdir/$filedate.loc!"); } } elsif (-x "/bin/gzip") { $k = system "/bin/gzip -fS \".gz\" \"$basedir/$mesgdir/$filedate.loc\""; if ($k) { &tech_error("Can't gzip $basedir/$mesgdir/$filedate.loc!"); } } else { return; } &unlock_datefile("$sortfiledate.loc"); &lock_datefile("$sortfiledate.msg"); if (-x "/usr/bin/bzip2") { $k = system "/usr/bin/bzip2 -f \"$basedir/$mesgdir/$filedate.msg\""; if ($k) { &tech_error("Can't bzip $basedir/$mesgdir/$filedate.msg!"); } } elsif (-x "/bin/gzip") { $k = system "/bin/gzip -fS \".gz\" \"$basedir/$mesgdir/$filedate.msg\""; if ($k) { &tech_error("Can't gzip $basedir/$mesgdir/$filedate.msg!"); } } else { return; } &unlock_datefile("$sortfiledate.msg"); } } } } sub load_message { $defaultname = lc($name); $defaultname =~ s/\W//g; $filename = "$basedir/$savedir/$defaultname.txt"; open(SAVEFILE,"$filename") || &tech_error("Can't find $filename!"); @savefile = ; close(SAVEFILE); undef $j; foreach $line (@savefile) { if ($line =~ /^Subject: (.*)/) { $subject = $1; } elsif ($line =~ /^Message Body:/) { undef $FORM{'body'}; $j = 1; } elsif ($line =~ /^Spoiler Message:/) { undef $FORM{'spoilbody'}; $j = 2; } elsif ($j == 1) { $FORM{'body'} = $FORM{'body'}.$line; } elsif ($j == 2) { $FORM{'spoilbody'} = $FORM{'spoilbody'}.$line; } } } sub quote_message { &read_message; $FORM{'body'} = $body; $FORM{'body'} =~ s/\n/ /g; $FORM{'body'} =~ s/

      /\n\n/ig; $FORM{'body'} =~ s/
      /\n/ig; $FORM{'body'} =~ s/  / /g; $FORM{'body'} =~ s/  / /g; $FORM{'body'} =~ s/\<(?:.*?)\>//g; if ($use_html) { $FORM{'body'} =~ s/(\n|^)([^\n]+)/$1$2<\/b>/g; } $FORM{'body'} =~ s/\s*$//; $subject = $FORM{'subject'}; } sub save_message { $defaultname = lc($name); $defaultname =~ s/\W//g; $filename = "$basedir/$savedir/$defaultname.txt"; open(SAVEFILE,">$filename") || &tech_error("Can't create $filename!"); print SAVEFILE "Subject: $subject\n"; print SAVEFILE "Message Body:\n"; print SAVEFILE "$FORM{'body'}\n"; if ($FORM{'spoilbody'}) { print SAVEFILE "Spoiler Message:\n"; print SAVEFILE "$FORM{'spoilbody'}\n"; } close(SAVEFILE); chmod $chmod_num, "$filename"; } sub email_message { $mail_boundary = "------------".&dec2hex(int(rand(2 ** 32))).&dec2hex(int(rand(2 ** 32))).&dec2hex(int(rand(2 ** 32))); $textbody = $body; $textbody =~ s/<(.*?)>//g; if ($use_backgrounds) { $r = $bgcolor[$HEADER{"Background"}]; $s = ""; $t = ""; $u = ""; } else { $r = $bgcolor; undef $s; undef $t; undef $u; } $subject =~ s/&/&/g; $subject =~ s/"/"/g; $subject =~ s/<//g; $subject =~ s/  / /g; $subject =~ s/  / /g; if (-x "/usr/lib/sendmail") { open(MAIL,"|/usr/lib/sendmail -t") || &tech_error("Can't use /usr/lib/sendmail!"); } elsif (-x "/usr/sbin/sendmail") { open(MAIL,"|/usr/sbin/sendmail -t") || &tech_error("Can't use /usr/sbin/sendmail!"); } else { &tech_error("Can't execute /usr/lib/sendmail or /usr/sbin/sendmail!"); } if ($realname && $realname ne $name) { print MAIL "From: $realname/$name <$email>\n"; } else { print MAIL "From: $name <$email>\n"; } print MAIL "Organization: $title{'Default'}\n"; print MAIL "X-Mailer: RPGBoard V$version\n"; print MAIL "MIME-Version: 1.0\n"; if ($mailto) { print MAIL "To: $mailto\n"; } if ($auto_email{$forum}) { print MAIL "Bcc: $auto_email{$forum}\n"; } print MAIL "Subject: $subject\n"; print MAIL "Content-type: multipart/alternative; boundary=\"$mail_boundary\"\n\n"; print MAIL "--$mail_boundary\n"; print MAIL "Content-type: text/plain; charset=$charset\n\n"; print MAIL "View Message: http://$ENV{'HTTP_HOST'}$rpgmessage_uri?".&dec2hex($gmt_epoch).&dec2hex($num)."\n\n"; print MAIL "$textbody\n"; print MAIL "--$mail_boundary\n"; print MAIL "Content-type: text/html; charset=$charset\n\n"; print MAIL "\n"; print MAIL " \n"; print MAIL " \n"; print MAIL " \n"; print MAIL " \n"; print MAIL "\n"; if ($use_backgrounds) { print MAIL "


      \n"; } elsif ($standardbg) { print MAIL "

      \n"; } else { print MAIL "

      \n"; } print MAIL "$header\n"; print MAIL "

      $title"; print MAIL " - View Message

      \n"; print MAIL "

      $table\n"; print MAIL " \n"; print MAIL " $s$titlefontMessage: $u\n"; print MAIL " \n"; print MAIL " \n"; print MAIL " "; if ($HEADER{"Image"}) { print MAIL "

      \n"; } unless ($HEADER{"Tag"} eq "N") { print MAIL "$mesgfont$body\n

      \n$footerbody\n"; } else { print MAIL "$mesgfont".$HEADER{"Subject"}."

      $footerbody\n"; } print MAIL " \n"; print MAIL " \n"; if ($spoilbody && $HEADER{"Tag"} ne "N") { print MAIL " \n"; print MAIL " $s$titlefontSpoiler Message: $u\n"; print MAIL " \n"; print MAIL " \n"; print MAIL " $s$mesgfont\"$spoilbody\"$u\n"; print MAIL " \n"; } if ($HEADER{"Link URL"}) { print MAIL " \n"; print MAIL " $s$titlefontLink: $u\n"; print MAIL " $t".$HEADER{"Link Title"}."$u\n"; print MAIL " \n"; } print MAIL "

      \n"; print MAIL "$footer\n\n"; print MAIL "

      ".$title{'Default'}."'s RPGBoard script (V$version) was created by\n"; print MAIL "\">Brendan Byrd AKA SineSwiper of Resonator Software. \n"; print MAIL "It is copylefted under the conditions of the GNU\n"; print MAIL "Public License (GPL).  It can be freely distributed and modified as long as it retains\n"; print MAIL "its GPL status.

      \n\n"; print MAIL "$counter\n\n"; print MAIL \n"; print MAIL "



      \n"; print MAIL "--$mail_boundary--\n\n"; } #!/usr/bin/perl ############################################################################## # RPGBoard Configurator Tool version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## $SIG{__DIE__} = \&tech_error; sub tech_error { print "Content-type: text/plain; charset=$charset\n\n"; print "ERROR: $_[0]"; exit; } require 5.004; for $j ("rpgvariables.h", "rpgglobal.h", "rpgerrors.h") { unless ($k = do $j) { &tech_error("Couldn't parse $j: $@") if $@; &tech_error("Couldn't do $j: $!") unless defined $k; } } &get_variables; unless (&validate_password == 3) { &request_password; } &print_cookies; if ($ENV{'QUERY_STRING'} eq "change") { &check_warnings; &change_variables; &display_changed; } elsif ($basedir =~ /\[MB directory\]/) { &display_basicinfo; } elsif ($ENV{'QUERY_STRING'} eq "basicinfo") { &display_basicinfo; } elsif ($ENV{'QUERY_STRING'} eq "location") { &display_location; } elsif ($ENV{'QUERY_STRING'} eq "spellcheck") { &display_spellcheck; } elsif ($ENV{'QUERY_STRING'} eq "forums") { &display_forums; } elsif ($ENV{'QUERY_STRING'} eq "backgrounds") { &display_backgrounds; } elsif ($ENV{'QUERY_STRING'} eq "cosmetics") { &display_cosmetics; } elsif ($ENV{'QUERY_STRING'} eq "filter") { &display_filter; } elsif ($ENV{'QUERY_STRING'} eq "msgtags") { &display_msgtags; } elsif ($ENV{'QUERY_STRING'} eq "custombio") { &display_custombio; } elsif ($ENV{'QUERY_STRING'} eq "moderate") { &display_moderate; } elsif ($ENV{'QUERY_STRING'} eq "toggles") { &display_toggles; } elsif ($ENV{'QUERY_STRING'} eq "warnings") { &check_warnings; &display_warnings; } else { &display_menu; } exit; sub get_variables { # Basic information variables if ($FORM{'baseuri'}) { $baseuri = $FORM{'baseuri'}; if ($baseuri =~ /(.+)\/$/) { $baseuri = $1; } unless ($baseuri =~ /^\//) { $baseuri = "/$baseuri"; } } elsif (!($baseuri || $root_baseuri)) { $baseuri = "/[MB directory]"; } if ($FORM{'basedir'}) { $basedir = $FORM{'basedir'}; if ($basedir =~ /(.+)\/$/) { $basedir = $1; } } elsif (!($basedir)) { if ($ENV{'SERVER_SOFTWARE'} =~ /Microsoft/) { $j = $ENV{'SCRIPT_NAME'}; $j =~ s/\//\\/g; if ($ENV{'SERVER_SOFTWARE'} =~ /(.+)$j/) { $basedir = $1.$baseuri; } } else { $basedir = $ENV{'DOCUMENT_ROOT'}.$baseuri; } } $rpgconfig_uri = $ENV{'SCRIPT_NAME'}; $j = $ENV{'SCRIPT_NAME'}; $j =~ s/(.+)\/.+$/$1\//; if ($FORM{'rpgadmin_uri'}) { $rpgadmin_uri = $FORM{'rpgadmin_uri'}; } elsif (!$rpgadmin_uri) { $rpgadmin_uri = $j."rpgadmin.cgi"; } if ($FORM{'rpgbio_uri'}) { $rpgbio_uri = $FORM{'rpgbio_uri'}; } elsif (!$rpgbio_uri) { $rpgbio_uri = $j."rpgbio.cgi"; } if ($FORM{'rpgboard_uri'}) { $rpgboard_uri = $FORM{'rpgboard_uri'}; } elsif (!$rpgboard_uri) { $rpgboard_uri = $j."rpgboard.cgi"; } if ($FORM{'rpgdefaults_uri'}) { $rpgdefaults_uri = $FORM{'rpgdefaults_uri'}; } elsif (!$rpgdefaults_uri) { $rpgdefaults_uri = $j."rpgdefaults.cgi"; } if ($FORM{'rpgheaders_uri'}) { $rpgheaders_uri = $FORM{'rpgheaders_uri'}; } elsif (!$rpgheaders_uri) { $rpgheaders_uri = $j."rpgheaders.cgi"; } if ($FORM{'rpgmessage_uri'}) { $rpgmessage_uri = $FORM{'rpgmessage_uri'}; } elsif (!$rpgmessage_uri) { $rpgmessage_uri = $j."rpgmessage.cgi"; } if ($FORM{'rpgsearch_uri'}) { $rpgsearch_uri = $FORM{'rpgsearch_uri'}; } elsif (!$rpgsearch_uri) { $rpgsearch_uri = $j."rpgsearch.cgi"; } if ($FORM{'rpgstats_uri'}) { $rpgstats_uri = $FORM{'rpgstats_uri'}; } elsif (!$rpgstats_uri) { $rpgstats_uri = $j."rpgstats.cgi"; } if ($FORM{'charset'}) { $charset = $FORM{'charset'}; } elsif (!$charset) { $charset = $charset_order[0]; } if ($FORM{'changepassword'}) { if ($FORM{'changepassword'} ne $FORM{'reenterpassword'}) { &error(no_pw_match); } $godpassword = crypt($FORM{'changepassword'}, chr(rand(93) + 33).chr(rand(93) + 33)); $FORM{'password'} = $FORM{'changepassword'}; } # Location variables if ($FORM{'defaultdir'}) { $defaultdir = $FORM{'defaultdir'}; if ($defaultdir =~ /(.+)\/$/) { $defaultdir = $1; } if ($defaultdir =~ /^\/(.+)/) { $defaultdir = $1; } } elsif (!($defaultdir)) { $defaultdir = "defaults"; } if ($FORM{'savedir'}) { $savedir = $FORM{'savedir'}; if ($savedir =~ /(.+)\/$/) { $savedir = $1; } if ($savedir =~ /^\/(.+)/) { $savedir = $1; } } elsif (!($savedir)) { $savedir = "saves"; } if ($FORM{'banfile'}) { $banfile = $FORM{'banfile'}; } elsif (!($banfile)) { $banfile = "banlist.txt"; } if ($FORM{'defaultsetfile'}) { $defaultsetfile = $FORM{'defaultsetfile'}; } elsif (!($defaultsetfile)) { $defaultsetfile = "default.html"; } if ($FORM{'bgfile'}) { $bgfile = $FORM{'bgfile'}; } if ($FORM{'faqfile'}) { $faqfile = $FORM{'faqfile'}; } if ($FORM{'standardbg'}) { $standardbg = $FORM{'standardbg'}; } elsif ($FORM{'defaultdir'}) { undef $standardbg; } if ($FORM{'textcolor'}) { $textcolor = $FORM{'textcolor'}; } if ($FORM{'bgcolor'}) { $bgcolor = $FORM{'bgcolor'}; } if ($FORM{'linkcolor'}) { $linkcolor = $FORM{'linkcolor'}; } if ($FORM{'vlinkcolor'}) { $vlinkcolor = $FORM{'vlinkcolor'}; } # SpellCheck variables if ($use_spellcheck) { if ($FORM{'dictionaryfile'}) { $dictionaryfile = $FORM{'dictionaryfile'}; } elsif (!($dictionaryfile)) { if (-x "/usr/bin/bzip2") { $dictionaryfile = "dictionary.txt.bz2"; } elsif (-x "/bin/gzip") { $dictionaryfile = "dictionary.txt.gz"; } else { $dictionaryfile = "dictionary.txt"; } } if ($FORM{'slangfile'}) { $slangfile = $FORM{'slangfile'}; } elsif (!($slangfile)) { $slangfile = "slangdictionary.txt"; } } # Forum variables foreach $var (keys %FORM) { if ($var =~ /^title-(.+)$/ && $FORM{$var}) { $j = $1; $title{$j} = $FORM{$var}; if ($j ne "Default") { $indexfile{$j} = $FORM{"indexfile-$j"}; $mesgdir{$j} = $FORM{"mesgdir-$j"}; $expire_time{$j} = $FORM{"expire_time-$j"}; $option{$j} = $FORM{"option-$j"}; $auto_email{$j} = $FORM{"auto_email-$j"}; } } if ($var =~ /^newforum\d$/ && $FORM{$var}) { $j = lc($FORM{$var}); $j =~ s/\W//g; $title{$j} = $FORM{$var}; $indexfile{$j} = "$j/"; $mesgdir{$j} = "messages/$j"; $expire_time{$j} = -1; } } foreach $var (keys %FORM) { if ($var =~ /^delete1-(.+)$/ && $FORM{$var}) { if ($FORM{"delete1-$1"} && $FORM{"delete2-$1"} && $FORM{"delete3-$1"}) { delete $title{$1}; delete $indexfile{$1}; delete $mesgdir{$1}; delete $expire_time{$1}; delete $option{$1}; delete $auto_email{$1}; next; } } } # Background variables if ($FORM{'bkgrndname'}) { $bkgrndname = $FORM{'bkgrndname'}; } foreach $var (keys %FORM) { if ($var =~ /^bkgrndname-(.+)$/ && $FORM{$var}) { $bkgrndname[$1] = $FORM{$var}; $bkgrndfile[$1] = $FORM{"bkgrndfile-$1"}; $textcolor[$1] = $FORM{"textcolor-$1"}; $bgcolor[$1] = $FORM{"bgcolor-$1"}; $linkcolor[$1] = $FORM{"linkcolor-$1"}; $vlinkcolor[$1] = $FORM{"vlinkcolor-$1"}; } } # Cosmetics variables if ($FORM{'forumline'}) { $forumline = $FORM{'forumline'}; } elsif (!($forumline)) { $forumline = "
      "; } if ($FORM{'table'}) { $table = $FORM{'table'}; } elsif (!($table)) { $table = ""; } if ($FORM{'statstable'}) { $statstable = $FORM{'statstable'}; } elsif (!($statstable)) { $statstable = "
      "; } if ($FORM{'headertable'}) { $headertable = $FORM{'headertable'}; } elsif (!($headertable)) { $headertable = "$table"; } if ($FORM{'headerfont'}) { $headerfont = $FORM{'headerfont'}; } elsif (!($headerfont)) { $headerfont = ""; } if ($FORM{'titlefont'}) { $titlefont = $FORM{'titlefont'}; } elsif (!($titlefont)) { $titlefont = ""; } if ($FORM{'rpgheadersfont'}) { $rpgheadersfont = $FORM{'rpgheadersfont'}; } elsif (!($rpgheadersfont)) { $rpgheadersfont = ""; } if ($FORM{'notextcolor'}) { $notextcolor = $FORM{'notextcolor'}; } elsif (!($notextcolor)) { $notextcolor = "green"; } if ($FORM{'newpostcolor'}) { $newpostcolor = $FORM{'newpostcolor'}; } elsif (!($newpostcolor)) { $newpostcolor = "navy"; } if ($FORM{'newerpostcolor'}) { $newerpostcolor = $FORM{'newerpostcolor'}; } elsif (!($newerpostcolor)) { $newerpostcolor = "blue"; } if ($FORM{'header'}) { $header = $FORM{'header'}; $headervar = $header; if ($header =~ /^([file|exec]+):(.+)$/) { $header =~ s/\\n.*$//; $headervar = $header; if ($1 eq "file") { open(HEADER,$2); } else { open(HEADER,"$2 |"); } $header = "\n".join('',
      )."\n"; close(HEADER); if ($1 eq "exec") { $header =~ s/^Content-type\:.+?\n\n//ms; } } } elsif ($FORM{'basemsgwidth'}) { undef $header; undef $headervar; } if ($FORM{'footer'}) { $footer = $FORM{'footer'}; $footervar = $footer; if ($footer =~ /^([file|exec]+):(.+)$/) { $footer =~ s/\\n.*$//; $footervar = $footer; if ($1 eq "file") { open(FOOTER,$2); } else { open(FOOTER,"$2 |"); } $footer = "\n".join('',
      )."\n"; close(FOOTER); if ($1 eq "exec") { $footer =~ s/^Content-type:.+?\n\n//ms; } } } elsif ($FORM{'basemsgwidth'}) { undef $footer; undef $footervar; } if ($FORM{'counter'}) { $counter = $FORM{'counter'}; $countervar = $counter; if ($counter =~ /^([file|exec]+):(.+)$/) { $counter =~ s/\\n.*$//; $countervar = $counter; if ($1 eq "file") { open(COUNTER,$2); } else { open(COUNTER,"$2 |"); } $counter = "\n".join('',)."\n"; close(COUNTER); if ($1 eq "exec") { $counter =~ s/^Content-type:.+?\n\n//ms; } } } elsif ($FORM{'basemsgwidth'}) { undef $counter; undef $countervar; } if ($FORM{'basemsgwidth'}) { $basemsgwidth = $FORM{'basemsgwidth'}; } elsif (!($basemsgwidth)) { $basemsgwidth = 70; } if ($FORM{'previewframe'}) { $previewframe = $FORM{'previewframe'}; } elsif ($FORM{'basemsgwidth'}) { undef $previewframe; } # Word filter variables if ($FORM{'uncensorword1'}) { undef %filter; foreach $var (sort keys %FORM) { if ($var =~ /^uncensorword(\d+)$/ && $FORM{$var}) { $filter{$FORM{$var}} = $FORM{"filterword$1"}; } } } # Message tag variables if ($use_msgtags) { $msgtagorder =~ s/N//g; if ($FORM{'msgtag1'}) { undef %msgtag; undef %msgtagcolor; foreach $var (sort keys %FORM) { if ($var =~ /^msgtag(\d+)$/ && $FORM{$var}) { $msgtag{$FORM{"tagid$1"}} = $FORM{$var}; $msgtagcolor{$FORM{"tagid$1"}} = $FORM{"msgtagcolor$1"}; } } } if ($FORM{'msgtagorder'}) { $msgtagorder = $FORM{'msgtagorder'}; } if ($FORM{'sectiontext'}) { $sectiontext = $FORM{'sectiontext'}; } elsif (!($sectiontext)) { $sectiontext = "If this is a spoiler, what game/section is it for"; } } # Custom bio variables if ($FORM{'custom_entry_description1'}) { undef @custom_entry_description; foreach $var (sort keys %FORM) { if ($var =~ /^custom_entry_description(\d+)$/ && $FORM{$var}) { $custom_entry_description[$1] = $FORM{$var}; } } } # User moderation options if ($use_moderate) { if ($FORM{'msg_points'}) { $msg_points = int($FORM{'msg_points'}); } elsif (int($msg_points) < 1) { $msg_points = 5; } if ($FORM{'min_msgs'}) { $min_msgs = int($FORM{'min_msgs'}); } elsif (!$min_msgs) { $min_msgs = 100; } } # Toggles if ($FORM{'subjectline_length'}) { $use_html = int($FORM{'use_html'}); $use_backgrounds = int($FORM{'use_backgrounds'}); $use_spellcheck = int($FORM{'use_spellcheck'}); $use_spoilermsg = int($FORM{'use_spoilermsg'}); $use_msgtags = int($FORM{'use_msgtags'}); $use_filter = int($FORM{'use_filter'}); $use_ip_display = int($FORM{'use_ip_display'}); $use_email = int($FORM{'use_email'}); $use_moderate = int($FORM{'use_moderate'}); $force_registeration = int($FORM{'force_registeration'}); $subjectline_length = int($FORM{'subjectline_length'}); $archive_days = int($FORM{'archive_days'}); $compress_days = int($FORM{'compress_days'}); $delete_days = int($FORM{'delete_days'}); } elsif (!($subjectline_length)) { $subjectline_length = 300; } } sub change_variables { open(RPGVARIABLES, ">rpgvariables.h") || &tech_error("Can't write to rpgvariables.h"); print RPGVARIABLES "##############################################################################\n"; print RPGVARIABLES "# RPGBoard Variables version $version" . " " x (48 - length($version)) . "#\n"; print RPGVARIABLES "# Copyleft 1999 Brendan Byrd and Resonator Software #\n"; print RPGVARIABLES "# Contact me at: sineswiper\@resonatorsoft.com #\n"; print RPGVARIABLES "##############################################################################\n\n"; print RPGVARIABLES "#####################\n"; print RPGVARIABLES "# Basic Information #\n"; print RPGVARIABLES "#####################\n\n"; print RPGVARIABLES "\$basedir = \"".&convert_variable($basedir)."\";\n"; if ($root_baseuri) { print RPGVARIABLES "\$baseuri = \"/\";\n\n"; } else { print RPGVARIABLES "\$baseuri = \"".&convert_variable($baseuri)."\";\n\n"; } print RPGVARIABLES "\$rpgadmin_uri = \"".&convert_variable($rpgadmin_uri)."\";\n"; print RPGVARIABLES "\$rpgbio_uri = \"".&convert_variable($rpgbio_uri)."\";\n"; print RPGVARIABLES "\$rpgboard_uri = \"".&convert_variable($rpgboard_uri)."\";\n"; print RPGVARIABLES "\$rpgconfig_uri = \"".&convert_variable($ENV{'SCRIPT_NAME'})."\";\n"; print RPGVARIABLES "\$rpgdefaults_uri = \"".&convert_variable($rpgdefaults_uri)."\";\n"; print RPGVARIABLES "\$rpgheaders_uri = \"".&convert_variable($rpgheaders_uri)."\";\n"; print RPGVARIABLES "\$rpgmessage_uri = \"".&convert_variable($rpgmessage_uri)."\";\n"; print RPGVARIABLES "\$rpgsearch_uri = \"".&convert_variable($rpgsearch_uri)."\";\n"; print RPGVARIABLES "\$rpgstats_uri = \"".&convert_variable($rpgstats_uri)."\";\n\n"; print RPGVARIABLES "\$charset = \"".&convert_variable($charset)."\";\n\n"; print RPGVARIABLES "\$godpassword = \"".&convert_variable($godpassword)."\";\n\n"; print RPGVARIABLES "######################\n"; print RPGVARIABLES "# Location variables #\n"; print RPGVARIABLES "######################\n\n"; print RPGVARIABLES "\$defaultdir = \"".&convert_variable($defaultdir)."\";\n"; print RPGVARIABLES "\$savedir = \"".&convert_variable($savedir)."\";\n\n"; print RPGVARIABLES "\$banfile = \"".&convert_variable($banfile)."\";\n"; print RPGVARIABLES "\$defaultsetfile = \"".&convert_variable($defaultsetfile)."\";\n"; if ($use_backgrounds) { print RPGVARIABLES "\$bgfile = \"".&convert_variable($bgfile)."\";\n"; } print RPGVARIABLES "\$faqfile = \"".&convert_variable($faqfile)."\";\n\n"; if ($use_backgrounds) { print RPGVARIABLES "\$bkgrndname = \"".&convert_variable($bkgrndname)."\";\n"; } if ($standardbg) { print RPGVARIABLES "\$standardbg = \"".&convert_variable($standardbg)."\";\n"; } print RPGVARIABLES "\$textcolor = \"".&convert_variable($textcolor)."\";\n"; print RPGVARIABLES "\$bgcolor = \"".&convert_variable($bgcolor)."\";\n"; print RPGVARIABLES "\$linkcolor = \"".&convert_variable($linkcolor)."\";\n"; print RPGVARIABLES "\$vlinkcolor = \"".&convert_variable($vlinkcolor)."\";\n\n"; if ($use_spellcheck) { print RPGVARIABLES "########################\n"; print RPGVARIABLES "# SpellCheck variables #\n"; print RPGVARIABLES "########################\n\n"; print RPGVARIABLES "\$dictionaryfile = \"".&convert_variable($dictionaryfile)."\";\n"; print RPGVARIABLES "\$slangfile = \"".&convert_variable($slangfile)."\";\n\n"; } print RPGVARIABLES "#########################\n"; print RPGVARIABLES "# Multi-forum variables #\n"; print RPGVARIABLES "#########################\n\n"; print RPGVARIABLES "\$title{'Default'} = \"".&convert_variable($title{'Default'})."\";\n"; foreach $forumid (sort keys %indexfile) { print RPGVARIABLES "\$title{'$forumid'} = \"".&convert_variable($title{$forumid})."\";\n"; print RPGVARIABLES "\$indexfile{'$forumid'} = \"".&convert_variable($indexfile{$forumid})."\";\n"; print RPGVARIABLES "\$mesgdir{'$forumid'} = \"".&convert_variable($mesgdir{$forumid})."\";\n"; print RPGVARIABLES "\$expire_time{'$forumid'} = \"".&convert_variable($expire_time{$forumid})."\";\n"; if ($option{$forumid}) { print RPGVARIABLES "\$option{'$forumid'} = $option{$forumid};\n"; } if ($auto_email{$forumid}) { print RPGVARIABLES "\$auto_email{'$forumid'} = \"".&convert_variable($auto_email{$forumid})."\";\n"; } print RPGVARIABLES "\n"; } if ($use_backgrounds) { print RPGVARIABLES "########################\n"; print RPGVARIABLES "# Background variables #\n"; print RPGVARIABLES "########################\n\n"; print RPGVARIABLES "\$bkgrndname[1] = \$bkgrndname;\n"; if ($bkgrndfile[1]) { print RPGVARIABLES "\$bkgrndfile[1] = \$standardbg;\n"; } print RPGVARIABLES "\$textcolor[1] = \$textcolor;\n"; print RPGVARIABLES "\$bgcolor[1] = \$bgcolor;\n"; print RPGVARIABLES "\$linkcolor[1] = \$linkcolor;\n"; print RPGVARIABLES "\$vlinkcolor[1] = \$vlinkcolor;\n\n"; for ($j = 2; $j < @bkgrndname; $j++) { print RPGVARIABLES "\$bkgrndname[$j] = \"".&convert_variable($bkgrndname[$j])."\";\n"; if ($bkgrndfile[$j]) { print RPGVARIABLES "\$bkgrndfile[$j] = \"".&convert_variable($bkgrndfile[$j])."\";\n"; } print RPGVARIABLES "\$textcolor[$j] = \"".&convert_variable($textcolor[$j])."\";\n"; print RPGVARIABLES "\$bgcolor[$j] = \"".&convert_variable($bgcolor[$j])."\";\n"; print RPGVARIABLES "\$linkcolor[$j] = \"".&convert_variable($linkcolor[$j])."\";\n"; print RPGVARIABLES "\$vlinkcolor[$j] = \"".&convert_variable($vlinkcolor[$j])."\";\n\n"; } } print RPGVARIABLES "######################\n"; print RPGVARIABLES "# Cosmetic variables #\n"; print RPGVARIABLES "######################\n\n"; print RPGVARIABLES "\$forumline = \"".&convert_variable($forumline)."\";\n"; print RPGVARIABLES "\$table = \"".&convert_variable($table)."\";\n"; print RPGVARIABLES "\$statstable = \"".&convert_variable($statstable)."\";\n\n"; print RPGVARIABLES "\$headertable = \"".&convert_variable($headertable)."\";\n\n"; print RPGVARIABLES "\$headerfont = \"".&convert_variable($headerfont)."\";\n"; print RPGVARIABLES "\$titlefont = \"".&convert_variable($titlefont)."\";\n"; print RPGVARIABLES "\$rpgheadersfont = \"".&convert_variable($rpgheadersfont)."\";\n\n"; print RPGVARIABLES "\$notextcolor = \"".&convert_variable($notextcolor)."\";\n"; print RPGVARIABLES "\$newpostcolor = \"".&convert_variable($newpostcolor)."\";\n"; print RPGVARIABLES "\$newerpostcolor = \"".&convert_variable($newerpostcolor)."\";\n\n"; print RPGVARIABLES "\$header = \"".&convert_variable($headervar)."\";\n"; print RPGVARIABLES "\$footer = \"".&convert_variable($footervar)."\";\n"; print RPGVARIABLES "\$counter = \"".&convert_variable($countervar)."\";\n\n"; print RPGVARIABLES "\$basemsgwidth = \"".&convert_variable($basemsgwidth)."\";\n\n"; if ($previewframe) { print RPGVARIABLES "\$previewframe = \"".&convert_variable($previewframe)."\";\n\n"; } if ($use_filter) { print RPGVARIABLES "#########################\n"; print RPGVARIABLES "# Word Filter variables #\n"; print RPGVARIABLES "#########################\n\n"; foreach $word (sort keys %filter) { if ($word) { print RPGVARIABLES "\$filter{'$word'} = \"".&convert_variable($filter{$word})."\";\n"; } } print RPGVARIABLES "\n"; } if ($use_msgtags) { print RPGVARIABLES "################\n"; print RPGVARIABLES "# Message Tags #\n"; print RPGVARIABLES "################\n\n"; foreach $tag (split(//, $msgtagorder)) { print RPGVARIABLES "\$msgtag{'$tag'} = \"".&convert_variable($msgtag{$tag})."\";\n"; print RPGVARIABLES "\$msgtagcolor{'$tag'} = \"".&convert_variable($msgtagcolor{$tag})."\";\n\n"; } print RPGVARIABLES "\$msgtagorder = \"".&convert_variable($msgtagorder)."\";\n"; print RPGVARIABLES "\$sectiontext = \"".&convert_variable($sectiontext)."\";\n\n"; } if (@custom_entry_description) { print RPGVARIABLES "######################\n"; print RPGVARIABLES "# Custom Bio Entries #\n"; print RPGVARIABLES "######################\n\n"; for ($j = 1; $j < @custom_entry_description; $j++) { print RPGVARIABLES "\$custom_entry_description[$j] = \"".&convert_variable($custom_entry_description[$j])."\";\n"; } print RPGVARIABLES "\n"; } if ($use_moderate) { print RPGVARIABLES "###########################\n"; print RPGVARIABLES "# User Moderation Options #\n"; print RPGVARIABLES "###########################\n\n"; print RPGVARIABLES "\$msg_points = ".int($msg_points).";\n"; print RPGVARIABLES "\$min_msgs = ".int($min_msgs).";\n\n"; } print RPGVARIABLES "#########################\n"; print RPGVARIABLES "# Configuration options #\n"; print RPGVARIABLES "#########################\n\n"; print RPGVARIABLES "\$use_html = ".int($use_html).";\n"; print RPGVARIABLES "\$use_backgrounds = ".int($use_backgrounds).";\n"; print RPGVARIABLES "\$use_spellcheck = ".int($use_spellcheck).";\n"; print RPGVARIABLES "\$use_spoilermsg = ".int($use_spoilermsg).";\n"; print RPGVARIABLES "\$use_msgtags = ".int($use_msgtags).";\n"; print RPGVARIABLES "\$use_filter = ".int($use_filter).";\n"; print RPGVARIABLES "\$use_ip_display = ".int($use_ip_display).";\n"; print RPGVARIABLES "\$use_email = ".int($use_email).";\n"; print RPGVARIABLES "\$use_moderate = ".int($use_moderate).";\n"; print RPGVARIABLES "\$force_registeration = ".int($force_registeration).";\n"; print RPGVARIABLES "\$subjectline_length = ".int($subjectline_length).";\n\n"; print RPGVARIABLES "\$archive_days = ".int($archive_days).";\n"; print RPGVARIABLES "\$compress_days = ".int($compress_days).";\n"; print RPGVARIABLES "\$delete_days = ".int($delete_days).";\n"; close(RPGVARIABLES); } sub check_warnings { if ($basedir) { unless (-d $basedir) { $errorhtml .= "
    3. Base directory ($basedir) doesn't exist; deleting variable \$basedir
    4. \n"; undef $basedir; } } else { $errorhtml .= "
    5. Base directory isn't defined
    6. \n"; } unless ($baseuri || $root_baseuri) { $errorhtml .= "
    7. Base URI isn't defined
    8. \n"; } unless ($rpgadmin_uri) { $errorhtml .= "
    9. RPGAdmin URI isn't defined
    10. \n"; } unless ($rpgbio_uri) { $errorhtml .= "
    11. RPGBio URI isn't defined
    12. \n"; } unless ($rpgboard_uri) { $errorhtml .= "
    13. RPGBoard URI isn't defined
    14. \n"; } unless ($rpgconfig_uri) { $errorhtml .= "
    15. RPGConfig URI isn't defined
    16. \n"; } unless ($rpgdefaults_uri) { $errorhtml .= "
    17. RPGDefaults URI isn't defined
    18. \n"; } unless ($rpgheaders_uri) { $errorhtml .= "
    19. RPGHeaders URI isn't defined
    20. \n"; } unless ($rpgmessage_uri) { $errorhtml .= "
    21. RPGMessage URI isn't defined
    22. \n"; } unless ($rpgsearch_uri) { $errorhtml .= "
    23. RPGSearch URI isn't defined
    24. \n"; } unless ($rpgstats_uri) { $errorhtml .= "
    25. RPGStats URI isn't defined
    26. \n"; } if ($defaultdir) { unless (-d "$basedir/$defaultdir") { $errorhtml .= "
    27. Default directory ($basedir/$defaultdir) doesn't exist...
    28. \n"; $errorhtml .= "
        \n"; if (mkdir ("$basedir/$defaultdir", ($chmod_num + 0111))) { chmod ($chmod_num + 0111), "$basedir/$defaultdir"; $errorhtml .= "
      • Directory created
      • \n"; if (&make_defaults) { $errorhtml .= "
      • Default files created
      • \n"; } else { $errorhtml .= "
      • Can't create default files!
      • \n"; } } else { $errorhtml .= "
      • Can't create directory!
      • \n"; } $errorhtml .= "
      \n"; } unless (-f "$basedir/$defaultdir/!!default.txt") { $errorhtml .= "
    29. Master default ($basedir/$defaultdir/!!default.txt) doesn't exist...
    30. \n"; $errorhtml .= "
        \n"; if (&make_defaults) { $errorhtml .= "
      • Default files created
      • \n"; } else { $errorhtml .= "
      • Can't create default files!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    31. Default directory isn't defined
    32. \n"; } if ($savedir) { unless (-d "$basedir/$savedir") { $errorhtml .= "
    33. Save directory ($basedir/$savedir) doesn't exist...
    34. \n"; $errorhtml .= "
        \n"; if (mkdir ("$basedir/$savedir", ($chmod_num + 0111))) { chmod ($chmod_num + 0111), "$basedir/$savedir"; $errorhtml .= "
      • Directory created
      • \n"; } else { $errorhtml .= "
      • Can't create directory!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    35. Save directory isn't defined
    36. \n"; } if ($banfile) { unless (-f "$basedir/$banfile") { $errorhtml .= "
    37. Ban file ($basedir/$banfile) doesn't exist...
    38. \n"; $errorhtml .= "
        \n"; if (open(BANFILE, ">$basedir/$banfile")) { close(BANFILE); chmod $chmod_num, "$basedir/$banfile"; $errorhtml .= "
      • File created
      • \n"; } else { $errorhtml .= "
      • Can't create file!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    39. Ban file isn't defined
    40. \n"; } if ($defaultsetfile) { unless (-f "$basedir/$defaultsetfile") { $errorhtml .= "
    41. Defaults page (http://$ENV{'HTTP_HOST'}$baseuri/$defaultsetfile) doesn't appear to exist
    42. \n"; $errorhtml .= "
        \n"; if (&make_defaults_page) { $errorhtml .= "
      • Defaults page created
      • \n"; } else { $errorhtml .= "
      • Can't create defaults page!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    43. Defaults page isn't defined
    44. \n"; } if ($use_backgrounds) { if ($bgfile) { unless (-f "$basedir/$bgfile") { $errorhtml .= "
    45. Backgrounds page (http://$ENV{'HTTP_HOST'}$baseuri/$bgfile) doesn't appear to exist
    46. \n"; $errorhtml .= "
        \n"; if (&make_bg_page) { $errorhtml .= "
      • Backgrounds page created
      • \n"; } else { $errorhtml .= "
      • Can't create defaults page!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    47. Backgrounds page isn't defined
    48. \n"; } } if ($faqfile) { unless (-f "$basedir/$faqfile") { $errorhtml .= "
    49. FAQ page (http://$ENV{'HTTP_HOST'}$baseuri/$faqfile) doesn't appear to exist
    50. \n"; } } else { $errorhtml .= "
    51. FAQ page isn't defined
    52. \n"; } if ($standardbg && !(-f "$basedir/$standardbg")) { $errorhtml .= "
    53. Standard background (http://$ENV{'HTTP_HOST'}$baseuri/$standardbg) doesn't appear to exist
    54. \n"; } if ($use_spellcheck) { if ($dictionaryfile) { if ($dictionaryfile =~ /\.bz2$/ && !(-x "/usr/bin/bzip2")) { $errorhtml .= "
    55. /usr/bin/bzip2 not found; changing dictionary file to .gz
    56. \n"; $dictionaryfile =~ s/\.bz2$/\.gz/; } if ($dictionaryfile =~ /\.gz$/ && !(-x "/bin/gzip")) { $errorhtml .= "
    57. /bin/gzip not found; changing dictionary file to .txt
    58. \n"; $dictionaryfile =~ s/\.gz$//; } unless (-f "$basedir/$dictionaryfile") { if ($dictionaryfile =~ /\.bz2$/) { $j = ".bz2" } elsif ($dictionaryfile =~ /\.gz$/) { $j = ".gz" } else { $j = ""; } $errorhtml .= "
    59. Dictionary file doesn't exist (download it)
    60. \n"; } } else { $errorhtml .= "
    61. Dictionary file isn't defined
    62. \n"; } if ($slangfile) { unless (-f "$basedir/$slangfile") { $errorhtml .= "
    63. Slang dictionary file doesn't exist...
    64. \n"; $errorhtml .= "
        \n"; if (open(SLANGFILE, ">$basedir/$slangfile")) { close(SLANGFILE); chmod $chmod_num, "$basedir/$slangfile"; $errorhtml .= "
      • File created
      • \n"; } else { $errorhtml .= "
      • Can't create file!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    65. Slang dictionary file isn't defined
    66. \n"; } } unless ($title{'Default'}) { $errorhtml .= "
    67. Main title isn't defined
    68. \n"; } if (%indexfile) { foreach $forumid (sort keys %indexfile) { unless ($title{$forumid}) { $errorhtml .= "
    69. Forum title for \"$forumid\" isn't defined
    70. \n"; $j = $forumid; } else { $j = $title{$forumid}; } if ($mesgdir{$forumid}) { unless (-d "$basedir/$mesgdir{$forumid}") { $errorhtml .= "
    71. Message directory for \"$j\" ($basedir/$mesgdir{$forumid}) doesn't exist...
    72. \n"; $errorhtml .= "
        \n"; if (mkdir ("$basedir/$mesgdir{$forumid}", ($chmod_num + 0111)) && mkdir ("$basedir/$forumid", ($chmod_num + 0111))) { chmod ($chmod_num + 0111), "$basedir/$mesgdir{$forumid}"; chmod ($chmod_num + 0111), "$basedir/$forumid"; $errorhtml .= "
      • Directories created
      • \n"; if (&make_forum($forumid)) { $errorhtml .= "
      • Forum pages created
      • \n"; } else { $errorhtml .= "
      • Can't create forum pages!
      • \n"; } } else { $errorhtml .= "
      • Can't create directories!
      • \n"; } $errorhtml .= "
      \n"; } } else { $errorhtml .= "
    73. Message directory for \"$j\" isn't defined
    74. \n"; } unless ($expire_time{$forumid}) { $errorhtml .= "
    75. Expire time for \"$j\" isn't defined
    76. \n"; } } } else { $errorhtml .= "
    77. No forums are defined
    78. \n"; } if ($use_backgrounds) { if (scalar(@bkgrndname) > 1) { for ($j = 1; $j < @bkgrndname; $j++) { unless ($bkgrndname[$j]) { $errorhtml .= "
    79. Background name for #$j isn't defined
    80. \n"; $k = "Background #$j"; } else { $k = $bkgrndname[$j]; } if ($bkgrndfile[$j]) { unless (-f "$basedir/$bkgrndfile[$j]") { $errorhtml .= "
    81. $k (http://$ENV{'HTTP_HOST'}$baseuri/$bkgrndfile[$j]) doesn't appear to exist
    82. \n"; } } unless ($textcolor[$j]) { $errorhtml .= "
    83. Text color for $k isn't defined
    84. \n"; } unless ($bgcolor[$j]) { $errorhtml .= "
    85. Background color for $k isn't defined
    86. \n"; } unless ($linkcolor[$j]) { $errorhtml .= "
    87. Link color for $k isn't defined
    88. \n"; } unless ($vlinkcolor[$j]) { $errorhtml .= "
    89. Visted link color for $k isn't defined
    90. \n"; } } } else { $errorhtml .= "
    91. No backgrounds are defined
    92. \n"; } } if ($use_msgtags) { if ($msgtagorder) { foreach $tag (split(//, $msgtagorder)) { unless ($msgtag{$tag}) { $errorhtml .= "
    93. Message tag name for \"$tag\" isn't defined
    94. \n"; $k = $tag; } else { $k = $msgtag{$tag}; } unless ($msgtagcolor{$tag}) { $errorhtml .= "
    95. Message tag color for \"$k\" isn't defined
    96. \n"; } } unless ($sectiontext) { $errorhtml .= "
    97. Message tag section text isn't defined
    98. \n"; } } else { $errorhtml .= "
    99. No message tags are defined
    100. \n"; } } unless ($forumline) { $errorhtml .= "
    101. Forum line isn't defined
    102. \n"; } unless ($table) { $errorhtml .= "
    103. Message table isn't defined
    104. \n"; } unless ($statstable) { $errorhtml .= "
    105. Stats table isn't defined
    106. \n"; } unless ($headertable) { $errorhtml .= "
    107. Header table isn't defined
    108. \n"; } unless ($headerfont) { $errorhtml .= "
    109. Header font isn't defined
    110. \n"; } unless ($titlefont) { $errorhtml .= "
    111. Title font isn't defined
    112. \n"; } unless ($rpgheadersfont) { $errorhtml .= "
    113. Message headers font isn't defined
    114. \n"; } unless ($notextcolor) { $errorhtml .= "
    115. NT tag color isn't defined
    116. \n"; } unless ($newpostcolor) { $errorhtml .= "
    117. New post color isn't defined
    118. \n"; } unless ($newerpostcolor) { $errorhtml .= "
    119. Newer post color isn't defined
    120. \n"; } unless ($basemsgwidth) { $errorhtml .= "
    121. Base message width isn't defined
    122. \n"; } if ($textcolor eq $newpostcolor) { $errorhtml .= "
    123. The standard text color is the same as the new post color
    124. \n"; } if ($textcolor eq $newerpostcolor) { $errorhtml .= "
    125. The standard text color is the same as the newer post color
    126. \n"; } if ($newpostcolor eq $newerpostcolor) { $errorhtml .= "
    127. The new post color is the same as the newer post color
    128. \n"; } if ($use_filter && !(%filter)) { $errorhtml .= "
    129. No words for the filter are defined
    130. \n"; } if ($use_msgtags && !($msgtagorder)) { $errorhtml .= "
    131. No message tags are defined
    132. \n"; } if ($delete_days && ($delete_days <= $archive_days)) { $errorhtml .= "
    133. Auto-deleting happens sooner (or the same) than auto-archiving; disabling auto-archive
    134. \n"; $archive_days = 0; } if ($delete_days && ($delete_days <= $compress_days)) { $errorhtml .= "
    135. Auto-deleting happens sooner (or the same) than auto-compressing; disabling auto-compression
    136. \n"; $compress_days = 0; } if ($compress_days && !(-x "/usr/bin/bzip2" || -x "/bin/gzip")) { $errorhtml .= "
    137. Can't find or execute /usr/bin/bzip2 or /bin/gzip; disabling auto-compression
    138. \n"; $compress_days = 0; } } sub convert_variable { $s = $_[0]; $s =~ s/([\"\@\$\%\&\`\\])/\\$1/g; $s =~ s/\n/\\n/g; return $s; } sub convert_variable_html { $s = $_[0]; $s =~ s/\"/\"/g; $s =~ s//\>/g; $s =~ s/\\n/\n/g; return $s; } sub display_menu { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " RPGBoard Configurator\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      RPGBoard Configurator
      \n"; print "
      $forumline
      \n"; print "

      (NOTE: Some menus might be disabled because they aren't turned on in the toggles.)

      \n\n"; print "

      Configure basic information
      \n"; print " Configure directory/file locations
      \n"; if ($use_spellcheck) { print " Configure SpellCheck options
      \n"; } else { print " Configure SpellCheck options
      \n"; } print " Configure forums
      \n"; if ($use_backgrounds) { print " Configure backgrounds
      \n"; } else { print " Configure backgrounds
      \n"; } print " Configure cosmetics
      \n"; if ($use_filter) { print " Configure word filter
      \n"; } else { print " Configure word filter
      \n"; } if ($use_msgtags) { print " Configure message tags
      \n"; } else { print " Configure message tags
      \n"; } print " Configure custom bio entries
      \n"; if ($use_moderate) { print " Configure moderation options
      \n"; } else { print " Configure moderation options
      \n"; } print " Configure toggles
      \n"; print " Check for variable warnings\n"; print "

      \n\n"; &print_credits; } sub display_basicinfo { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating basic information\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Basic Information
      \n"; print "
      $forumline
      \n"; print "

      (NOTE: You must make sure the information below is correct before you can change anything else.)

      \n\n"; print "\n"; print "
      \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; if ($root_baseuri) { print " \n"; } else { print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      MB Title:
      Base Directory:
      Base URL: http://$ENV{'HTTP_HOST'}http://$ENV{'HTTP_HOST'}
      RPGAdmin URL: http://$ENV{'HTTP_HOST'}
      RPGBio URL: http://$ENV{'HTTP_HOST'}
      RPGBoard URL: http://$ENV{'HTTP_HOST'}
      RPGDefaults URL: http://$ENV{'HTTP_HOST'}
      RPGHeaders URL: http://$ENV{'HTTP_HOST'}
      RPGMessage URL: http://$ENV{'HTTP_HOST'}
      RPGSearch URL: http://$ENV{'HTTP_HOST'}
      RPGStats URL: http://$ENV{'HTTP_HOST'}
      Character Set:
      Change password:
      Re-enter password:
      \n\n"; print "

      \n\n"; &print_credits; } sub display_location { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating directory/file locations\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Directory/File Locations
      \n"; print "
      $forumline
      \n\n"; print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; if ($use_backgrounds) { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      Defaults Directory: $basedir/
      Saves Directory: $basedir/
      Ban file: $basedir/
      Defaults page: http://$ENV{'HTTP_HOST'}$baseuri/
      Background page: http://$ENV{'HTTP_HOST'}$baseuri/
      FAQ page: http://$ENV{'HTTP_HOST'}$baseuri/
      Standard Background
      Background URL: http://$ENV{'HTTP_HOST'}$baseuri/ (optional)
      Text color: (color names or #RRGGBB notation)
      Background color: (color names or #RRGGBB notation)
      Link color: (color names or #RRGGBB notation)
      Visited link color: (color names or #RRGGBB notation)
      \n\n"; print "

      \n\n"; &print_credits; } sub display_spellcheck { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating SpellCheck options\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      SpellCheck Options
      \n"; print "
      $forumline
      \n\n"; print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      Dictionary file: $basedir/
      Slang file: $basedir/
      \n\n"; print "

      \n\n"; &print_credits; } sub display_forums { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating forums\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Forums
      \n"; print "
      $forumline
      \n\n"; print "\n"; print "\n"; foreach $forumid (sort keys %indexfile) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; if ($use_email) { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      Title:
      URL: http://$ENV{'HTTP_HOST'}$baseuri/
      Message Directory: $basedir/
      Expire Time:
      Special Options:
      E-Mail all posts to: (leave blank to disable)
      Delete forum: (NOTE: All three must be checked to delete the forum.)
      Creating new forums
      Title:
      Title:
      Title:
      Title:
      Title:
      \n\n"; print "

      \n\n"; &print_credits; } sub display_backgrounds { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating backgrounds\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Backgrounds
      \n"; print "
      $forumline
      \n\n"; print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; if ($bkgrndfile[1]) { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; for ($j = 2; $j < @bkgrndfile + 5; $j++) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } print "
      Background #1
      Name:
      Background URL: http://$ENV{'HTTP_HOST'}$baseuri/$bkgrndfile[1]
      Text color: $textcolor[1]
      Background color: $bgcolor[1]
      Link color: $linkcolor[1]
      Visited link color: $vlinkcolor[1]
      Background #$j
      Name:
      Background URL: http://$ENV{'HTTP_HOST'}$baseuri/ (optional)
      Text color: (color names or #RRGGBB notation)
      Background color: (color names or #RRGGBB notation)
      Link color: (color names or #RRGGBB notation)
      Visited link color: (color names or #RRGGBB notation)
      \n\n"; print "

      \n\n"; &print_credits; } sub display_cosmetics { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating cosmetics\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Cosmetics
      \n"; print "
      $forumline
      \n"; print "

      (NOTE: On the header/footer/counter lines, you can specify a file by putting \"file:[full filename]\" in the line,\n"; print " or specify a command/script by putting \"exec:[full filename]\" in the line.)

      \n\n"; print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      Default line:
      Message table:
      Stats table:
      Header table:
      Header font:
      Title font:
      Message headers font:
      NT tag color:
      Text color: $textcolor
      New post color: (should be a gradient between standard and newer text colors)
      Newer post color:
      Header HTML: (after the BODY tag)
      \n"; print "
      \n"; print " Footer HTML: (before credits)
      \n"; print "
      \n"; print " Counter HTML: (after credits)
      \n"; print "
      Base field width: (adjust if you use a vertical frame bar)
      Preview frame name: (leave blank to disable)
      \n\n"; print "

      \n\n"; &print_credits; } sub display_filter { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating word filter\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Word Filter
      \n"; print "
      $forumline
      \n"; print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; $j = 1; foreach $word (sort keys %filter) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; $j++; } for ($k = $j; $k < $j + 5; $k++) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } print "
      Uncensored word\ =\ Filtered word
      \ =\ 
      \ =\ 
      \n\n"; print "

      \n\n"; &print_credits; } sub display_msgtags { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating message tags\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Message Tags
      \n"; print "
      $forumline
      \n"; print "

      (NOTE: The tag ID \"N\" is reserved for the No Text tag.)

      \n\n"; print "\n"; print "\n"; $j = 1; foreach $tag (split(//, $msgtagorder)) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; $j++; } for ($k = $j; $k < $j + 3; $k++) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      Tag Name:
      Tag Color:
      Tag ID:
      Tag Name:
      Tag Color:
      Tag ID:
      Tag Order: (Tag IDs from first to last)
      Section text: (Description of \"section\" field)
      \n\n"; print "

      \n\n"; &print_credits; } sub display_custombio { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating custom bio entries\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Custom Bio Entries
      \n"; print "
      $forumline
      \n"; print "\n"; print "\n"; for ($j = 1; $j < @custom_entry_description; $j++) { print " \n"; print " \n"; print " \n"; print " \n"; } for ($k = $j; $k < $j + 3; $k++) { print " \n"; print " \n"; print " \n"; print " \n"; } print "
      Custom Entry #$j:
      Custom Entry #$k:
      \n\n"; print "

      \n\n"; &print_credits; } sub display_moderate { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating moderation options\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      User Moderation Options
      \n"; print "
      $forumline
      \n\n"; print "\n"; print "

      Messages start with points.
      \n"; print " Only regulars, who have posted at least messages (per forum), may moderate messages in that forum.

      \n\n"; print "

      \n\n"; &print_credits; } sub display_toggles { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Configurating toggles\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Toggles
      \n"; print "
      $forumline
      \n"; print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
      Use HTML:
      Selectable Backgrounds:
      SpellCheck:
      Spoiler Messages:
      Message Tags:
      Word Filter:
      IP Display: (NOTE: Admins can always see the display.)
      Use E-Mail Functions:
      User Moderation:
      Force Registeration:
      Max Subject Length: characters
      \n\n"; @days = (1,2,3,4,5,10,15,20,25,30,45,60,75,90); print "

      Messages are auto-archived if they are days old.
      \n"; print " Messages are auto-compressed if they are days old.
      \n\n"; print " Messages are auto-deleted if they are days old.

      \n"; print "

      \n\n"; &print_credits; } sub display_warnings { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " Warnings\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Warnings
      \n"; print "
      $forumline
      \n\n"; print "

      The following are warnings that you should correct:

      \n"; print "
        \n"; print $errorhtml; print "
      \n\n"; print "

      Back to configurator

      \n\n"; &print_credits; } sub display_changed { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " RPGVariables Changed\n"; print "\n"; if ($standardbg) { print "

      \n"; } elsif ($bgcolor) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      RPGVariables Changed
      \n"; print "
      $forumline
      \n\n"; print "

      The following are warnings that you should correct:

      \n"; print "
        \n"; print $errorhtml; print "
      \n\n"; print "

      Back to configurator

      \n\n"; &print_credits; } sub make_defaults { open(DEFAULT, ">$basedir/$defaultdir/!!default.txt") || return 0; print DEFAULT "Name: !!default\n"; print DEFAULT "Password: ".crypt("password", "8e")."\n"; print DEFAULT "Date Mode: 23221\n"; print DEFAULT "Cookie Expire: 31536000\n"; print DEFAULT "Collapse Threads: N\n"; print DEFAULT "Message Threads: Y\n"; print DEFAULT "Header Style: 1\n"; print DEFAULT "Submit State: preview\n"; print DEFAULT "\xff\xff\xff\n"; for ($j = 1; $j <= 22; $j++) { print DEFAULT "\xff\n"; } print DEFAULT "\xff\xff\xff\n"; close(DEFAULT); chmod $chmod_num, "$basedir/$defaultdir/!!default.txt"; open(DEFAULT, ">$basedir/$defaultdir/sineswiper.txt") || return 0; print DEFAULT "Name: SineSwiper\n"; if (length(crypt("password", "12")) == 28) { print DEFAULT "Password: \$1\$t2\$sTN/r8OfCx9FI2OEXIDTu.\n"; } else { print DEFAULT "Password: .oimO6mLFba9g\n"; } print DEFAULT "E-Mail: sineswiper\@resonatorsoft.com\n"; print DEFAULT "Font Face: EngraversGothic BT, Copperplate Gothic Light\n"; print DEFAULT "Font Color: 7F7FFF\n"; print DEFAULT "Font Size: +1\n"; print DEFAULT "Time Zone: -0500D\n"; print DEFAULT "Date Mode: 23122\n"; print DEFAULT "Cookie Expire: 31536000\n"; print DEFAULT "Collapse Threads: N\n"; print DEFAULT "Message Threads: Y\n"; print DEFAULT "Header Style: 1\n"; print DEFAULT "Screen Size: 15\n"; print DEFAULT "View Deleted: Y\n"; print DEFAULT "Auto-Save: Y\n"; print DEFAULT "Footer: \"SineSwiper\"\n"; print DEFAULT "Real Name: Brendan Byrd\n"; print DEFAULT "Sex: M\n"; print DEFAULT "Date of Birth: 10/26/1978\n"; print DEFAULT "Current Residence: Louisville, KY\n"; print DEFAULT "Occupation: Computer Tech, Web Programmer\n"; print DEFAULT "Home Page: http://www.resonatorsoft.com/\n"; print DEFAULT "Interests: Computers, programming, lots of music, movies, Linux, politics\n"; print DEFAULT "\xff\xff\xff\n"; for ($j = 1; $j <= 22; $j++) { print DEFAULT "\xff\n"; } print DEFAULT "\xff\xff\xff\n"; close(DEFAULT); chmod $chmod_num, "$basedir/$defaultdir/sineswiper.txt"; &make_defaults_page; } sub make_defaults_page { open(DEFAULT, ">$basedir/$defaultsetfile") || return 0; print DEFAULT "\n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " Message Defaults\n"; print DEFAULT "\n"; if ($standardbg) { print DEFAULT "

      \n\n"; } elsif ($bgcolor) { print DEFAULT "

      \n\n"; } else { print DEFAULT "

      \n\n"; } print DEFAULT "

      ".$headerfont."Message Defaults

      \n\n"; print DEFAULT "\n"; print DEFAULT "\n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT " \n"; print DEFAULT "
      Nick:
      Password:
      \n\n"; print DEFAULT "

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



      \n"; close(DEFAULT); chmod $chmod_num, "$basedir/$defaultsetfile"; return 1; } sub make_bg_page { open(BGPAGE, ">$basedir/$bgfile") || return 0; print BGPAGE "This is the page that shows off the backgrounds. Change this\n"; print BGPAGE "anyway you like.\n"; chmod $chmod_num, "$basedir/$defaultsetfile"; return 1; } sub make_forum { $s = $_[0]; open(INDEX, ">$basedir/$s/index.html") || return 0; print INDEX "\n"; print INDEX " \n"; print INDEX " \n"; print INDEX " \n"; print INDEX " \n"; print INDEX " $title{'Default'} - $title{$s}\n"; print INDEX "\n"; if ($standardbg) { print INDEX "

      \n\n"; } elsif ($bgcolor) { print INDEX "

      \n\n"; } else { print INDEX "

      \n\n"; } print INDEX "

      $headerfont$title{'Default'} - $title{$s}

      \n\n"; print INDEX "

      This is the bare bones, basic HTML for RPGBoard.  You should edit this file\n"; print INDEX "for your own forum (the advanced way :), or cut&paste your own HTML that you\n"; print INDEX "created from a HTML editor.  Or you can use an HTML editor (blah!). \n"; print INDEX "Just be sure that the include comment is untouched.

      \n\n"; print INDEX "

      Also, be sure to leave an administrator's e-mail (you, for example), so I don't\n"; print INDEX "get bugged with the misguided questions from non-admins.

      \n\n"; print INDEX "

      Post a Message -\n"; print INDEX "Message Defaults -\n"; print INDEX "Mini-Biographies -\n"; print INDEX "Search -\n"; print INDEX "FAQ

      \n\n"; if ($ENV{'SERVER_SOFTWARE'} =~ /Microsoft/) { print INDEX "\n"; } else { print INDEX "\n"; } close(INDEX); chmod ($chmod_num + 0111), "$basedir/$s/index.html"; open(POST, ">$basedir/$s/post.html") || return 0; print POST "\n"; print POST " \n"; print POST " \n"; print POST " \n"; print POST " $title{$s} - Post a Message\n"; print POST "\n"; if ($standardbg) { print POST "

      \n\n"; } elsif ($bgcolor) { print POST "

      \n\n"; } else { print POST "

      \n\n"; } print POST "

      ".$headerfont."Post a Message

      \n\n"; print POST "
      \n"; if ($ENV{'SERVER_SOFTWARE'} =~ /Microsoft/) { print POST "\n"; } else { print POST "\n"; } close(POST); chmod ($chmod_num + 0111), "$basedir/$s/post.html"; return 1; } #!/usr/bin/perl ############################################################################## # RPGBoard Defaults version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## $SIG{__DIE__} = \&tech_error; sub tech_error { print "Content-type: text/plain; charset=$charset\n\n"; print "ERROR: $_[0]"; exit; } for $j ("rpgvariables.h", "rpgglobal.h", "rpgerrors.h") { unless ($k = do $j) { &tech_error("Couldn't parse $j: $@") if $@; &tech_error("Couldn't do $j: $!") unless defined $k; } } &get_first_variables; &get_default; &get_master_default; &get_variables; &check_password; unless ($action) { &display_form; exit; } else { &add_default; &print_cookies; &display_add; exit; } ############### # Get Variables sub get_first_variables { if ($FORM{'action'}) { $action = $FORM{'action'}; } if ($FORM{'name'}) { $name = $FORM{'name'}; $name =~ s/[\"<>\&\xff]//g; } else { &error(no_name); } } sub get_variables { if ($FORM{'delete1'} && $FORM{'delete2'} && $FORM{'delete3'}) { &check_password; unlink "$basedir/$defaultdir/$defaultname.txt"; &error(record_deleted); } if ($FORM{'email'} =~ /\@.*\./) { $email = $FORM{'email'}; } elsif ($action) { undef $email; } if ($FORM{'fontface'}) { $fontface = $FORM{'fontface'}; $fontface =~ s/[\"<>\&\xff]//g; } if ($FORM{'fontcolor'}) { $fontcolor = $FORM{'fontcolor'}; $fontcolor =~ s/[\"<>\&\xff]//g; } if ($FORM{'fontsize'}) { $fontsize = $FORM{'fontsize'}; $fontsize =~ s/[\"<>\&\xff]//g; } if ($fontcolor) { $mesgfont = ""; } else { $mesgfont = ""; } if ($FORM{'footerbody'}) { unless ($use_html) { $FORM{'footerbody'} =~ s/<(.*?)>/$1/g; } elsif ($use_html == 1) { $FORM{'footerbody'} =~ s/<\s*\/?(?:IMG|EMBED|TABLE|T[DHR]).*?>//gi; } elsif ($use_html == 2) { $FORM{'footerbody'} =~ s/<\s*\/?(?:TABLE|T[DHR]).*?>//gi; } $footerbody = $FORM{'footerbody'}; $footerbody =~ s/\cM//g; if ($FORM{'convert_html'} || !($use_html)) { $footerbody =~ s/\n\n/

      /g; $footerbody =~ s/\n/
      /g; $footerbody =~ s/ /  /g; $footerbody =~ s/ /  /g; } } elsif ($action) { undef $footerbody; } if ($FORM{'bgtype'}) { $bgtype = $FORM{'bgtype'}; } if ($FORM{'screensize'}) { $screensize = $FORM{'screensize'}; $msgwidth = $basemsgwidth + $screensize; } unless ($msgwidth) { $msgwidth = $basemsgwidth; } if ($FORM{'timezone'}) { $timezone = $FORM{'timezone'}; } if ($action) { undef @ignore_name; undef @ignore_forum; foreach $j (sort keys %FORM) { if ($FORM{$j} && $j =~ /ignore_name(\d+)/) { $k = $1; $ignore_name[$k] = $FORM{$j}; $ignore_name[$k] =~ s/(?:[\"<>\&\xff]|^\s|\s$)//g; $ignore_forum[$k] = $FORM{"ignore_forum$k"}; } } } if ($FORM{'datemode1'}) { $datemode = $FORM{'datemode1'}.$FORM{'datemode2'}.$FORM{'datemode3'}.$FORM{'datemode4'}.$FORM{'datemode5'}; } if ($FORM{'cookieexpire'}) { $cookieexpire = $FORM{'cookieexpire'}; } if ($FORM{'collapse_threads'}) { $collapse_threads = $FORM{'collapse_threads'}; } if ($FORM{'message_threads'}) { $message_threads = $FORM{'message_threads'}; } if ($FORM{'header_style'}) { $header_style = $FORM{'header_style'}; } if ($FORM{'submit_state'}) { $submit_state = $FORM{'submit_state'}; } if ($FORM{'view_deleted'}) { $view_deleted = $FORM{'view_deleted'}; } if ($FORM{'view_sigs'}) { $view_sigs = $FORM{'view_sigs'}; } if ($FORM{'auto_save'}) { $auto_save = $FORM{'auto_save'}; } if ($FORM{'msg_threshold'}) { $msg_threshold = $FORM{'msg_threshold'}; } elsif ($action) { undef $msg_threshold; } if ($FORM{'realname'}) { $realname = $FORM{'realname'}; } elsif ($action) { undef $realname; } if ($FORM{'sex'}) { $sex = $FORM{'sex'}; } elsif ($action) { undef $sex; } if ($FORM{'date_of_birth'} =~ /^(\d{1,2}).(\d{1,2}).(\d{4})$/ && int(&convert_date($gmt_epoch, $timezone, 0) / 10000 - "$3.$1$2") > 0) { $mon = $1; $mon = "0$mon" if (length($mon) == 1); $mday = $2; $mday = "0$mday" if (length($mon) == 1); $year = $3; $date_of_birth = "$mon/$mday/$year"; } elsif ($action) { undef $date_of_birth; } if ($FORM{'current_residence'}) { $current_residence = $FORM{'current_residence'}; $current_residence =~ s/[\"<>\&\xff]//g; } elsif ($action) { undef $current_residence; } if ($FORM{'occupation'}) { $occupation = $FORM{'occupation'}; $occupation =~ s/[\"<>\&\xff]//g; } elsif ($action) { undef $occupation; } if ($FORM{'homepage'} =~ /.*\:.*\..*/) { $homepage = $FORM{'homepage'}; $homepage =~ s/[\"<>\&\xff]//g; } elsif ($action) { undef $homepage; } if ($FORM{'interests'}) { $interests = $FORM{'interests'}; $interests =~ s/[\"<>\&\xff]//g; } elsif ($action) { undef $interests; } for ($j = 1;$j < @custom_entry_description;$j++) { if ($FORM{"custom_entry$j"}) { $custom_entry[$j] = $FORM{"custom_entry$j"}; $custom_entry[$j] =~ s/[\"<>\&\xff]//g; } elsif ($action) { undef $custom_entry[$j]; } } if ($FORM{'portrait'} =~ /.*\:.*\..*/ && $use_html > 1) { $portrait = $FORM{'portrait'}; $portrait =~ s/[\"<>\&\xff]//g; } elsif ($action) { undef $portrait; } if ($FORM{'description'}) { $description = "$FORM{'description'}"; $description =~ s/\cM//g; $description =~ s/\n\n/

      /g; $description =~ s/\n/
      /g; $description =~ s/<//g; $description =~ s/"/"/g; $description =~ s/\xff//g; } elsif ($action) { undef $description; } if ($name eq $COOKIE{'Name'} && &validate_password >= 2) { undef @ignore_name; undef @ignore_forum; $view_deleted = "Y"; $view_sigs = "Y"; $msg_threshold = -$msg_points; } } ################ # Password Check sub check_password { if ($name eq "!!default") { unless (&validate_password >= 2) { &error(bad_password); } if ($action && $FORM{'changepassword'}) { if ($FORM{'changepassword'} ne $FORM{'reenterpassword'}) { &error(no_pw_match); } $masterpassword = crypt($FORM{'changepassword'}, chr(rand(93) + 33).chr(rand(93) + 33)); $password = $masterpassword; $FORM{'password'} = $FORM{'changepassword'}; } } elsif ($recordfound) { unless (&validate_password) { &error(bad_password); } if ($action && $FORM{'changepassword'}) { if ($FORM{'changepassword'} ne $FORM{'reenterpassword'}) { &error(no_pw_match); } $password = crypt($FORM{'changepassword'}, chr(rand(93) + 33).chr(rand(93) + 33)); $FORM{'password'} = $FORM{'changepassword'}; } if ($action && $FORM{'changename'} && $FORM{'changename'} ne $name) { $defaultchangename = lc($FORM{'changename'}); $defaultchangename =~ s/\W//g; $defaultname = lc($name); $defaultname =~ s/\W//g; if (-e "$basedir/$defaultdir/$defaultchangename.txt" && $defaultchangename ne $defaultname) { &error(name_used); } unlink ("$basedir/$defaultdir/$defaultname.txt") || &tech_error("Can't delete $basedir/$defaultdir/$defaultname.txt!"); if (eval { symlink("", ""); 1 } && $last_post_msg) { symlink ("$defaultchangename.txt", "$basedir/$defaultdir/$defaultname.txt"); } $name = $FORM{'changename'}; } } else { if ($action && ($FORM{'password'} ne $FORM{'reenterpassword'})) { &error(no_pw_match); } $password = crypt($FORM{'password'}, chr(rand(93) + 33).chr(rand(93) + 33)); } } ######################### # Display Form Subroutine sub display_form { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; if ($name eq "!!default") { print " Changing Master Default\n"; print "\n"; if ($standardbg) { print "


      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Changing Master Default
      \n"; print "
      $forumline
      \n"; print "

      Below is the information found in the defaults file.

      \n"; } elsif ($recordfound) { print " Changing Default\n"; print "\n"; if ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Changing Default
      \n"; print "
      $forumline
      \n"; print "

      Below is the information found in the defaults file.  Any blank fields means there is no default.

      \n"; } else { print " Adding New Default\n"; print "\n"; if ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Adding New Default
      \n"; print "
      $forumline
      \n"; print "

      Fill in the information to set as your default.  Only the password fields are required.  Any blank fields means there is no default.

      \n"; } print "

      \n"; print "\n"; if ($name ne "!!default" && $recordfound) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } else { print " \n"; print " \n"; print " \n"; print " \n"; } if ($name eq "!!default" || $recordfound) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } else { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; if ($name ne "!!default" && $recordfound) { print " \n"; print " \n"; print " \n"; print " \n"; } if ($name ne "!!default") { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; if ($name ne "!!default") { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; if ($use_backgrounds && $name ne "!!default") { print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; if ($name ne "!!default") { print " \n"; print " \n"; print " \n"; print " \n"; unless ($name eq $COOKIE{'Name'} && &validate_password >= 2) { print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; } print " \n"; print " \n"; print " \n"; if ($use_moderate && !($name eq $COOKIE{'Name'} && &validate_password >= 2)) { print " \n"; print " \n"; print " \n"; } } print "
      Nick:
      Nick: $name
      Change password:
      Password:
      Re-enter password:
      Delete record: (NOTE: All three must be checked to delete record.)
      E-Mail:
      Font type:
      Font color: (color names or #RRGGBB notation)
      Font size: \n"; print " \n"; print "
      Background: \n"; print " \n"; print "
      Time zone: \n"; print " \n"; print "
      Date mode: , at h:mm
      Name/PW cookies:
      Headers in index:
      Headers in messages:
      Header style:
      Default submit state:
      Screen size: \n"; print " \n"; print "
      \n"; print " Do you want to see your deleted messages?
      \n"; print " Do you want to see footers?
      \n"; print " Automatically save messages after each preview/post?
      \n"; print " Don't show any messages that have a score below points.
      \n"; if ($name ne "!!default") { unless ($name eq $COOKIE{'Name'} && &validate_password >= 2) { print "\n

      Ignore List:\n"; for ($j = 0; $j < @ignore_name + 5; $j++) { print "
      \n"; print "\n"; } print "

      \n"; } unless ($footerbody =~ /\n/) { $footerbody =~ s/

      /\n\n/g; $footerbody =~ s/
      /\n/g; $footerbody =~ s//>/g; $footerbody =~ s/"/"/g; $footerbody =~ s/  / /g; $footerbody =~ s/  / /g; print "\n

      Footer (like your sig):\n"; print "
      \n"; if ($use_html) { print "
      Convert to HTML "; } } else { print "\n

      Footer (like your sig):\n"; print "
      \n"; if ($use_html) { print "
      Convert to HTML "; } } print "

      $forumline

      \n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; for ($j = 1; $j < @custom_entry_description; $j++) { print " \n"; print " \n"; print " \n"; print " \n"; } if ($use_html > 1) { print " \n"; print " \n"; print " \n"; print " \n"; } print "
      Real Name:
      Sex: \n"; print " \n"; print "
      Date of Birth: (in the form mm/dd/yyyy)
      Current Residence:
      Occupation:
      Home Page:
      Interests:
      $custom_entry_description[$j]:
      Portrait URL:
      \n"; $description =~ s/

      /\n\n/g; $description =~ s/
      /\n/g; $description =~ s//>/g; $description =~ s/"/"/g; print "

      Description:\n"; print "
      \n"; } print "

      \n"; print "
      \n"; &print_credits; } ########################### # Display Result Subroutine sub display_add { print "Content-type: text/html; charset=$charset\n\n"; print "\n"; print " \n"; print " \n"; print " \n"; if ($name eq "!!default") { print " Changed Master Default\n"; print " \n"; if ($use_backgrounds) { print "


      \n"; } elsif ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Changed Master Default
      \n"; print "
      $forumline
      \n"; print "

      The master default settings have been changed.

      \n"; } elsif ($recordfound) { print " Changed Default\n"; print " \n"; if ($use_backgrounds) { print "

      \n"; } elsif ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Changed Default
      \n"; print "
      $forumline
      \n"; print "

      Your default settings have been changed. If there are any settings that are incorrect, hit the back button and resubmit.

      \n"; } else { print " Added New Default\n"; print " \n"; if ($use_backgrounds) { print "

      \n"; } elsif ($standardbg) { print "

      \n"; } else { print "

      \n"; } print "$header\n"; print "$headerfont
      Added New Default
      \n"; print "
      $forumline
      \n"; print "

      Your default settings have been added. Remember your password because you'll need to change your settings. If there are any settings that are incorrect, hit the back button and resubmit.

      \n"; } print "

      $table\n"; print " \n"; print " $titlefontNick: \n"; print " $name\n"; print " \n"; print " \n"; print " $titlefontPassword: \n"; if ($FORM{'changepassword'}) { print " \"$FORM{'changepassword'}\"\n"; } else { print " \"$FORM{'password'}\"\n"; } print " \n"; if ($name ne "!!default") { print " \n"; print " $titlefontE-Mail: \n"; if ($email) { print " $email\n"; } else { print " No default\n"; } print " \n"; print " \n"; print " $titlefontScreen size: \n"; unless ($screensize) { print " 640x480\n"; } elsif ($screensize == 15) { print " 800x600\n"; } elsif ($screensize == 40) { print " 1024x768\n"; } elsif ($screensize == 70) { print " 1280x960\n"; } print " \n"; } print " \n"; print " $titlefontCurrent date/time: \n"; print " ".&convert_date($gmt_epoch,$timezone,$datemode."0")."\n"; print " \n"; if (@ignore_name) { print " \n"; print " $titlefontIgnore list: \n"; print " "; for ($j = 0; $j < @ignore_name; $j++) { print $ignore_name[$j]; if ($ignore_forum[$j]) { print " (".$title{$ignore_forum[$j]}.")"; } unless ($j == @ignore_name - 1) { print ", "; } } print "\n"; print " \n"; } print " \n"; print " $titlefontFont settings: \n"; if ($fontcolor) { print " <FONT FACE=\"$fontface, $masterfontface\" COLOR=\"$fontcolor\" SIZE=\"$fontsize\">\n"; } else { print " <FONT FACE=\"$fontface\" SIZE=\"$fontsize\">\n"; } print " \n"; print " \n"; print " ".$mesgfont."The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.\n"; print " \n"; if ($name ne "!!default") { if ($footerbody) { print " \n"; print " $titlefontFooter: "; print " \n"; print " $mesgfont$footerbody\n"; print " \n"; } else { print " \n"; print " ".$titlefont."Footer: \n"; print " No default\n"; print " \n"; } } print "

      \n"; if ($date_of_birth =~ /^(\d{2})\/(\d{2})\/(\d{4})$/) { $age = int(&convert_date($gmt_epoch, $timezone, 0) / 10000 - "$3.$1$2"); $date_of_birth = "$months[$1] ".int($2).", $3"; } print "

      $statstable\n"; if ($portrait) { print " \n"; print " \n"; print " \n"; } if ($realname) { print " \n"; print " $titlefontReal Name: \n"; print " $realname\n"; print " \n"; } if ($email) { print " \n"; print " $titlefontE-Mail: \n"; if ($realname && $realname ne $name) { print " \">$realname/$name <$email>\n"; } else { print " \">$name <$email>\n"; } print " \n"; } if ($sex && $age) { print " \n"; print " $titlefontAge/Sex: \n"; print " $age/$sex\n"; print " \n"; } elsif ($sex) { print " \n"; print " $titlefontSex: \n"; if ($sex eq "M") { print " Male\n"; } else { print " Female\n"; } print " \n"; } elsif ($age) { print " \n"; print " $titlefontAge: \n"; print " $age\n"; print " \n"; } if ($date_of_birth) { print " \n"; print " $titlefontDate of Birth: \n"; print " $date_of_birth\n"; print " \n"; } if ($current_residence) { print " \n"; print " $titlefontCurrent Residence: \n"; print " $current_residence\n"; print " \n"; } if ($occupation) { print " \n"; print " $titlefontOccupation: \n"; print " $occupation\n"; print " \n"; } if ($homepage) { print " \n"; print " $titlefontHome Page: \n"; print " $homepage\n"; print " \n"; } if ($interests) { print " \n"; print " $titlefontInterests: \n"; print " $interests\n"; print " \n"; } for ($k = 1;$k < @custom_entry_description;$k++) { if ($custom_entry[$k]) { print " \n"; print " $titlefont$custom_entry_description[$k]: \n"; print " $custom_entry[$k]\n"; print " \n"; } } if ($description) { print " \n"; print " $titlefontDescription: \n"; print " \n"; print " \n"; print " $description\n"; print " \n"; } print "

      \n"; &print_credits; } #!/usr/bin/perl ############################################################################## # RPGBoard Message Header Display version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## $SIG{__DIE__} = \&tech_error; sub tech_error { print "Content-type: text/plain; charset=$charset\n\n"; print "ERROR: $_[0]"; exit; } for $j ("rpgvariables.h", "rpgglobal.h", "rpgheaders.h") { unless ($k = do $j) { &tech_error("Couldn't parse $j: $@") if $@; &tech_error("Couldn't do $j: $!") unless defined $k; } } if ($COOKIE{'Name'}) { $name = $COOKIE{'Name'}; } &get_default; &get_master_default; if ($FORM{'expire'}) { $expire_time = $FORM{'expire'} } print "Content-type: text/html; charset=$charset\n\n"; print "$forumline\n"; if ($name) { print "$rpgheadersfont$name on ".&convert_date($gmt_epoch, $timezone, $datemode."0"); if ($masterpassword eq crypt("password", "8e")) { print "
      \nChange the master default password!"; } print "
      \n"; } else { print $rpgheadersfont.&convert_date($gmt_epoch, $timezone, $datemode."0")."
      \n"; } &display_headers; print $rpgheadersfont.int($newerposts)." Fresh + ".int($newposts)." New + ".int($oldposts)." Old = ".int($newerpost+$newposts+$oldposts)." Total headers
      \n"; print "$forumline\n"; print "
      \n"; print "\n"; print "Display messages from: \ \n"; print "\ \n"; print "\n"; print "
      \n"; &print_credits; exit; ############################################################################## # RPGBoard Errors version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## sub error { $error = $_[0]; print "Content-type: text/html; charset=$charset\n\n"; if ($error eq 'no_name') { print "\n"; print " \n"; print " \n"; print " \n"; print " Name Needed\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."No Name
      \n"; print "$forumline

      \n"; print "

      You forgot to fill in the 'Name' field in your posting.  Correct it below and re-submit.  The necessary fields are Name and Subject.

      \n"; if ($ENV{'SCRIPT_NAME'} eq $rpgboard_uri) { print "$forumline\n"; print "
      \n"; &rest_of_form; } else { &print_credits; } } elsif ($error eq 'no_password') { print "\n"; print " \n"; print " \n"; print " \n"; print " Password Needed\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."No Password
      \n"; print "$forumline

      \n"; print "

      You forgot to fill in the 'Password' field.  Hit the back button, correct the problem, and re-submit.

      \n"; if ($ENV{'SCRIPT_NAME'} eq $rpgboard_uri) { print "$forumline\n"; print "\n"; &rest_of_form; } else { &print_credits; } } elsif ($error eq 'bad_password') { print "\n"; print " \n"; print " \n"; print " \n"; print " Bad Password\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Bad Password
      \n"; print "$forumline

      \n"; print "

      You entered a password which doesn't match the password in record.  Hit the back button, correct the problem, and re-submit.

      \n"; if ($ENV{'SCRIPT_NAME'} eq $rpgboard_uri) { print "$forumline\n"; print "\n"; &rest_of_form; } else { &print_credits; } } elsif ($error eq 'name_used') { print "\n"; print " \n"; print " \n"; print " \n"; print " Conflicting Names\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Name Already in Use
      \n"; print "$forumline

      \n"; print "

      You entered a name which already exists in the records.  Pick another name.

      \n"; &print_credits; } elsif ($error eq 'no_pw_match') { print "\n"; print " \n"; print " \n"; print " \n"; print " Conflicting Passwords\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Passwords Don't Match
      \n"; print "$forumline

      \n"; print "

      You entered a password which doesn't match the password on the 'Re-enter Password' field.  Hit the back button, correct the problem, and re-submit.

      \n"; &print_credits; } if ($error eq 'no_email') { print "\n"; print " \n"; print " \n"; print " \n"; print " E-Mail Address Needed\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."No E-Mail Address
      \n"; print "$forumline

      \n"; print "

      You forgot to fill in the 'E-Mail' field in your posting.  You'll need it if you expect any e-mail responses to your message.  Correct it below and re-submit.

      \n"; print "$forumline\n"; print "\n"; &rest_of_form; } elsif ($error eq 'no_msg') { print "\n"; print " \n"; print " \n"; print " \n"; print " Can't Find Message\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Does Not Exist
      \n"; print "$forumline

      \n"; print "

      The message you requested to delete does not exist!

      \n"; &print_credits; } elsif ($error eq 'too_many') { print "\n"; print " \n"; print " \n"; print " \n"; print " Too Many Messages\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Thread is Too Dense
      \n"; print "$forumline

      \n"; print "

      The message you requested to delete already has replies to it, therefore it's beyond your power to delete it!  Ask an administrator to delete it for you.

      \n"; &print_credits; } elsif ($error eq 'no_rpgadmin') { print "\n"; print " \n"; print " \n"; print " \n"; print " Can't use RPGAdmin\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Can't use RPGAdmin
      \n"; print "$forumline

      \n"; print "

      Only administrators can use RPGAdmin.  If you want to delete a message, use the delete function on the messages.

      \n"; &print_credits; } elsif ($error eq 'no_undelete') { print "\n"; print " \n"; print " \n"; print " \n"; print " Can't Undelete\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Can't Undelete
      \n"; print "$forumline

      \n"; print "

      Only administrators can undelete messages.  If you need to get a message undeleted, ask one of them.

      \n"; &print_credits; } elsif ($error eq 'no_body') { print "\n"; print " \n"; print " \n"; print " \n"; print " Message Needed\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."No Message
      \n"; print "$forumline

      \n"; print "

      You forgot to fill in your message.  If this is a subject-only message, please mark the 'No Text' tag.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'no_subject') { print "\n"; print " \n"; print " \n"; print " \n"; print " Subject Needed\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."No Subject
      \n"; print "$forumline

      \n"; print "

      You forgot to fill in the 'Subject' field in your posting.  Correct it below and re-submit.  The necessary fields are Name and Subject.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'body_with_notext') { print "\n"; print " \n"; print " \n"; print " \n"; print " No Text Message with a Body\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Body With \"No Text\" Tag
      \n"; print "$forumline

      \n"; print "

      You have a message with a \"No Text\" tag.  Either delete the text from the message or take off the \"No Text\" tag.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'need_register') { print "\n"; print " \n"; print " \n"; print " \n"; print " Name Not Found\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Name not Registered
      \n"; print "$forumline

      \n"; print "

      You need to register your name in the Defaults database before you can post here.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'loaded') { print "\n"; print " \n"; print " \n"; print " \n"; print " Message Loaded\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Loaded
      \n"; print "$forumline

      \n"; print "

      Your message has been loaded.  You may complete your message below.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'quoted') { print "\n"; print " \n"; print " \n"; print " \n"; print " Message Quoted\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Quoted
      \n"; print "$forumline

      \n"; print "

      The reply has been quoted.  You may complete your message below.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'saved') { print "\n"; print " \n"; print " \n"; print " \n"; print " Message Saved\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Saved
      \n"; print "$forumline

      \n"; print "

      Your message has been saved.  If your message gets erased before you get to post it, you can hit the Load button and try again.

      \n"; print "\n"; &rest_of_form; } elsif ($error eq 'record_deleted') { print "\n"; print " \n"; print " \n"; print " \n"; print " Record Deleted\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Record Deleted
      \n"; print "$forumline

      \n"; print "

      The requested record has been deleted.

      \n"; &print_credits; } elsif ($error eq 'record_not_found') { print "\n"; print " \n"; print " \n"; print " \n"; print " Can't Find Record\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Record Not Found
      \n"; print "$forumline

      \n"; print "

      The requested record can't be found.  Either the default record was deleted or it never existed in the first place.

      \n"; &print_credits; } elsif ($error eq 'too_old') { print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " Message Too Old\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Expired
      \n"; print "$forumline

      \n"; print "

      The message you are trying to reply from is too old for replies.  Try some of the newer threads :)

      \n"; print "
      Back to $title
      "; &print_credits; } elsif ($error eq 'msg_deleted') { print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " Message Deleted\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Doesn't Exist
      \n"; print "$forumline

      \n"; print "

      The message you are trying to reply/moderate from has been marked for deletion.  You can't reply/moderate to deleted messages.

      \n"; print "
      Back to $title
      "; &print_credits; } elsif ($error eq 'msg_purged') { print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " Message Purged\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Data Doesn't Exist
      \n"; print "

      $forumline

      \n"; print "

      This message has been permanently deleted.  There is no way to read it.

      \n"; print "
      Back to $title
      "; &print_credits; } elsif ($error eq 'dupe_msg') { print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " Duplicate Message\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Already Exists
      \n"; print "$forumline

      \n"; print "

      You have already posted your message.  Remember, it only takes one button click to post your message.

      \n"; print "
      Back to $title
      "; &print_credits; } elsif ($error eq 'banned') { print "\n"; print " \n"; print " \n"; print " \n"; print " You are Banned!\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."You are Banned!
      \n"; print "$forumline

      \n"; print "

      Your message has NOT been added!

      \n"; &print_credits; } elsif ($error eq 'already_moderated') { print "\n"; print " \n"; print " \n"; print " \n"; print " Message Already Moderated\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Can't Moderate Twice
      \n"; print "$forumline

      \n"; print "

      The message has already been moderated by you.  You can't moderate the same message twice.

      \n"; print "
      Go Back to the Message
      "; print "
      Back to $title
      "; &print_credits; } elsif ($error eq 'moderated') { print "\n"; print " \n"; print " \n"; print " \n"; print " Message Moderated\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Moderated
      \n"; print "$forumline

      \n"; print "

      The message has been moderated.

      \n"; print "
      Go Back to the Message
      "; print "
      Back to $title
      "; &print_credits; } elsif ($error eq 'success') { print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " Message Added\n"; print "\n"; print "

      \n"; print "$header\n"; print "

      ".$headerfont."Message Added
      \n"; print "$forumline

      \n"; print "

      Thank you.  Your message has been added.

      \n"; print "
      View Your Message
      "; print "
      Back to $title
      "; &print_credits; } exit; } $temp = "!"; ############################################################################## # RPGBoard Global code version 2.10a # # Copyleft 1999 Brendan Byrd and Resonator Software # # Contact me at: sineswiper@resonatorsoft.com # ############################################################################## require 5.004; $gmt_epoch = time; @labels = ("Automatic", "4 hours ago", "8 hours ago", "12 hours ago", "1 day ago", "2 days ago", "3 days ago", "4 days ago", "5 days ago", "1 week ago", "2 weeks ago", "3 weeks ago", "1 month ago", "2 months ago", "3 months ago", "6 months ago", "1 year ago", "Everything"); @expirevalues = (-1, 4, 8, 12, 24, 48, 72, 96, 120, 168, 336, 504, 720, 1440, 2160, 4320, 8760, 100000); @months = ("","January","February","March","April","May","June","July","August","September","October","November","December"); @weekdays = ("","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); # Roxen QUERY_STRING fix if ($ENV{'SERVER_SOFTWARE'} =~ /Roxen/) { $ENV{'QUERY_STRING'} = $ENV{'INDEX'}; } if ($ENV{'QUERY_STRING'} eq "\@\@TRANSPARENT\@\@") { &print_transparent; } if (-d $basedir) { ($z,$z,$z,$z,$uid,$gid,$z,$z,$z,$z,$z,$z,$z) = stat($basedir); if ($uid == $< && $gid == $() { $chmod_num = 0644; } else { $chmod_num = 0666; } } else { $chmod_num = 0666; } ########################### # Set "Default" background $bkgrndname[0] = "Default"; $bkgrndfile[0] = "$standardbg"; $textcolor[0] = "$textcolor"; $bgcolor[0] = "$bgcolor"; $linkcolor[0] = "$linkcolor"; $vlinkcolor[0] = "$vlinkcolor"; $bgtype = 0; $msgtag{'N'} = "No Text"; $msgtagcolor{'N'} = "$notextcolor"; $msgtagorder = $msgtagorder."N"; ######################### # Get standard variables $title = $title{'Default'}; if ($ENV{'QUERY_STRING'} =~ /([^\;]*)\;([0-9A-F]{16})(.?)/) { $forum = $1; $querydate = &hex2dec(substr($2, 0, 8)); $querynum = &hex2dec(substr($2, 8, 8)); $special_option = $3; } else { $forum = $ENV{'QUERY_STRING'}; } if ($forum && !$mesgdir{$forum} && ($ENV{'SCRIPT_NAME'} eq $rpgboard_uri || $ENV{'SCRIPT_NAME'} eq $rpgheaders_uri)) { &tech_error("Forum ID \"$forum\" doesn't exist! Forum IDs that -do- exist are:\n\n".join("\n", keys %mesgdir)); } $title = $title{$forum} if ($title{$forum}); $expire_time = $expire_time{$forum} if ($expire_time{$forum}); $indexfile = $indexfile{$forum} if ($indexfile{$forum}); $mesgdir = $mesgdir{$forum} if ($mesgdir{$forum}); $option = $option{$forum} if ($option{$forum}); ############################ # Deal with root-based URIs if ($baseuri eq "/") { $root_baseuri = 1; undef $baseuri; } ###################### # Grab form variables read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); push(@pairs, split(/&/, $buffer)); push(@pairs, split(/&/, $ENV{'QUERY_STRING_UNESCAPED'})); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } ############################################# # Check header/footer/counter files (if any) $headervar = $header; $footervar = $footer; $countervar = $counter; if ($header =~ /^([file|exec]+):(.+)$/) { if ($1 eq "file") { open(HEADER,$2); } else { open(HEADER,"$2 |"); } $header = "\n".join('',
      )."\n"; close(HEADER); if ($1 eq "exec") { $header =~ s/^Content-type:.+?\n\n//ms; } } if ($footer =~ /^([file|exec]+):(.+)$/) { if ($1 eq "file") { open(FOOTER,$2); } else { open(FOOTER,"$2 |"); } $footer = "\n".join('',