Subversion Repositories Applications.projet

Rev

Rev 308 | Rev 404 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 ddelon 1
<?php
359 aperonnet 2
// $Id: ezmlm-threads.php,v 1.7 2008-11-19 09:28:46 aperonnet Exp $
2 ddelon 3
//
4
// ezmlm-threads.php - ezmlm-php v2.0
5
// --------------------------------------------------------------
6
// Builds, maintains & displays thread caches
7
// These cache files live in $ezmlm->tmpdir and are serialized
8
// php objects that can be unserialized and displayed easily
9
// --------------------------------------------------------------
10
 
11
require_once("ezmlm.php");
12
require_once("ezmlm-parser.php");
208 neiluj 13
require_once ('ezmlm-langue-fr.php');
2 ddelon 14
 
15
// CLASS: ezmlm_threads will build, maintain & display thread files (even if a thread is only 1 msg)
16
class ezmlm_threads extends ezmlm_php {
17
 
18
	// load: this is the main function that should be called.
19
	// it first checks to see if the cache files are stale, if they are it calls build
20
	// other wise it loads them and calls display
21
	function load($month) {
22
		if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
23
			$checksum = $this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month . "-" . "checksum";
24
		} else {
25
			$checksum = $this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month . "-" . "checksum";
26
		}
27
        $md5 = '' ;
28
		if (!is_file($checksum)) {
29
			$this->build($month);
30
		} else {
31
			$fd = fopen($checksum,"r");
32
			while (!preg_match('/^md5:/', $md5)) { $md5 = fgets($fd,4096); }
33
			fclose($fd);
34
			$md5 = rtrim(preg_replace('/^md5:/', '', $md5), "\n");
35
			if ($md5 != $this->md5_of_file($this->listdir . "/archive/threads/" . $month)) {
36
				print "<!-- $md5 ne " . $this->md5_of_file($this->listdir . "/archive/threads/" . $month) . " -->\n";
37
				$this->build($month);
38
			}
39
		}
359 aperonnet 40
		$html = $this->display($month);
41
		return $html ;
2 ddelon 42
	}
43
 
44
	// display: this loads each cache file sequentially and displays the messages in them
45
	// there is no checking of checksum's done here so load() is the preferred method to
46
	// view the threads
47
	function display($month) {
359 aperonnet 48
		$html = '' ;
2 ddelon 49
		$seq = 0;
50
		if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
51
			$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month;
52
		} else {
53
			$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month;
54
		}
55
        // Le lien par date et par thread
359 aperonnet 56
        $html .= '[ '.$this->makelink('action=show_month&amp;actionargs[]='.$month, 'par date').' ]' ;
57
		$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August',
58
		9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
2 ddelon 59
        // remplacé par le tableau globals $mois dans ezmlm.php
359 aperonnet 60
		$html .= '<h2>'.FIL_DE_DISCUSSION.' pour '.$GLOBALS['mois'][((int)substr($month,4,2) / 1) -1] .', ' . substr($month,0,4) . '</h2>'."\n";
2 ddelon 61
 
359 aperonnet 62
		$html .= '<table class="table_cadre">'."\n";
63
		$html .= '<tr><th>Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
64
		$html .= '<tr><td colspan="3"><hr /></td></tr>'."\n";
65
		$ctc .= 0;
2 ddelon 66
 
67
		if (is_file($cache)) {
68
			include($cache);
69
		}
359 aperonnet 70
		$html .= '<tr><td colspan="3"></td></tr>'."\n";
71
        $html .= '</table>'."\n";
72
 
73
        return $html ;
2 ddelon 74
        }
75
 
76
 
