[Discussions]
    Participate in national discussions of our Revolutionary origins.
[Discussions]
#!/usr/bin/perl -w require cgi_head; if ($FORM{'sort'}) { $sort = $FORM{'sort'}; } else { $sort = "date"; } #$date = $FORM{'month'}; $list = "revolution"; $| = 1; %fsort = ( 'date' => 'Date', 'sub' => 'Subject', 'from' => 'Author', 'thread' => 'Threads' ); chdir "/tigger/logs" || &end("Couldn't chdir! $!"); opendir (L, "$list") || &end("Couldn't open $list! $!"); @dirs = readdir L; closedir L; chdir "$list" || &end("Couldn't chdir to $list! $!"); @ndirs = grep(/^$list\.log/, @dirs); $num = 0; foreach $ndir (@ndirs) { opendir (L, $ndir) || &end("Couldn't open $list! $!"); @files = readdir L; closedir L; @nfiles = grep(/^[0-9]+$/, @files); print STDERR join(" ### $ndir nfiles\n", @nfiles); @sfiles = sort @nfiles; $i = -1; $j = 0; foreach $nfile (@sfiles) { $num++; my $filenum = 0; open(FF, "$ndir/$nfile"); my $new = 1; LOOP: while () { my $sub = ""; my $nsub = ""; s//>\;/g; s/"/"\;/g; if (/^\={30}/) { $new = 1; next LOOP; } elsif ($new == 0) { if (/^\s*From:\s+(.*)/) { $entry[$i]->{'From'} = $1; $entry[$i]->{'Sfrom'} = $entry[$i]->{'From'}; $entry[$i]->{'Sfrom'} =~ s/"\;//g; } next LOOP; } elsif (/^Date:\s+(.*)/ && ( $new == 1 ) ) { $entry[++$i]->{'Date'} = $1; if ($j == 0) { $j++; } $entry[$i]->{'File'} = $ndir . "/" . $nfile; $entry[$i]->{'Num'} = $filenum++; $new = 2; } elsif ($new == 1) { $new = 0; next LOOP; } elsif (/^Subject:\s+(.*)/) { $sub = $1; ($nsub = $sub) =~ s/^\s*(re:\s*)+//i; if (($sub =~ /^\s*(re:\s*)*/i) && ( $sort eq "thread" )) { $entry[$i]->{'Reply'} = 1; } elsif ( $sort eq "thread" ) { $entry[$i]->{'Reply'} = 0; } $entry[$i]->{'Subject'} = $nsub; } elsif (/^From:\s+(.*)/) { $entry[$i]->{'From'} = $1; $entry[$i]->{'Sfrom'} = $entry[$i]->{'From'}; $entry[$i]->{'Sfrom'} =~ s/"\;//g; } elsif (/^\s*$/) { $new = 0; next LOOP; } } close FF; } } $lastdate = $entry[$i]->{'Date'}; if ( ( $sort eq "sub") || ( $sort eq "thread" ) ) { @newent = sort { "\L$$a{'Subject'}" cmp "\L$$b{'Subject'}" } @entry; } elsif ($sort eq "from") { @newent = sort { "\L$$a{'Sfrom'}" cmp "\L$$b{'Sfrom'}" } @entry; } else { @newent = reverse @entry; } if ($sort eq "thread") { foreach $i (0 .. $#newent) { if ($newent[$i]->{'Reply'} == 1) { push ( @{$reply{$newent[$i]->{'Subject'}}}, $i); } elsif ($newent[$i]->{'Reply'} == 0) { push ( @{$master{$newent[$i]->{'Subject'}}}, $i); } } } #print "HERE!\n"; &cgi_header; #print "HERE2!\n"; print < Revolution Discussions by $fsort{$sort} Revolution Discussions by $fsort{$sort} [USEMAP--Discussion Logs] [Author] [Date] [Subject] [Threads] EOP # Jerry: "I whacked this because the damn thing never counted right. # I'm not about to find out why... 5/10/99" #Messages: $num #

print <

\n"; } else { $i++; } print "
  • $info{'Subject'}\n\n"; } sub printfrom { $i = 0; $oldfrom = ""; foreach (@newent) { %info = (); %info = %$_; if ( "\L$info{'Sfrom'}" ne "\L$oldfrom" ) { if ($i != 0) { print "\n"; } else { $i++; } print "
  • $info{'From'}\n\n"; }
    Bibliography - Discussions - Essays - Program Notes - Resources - Main - Site Credits
    H-Net - OIEAHC - MSU - NEH - Liberty!