// // This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. // // To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ // // or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. // // Francais (brouillon): http://creativecommons.org/projects/international/fr/translated-license // ////////////////////////////////////////////////////////////////////////////////////////////////////// // Export HTML + Images // v0.1.0 function makeArchive($id, $path, $force=false) { global $cfg; require_once("../classes/ecrits.php"); require_once("../classes/fonctions.php"); $ecrits = new ecrits(); $journal = new journal(); $datas = $journal->infos($id); if(!$force) { if($datas['statut'] != 'collectif' && $datas['statut'] != 'public') return true; } $page = ' '.str2html($datas['titre']).'

'.str2html($datas['titre']).'

Un journal de '.str2html($cfg['titre']).'

Archive du journal au '.date("d/m/Y").'.

Sommaire

'; $liste_mois = $ecrits->liste_mois($datas['id']); if(empty($liste_mois)) return false; $lst = array(); foreach($liste_mois as $mois) { $liste[$mois] = $ecrits->liste($datas['id'],$mois,TRUE,TRUE); $lst = array_merge($lst,$liste[$mois]); } $liste = $lst; if(count($liste) < 1) return false; foreach($liste as $id=>$rec) { $rec['texte_html'] = str_replace('
'.str2html($rec['titre']).'
'; } $page.= '
'; reset($liste); foreach($liste as $rec) { $page.= '

'.str2html($rec['titre']).'

'.str2html(date_fr("l j F Y à G\hi",$rec['date'])).'

'.stripslashes($rec['texte_html']).'
'; } $page.= '
'; $fp = @fopen($path, "w"); if(!$fp) return false; fputs($fp,$page); fclose($fp); return true; } ?>