77
	function thread_to_html($thread) {
78
		$html = '';
79
		$lastdepth = -1;
80
        $ctc = 0 ;
81
		$thread_curr = $thread;
82
        $class = array ('ligne_paire', 'ligne_impaire') ;
83
		while ($thread_curr != NULL) {
84
            preg_match ('!/archive/([0-9]*)/([0-9]*)!', $thread_curr->file, $match) ;
85
            if (!isset($GLOBALS['fichiers_analyses'][$match[1]][$match[2]])) {
86
                $message = file_get_contents($this->listdir . "/archive/" . $msgdir . "/" . $msgfile) ;
87
                $mimeDecode = new Mail_mimeDecode($message) ;
88
                $mailDecode = $mimeDecode->decode() ;
89
                //$msg = new ezmlm_parser();
90
                //$msg->parse_file($this->listdir . $thread_curr->file, TRUE);
91
 
92
            } else {
93
                $mailDecode = $GLOBALS['fichiers_analyses'][$match[1]][$match[2]] ;
94
            }
95
            $actionargs = preg_split("/\//", $thread_curr->file);
96
			$html .= '<tr class="'.$class[$ctc].'">'."\n";
97
			$html .= '<td>'.$actionargs[2].$actionargs[3].'</td><td>';
98
			$html .= $this->makelink('action=show_author_msgs&amp;actionargs[]='.
99
                    $this->makehash($this->decode_iso($mailDecode->headers['from'])),$this->decode_iso($this->protect_email($mailDecode->headers['from'],TRUE)));
100
			$html .= '</td>'."\n";
101
			$html .= '<td><b>';
102
			//$html .= " <a name=\"" . urlencode($thread_curr->file) . "\">";    A quoi ça sert ?
103
			for ($i = 0; $i < $thread_curr->depth; $i++) {
104
				$html .= "&nbsp;&nbsp;";
105
			}
106
			if (($this->thread_subjlen > 0) and (strlen($this->decode_iso($mailDecode->headers['subject'])) > $this->thread_subjlen)) {
107
				$subject = substr($this->decode_iso($mailDecode->headers['subject']), 0, ($this->thread_subjlen - 3 - ($thread_curr->depth * 2)));
108
				$subject = $subject . "...";
109
			} else {
110
				$subject = $this->decode_iso($mailDecode->headers['subject']);
111
			}
112
 
113
 
114
			$subject = preg_replace("/\[" . $this->listname . "\]/", "", $subject);
115
			$html .= $this->makelink("action=show_msg&amp;actionargs[]=" . $actionargs[2] . "&amp;actionargs[]=" . $actionargs[3], $subject);
116
			$html .= "</b></td>\n";
117
			$html .= '<td>' .$this->date_francaise($mailDecode->headers['date']).'</td>'."\n";
118
			$html .= "</tr>\n";
119
 
120
			$ctc++;
121
			if ($ctc == count($this->tablecolours)) { $ctc = 0; }
122
 
123
			$lastdepth = $thread_curr->depth;
124
			$thread_curr = $thread_curr->next;
125
		}
126
 
127
		$html .= '<tr><td colspan="3"><hr noshade size="1" /></td></tr>'."\n";
128
		return $html;
129
	}
359 aperonnet 130
 
131
	// TODO: Fonction à tester et compléter
132
	// Construit un index de tous les messages envoyés dans une liste donnée pour un mois
133
	// au format YYYYMM
134
	function build_month_list($date)
135
	{
136
		$months = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug',
137
		9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');
138
 
139
		$month = $months[((int)substr($month,4,2) / 1) -1] ;
140
		$year = substr($month,0,4) ;
141
		$numArchive = $this->getNumArchive();
142
		$dernierRepertoire = floor($numArchive / 100);
143
 
144
		$threads = array();
145
 
146
		for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
147
			$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
2 ddelon 148
 
359 aperonnet 149
			// On parcourt le fichier a l envers
150
			for ($j = count($fichier_index)-1; $j >= 0; $j-=2) {
151
				$match = strpos($fichier_index[$j],$month.' '.$year) ;
152
				if ($match) {
153
 
154
					$threads[] = $fichier_index[$j-1] ;
155
 
156
				}
157
			}
158
		}
159
	}
160
 
2 ddelon 161
	// build: takes one argument in the format YYYYMM and builds the thread cache file
162
	// for that month if the ezmlm thread file exists. The resulting cache file is then
163
	// stored in $this->tmpdir;
164
	function build($month) {
165
		if (!is_file($this->listdir . "/archive/threads/" . $month)) { return FALSE; }
166
 
167
		if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
168
                        $fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month,"w+");
169
                } else {
170
                        $fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month,"w+");
171
                }
172
		fclose($fd2);
173
        $i=0;
174
        // ouverture du fichier thread de ezmlm
175
        // Ils sont classés mois par mois
176
		$fd1 = fopen($this->listdir . "/archive/threads/" . $month, "r");
