| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
// $Id: ezmlm-listinfo.php,v 1.2.4.1 2007-02-16 13:36:51 alexandre_tb Exp $
|
2 |
// $Id: ezmlm-listinfo.php,v 1.2.4.2 2007-03-12 11:22:56 alexandre_tb Exp $
|
| 3 |
//
|
3 |
//
|
| 4 |
// ezmlm-listinfo.php - ezmlm-php v2.0
|
4 |
// ezmlm-listinfo.php - ezmlm-php v2.0
|
| 5 |
// --------------------------------------------------------------
|
5 |
// --------------------------------------------------------------
|
| 6 |
// Displays general list info in the format of a welcome page.
|
6 |
// Displays general list info in the format of a welcome page.
|
| 7 |
// --------------------------------------------------------------
|
7 |
// --------------------------------------------------------------
|
| Line 54... |
Line 54... |
| 54 |
$parser->listdir = $this->listdir ;
|
54 |
$parser->listdir = $this->listdir ;
|
| 55 |
print '<table class="table_cadre">'."\n";
|
55 |
print '<table class="table_cadre">'."\n";
|
| 56 |
print '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
|
56 |
print '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
|
| 57 |
$ctc = 0;
|
57 |
$ctc = 0;
|
| 58 |
$recent = $parser->recent_msgs();
|
58 |
$recent = $parser->recent_msgs();
|
| - |
|
59 |
|
| - |
|
60 |
// le tableau recent est de la forme
|
| - |
|
61 |
// $recent[numero_message][1] sujet
|
| - |
|
62 |
// $recent[numero_message][2] date en anglais => (22 May 2006)
|
| - |
|
63 |
// $recent[numero_message][3] le hash de l auteur
|
| - |
|
64 |
// $recent[numero_message][4] auteur
|
| - |
|
65 |
|
| 59 |
$class = array ('ligne_paire', 'ligne_impaire') ;
|
66 |
$class = array ('ligne_paire', 'ligne_impaire') ;
|
| Line 60... |
Line 67... |
| 60 |
|
67 |
|
| 61 |
while (list($key,$val) = each($recent)) {
|
68 |
while (list($key,$val) = each($recent)) {
|
| 62 |
print '<tr class="'.$class[$ctc].'">'."\n";
|
69 |
print '<tr class="'.$class[$ctc].'">'."\n";
|
| 63 |
print '<td>'.$val->nummessage.'</td>' ;
|
- |
|
| 64 |
print '<td>';
|
- |
|
| Line -... |
Line 70... |
| - |
|
70 |
//print '<td>'.$val->nummessage.'</td>' ;
|
| - |
|
71 |
|
| - |
|
72 |
// $key contient le numero du message tel que dans les fichiers d index par ex 216
|
| - |
|
73 |
// on retrouve le nom du repertoire et le nom du fichier
|
| - |
|
74 |
$decimal = (string) $key;
|
| - |
|
75 |
if ($key >= 100) {
|
| - |
|
76 |
$fichier_message = substr($decimal, -2) ;
|
| - |
|
77 |
$repertoire_message = substr ($decimal, 0,count ($decimal) -2) ;
|
| - |
|
78 |
} else {
|
| - |
|
79 |
if ($key < 10) {
|
| - |
|
80 |
$fichier_message = '0'.$key;
|
| - |
|
81 |
} else {
|
| - |
|
82 |
$fichier_message = $decimal;
|
| - |
|
83 |
}
|
| - |
|
84 |
$repertoire_message = '0';
|
| - |
|
85 |
}
|
| - |
|
86 |
|
| - |
|
87 |
print '<td>'.$key.'</td>' ;
|
| - |
|
88 |
print '<td>';
|
| - |
|
89 |
|
| 65 |
$hash = $this->makehash($val->headers['from']);
|
90 |
$from = $val[4];
|
| 66 |
|
91 |
|
| 67 |
print $this->makelink("action=show_author_msgs&actionargs[]=" . $hash,$this->decode_iso($this->protect_email($val->headers['from'],TRUE)));
|
92 |
print $this->makelink("action=show_author_msgs&actionargs[]=".$val[3],$this->decode_iso($this->protect_email($from,false)));
|
| 68 |
print "</td>\n";
|
93 |
print "</td>\n";
|
| 69 |
print '<td><b>';
|
- |
|
| - |
|
94 |
print '<td><b>';
|
| 70 |
$actionargs = preg_split("/\//", $val->msgfile);
|
95 |
$actionargs = preg_split("/\//", $val->msgfile);
|
| 71 |
if (count ($actionargs) > 2) {
|
96 |
|
| 72 |
print $this->makelink("action=show_msg&actionargs[]=" . $actionargs[(count($actionargs) - 2)] .
|
97 |
print $this->makelink("action=show_msg&actionargs[]=" . $repertoire_message .
|
| 73 |
"&actionargs[]=" . $actionargs[(count($actionargs) - 1)] ,$this->decode_iso(str_replace(' ', '', $val->headers['subject'])));
|
98 |
"&actionargs[]=" . $fichier_message ,$this->decode_iso($val[1]));
|
| Line 74... |
Line 99... |
| 74 |
}
|
99 |
|
| - |
|
100 |
print "</b></td>\n";
|
| 75 |
print "</b></td>\n";
|
101 |
|
| Line 76... |
Line 102... |
| 76 |
|
102 |
//print '<td>'.$this->date_francaise($val[2]).'</td>'."\n";
|
| 77 |
print '<td>'.$this->date_francaise($val->headers['date']).'</td>'."\n";
|
103 |
print '<td>'.$val[2].'</td>'."\n";
|
| 78 |
print "</tr>\n";
|
104 |
print "</tr>\n";
|
| Line 103... |
Line 129... |
| 103 |
|
129 |
|
| Line 104... |
Line 130... |
| 104 |
// On cherche le répertoire du premier mail
|
130 |
// On cherche le répertoire du premier mail
|
| Line -... |
Line 131... |
| - |
|
131 |
|
| - |
|
132 |
$repertoire_premier_mail = (int) ($numero_premier_mail / 100) ;
|
| - |
|
133 |
|
| - |
|
134 |
// petite verification de coherence
|
| - |
|
135 |
if ($numero_premier_mail > $numero_dernier_mail) {
|
| - |
|
136 |
$temp = $numero_premier_mail;
|
| 105 |
|
137 |
$numero_premier_mail = $numero_dernier_mail ;
|
| 106 |
$repertoire_premier_mail = (int) ($numero_premier_mail / 100) ;
|
138 |
$numero_dernier_mail = $temp;
|
| 107 |
|
139 |
}
|
| Line 108... |
Line 140... |
| 108 |
print '<table class="table_cadre">'."\n";
|
140 |
print '<table class="table_cadre">'."\n";
|
| Line 116... |
Line 148... |
| 116 |
$multiplicateur = (int) ($i / 100) ;
|
148 |
$multiplicateur = (int) ($i / 100) ;
|
| 117 |
// pour les nails > 99, on retranche n fois 100, ex 256 => 56 cad 256 - 2 * 100
|
149 |
// pour les nails > 99, on retranche n fois 100, ex 256 => 56 cad 256 - 2 * 100
|
| 118 |
$i = $i - $multiplicateur * 100 ;
|
150 |
$i = $i - $multiplicateur * 100 ;
|
| 119 |
}
|
151 |
}
|
| 120 |
if ($i < 10) $num_message = '0'.$i ; else $num_message = $i ;
|
152 |
if ($i < 10) $num_message = '0'.$i ; else $num_message = $i ;
|
| 121 |
if (file_exists($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) {
|
153 |
if (file_exists($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) {
|
| 122 |
$mimeDecode = new Mail_mimeDecode(file_get_contents ($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) ;
|
154 |
$mimeDecode = new Mail_mimeDecode(file_get_contents ($this->listdir.'/archive/'.$repertoire_premier_mail.'/'.$num_message)) ;
|
| 123 |
$mailDecode = $mimeDecode->decode() ;
|
155 |
$mailDecode = $mimeDecode->decode() ;
|
| 124 |
if ($i == 99) {
|
156 |
if ($i == 99) {
|
| 125 |
$repertoire_premier_mail++;
|
157 |
$repertoire_premier_mail++;
|
| 126 |
$i = -1;
|
158 |
$i = -1;
|
| 127 |
}
|
159 |
}
|
| Line 128... |
Line 160... |
| 128 |
|
160 |
|
| 129 |
print '<tr class="'.$class[$ctc].'">'."\n";
|
161 |
print '<tr class="'.$class[$ctc].'">'."\n";
|
| 130 |
print '<td>'.$repertoire_premier_mail.$num_message.'</td><td>';
|
162 |
print '<td>'.($repertoire_premier_mail != 0 ? $repertoire_premier_mail : '').$num_message.'</td><td>';
|
| Line -... |
Line 163... |
| - |
|
163 |
$hash = $this->makehash($mailDecode->headers['from']);
|
| 131 |
$hash = $this->makehash($mailDecode->headers['from']);
|
164 |
|
| 132 |
|
165 |
print $this->makelink("action=show_author_msgs&actionargs[]=".
|
| 133 |
print $this->makelink("action=show_author_msgs&actionargs[]=" . $hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
|
166 |
$hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
|
| 134 |
print "</td>\n";
|
167 |
print "</td>\n";
|
| 135 |
print '<td><b>';
|
168 |
print '<td><b>';
|
| Line 136... |
Line 169... |
| 136 |
$actionargs[0] = $repertoire_premier_mail ;
|
169 |
$actionargs[0] = $repertoire_premier_mail ;
|
| 137 |
$actionargs[1] = $num_message ;
|
170 |
$actionargs[1] = $num_message ;
|
| - |
|
171 |
|
| - |
|
172 |
if (count ($actionargs) > 1) {
|
| 138 |
|
173 |
print $this->makelink("action=show_msg&actionargs[]=".
|
| 139 |
if (count ($actionargs) > 1) {
|
174 |
$actionargs[(count($actionargs) - 2)] .
|
| 140 |
print $this->makelink("action=show_msg&actionargs[]=" . $actionargs[(count($actionargs) - 2)] .
|
175 |
"&actionargs[]=".
|
| 141 |
"&actionargs[]=" . $actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
|
176 |
$actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
|
| 142 |
}
|
177 |
}
|
| 143 |
print "</b></td>\n";
|
178 |
print "</b></td>\n";
|
| 144 |
print '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
|
179 |
print '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
|
| 145 |
print "</tr>\n";
|
180 |
print "</tr>\n";
|
| 146 |
$ctc++;
|
181 |
$ctc++;
|
| 147 |
if ($ctc == 2) { $ctc = 0; }
|
182 |
if ($ctc == 2) { $ctc = 0; }
|
| 148 |
}
|
183 |
}
|
| 149 |
}
|
184 |
}
|
| 150 |
print '</table>'."\n";
|
185 |
print '</table>'."\n";
|