Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
// $Id: ezmlm-threads.php,v 1.5.4.2 2008-11-05 09:55:56 aperonnet Exp $
|
2 |
// $Id: ezmlm-threads.php,v 1.5.4.3 2008-11-19 09:30:18 aperonnet Exp $
|
3 |
//
|
3 |
//
|
4 |
// ezmlm-threads.php - ezmlm-php v2.0
|
4 |
// ezmlm-threads.php - ezmlm-php v2.0
|
5 |
// --------------------------------------------------------------
|
5 |
// --------------------------------------------------------------
|
6 |
// Builds, maintains & displays thread caches
|
6 |
// Builds, maintains & displays thread caches
|
7 |
// These cache files live in $ezmlm->tmpdir and are serialized
|
7 |
// These cache files live in $ezmlm->tmpdir and are serialized
|
Line 31... |
Line 31... |
31 |
$fd = fopen($checksum,"r");
|
31 |
$fd = fopen($checksum,"r");
|
32 |
while (!preg_match('/^md5:/', $md5)) { $md5 = fgets($fd,4096); }
|
32 |
while (!preg_match('/^md5:/', $md5)) { $md5 = fgets($fd,4096); }
|
33 |
fclose($fd);
|
33 |
fclose($fd);
|
34 |
$md5 = rtrim(preg_replace('/^md5:/', '', $md5), "\n");
|
34 |
$md5 = rtrim(preg_replace('/^md5:/', '', $md5), "\n");
|
35 |
if ($md5 != $this->md5_of_file($this->listdir . "/archive/threads/" . $month)) {
|
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";
|
36 |
$html .= "<!-- $md5 ne " . $this->md5_of_file($this->listdir . "/archive/threads/" . $month) . " -->\n";
|
37 |
$this->build($month);
|
37 |
$this->build($month);
|
38 |
}
|
38 |
}
|
39 |
}
|
39 |
}
|
40 |
return $this->display($month);
|
40 |
$html .= $this->display($month);
|
- |
|
41 |
return $html ;
|
41 |
}
|
42 |
}
|
Line 42... |
Line 43... |
42 |
|
43 |
|
43 |
// display: this loads each cache file sequentially and displays the messages in them
|
44 |
// display: this loads each cache file sequentially and displays the messages in them
|
44 |
// there is no checking of checksum's done here so load() is the preferred method to
|
45 |
// there is no checking of checksum's done here so load() is the preferred method to
|
45 |
// view the threads
|
46 |
// view the threads
|
46 |
function display($month) {
|
47 |
function display($month) {
|
- |
|
48 |
$seq = 0;
|
47 |
$seq = 0;
|
49 |
$html = '' ;
|
48 |
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
|
50 |
if (!is_dir($this->tempdir . "/ezmlm-php-" . $this->listname)) {
|
49 |
$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month;
|
51 |
$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "-" . $month;
|
50 |
} else {
|
52 |
} else {
|
51 |
$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month;
|
53 |
$cache = $this->tempdir . "/ezmlm-php-" . $this->listname . "/" . $month;
|
52 |
}
|
54 |
}
|
53 |
// Le lien par date et par thread
|
55 |
// Le lien par date et par thread
|
54 |
$html = '[ '.$this->makelink('action=show_month&actionargs[]='.$month, 'par date').' ]' ;
|
56 |
$html .= '[ '.$this->makelink('action=show_month&actionargs[]='.$month, 'par date').' ]' ;
|
55 |
$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August',
|
57 |
$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August',
|
56 |
9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
|
58 |
9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
|
57 |
// remplacé par le tableau globals $mois dans ezmlm.php
|
59 |
// remplacé par le tableau globals $mois dans ezmlm.php
|
Line 58... |
Line 60... |
58 |
$html = '<h2>'.FIL_DE_DISCUSSION.' pour '.$GLOBALS['mois'][((int)substr($month,4,2) / 1) -1] .', ' . substr($month,0,4) . '</h2>'."\n";
|
60 |
$html .= '<h2>'.FIL_DE_DISCUSSION.' pour '.$GLOBALS['mois'][((int)substr($month,4,2) / 1) -1] .', ' . substr($month,0,4) . '</h2>'."\n";
|
59 |
|
61 |
|
60 |
$html = '<table class="table_cadre">'."\n";
|
62 |
$html .= '<table class="table_cadre">'."\n";
|
61 |
$html = '<tr><th>Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
|
63 |
$html .= '<tr><th>Num</th><th>De</th><th>Sujet</th><th>Date</th></tr>'."\n";
|
Line 62... |
Line 64... |
62 |
$html = '<tr><td colspan="3"><hr /></td></tr>'."\n";
|
64 |
$html .= '<tr><td colspan="3"><hr /></td></tr>'."\n";
|
63 |
$ctc = 0;
|
65 |
$ctc = 0;
|
64 |
|
66 |
|
65 |
if (is_file($cache)) {
|
67 |
if (is_file($cache)) {
|
66 |
include($cache);
|
68 |
include($cache);
|
- |
|
69 |
}
|
- |
|
70 |
$html .= '<tr><td colspan="3"></td></tr>'."\n";
|
67 |
}
|
71 |
$html .= '</table>'."\n";
|
Line 68... |
Line 72... |
68 |
$html = '<tr><td colspan="3"></td></tr>'."\n";
|
72 |
|
69 |
$html = '</table>'."\n";
|
73 |
return $html ;
|