177
		while (!feof($fd1)) {
178
			$line = fgets($fd1,4096);
179
			if (preg_match('/^[0-9]*\:[a-z]* \[.*/', $line)) {
180
				// valid ezmlm thread file entry
181
 
182
                // On place dans $subjectfile le chemin vers le fichier sujet
183
				$subjectfile = preg_replace("/^[0-9]*\:([a-z]*) \[.*/", "\\1", $line);
184
                $subjectfile = substr($subjectfile,0,2) . '/' . substr($subjectfile,2,18);
185
 
186
				$thread_head = NULL;
187
				$thread_curr = NULL;
188
				$thread_temp = NULL;
189
				$thread_depth = 1;
190
 
191
				if (!is_file($this->listdir . "/archive/subjects/" . $subjectfile)) { continue; }
192
                // on ouvre le fichier sujet
193
                // Celui-ci contient sur la première ligne le hash du sujet puis le sujet
194
                // sur les autres lignes :
195
                // num_message:annéemois:hash_auteur nom_auteur
196
				$fd2 = fopen($this->listdir . "/archive/subjects/" . $subjectfile, "r");
197
				while (!feof($fd2)) {
198
					$line2 = fgets($fd2,4096);
199
					if (preg_match('/^[0-9]/',$line2)) {
200
						$msgnum = preg_replace('/^([0-9]*):.*/', '\\1', $line2);
201
						$msgfile = $msgnum % 100;
202
                        $msgdir  = (int)($msgnum / 100);
203
						if ($msgfile < 10) { $msgfile = "0" . $msgfile; }
204
						//$msg = new ezmlm_parser();
205
						//$msg->parse_file_headers($this->listdir . "/archive/" . $msgdir . "/" . $msgfile, TRUE);
206
 
207
                        $message = file_get_contents($this->listdir . "/archive/" . $msgdir . "/" . $msgfile) ;
208
                        $mimeDecode = new Mail_mimeDecode($message) ;
209
                        $mailDecode = $mimeDecode->decode() ;
210
 
211
 
212
 
208 neiluj 213
                        // On stocke le fichier analysée pour réutilisation ultàrieure
2 ddelon 214
                        $GLOBALS['fichiers_analyses'][$msgdir][$msgfile] =  $mailDecode ;
215
						$msgid = (isset ($mailDecode->headers['message-id']) ? $mailDecode->headers['message-id'] : '');
216
						$inreply = (isset($mailDecode->headers['in-reply-to']) ? $mailDecode->headers['in-reply-to'] : '');
217
						$references = (isset ($mailDecode->headers['references']) ? $mailDecode->headers['references'] : '') ;
218
						$thread_depth = 1;
219
 
220
						if ($thread_head == NULL) {
221
							$thread_head = new ezmlm_thread(0,'/archive/' . $msgdir . '/' . $msgfile,$msgid);
222
						} else {
223
							$thread_curr = new ezmlm_thread($depth,'/archive/' . $msgdir . '/' . $msgfile,$msgid);
224
							if ($inreply != '') { $thread_curr->inreply = $inreply; }
225
							if ($references != '') { $thread_curr->references = $references; }
226
							$thread_head->append($thread_curr);
227
						}
228
					}
229
				}
230
				fclose($fd2);
231
 
232
				// so now after all that mess $thread_head contains a full thread tree
233
				// first build the depth of each message based on 'in-reply-to' and 'references'
234
				unset($thread_temp);
235
				$thread_temp = NULL;
236
				$thread_curr =& $thread_head->next;
237
				while (get_class($thread_curr) == 'ezmlm_thread') {
238
					unset($thread_temp);
239
					$thread_temp = NULL;
240
 
241
					if ($thread_curr->inreply != '') { $thread_temp =& $thread_head->find_msgid($thread_curr->inreply); }
242
					if ($thread_temp == NULL) {
243
						if ($thread_curr->references != '') {
244
							$refs = preg_split('/ /', $thread_curr->references);
245
							$refs = array_pop($refs);
246
							$thread_temp =& $thread_head->find_msgid($refs);
247
						}
248
					}
249
					if ($thread_temp == NULL) {
250
						// we couldn't find anything... set depth to 1, the default
251
						$thread_curr->depth = 1;
252
					} else {
253
						// we found a reference, set it to it's depth + 1
254
						$thread_curr->depth = $thread_temp->depth + 1;
255
					}
256
					$thread_curr =& $thread_curr->next;
257
				}
258
 
259
				// now write it to a temp file named MONTH-SEQ where seq is cronologic sequence order of the thread.
260
				if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
261
					@mkdir($this->tempdir . "/ezmlm-php-" . $this->listname, 0755);
262
					if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
263
						$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month, "a");
264
					} else {
265
						$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month, "a");
266
					}
267
				} else {
268
					$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month, "a");
269
				}
270
				fputs($fd2,$this->thread_to_html($thread_head));
271
				fclose($fd2);
272
			}
273
		}
274
 
275
		// finally store our checksum
276
		if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
277
			$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month . "-" . "checksum","w+");
278
		} else {
279
			$fd2 = fopen($this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month . "-" . "checksum","w+");
280
		}
281
		fputs($fd2,"md5:" . $this->md5_of_file($this->listdir . "/archive/threads/" . $month) . "\n");
282
		fclose($fd2);
283
		fclose($fd1);
284
 
