www.pudn.com > coolchat.zip > chatshowallmsg.pl


sub listallmsg 
{ 
     my($qry_string) = shift; 
     my $nowtime = time; 
     my($i,$k,@msglines,$linenum,$lowid,$message,$namestr,$id,$state,$towho,$tails); 
      
     my $fontcolor = " color=\"$UserData{'Fontcolor'}\"" if($UserData{'Fontcolor'} ne ""); 
     my $fontface  = " face=\"$UserData{'Fontface'}\"" if($UserData{'Fontface'} ne ""); 
     my $fontsize  = " size=\"$UserData{'Fontsize'}\"" if($UserData{'Fontsize'}  ne ""); 
     my $basefont  = ""; 
     $lowid = lc($UserData{'User'}); 
      
     &SendHeader($UserData{'Room'},$basefont); 
     $qry_string = &convert_time(time,1)."-".$UserData{'Room'} unless($qry_string); 
      
     if(open(MSG,"$chatdatadir/day/$qry_string$MSG")) 
     { 
     	  @msglines = ; 
     	  close MSG; 
     	  $linenum = @msglines; 
     	  foreach $msgline(@msglines) 
     	  { 
     	  	($postid,$private,$towho,$tails) = split(/:/,$msgline,4); 
     	  	next if($UserData{$postid} eq "f"); 
     	  	next if(($private) && ($postid ne $lowid) && ($towho ne $lowid)  && ($UserData{'Group'} ne 99)); 
 
     	  	($state,$message,$nickname,$color) = split(/:/,$tails); 
 
     	  	if($state > 10) 
     	  	{ 
     	  	      next; 
     	  	} 
     	  	elsif($state eq 10) 
     	  	{#System Info 
     	  	      $message = "[系统信息] ".$message.""; 
     	        } 
     	        elsif($towho ne "") 
     	        { 
     	              $private = qq{(悄悄话)} if($private); 
     	              $message = "[$nickname] => $towho $private $message "."[$postid]"; 
     	        } 
     	        else 
     	        { 
     	              $message = "[$nickname]".$message."[$postid]"; 
     	        } 
     	        $message =~ s/$colon/:/g; 
     	        $message =~ s/\\\\/\\/g; 
     	        $message =~ s/\\\'/\'/g; 
     	        $message =~ s/\\\"/\"/g; 
 
     	        print "$message
\n"; } } &SendFooter($UserData{'Room'}); } sub SendHeader { my $room = shift; my $basefont = shift; $UserData{'Bgcolor'} = "black" if($UserData{'Bgcolor'} eq ""); print "Content-type: text/html\nPragma: no-cache\n\n"; print qq| $room $basefont
|; if(open(Header,"$chatdatadir/$UserData{'Room'}$HEAD")) { foreach(
) { print $_; } close Header; } print "
\n"; } sub SendFooter { print "
NET638 主题聊天室, (c) 1999-2002 苏州网通
"; } 1;