Subversion Repositories Applications.projet

Rev

Rev 312 | Rev 359 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 312 Rev 356
Line 1... Line 1...
1
<?php
1
<?php
2
// $Id: ezmlm-listinfo.php,v 1.4 2008-08-25 15:22:48 alexandre_tb Exp $
2
// $Id: ezmlm-listinfo.php,v 1.5 2008-11-04 17:11:10 aperonnet 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 44... Line 44...
44
			}
44
			}
45
		}
45
		}
46
	}
46
	}
Line 47... Line 47...
47
 
47
 
Line 48... Line 48...
48
 
48
 
Line -... Line 49...
-
 
49
	function show_recentmsgs($title = "Messages ràcents") {
-
 
50
        
49
	function show_recentmsgs($title = "Messages r&eacute;cents") {
51
        if (!is_dir($this->listdir.'/archive/0')) return false;
50
        
52
        
51
        if (!is_dir($this->listdir.'/archive/0')) return false;
53
        
52
        
54
        $html = '' ;
53
		$parser = new ezmlm_parser();
55
		$parser = new ezmlm_parser();
54
        $parser->listdir = $this->listdir ;
56
        $parser->listdir = $this->listdir ;
Line 55... Line 57...
55
        print '<table class="table_cadre">'."\n";
57
        $html .= '<table class="table_cadre">'."\n";
56
        print '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
58
        $html .= '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
Line 63... Line 65...
63
        // $recent[numero_message][3] le hash de l auteur
65
        // $recent[numero_message][3] le hash de l auteur
64
        // $recent[numero_message][4] auteur
66
        // $recent[numero_message][4] auteur
Line 65... Line 67...
65
        
67
        
Line 66... Line -...
66
        $class = array ('ligne_paire', 'ligne_impaire') ;
-
 
67
        
-
 
68
        include_once 'ezmlm-parser.php';
68
        $class = array ('ligne_paire', 'ligne_impaire') ;
69
        
69
        
70
        while (list($key,$val) = each($recent)) {
70
        while (list($key,$val) = each($recent)) {
Line 71... Line 71...
71
            print '<tr class="'.$class[$ctc].'">'."\n";
71
            $html .= '<tr class="'.$class[$ctc].'">'."\n";
72
            //print '<td>'.$val->nummessage.'</td>' ;
72
            //print '<td>'.$val->nummessage.'</td>' ;
73
            
73
            
74
            // $key contient le numero du message tel que dans les fichiers d index par ex 216
74
            // $key contient le numero du message tel que dans les fichiers d index par ex 216
75
            // on retrouve le nom du repertoire et le nom du fichier
75
            // on retrouve le nom du repertoire et le nom du fichier
76
            $decimal = (string) $key;
76
            $decimal = (string) $key;
77
            if ($key >= 100) {
77
            if ($key >= 100) {
78
					$fichier_message = substr($decimal, -2) ;
78
					$fichier_message = substr($decimal, -2) ;
79
					$repertoire_message = substr ($decimal, 0,count ($decimal) -3) ;
79
					$repertoire_message = substr ($decimal, 0, -2) ;
80
				} else {
80
				} else {
81
					if ($key < 10) {
81
					if ($key < 10) {
82
						$fichier_message = '0'.$key;
82
						$fichier_message = '0'.$key;
83
					} else {
83
					} else {
84
						$fichier_message = $decimal;
84
						$fichier_message = $decimal;
Line 85... Line 85...
85
					}
85
					}
86
					$repertoire_message = '0';
86
					$repertoire_message = '0';
Line 87... Line 87...
87
			}
87
			}
Line 88... Line 88...
88
            
88
            
89
            print '<td>'.$key.'</td>' ;
89
            $html .= '<td>'.$key.'</td>' ;
90
            print '<td>';
90
            $html .= '<td>';
91
 
91
 
92
            $from = $val[4];
-
 
93
 
-
 
94
            print $this->makelink("action=show_author_msgs&amp;actionargs[]=".$val[3],$this->decode_iso($this->protect_email($from,false)));
-
 
95
            print "</td>\n";
-
 
-
 
92
            $from = $val[4];
96
            print '<td><b>';
93
 
97
            $actionargs = preg_split("/\//", $val->msgfile);
94
            $html .= $this->makelink("action=show_author_msgs&actionargs[]=".$val[3],$this->decode_iso($this->protect_email($from,false)));
Line 98... Line 95...
98
            $parser = new ezmlm_parser();
95
            $html .= "</td>\n";
Line 99... Line 96...
99
            $mailDecode = $parser->parse_file_headers($this->listdir.'/archive/'.$repertoire_message.'/'.$fichier_message);
96
            $html .= '<td><b>';
100
            if (preg_match('/multipart/', $mailDecode->headers['content-type'])) 
97
            $actionargs = preg_split("/\//", $val->msgfile);
101
            print '<img src="client/projet/images/piece_jointe.png" alt="Pi&egrave;ce jointe" />';
98
            
Line 102... Line 99...
102
            print $this->makelink("action=show_msg&amp;actionargs[]=" .  $repertoire_message . 
99
            $html .= $this->makelink("action=show_msg&actionargs[]=".$repertoire_message.
103
                                "&amp;actionargs[]=" .  $fichier_message , $this->decode_iso($mailDecode->headers['subject']) /* $this->decode_iso($val[1]) */);
100
                                "&actionargs[]=".$fichier_message ,$this->decode_iso($val[1]));
104
 
101
 
105
            print "</b></td>\n";
102
            $html .= "</b></td>\n";
106
            
103
            
107
            //print '<td>'.$this->date_francaise($val[2]).'</td>'."\n";
104
            //print '<td>'.$this->date_francaise($val[2]).'</td>'."\n";
Line 108... Line 105...
108
            print '<td>'.$val[2].'</td>'."\n";
105
            $html .= '<td>'.$val[2].'</td>'."\n";
109
            print "</tr>\n";
106
            $html .= "</tr>\n";
Line -... Line 107...
-
 
107
 
-
 
108
            $ctc++;
-
 
109
            if ($ctc == 2) { $ctc = 0; }
110
 
110
        }
-
 
111
        $html .= '</table>'."\n";
-
 
112
        return $html;
-
 
113
	}
111
            $ctc++;
114
    
112
            if ($ctc == 2) { $ctc = 0; }
115
    function show_month ($month) {
113
        }
116
        // Le nom du fichier est annéemois ex 200501 pour janvier 2005
114
        print '</table>'."\n";
117
        
115
        return true;
118
        // le html est vide au début
Line 140... Line 143...
140
        if ($numero_premier_mail > $numero_dernier_mail) {
143
        if ($numero_premier_mail > $numero_dernier_mail) {
141
        	$temp = $numero_premier_mail;
144
        	$temp = $numero_premier_mail;
142
        	$numero_premier_mail = $numero_dernier_mail ;
145
        	$numero_premier_mail = $numero_dernier_mail ;
143
        	$numero_dernier_mail = $temp;
146
        	$numero_dernier_mail = $temp;
144
        }
147
        }
145
        print '<table class="table_cadre">'."\n";
148
        $html .= '<table class="table_cadre">'."\n";
146
        print '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
149
        $html .= '<tr><th class="col1">Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
147
        $ctc = 0;
150
        $ctc = 0;
Line 148... Line 151...
148
        
151
        
Line 149... Line 152...
149
        $class = array ('ligne_paire', 'ligne_impaire') ;
152
        $class = array ('ligne_paire', 'ligne_impaire') ;
Line 161... Line 164...
161
            	if ($i == 99) {
164
            	if ($i == 99) {
162
                	$repertoire_premier_mail++;
165
                	$repertoire_premier_mail++;
163
               	 $i = -1;
166
               	 $i = -1;
164
            	}
167
            	}
Line 165... Line 168...
165
            
168
            
166
           	 	print '<tr class="'.$class[$ctc].'">'."\n";
169
           	 	$html .= '<tr class="'.$class[$ctc].'">'."\n";
167
            	print '<td>'.($repertoire_premier_mail != 0 ? $repertoire_premier_mail : '').$num_message.'</td><td>';
170
            	$html .= '<td>'.($repertoire_premier_mail != 0 ? $repertoire_premier_mail : '').$num_message.'</td><td>';
Line 168... Line 171...
168
            	$hash = $this->makehash($mailDecode->headers['from']);
171
            	$hash = $this->makehash($mailDecode->headers['from']);
169
            
172
            
170
            	print $this->makelink("action=show_author_msgs&actionargs[]=".
173
            	$html .= $this->makelink("action=show_author_msgs&actionargs[]=".
171
            			$hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
174
            			$hash,$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
172
            	print "</td>\n";
175
            	$html .= "</td>\n";
173
            	print '<td><b>';
176
            	$html .= '<td><b>';
Line 174... Line 177...
174
            	$actionargs[0] = $repertoire_premier_mail ;
177
            	$actionargs[0] = $repertoire_premier_mail ;
175
            	$actionargs[1] = $num_message ;
178
            	$actionargs[1] = $num_message ;
176
            
179
            
177
           	 	if (count ($actionargs) > 1) {
180
           	 	if (count ($actionargs) > 1) {
178
                	print $this->makelink("action=show_msg&actionargs[]=".
181
                	$html .= $this->makelink("action=show_msg&actionargs[]=".
179
                			$actionargs[(count($actionargs) - 2)] . 
182
                			$actionargs[(count($actionargs) - 2)] . 
180
                            "&actionargs[]=".
183
                            "&actionargs[]=".
181
                            $actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
184
                            $actionargs[(count($actionargs) - 1)] ,$this->decode_iso($mailDecode->headers['subject']));
182
            	}
185
            	}
183
            	print "</b></td>\n";
186
            	$html .= "</b></td>\n";
184
           	 	print '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
187
           	 	$html .= '<td>'.$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
185
            	print "</tr>\n";
188
            	$html .= "</tr>\n";
186
            	$ctc++;
189
            	$ctc++;
187
            	if ($ctc == 2) { $ctc = 0; }
190
            	if ($ctc == 2) { $ctc = 0; }
188
			}
191
			}
189
        }
192
        }
190
        print '</table>'."\n";
193
        $html .= '</table>'."\n";
191
        return true;
194
        return $html;
192
    }
195
    }