Subversion Repositories Applications.projet

Rev

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

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