listdir . $file)) { $this->error(EZMLM_INVALID_AUTHOR); return; } // Le fichier author comprend // première ligne hash_auteur nom_auteur // num_mess:annéemois:hash_sujet sujet $fd = @fopen($this->listdir . $file, "r"); $i = 0 ; $class = array ('ligne_impaire', 'ligne_paire') ; while (!feof($fd)) { $buf = fgets($fd,4096); if (preg_match('/^' . $authorhash . '/', $buf)) { // this should ALWAYS be the first line in the file $author = preg_replace('/^' . $authorhash . ' /', '', $buf); print '

'.$author.'

' ; print ''."\n"; print ''."\n"; $tableopened = TRUE; } else if (preg_match('/^[0-9]*:[0-9]/',$buf)) { // si la ligne est valide // on récupère le numéro du message pour en extraire le nom du fichier $msgfile = preg_replace('/^([0-9]*):.*/', '\1', $buf); $msgdir = (int)((int)$msgfile / 100); $msgfile = (int)$msgfile % 100; if ($msgfile < 10) { $msgfile = "0" . $msgfile; } if (!is_file($this->listdir . "/archive/" . $msgdir . "/" . $msgfile)) { print "\n"; $this->error(EZMLM_INCONSISTANCY); fclose($fd); return; } //$msg = new ezmlm_parser(); //$msg->parse_file_headers($this->listdir . "/archive/" . $msgdir . "/" . $msgfile); $message = file_get_contents($this->listdir . "/archive/" . $msgdir . "/" . $msgfile) ; $mimeDecode = new Mail_mimeDecode($message) ; $mailDecode = $mimeDecode->decode() ; $subject = $mailDecode->headers['subject']; $subject = preg_replace("/\[" . $this->listname . "\]/", "", $subject); $date = preg_replace ('/CEST/', '', $mailDecode->headers['date']); print ''."\n"; if ($mailDecode->headers['from'] == '') $from = $mailDecode->headers['return-path'] ; else $from = $mailDecode->headers['from']; $hash = $this->makehash($from); print ''; print ""; print "\n"; print "\n"; $i++; if ($i == 2) $i = 0 ; unset ($mailDecode) ; } } if ($tableopened) { print "
DeSujetDate
'.$this->makelink("action=show_author_msgs&actionargs[]=" . $hash,$this->decode_iso($this->protect_email($from,false))); print '" . $this->makelink("action=show_msg&actionargs[]=" . $msgdir . "&actionargs[]=" . $msgfile, $this->decode_iso($subject)) . "" . $this->date_francaise($mailDecode->headers['date']) . "
\n"; } } }