Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1253 → Rev 1254

/branches/livraison_menes/client/projet/classes/ezmlm-php-2.0/ezmlm-listinfo.php
1,5 → 1,5
<?php
// $Id: ezmlm-listinfo.php,v 1.2.4.1 2007-02-16 13:36:51 alexandre_tb Exp $
// $Id: ezmlm-listinfo.php,v 1.2.4.2 2007-03-12 11:22:56 alexandre_tb Exp $
//
// ezmlm-listinfo.php - ezmlm-php v2.0
// --------------------------------------------------------------
56,25 → 56,51
print '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
$ctc = 0;
$recent = $parser->recent_msgs();
// le tableau recent est de la forme
// $recent[numero_message][1] sujet
// $recent[numero_message][2] date en anglais => (22 May 2006)
// $recent[numero_message][3] le hash de l auteur
// $recent[numero_message][4] auteur
$class = array ('ligne_paire', 'ligne_impaire') ;
while (list($key,$val) = each($recent)) {
print '<tr class="'.$class[$ctc].'">'."\n";
print '<td>'.$val->nummessage.'</td>' ;
//print '<td>'.$val->nummessage.'</td>' ;
// $key contient le numero du message tel que dans les fichiers d index par ex 216
// on retrouve le nom du repertoire et le nom du fichier
$decimal = (string) $key;
if ($key >= 100) {
$fichier_message = substr($decimal, -2) ;
$repertoire_message = substr ($decimal, 0,count ($decimal) -2) ;
} else {
if ($key < 10) {
$fichier_message = '0'.$key;
} else {
$fichier_message = $decimal;
}
$repertoire_message = '0';
}
print '<td>'.$key.'</td>' ;
print '<td>';
$hash = $this->makehash($val->headers['from']);
print $this->makelink("action=show_author_msgs&actionargs[]=" . $hash,$this->decode_iso($this->protect_email($val->headers['from'],TRUE)));
 
$from = $val[4];
 
print $this->makelink("action=show_author_msgs&actionargs[]=".$val[3],$this->decode_iso($this->protect_email($from,false)));
print "</td>\n";
print '<td><b>';
$actionargs = preg_split("/\//", $val->msgfile);
if (count ($actionargs) > 2) {
print $this->makelink("action=show_msg&actionargs[]=" . $actionargs[(count($actionargs) - 2)] .
"&actionargs[]=" . $actionargs[(count($actionargs) - 1)] ,$this->decode_iso(str_replace(' ', '', $val->headers['subject'])));
}
print $this->makelink("action=show_msg&actionargs[]=" . $repertoire_message .
"&actionargs[]=" . $fichier_message ,$this->decode_iso($val[1]));
 
print "</b></td>\n";
print '<td>'.$this->date_francaise($val->headers['date']).'</td>'."\n";
//print '<td>'.$this->date_francaise($val[2]).'</td>'."\n";
print '<td>'.$val[2].'</td>'."\n";
print "</tr>\n";
 
$ctc++;
105,6 → 131,12
$repertoire_premier_mail = (int) ($numero_premier_mail / 100) ;
// petite verification de coherence
if ($numero_premier_mail > $numero_dernier_mail) {
$temp = $numero_premier_mail;
$numero_premier_mail = $numero_dernier_mail ;
$numero_dernier_mail = $temp;
}
print '<table class="table_cadre">'."\n";
print '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
$ctc = 0;
118,7 → 150,7
$i = $i - $multiplicateur * 100 ;
}
if ($i < 10) $num_message = '0'.$i ; else $num_message = $i ;
if (file_exists($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) {
if (file_exists($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) {
$mimeDecode = new Mail_mimeDecode(file_get_contents ($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) ;
$mailDecode = $mimeDecode->decode() ;
if ($i == 99) {
126,26 → 158,29
$i = -1;
}
print '<tr class="'.$class[$ctc].'">'."\n";
print '<td>'.$repertoire_premier_mail.$num_message.'</td><td>';
print '<tr class="'.$class[$ctc].'">'."\n";
print '<td>'.($repertoire_premier_mail != 0 ? $repertoire_premier_mail : '').$num_message.'</td><td>';
$hash = $this->makehash($mailDecode->headers['from']);
print $this->makelink("action=show_author_msgs&actionargs[]=" . $hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
print $this->makelink("action=show_author_msgs&actionargs[]=".
$hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
print "</td>\n";
print '<td><b>';
$actionargs[0] = $repertoire_premier_mail ;
$actionargs[1] = $num_message ;
if (count ($actionargs) > 1) {
print $this->makelink("action=show_msg&actionargs[]=" . $actionargs[(count($actionargs) - 2)] .
"&actionargs[]=" . $actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
if (count ($actionargs) > 1) {
print $this->makelink("action=show_msg&actionargs[]=".
$actionargs[(count($actionargs) - 2)] .
"&actionargs[]=".
$actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
}
print "</b></td>\n";
print '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
print '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
print "</tr>\n";
$ctc++;
if ($ctc == 2) { $ctc = 0; }
}
}
}
print '</table>'."\n";
return true;