//
// 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
// v0.1.0
if(!is_object($journal)) die("Indisponible");
require_once("../classes/ecrits.php");
require_once("../classes/fonctions.php");
$ecrits = new ecrits();
$datas = $journal->courant;
$page = '
'.str2html($datas['titre']).'
'.str2html($datas['titre']).'
'.id2url($datas['id']).'
Export HTML du '.date("d/m/Y").'.
Sommaire
';
$liste_mois = $ecrits->liste_mois($datas['id']);
$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) die("Rien à exporter. aucun écrit.");
foreach($liste as $rec)
{
$page.= '
- '.date_fr("j F Y à G\hi",$rec['date']).'
- '.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.= '
';
if(!empty($saveToFile))
{
$fp = @fopen($saveToFile,"w");
if(!$fp) die("Impossible d'ouvrir le fichier d'export en écriture.");
fputs($fp,$page);
fclose($fp);
}
else
{
echo $page;
exit;
}
?>