From 2afdde9749eeface10ceca832eb7f8ff8d32de3c Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 2 Mar 2022 01:10:29 +0100 Subject: Affichage et page archives --- controller/visitor.php | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'controller/visitor.php') diff --git a/controller/visitor.php b/controller/visitor.php index aae15a7..ac19441 100644 --- a/controller/visitor.php +++ b/controller/visitor.php @@ -30,8 +30,6 @@ function menu() // toutes celles du menu sauf: menu et discographie function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle) { - $headerImage = '
'; - // infos sur les fichiers $Articles->fileList $Articles = new Article($page); @@ -47,7 +45,7 @@ function pageArticlesSimplesVisitor(string $page, string $title, string $headerP $Articles->fileList = array_reverse($Articles->fileList); } - // variables $css, $js, $header et $content + // variables $css, $js, $header, $content et $headerImage require('view/pageArticlesSimples.php'); // HTML require('view/template.php'); @@ -122,43 +120,22 @@ function discoVisitor() } //var_dump($Albums->fileList); die(); - - // tri des albums avec l'année dans le .json - - // noms des fichiers JSON - //$albumNamesJSON = $Albums->fileList; - - //$annees = []; - for($i = 0; $i < $Albums->fileListCount; $i++) - {} - //var_dump($annee); die(); - - // tri d'un tableau multidimensionnel - //array_multisort($annees, $albumsJSON); - - - // lien vers le HTML ou ancre? - /*$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&file_code=' . $Albums->fileList[$i]['fileCode']; $avecLien[$i] = true; $linkDiscoChrono[$i] = 'linkChrono'; // pour le css } else { - $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; + $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['fileCode']; $avecLien[$i] = false; $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css } - $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode']; + $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode'] . '#' . $Albums->fileList[$i]['fileCode']; } // variables $css, $js et $content @@ -174,6 +151,10 @@ function album($fileCode) $Albums = new Album($page); $Albums->getAllJSON(); + if(!empty($Albums->fileList)) + { + $Albums->fileList = array_reverse($Albums->fileList); + } $Albums->fileCode = $fileCode; $Albums->readOne(); -- cgit v1.2.3