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


sub Chat_list 
{ 
        print "Content-type: text/html\nPragma: no-cache\n\n"; 
        if(open(LISTHTML,"<$ChatDetalHtml")) 
        { 
	     @htmllines=; 
	     close(LISTHTML); 
             foreach $htmlline(@htmllines) 
	     { 
                  printf $htmlline; 
             } 
        } 
 
	my $nowtime = time; 
	 
        my $hidenum = 0; 
	my $roomchanged = 0; 
	my %roomnumchange; 
	 
        if(open(ROOMLIST, "<$ChatRoomListFile")) 
        { 
	      @roomlines=;  
              close ROOMLIST; 
              foreach $roomline(@roomlines) 
              { 
              	   ($roomname,$usernum,$master,$visible,$attrib)=split(/:/,$roomline); 
               	   if(($visible eq 1)||($roomname eq $UserData{'Room'})||($UserData{'Group'} eq 99)) 
               	   { 
                        if($attrib eq 9) 
                        { 
                        	$attribstr = " $space [ÊÒÖ÷:$master|´óÌü]"; 
                        } 
                        else 
                        { 
                        	$attribstr = " $space [ÊÒÖ÷:$master]"; 
                        } 
                        print "$roomname"; 
                        print "$attribstr\n"; 
                        if(open(USERLIST,"<$chatdatadir/$roomname$DATA")) 
                        { 
	                    foreach() 
	                    {#"$userid:$updatetime:$keynum:$ENV{'REMOTE_ADDR'}:$nickname:$entertime:0:E\n"; 
	                    	($userid,$updatetime,$keynum,$ip,$nickname,$entertime)=split(/:/); 
	                    	next if($nickname eq ""); 
	                    	$ip = $space if($UserData{'Group'} ne 99); 
	                    	$statestr = ($updatetime + $MaxIdelTime < time) ? "Offline":"Online"; 
                                print ''; 
                                print "$nickname "; 
                                #print "(M)" if($master eq lc($userid)); 
                                print "\n"; 
                                print ''; 
                                print "$statestr\n"; 
                                print ''; 
                                print "$userid\n"; 
                                print ''; 
                                print "$ip\n"; 
                                my $timestr = convert_time($entertime); 
                                print ''; 
                                print "$timestr\n"; 
	                    } 
	                    close(USERLIST); 
                        }                          
               	   } 
              } 
        } 
        print "\n"; 
        print "\n"; 
} 
1; #return true