From abd968a1c573b1862bd0728f0b7b6a88e307900a Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 28 Feb 2022 02:15:31 +0100 Subject: sauvegarde zip --- controller/visitor.php | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'controller/visitor.php') diff --git a/controller/visitor.php b/controller/visitor.php index 2656798..f0dc877 100644 --- a/controller/visitor.php +++ b/controller/visitor.php @@ -59,7 +59,7 @@ function discoVisitor() // modèle $Albums = new Album($page_actuelle); - $Albums->makeFileList(); + //var_dump($Albums->fileList); die(); // on récupère tout: JSON, HTML, noms et chemins des fichiers $Albums->readAll(); @@ -88,19 +88,22 @@ function discoVisitor() /*$lienAlbum = []; $avecLien = []; $linkDiscoChrono = [];*/ + + // liens vers les albums for($i = 0; $i < $Albums->fileListCount; $i++) { if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) { - $lienAlbum[$i] = 'page=album&album_name=' . $Albums->fileList[$i]['titre'] . '&file_code=' . $Albums->fileList[$i]['fileCode']; + /*$lienAlbum[$i] = 'page=album&album_name=' . $Albums->fileList[$i]['titre'] . '&file_code=' . $Albums->fileList[$i]['fileCode'];*/ + $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; $avecLien[$i] = true; - $linkDiscoChrono[$i] = 'linkChrono'; // css + $linkDiscoChrono[$i] = 'linkChrono'; // pour le css } else { $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; $avecLien[$i] = false; - $linkDiscoChrono[$i] = 'noLinkChrono'; // css + $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css } $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode']; } @@ -112,12 +115,31 @@ function discoVisitor() } // page d'un album -function album($fileCode, $albumName) +function album($fileCode) { - $page_actuelle = 'discographie'; - $title = $albumName; + $page_actuelle = 'discographie'; // ??? + + $Albums = new Album($page_actuelle); + $Albums->getAllJSON(); + $Albums->fileCode = $fileCode; + $Albums->readOne(); - $album = Album::readOneHTML($fileCode); // simple, efficace + //var_dump($Albums); die(); + + $album = $Albums->oneAlbum['HTMLcontent']; + //$album = Album::readOneHTML($fileCode); + + for($i = 0; $i < $Albums->fileListCount; $i++) + { + if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) + { + $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; + } + else + { + $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; + } + } // variables $css, $header et $content require('view/album.php'); -- cgit v1.2.3