285
		return TRUE;
286
	}
287
 
288
	// listmessages: prints out a nice little calendar and displays the message
289
	// totals for each month. The link jumps to the thread listing.
359 aperonnet 290
    // On lit le repertoire archive/threads/ qui contient un fichier par mois avec tous les thread, par sujet
308 alexandre_ 291
    // Presentes comme suit
2 ddelon 292
    // num_thread:hash [taille_du_thread] Sujet du thread (le dernier)
308 alexandre_ 293
    // les messages sont ranges par leur numero
2 ddelon 294
	function listmessages() {
295
        if (!is_dir($this->listdir . "/archive/threads/")) {
296
            return false ;
297
        }
308 alexandre_ 298
 
299
        $res = '<table id="petit_calendrier">'."\n";
300
        $res .= " <tr>\n";
301
		$res .= "  <td></td>" ;
302
        foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
303
		$res .=" </tr>\n";
304
        $res .= $this->calendrierMessage();
305
        $res .= "</table>\n";
306
        return $res;
307
        /*
208 neiluj 308
        $threadcount = array();
309
 
310
		$repertoire_archive = opendir($this->listdir . "/archive/");
308 alexandre_ 311
		$tableau_annee = array();
208 neiluj 312
		while (false !== ($item = readdir($repertoire_archive))) {
313
			// $item contient les noms des repertoires
314
			// on ne garde que ceux qui sont des chiffres
315
 
316
			if (preg_match('/[0-9]+/', $item)) {
317
				// on ouvre le fichier d index de chaque repertoire
318
				$fichier_index = fopen($this->listdir.'/archive/'.$item.'/index', 'r');
319
				$compteur = 0 ;
320
 
321
				while (!feof($fichier_index)) {
322
					// On ignore la premiere ligne
323
					$temp = fgets($fichier_index, 4096);
324
					// dans la seconde on recupere la date
325
					$temp = fgets($fichier_index, 4096);
326
					preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9])/', $temp, $match) ;
327
					if ($match[0] != '') {
308 alexandre_ 328
 
208 neiluj 329
						$threadmonth = date('n', strtotime($match[0]))  ;
330
						$threadyear = date('Y', strtotime($match[0])) ;
331
						$threadcount[$threadyear][$threadmonth]++;
308 alexandre_ 332
						if (!in_array($threadyear, $tableau_annee)) array_push ($tableau_annee, $threadyear);
208 neiluj 333
					}
2 ddelon 334
				}
208 neiluj 335
				fclose ($fichier_index);
2 ddelon 336
			}
337
		}
308 alexandre_ 338
		if (count($threadcount) == 0) return 'Il n\y a pas de messages dans les archives';
339
        // La partie qui suit, simple, cree la table avec le nombre de message echange chaque mois
44 alexandre_ 340
		$res = '<table id="petit_calendrier">'."\n";
2 ddelon 341
		$res .= " <tr>\n";
342
		$res .= "  <td></td>" ;
308 alexandre_ 343
        foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
2 ddelon 344
		$res .=" </tr>\n";
308 alexandre_ 345
		arsort($tableau_annee);
346
		foreach ($tableau_annee as $annee) {
2 ddelon 347
			$res .= " <tr>\n";
308 alexandre_ 348
			$res .= '  <td class="col_annee">'.$annee.'</td>';
2 ddelon 349
			for ($i = 1; $i <= 12; $i++) {
308 alexandre_ 350
				$res .= '<td class="mois">';
351
				if (isset($threadcount[$annee][$i]) && $threadcount[$annee][$i] > 0) {
352
                    $res .= $this->makelink('action=show_month&amp;actionargs[]='.$annee.($i < 10 ? '0'.$i:$i),$threadcount[$annee][$i]);
353
				}
354
				$res .= '</td>';
2 ddelon 355
			}
308 alexandre_ 356
			$res .= '</tr>'."\n";
2 ddelon 357
		}
358
		$res .= "</table>\n";
308 alexandre_ 359
        return $res ;
360
        */
2 ddelon 361
	}
308 alexandre_ 362
	/*
363
	 *  Cree un fichier liste.calendrierPermanent qui contient
364
	 *  le nombre de message par mois pour toutes les annees
365
	 *  depuis le debut de la liste sauf la derniere
366
	 *
367
	 */
368
	function calculeCalendrierPermanent($Annnee = '') {
369
		$numArchive = $this->getNumArchive();
370
		$dernierRepertoire = floor($numArchive / 100);
371
 
372
		$threadcount = array();
373
		$tableau_annee = array();
374
 
375
 
376
		for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
377
			$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
378
 
379
			// On parcours le fichier a l envers
380
			for ($j = count($fichier_index)-1; $j >= 0; $j-=2) {
381
				preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9])/', $fichier_index[$j], $match) ;
