diff options
| author | polo <ordipolo@gmx.fr> | 2022-02-28 02:15:31 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2022-02-28 02:15:31 +0100 |
| commit | abd968a1c573b1862bd0728f0b7b6a88e307900a (patch) | |
| tree | ef985fe5757b4516c199a06eb37a5e22f7c5b259 /controller/visitor.php | |
| parent | f19db76cc3b21785619ffd24bfb34692a3aaa66a (diff) | |
| download | melaine-abd968a1c573b1862bd0728f0b7b6a88e307900a.tar.gz melaine-abd968a1c573b1862bd0728f0b7b6a88e307900a.tar.bz2 melaine-abd968a1c573b1862bd0728f0b7b6a88e307900a.zip | |
sauvegarde zip
Diffstat (limited to 'controller/visitor.php')
| -rw-r--r-- | controller/visitor.php | 38 |
1 files changed, 30 insertions, 8 deletions
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() | |||
| 59 | 59 | ||
| 60 | // modèle | 60 | // modèle |
| 61 | $Albums = new Album($page_actuelle); | 61 | $Albums = new Album($page_actuelle); |
| 62 | $Albums->makeFileList(); | 62 | //var_dump($Albums->fileList); die(); |
| 63 | 63 | ||
| 64 | // on récupère tout: JSON, HTML, noms et chemins des fichiers | 64 | // on récupère tout: JSON, HTML, noms et chemins des fichiers |
| 65 | $Albums->readAll(); | 65 | $Albums->readAll(); |
| @@ -88,19 +88,22 @@ function discoVisitor() | |||
| 88 | /*$lienAlbum = []; | 88 | /*$lienAlbum = []; |
| 89 | $avecLien = []; | 89 | $avecLien = []; |
| 90 | $linkDiscoChrono = [];*/ | 90 | $linkDiscoChrono = [];*/ |
| 91 | |||
| 92 | // liens vers les albums | ||
| 91 | for($i = 0; $i < $Albums->fileListCount; $i++) | 93 | for($i = 0; $i < $Albums->fileListCount; $i++) |
| 92 | { | 94 | { |
| 93 | if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) | 95 | if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) |
| 94 | { | 96 | { |
| 95 | $lienAlbum[$i] = 'page=album&album_name=' . $Albums->fileList[$i]['titre'] . '&file_code=' . $Albums->fileList[$i]['fileCode']; | 97 | /*$lienAlbum[$i] = 'page=album&album_name=' . $Albums->fileList[$i]['titre'] . '&file_code=' . $Albums->fileList[$i]['fileCode'];*/ |
| 98 | $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; | ||
| 96 | $avecLien[$i] = true; | 99 | $avecLien[$i] = true; |
| 97 | $linkDiscoChrono[$i] = 'linkChrono'; // css | 100 | $linkDiscoChrono[$i] = 'linkChrono'; // pour le css |
| 98 | } | 101 | } |
| 99 | else | 102 | else |
| 100 | { | 103 | { |
| 101 | $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; | 104 | $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; |
| 102 | $avecLien[$i] = false; | 105 | $avecLien[$i] = false; |
| 103 | $linkDiscoChrono[$i] = 'noLinkChrono'; // css | 106 | $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css |
| 104 | } | 107 | } |
| 105 | $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode']; | 108 | $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode']; |
| 106 | } | 109 | } |
| @@ -112,12 +115,31 @@ function discoVisitor() | |||
| 112 | } | 115 | } |
| 113 | 116 | ||
| 114 | // page d'un album | 117 | // page d'un album |
| 115 | function album($fileCode, $albumName) | 118 | function album($fileCode) |
| 116 | { | 119 | { |
| 117 | $page_actuelle = 'discographie'; | 120 | $page_actuelle = 'discographie'; // ??? |
| 118 | $title = $albumName; | 121 | |
| 122 | $Albums = new Album($page_actuelle); | ||
| 123 | $Albums->getAllJSON(); | ||
| 124 | $Albums->fileCode = $fileCode; | ||
| 125 | $Albums->readOne(); | ||
| 119 | 126 | ||
| 120 | $album = Album::readOneHTML($fileCode); // simple, efficace | 127 | //var_dump($Albums); die(); |
| 128 | |||
| 129 | $album = $Albums->oneAlbum['HTMLcontent']; | ||
| 130 | //$album = Album::readOneHTML($fileCode); | ||
| 131 | |||
| 132 | for($i = 0; $i < $Albums->fileListCount; $i++) | ||
| 133 | { | ||
| 134 | if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) | ||
| 135 | { | ||
| 136 | $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; | ||
| 137 | } | ||
| 138 | else | ||
| 139 | { | ||
| 140 | $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; | ||
| 141 | } | ||
| 142 | } | ||
| 121 | 143 | ||
| 122 | // variables $css, $header et $content | 144 | // variables $css, $header et $content |
| 123 | require('view/album.php'); | 145 | require('view/album.php'); |
