Subversion Repositories Applications.projet

Rev

Rev 407 | Rev 411 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 407 Rev 408
Line 303... Line 303...
303
		$res .= "  <td></td>" ;
303
		$res .= "  <td></td>" ;
304
        foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
304
        foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
305
		$res .=" </tr>\n";
305
		$res .=" </tr>\n";
306
        $res .= $this->calendrierMessage();
306
        $res .= $this->calendrierMessage();
307
        $res .= "</table>\n";
307
        $res .= "</table>\n";
308
 
-
 
309
        return $res;
308
        return $res;
310
        /*
309
        /*
311
        $threadcount = array();
310
        $threadcount = array();
Line 312... Line 311...
312
 
311
 
Line 373... Line 372...
373
		$dernierRepertoire = floor($numArchive / 100);
372
		$dernierRepertoire = floor($numArchive / 100);
Line 374... Line 373...
374
		
373
		
375
		$threadcount = array();
374
		$threadcount = array();
Line -... Line 375...
-
 
375
		$tableau_annee = array();
376
		$tableau_annee = array();
376
		
377
		
377
		
Line 378... Line 378...
378
		for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
378
		for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
379
			$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
379
			$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
Line 424... Line 424...
424
	
424
	
425
	function calendrierMessage() {
425
	function calendrierMessage() {
426
		$html = '';
426
		$html = '';
427
		// On ajoute la derniere annee
427
		// On ajoute la derniere annee
428
		$html .= $this->calculeCalendrierPermanent(date ('Y'));
428
		$html .= $this->calculeCalendrierPermanent(date ('Y'));
429
 
429
		
430
		if (! $this->isFichierCalendrierExiste()) return $html . $this->ecrireFichierCalendrier();
430
		if ($this->isFichierCalendrierExiste()) {
431
		// S'il existe mais qu il est trop vieux, il faut le recalculer et le réécrire
431
			// S il existe mais qu il est trop vieux, il faut le recalculer
432
		if ($this->isDoitRecalculerCalendrier()) return $html . $this->ecrireFichierCalendrier();
-
 
433
		// précédemment, dans ce cas ci-dessus
-
 
434
		// était effectuée un recalcul partiel, mais sans réécriture du fichier:
432
		    if ($this->isDoitRecalculerCalendrier()) {
435
		/* $annees = $this->getAnneesARecalculer();
433
			$annees = $this->getAnneesARecalculer();
436
		   $html .= $this->calculeCalendrierPermanent($annees); */
434
			$html .= $this->calculeCalendrierPermanent($annees);
437
 
435
		    }
-
 
436
			$html .= file_get_contents('tmp/'.$this->listname.'.calendrier');
-
 
437
		} else {
-
 
438
			$html .= $this->ecrireFichierCalendrier();
-
 
439
		}	
438
		return $html . file_get_contents('tmp/'.$this->listname.'.calendrier');
440
		return $html;
Line 439... Line 441...
439
	}
441
	}
440
	
442
	
441
	function isFichierCalendrierExiste() {
443
	function isFichierCalendrierExiste() {
442
		if (file_exists('tmp/'.$this->listname.'.calendrier')) {
444
		if (file_exists('tmp/'.$this->listname.'.calendrier')) {
443
			return true;
445
			return true;
444
		}
446
		}
445
		return false;
447
		return false;
-
 
448
	}
446
	}
449
	function isDoitRecalculerCalendrier() {
-
 
450
 
447
	function isDoitRecalculerCalendrier() {
451
		if (date ('Y', fileatime('tmp/'.$this->listname.'.calendrier')) != date('Y')) return true;
Line 448... Line 452...
448
	    return (date ('Y', filemtime('tmp/'.$this->listname.'.calendrier')) <= date('Y') - 1);
452
		return false;
449
	}
453
	}
450
	
454
	
451
	function getAnneesARecalculer() {
455
	function getAnneesARecalculer() {
452
		// On suppose que l index de ezmlm est correct
456
		// On suppose que l index de ezmlm est correct
Line 453... Line 457...
453
		$anneeFichierCalendrier = date ('Y', filemtime('tmp/'.$this->listname.'.calendrier'));
457
		$anneeFichierCalendrier = date ('Y', fileatime('tmp/'.$this->listname.'.calendrier'));