382
				if ($match[0] != '') {
383
					$threadmonth = date('n', strtotime($match[0]))  ;
384
					$threadyear = date('Y', strtotime($match[0])) ;
385
					if ($Annnee != '') {
386
						if ($threadyear < date('Y')) {
387
							$sortir = true;
388
							break;
389
						}
390
					}  else {
391
						if ($threadyear == date('Y')) continue;
392
					}
393
					$threadcount[$threadyear][$threadmonth]++;
394
					if (!in_array($threadyear, $tableau_annee)) array_push ($tableau_annee, $threadyear);
395
				}
396
			}
397
			if ($sortir) break;
398
		}
399
		$res = '';
400
		arsort($tableau_annee);
401
		foreach ($tableau_annee as $annee) {
402
			$res .= " <tr>\n";
403
			$res .= '  <td class="col_annee">'.$annee.'</td>';
404
			for ($i = 1; $i <= 12; $i++) {
405
				$res .= '<td class="mois">';
406
				if (isset($threadcount[$annee][$i]) && $threadcount[$annee][$i] > 0) {
407
                    $res .= $this->makelink('action=show_month&amp;actionargs[]='.$annee.($i < 10 ? '0'.$i:$i),$threadcount[$annee][$i]);
408
				}
409
				$res .= '</td>';
410
			}
411
			$res .= '</tr>'."\n";
412
		}
413
		return $res;
414
	}
415
	function ecrireFichierCalendrier() {
416
		$html = $this->calculeCalendrierPermanent();
417
		$f = fopen ('tmp/'.$this->listname.'.calendrier', 'w') ;
418
		fwrite ($f, $html);
419
		fclose($f);
420
		return $html;
421
	}
422
 
423
	function calendrierMessage() {
424
		$html = '';
425
		// On ajoute la derniere annee
426
		$html .= $this->calculeCalendrierPermanent(date ('Y'));
427
 
428
		if ($this->isFichierCalendrierExiste()) {
429
			// S il existe mais qu il est trop vieux, il faut le recalculer
359 aperonnet 430
		//	if ($this->isDoitRecalculerCalendrier()) {
308 alexandre_ 431
				$annees = $this->getAnneesARecalculer();
432
				$html .= $this->calculeCalendrierPermanent($annees);
359 aperonnet 433
		  //  }
308 alexandre_ 434
			$html .= file_get_contents('tmp/'.$this->listname.'.calendrier');
435
		} else {
436
			$html .= $this->ecrireFichierCalendrier();
437
		}
438
		return $html;
439
	}
440
 
441
	function isFichierCalendrierExiste() {
442
		if (file_exists('tmp/'.$this->listname.'.calendrier')) {
443
			return true;
444
		}
445
		return false;
446
	}
447
	function isDoitRecalculerCalendrier() {
448
 
449
		if (date ('Y', fileatime('tmp/'.$this->listname.'.calendrier')) != date('Y')) return true;
450
		return false;
451
	}
452
 
453
	function getAnneesARecalculer() {
454
		// On suppose que l index de ezmlm est correct
455
		$anneeFichierCalendrier = date ('Y', fileatime('tmp/'.$this->listname.'.calendrier'));
456
		return $anneeFichierCalendrier + 1;
457
	}
458
 
2 ddelon 459
}
460
 
461
// CLASS: ezmlm-thread is a quick little class to allow us to define
462
// a structure of the current thread in a single-linked list.
463
// it's a little messy since php doesn't support pointers like C does
464
// so we have to use references and a head object to append to the list.
465
class ezmlm_thread {
466
	var $next;
467
	var $depth;
468
	var $file;
469
	var $msgid;
470
	var $inreply;
471
	var $references;
472
	function append($thread) {
473
		$thread_curr =& $this;
474
		while ($thread_curr->next != NULL) {
475
			$thread_curr =& $thread_curr->next;
476
		}
477
		$thread_curr->next = $thread;
478
	}
479
	function &find_msgid($msgid) {
480
		$thread_curr =& $this;
481
		while ($thread_curr->next != NULL) {
482
			if (trim($thread_curr->msgid) == trim($msgid)) { return $thread_curr; }
483
			$thread_curr =& $thread_curr->next;
484
		}
485
		return NULL;
486
	}
487
	function ezmlm_thread($depth,$file,$msgid) {
488
		$this->depth = $depth;
489
		$this->file  = $file;
490
		$this->msgid = $msgid;
491
		$this->next = NULL;
492
	}
493
}
494
?>