#!/usr/local/bin/perl # Write the path to perl above ##################################### # Shoutbox .5 Beta- No guests # # for YaBB SP 1.1 - 1.3.1 # # by caliman # ##################################### # Write the path to tagbox.html. $mainpath = "/html/tagbox3.html"; # Write the URL to tagbox.html. $mainurl = "http://www.yourdomain.com/tagbox3.html"; # Write the URL to the smilies directory. $smilies = "http://www.yourdomain.com/YaBBImages/smilies2"; if ($username ne "Guest") { $displayname = $settings[1]; } else { $displayname = $username; } if ($ENV{'QUERY_STRING'} ne '') { $options = uc $ENV{'QUERY_STRING'}; } if ($options eq 'CLEAR') {# unlink "$mainpath"; open F, ">$mainpath"; close F; chmod 0666, "$mainpath"; print "Location: $mainurl\n\n"; } 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 { $yymain .= qq~ Your browser does not support inline frames or is currently configured not to display inline frames. ~; if ($username ne "Guest") { $yymain .= qq~ ~; if ($settings[7] eq "Administrator") { $yymain .= qq~ ~; } $yymain .= qq~~; } $yymain .= qq~by HCScripts ~; } 1;