############################################ ## ## ## WebBBS ## ## by Darryl Burgdorf ## ## (e-mail burgdorf@awsd.com) ## ## ## ## version: 4.31 ## ## last modified: 5/28/00 ## ## copyright (c) 2000 ## ## ## ## latest version is available from ## ## http://awsd.com/scripts/ ## ## ## ############################################ sub WebBBS { &Parse_Form; &Initialize_Data; if ($ENV{'QUERY_STRING'} =~ /addresslist/i) { &UpdateAddressList; } elsif ($ENV{'QUERY_STRING'} =~ /delete/i) { if ($DBMType==2) { dbmclose (%MessageList); } else { untie %MessageList; } unless ($UseLocking) { &MasterLockOpen; } &LockOpen (DBLOCK,"$dir/dblock.txt"); &MessageDBMWrite; &Delete; } elsif ($ENV{'QUERY_STRING'} =~ /reconfigure/i) { &Reconfigure; } elsif ($ENV{'QUERY_STRING'} =~ /search/i) { &Search; } elsif ($ENV{'QUERY_STRING'} =~ /subscribe/i) { &Subscribe; } else { &TopStats; } } sub TopStats { foreach $message (@sortedmessages) { $date=$sub=$poster=$prev=$next=$count=$admin=$ip=""; ($date,$sub,$poster,$prev,$next,$count,$admin,$ip) = split(/\|/,$MessageList{$message}); unless ($PosterCount{$poster}) { $PosterCount++; } $PosterCount{$poster}++; if ($date > $LastDate{$poster}) { $LastPost{$poster} = $message; $LastDate{$poster} = $date; } } &Header($text{'3001'},$MessageHeaderFile); &Header2; print "
$text{'3001'}\n"; } else { print "
$text{'3000'} $TopNPosters $text{'3001'}\n"; } print "
$text{'3002'}: $TotalMessages ";
print "| $text{'3003'}: $PosterCount\n";
if ($PosterCount == 0) {
&Footer($MessageFooterFile,"credits");
}
$average = int(($TotalMessages/$PosterCount)+.5);
print "
$text{'3004'}: $average\n";
print "
| ";
print "$text{'3005'} | "; print " | ";
print "$text{'3006'} | "; print " | ";
print "$text{'3007'} | "; print " | ";
print "$text{'3008'} |
|---|---|---|---|---|---|---|
| "; $ProfileCheck = $key; $ProfileCheck =~ s/\s/\+/g; $ProfileCheck =~ tr/A-Z/a-z/; if (-e "$UserProfileDir/$ProfileCheck.txt") { print "$key"; $ProfileList{$ProfileCheck} = 0; } else { print "$key"; } print " | "; print " | "; print "$PosterCount{$key} | "; $percent = (($PosterCount{$key}/$TotalMessages)*100)+0.0051; if ($percent < 10) { $percent =~ s/(....).*/$1/; } else { $percent =~ s/(.....).*/$1/; } print " | "; print "${percent}% | "; print " | "; print &PrintDate($LastDate{$key})," |
| "; $ProfileName = $key; $ProfileName =~ s/\+/ /g; print ""; print "$ProfileName"; print " | "; print " | "; print "0 | "; print " | "; print " | "; print " |
$text{'0212'}\n"; print "
$text{'0200'}\n"; &Footer($MessageFooterFile,"return","refresh"); } sub Subscribe { &Header($text{'4000'},$MessageHeaderFile); &Header2; print "
"; print "$text{'4000'}\n"; print "
$text{'4001'} "; if ($email_list == 1) { print "$text{'4002'} "; } else { print "$text{'4003'} "; } print "$text{'4004'}\n"; print "
\n"; &Footer($MessageFooterFile,"credits"); } sub SetCookieData { %Cookie_Encode_Chars = ( '\%','%25','\+','%2B','\;','%3B','\,','%2C', '\=','%3D','\&','%26','\:\:','%3A%3A','\s','+' ); %Cookie_Decode_Chars = ( '\+',' ','\%3A\%3A','::','\%26','&','\%3D','=', '\%2C',',','\%3B',';','\%2B','+','\%25','%' ); &GetCookie($boardname); unless ($FORM{'ListType'}) { $FORM{'ListType'} = $Cookies{'listtype'}; } unless ($FORM{'ListTime'}) { $FORM{'ListTime'} = $Cookies{'listtime'}; } unless ($FORM{'password'}) { $FORM{'password'} = $Cookies{'password'}; } if (!$email) { $email = $Cookies{'email'}; } } sub Search { &Header("$boardname - $text{'6000'}",$MessageHeaderFile); &Header2; print "$text{'6001'}\n"; print "
$text{'6002'}\n"; print "
\n"; &Footer($MessageFooterFile,"credits"); } sub Reconfigure { &Header("$boardname - $text{'6500'}",$MessageHeaderFile); &Header2; print "$text{'6501'}\n"; print "
$text{'6502'} "; if ($UseCookies) { print "$text{'6503'}\n"; } else { print "$text{'6504'}\n"; } print "
\n"; &Footer($MessageFooterFile,"credits"); } sub UpdateAddressList { unless ($email) { &Error("9300","9301"); } unless (-w "$dir") { &Error("9410","9411"); } &LockOpen (LIST,"$dir/addresses.txt"); @list =