#!/usr/bin/perl # Write the path to perl above ##################################### # Shoutbox .3 Beta # # for YaBB SP 1.1 - 1.3.1 # # by caliman # ##################################### # Write the path to shoutbox.html. $mainpath = "../../httpdocs/shoutbox.html"; # Write the URL to shoutbox.html. $mainurl = "http://www.edivaonline.com/YaBBImages/smiles2/shoutbox.html"; # Write the URL to the smilies directory. $smilies = "http://www.edivaonline.com/YaBBImages/smiles2"; if ($username ne "Guest") { $displayname = $settings[1]; } else { $displayname = $username; } if ($ENV{'QUERY_STRING'} ne '') { $options = uc $ENV{'QUERY_STRING'}; } if ($options eq 'CHATBOX1') { if ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $contents{$name} = $value; $contents{'message'} =~ s/\:\)//sg; $contents{'message'} =~ s/\:D//sg; $contents{'message'} =~ s/\:\(//sg; $contents{'message'} =~ s/\:p//sg; $contents{'message'} =~ s/\;\)//sg; $contents{'message'} =~ s/\>\(//sg; } } chop($date = `date`); ########################################################### open(DATA, "$mainpath"); @files =; close(DATA); open(DATA, "+<$mainpath"); flock DATA, LOCK_EX; @lines = ; if($#lines == 150) { pop(@lines); } unshift @lines, "$contents{'name'}: $contents{'message'}
\n"; seek DATA, 0, SEEK_SET; print DATA @lines; flock DATA, LOCK_UN; close DATA; print "Location: $mainurl\n\n"; if(-s "$mainpath" > 30*1024) { # unlink "$mainpath"; open F, ">$mainpath"; close F; chmod 0666, "$mainpath"; } } else { if ($options eq 'CHATBOX2') { } else { if ($options eq 'CHATBOX3') { print "Option CHATBOX3"; } else { $yymain .= qq~
~; } } } 1;