Subversion Repositories Applications.projet

Rev

Rev 417 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 417 Rev 431
Line 1... Line 1...
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU General Public                                                  |
9
// | modify it under the terms of the GNU General Public                                                  |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | General Public License for more details.                                                             |
16
// | General Public License for more details.                                                             |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: messages_mois.php,v 1.4 2008-11-04 17:11:10 aperonnet Exp $
22
// CVS : $Id: messages_mois.php,v 1.4 2008-11-04 17:11:10 aperonnet Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Action forums
26
* Action forums
27
*
27
*
28
*@package projet
28
*@package projet
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2008
33
*@copyright     Tela-Botanica 2000-2008
34
*@version       $Revision: 1.4 $
34
*@version       $Revision: 1.4 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
include_once 'ezmlm-php-2.0/ezmlm.php' ;
38
include_once 'ezmlm-php-2.0/ezmlm.php' ;
39
 
39
 
40
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
-
 
41
date_default_timezone_set("Europe/Paris");
-
 
42
// extract($_GET); // PHP-5.4, sans register_globals
-
 
43
 
40
 
44
// Parametrage de la liste
41
// Parametrage de la liste
45
$info = new ezmlm_listinfo();
42
$info = new ezmlm_listinfo();
46
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
43
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
47
$info->forcehref = $url;
44
$info->forcehref = $url;
48
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
45
$info->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
49
$info->listname = $liste;
46
$info->listname = $liste;
50
$info->listdomain = $domaine ;
47
$info->listdomain = $domaine ;
51
 
48
 
52
 
49
 
53
 
50
 
54
/** Calcul du cache */
51
/** Calcul du cache */
55
 
52
 
56
require_once('Cache/Lite.php');
53
require_once('Cache/Lite.php');
57
 
54
 
58
// Set a id for this cache
55
// Set a id for this cache
59
$id = 'cachemonth_'.$domaine.'_'.$liste.'_'.$actionargs[0];
56
$id = 'cachemonth_'.$domaine.'_'.$liste.'_'.$actionargs[0];
60
 
57
 
61
// Set a few options
58
// Set a few options
62
$options = array(
59
$options = array(
63
    'cacheDir' => 'tmp/',
60
    'cacheDir' => 'tmp/',
64
    'lifeTime' => 360000
61
    'lifeTime' => 360000
65
);
62
);
66
 
63
 
67
// Create a Cache_Lite object
64
// Create a Cache_Lite object
68
$Cache_Lite = new Cache_Lite($options);
65
$Cache_Lite = new Cache_Lite($options);
69
 
66
 
70
if ($xml = $Cache_Lite->get($id)) {
67
if ($xml = $Cache_Lite->get($id)) {
71
	
68
	
72
} else {
69
} else {
73
	include_once 'XML/Util.php' ;
70
	include_once 'XML/Util.php' ;
74
	$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
71
	$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
75
	
72
	
76
	$html = $info->show_month($actionargs[0]);
73
	$html = $info->show_month($actionargs[0]);
77
	if (!$html) {
74
	if (!$html) {
78
		$xml .= XML_Util::createStartElement ('ezmlm_erreur', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
75
		$xml .= XML_Util::createStartElement ('ezmlm_erreur', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
79
    	$xml .= '<![CDATA[ \'Les fichiers de la liste ne sont pas visibles sur le serveur\']]>';
76
    	$xml .= '<![CDATA[ \'Les fichiers de la liste ne sont pas visibles sur le serveur\']]>';
80
    	$xml .= XML_Util::createEndElement('ezmlm_erreur') ;	
77
    	$xml .= XML_Util::createEndElement('ezmlm_erreur') ;	
81
	} else {
78
	} else {
82
		$xml .= XML_Util::createStartElement ('ezmlm_messages_mois', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
79
		$xml .= XML_Util::createStartElement ('ezmlm_messages_mois', array('domaine' => $domaine, 'liste' => $liste, 'langue' => $langue)) ;
83
	
80
	
84
		$xml .= '<![CDATA[ '.$html.']]>';
81
		$xml .= '<![CDATA[ '.$html.']]>';
85
		
82
		
86
		$xml .= XML_Util::createEndElement('ezmlm_messages_mois') ;
83
		$xml .= XML_Util::createEndElement('ezmlm_messages_mois') ;
87
		$Cache_Lite->save($xml);
84
		$Cache_Lite->save($xml);
88
	}
85
	}
89
}
86
}
90
header ('Content-type: text/xml');
87
header ('Content-type: text/xml');
91
echo $xml ;
88
echo $xml ;
92
 
89
 
93
/* +--Fin du code ----------------------------------------------------------------------------------------+
90
/* +--Fin du code ----------------------------------------------------------------------------------------+
94
*
91
*
95
* $Log: not supported by cvs2svn $
92
* $Log: messages_mois.php,v $
-
 
93
* Revision 1.4  2008-11-04 17:11:10  aperonnet
-
 
94
* correction de bugs dans la liste des derniers messages
-
 
95
*
96
* Revision 1.3  2008-08-25 15:24:09  alexandre_tb
96
* Revision 1.3  2008-08-25 15:24:09  alexandre_tb
97
* ajout de la gestion du cache
97
* ajout de la gestion du cache
98
*
98
*
99
* +-- Fin du code ----------------------------------------------------------------------------------------+
99
* +-- Fin du code ----------------------------------------------------------------------------------------+
100
*/
100
*/
101
?>
101
?>
102
102