Subversion Repositories Applications.projet

Rev

Rev 423 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 423 Rev 431
Line 1... Line 1...
1
<?php
1
<?php
2
// $Id: ezmlm.php,v 1.3.2.2 2007/03/13 11:04:46 alexandre_tb Exp $
2
// $Id: ezmlm.php,v 1.5 2007/04/19 15:34:35 neiluj Exp $
3
//
3
//
4
// ezmlm.php - ezmlm-php v2.0
4
// ezmlm.php - ezmlm-php v2.0
5
// --------------------------------------------------------------
5
// --------------------------------------------------------------
6
// As the site that ezmlm-php was developed for grew, and grew
6
// As the site that ezmlm-php was developed for grew, and grew
7
// the old system used had to be bandaid fixed more, and more
7
// the old system used had to be bandaid fixed more, and more
Line 28... Line 28...
28
require_once("ezmlm-listinfo.php");
28
require_once("ezmlm-listinfo.php");
29
require_once("ezmlm-msgdisplay.php");
29
require_once("ezmlm-msgdisplay.php");
30
require_once("ezmlm-repondre.php");
30
require_once("ezmlm-repondre.php");
31
require_once("ezmlm-author.php");
31
require_once("ezmlm-author.php");
Line 32... Line 32...
32
 
32
 
Line 33... Line 33...
33
$GLOBALS['mois'] = array ('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre') ;
33
$GLOBALS['mois'] = array ('Jan', 'F�v', 'Mars', 'Avril', 'Mai', 'Juin', 'Juil', 'Ao�t', 'Sept', 'Oct', 'Nov', 'D�c') ;
34
 
34
 
35
// CLASS: ezmlm_php
35
// CLASS: ezmlm_php
36
// the base class, contains common functions and the config
36
// the base class, contains common functions and the config
Line 116... Line 116...
116
		    (!is_dir($this->listdir . "/archive/subjects"))) {
116
		    (!is_dir($this->listdir . "/archive/subjects"))) {
117
            return false ;
117
            return false ;
118
			/*$this->error(EZMLM_INVALID_DIR,TRUE);*/
118
			/*$this->error(EZMLM_INVALID_DIR,TRUE);*/
119
		}
119
		}
120
	}
120
	}
121
	/*
-
 
122
	 * Renvoi le nombre de message dans une archive
-
 
123
	 * Le nombre contenu dans liste/num
-
 
124
	 */
-
 
125
	function getNumArchive() {
-
 
126
		if ($this->listdir != '') {
-
 
127
			$num = split(':', file_get_contents($this->listdir.'/num'));
-
 
128
			return $num[0];
-
 
129
		}
-
 
130
	}
-
 
Line 131... Line 121...
131
 
121
 
132
	function set_action($action) {
122
	function set_action($action) {
133
		if (is_array($action)) { $this->error(EZMLM_INVALID_SYNTAX,TRUE); }
123
		if (is_array($action)) { $this->error(EZMLM_INVALID_SYNTAX,TRUE); }
134
		$this->action = $action;
124
		$this->action = $action;
Line 241... Line 231...
241
 
231
 
242
		if ($short) {
232
		if ($short) {
243
			$outstr = preg_replace("/&lt;.*&gt;/", '', $outstr);
233
			$outstr = preg_replace("/&lt;.*&gt;/", '', $outstr);
244
			$outstr = preg_replace("/[\"']/", '', $outstr);
234
			$outstr = preg_replace("/[\"']/", '', $outstr);
245
		}
-
 
246
 
-
 
247
		$at_split = explode('@',$outstr);
-
 
248
		$outstr = $at_split[0];
-
 
249
 
-
 
250
		$points_sep = explode('.',$outstr);
-
 
251
		if(count($points_sep) > 2) {
-
 
252
			$outstr = implode('.', array_slice($points_sep,0,count($points_sep) - 2));
-
 
253
			$outstr = rtrim($outstr, '.').'...';
-
 
254
		}
235
		}
255
		return trim($outstr);
236
		return trim($outstr);
Line 256... Line 237...
256
	}
237
	}
257
 
238
 
Line 271... Line 252...
271
		print "</table>\n\n";
252
		print "</table>\n\n";
Line 272... Line 253...
272
 
253
 
273
		if ($critical) { die; }
254
		if ($critical) { die; }
274
	}
255
	}
275
    /**
256
    /**
276
     *  Parse une chaine et supprime les probleme d'encodage de type ISO-4 ...
257
     *  Parse une chaime et supprime les probl�me d'encodage de type ISO-4 ...
277
     *
258
     *
278
     * @return string
259
     * @return string
Line 279... Line 260...
279
     */
260
     */
Line 309... Line 290...
309
     *
290
     *
310
     * @return
291
     * @return
311
     */
292
     */
Line 312... Line 293...
312
 
293
    
313
    function date_francaise ($date_mail) {
294
    function date_francaise ($date_mail) {
314
        $date_mail = preg_replace ('/CEST/', '', $date_mail) ;
295
        $date_mail = preg_replace ('/\(?CEST\)?/', '', $date_mail) ;
315
        $numero_mois = date('m ', strtotime($date_mail)) - 1 ;
296
        $numero_mois = date('m ', strtotime($date_mail)) - 1 ;
316
        $date = date ('d ', strtotime($date_mail)).$GLOBALS['mois'][$numero_mois] ; // Le jour et le mois
297
        $date = date ('d ', strtotime($date_mail)).$GLOBALS['mois'][$numero_mois] ; // Le jour et le mois
317
        $date .= date(' Y ', strtotime($date_mail)) ; // l'annee
298
        $date .= date(' Y ', strtotime($date_mail)) ; // l'ann�e
318
        if (date('a', strtotime($date_mail)) == 'pm') {
299
        if (date('a', strtotime($date_mail)) == 'pm') {
319
            $date .= (int) date('g', strtotime($date_mail)) + 12 ;  // Les heures
300
            $date .= (int) date('g', strtotime($date_mail)) + 12 ;  // Les heures
320
        } else {
301
        } else {
321
            $date .= date('g', strtotime($date_mail)) ;
302
            $date .= date('g', strtotime($date_mail)) ;