résolution d'un bug

This commit is contained in:
2024-06-17 19:18:08 +02:00
parent d06ea90853
commit 4258186b14
6 changed files with 28 additions and 26 deletions

View File

@@ -59,16 +59,8 @@ if ($page[count($page)-2] != 'viewAlbum'): ?>
<h5>Albums list</h5>
<section class="list">
<?php
$page = preg_split('/[\/]/',$_SERVER['REQUEST_URI']);
$long_page = count($page)-1;
$url = $page[$long_page];
while ($page[$long_page] != 'albums'){
$long_page = $long_page - 1;
$url = $page[$long_page].'/'.$url;
}
print_r($url);
<?php
foreach ($albums as $album):
?>
<div>
@@ -76,7 +68,7 @@ foreach ($albums as $album):
<header class="short-text">
<?= anchor("albums/viewMusique/{$album->albumId}", $album->name); ?>
<?php if ($this->session->userdata('logged_in')): ?>
<?= anchor("albums/addAlbumtoPlaylist/{$album->albumId}?page={$url}", "<i class='fa fa-plus'></i>"); ?>
<?= anchor("albums/addAlbumtoPlaylist/{$album->albumId}", "<i class='fa fa-plus'></i>"); ?>
<?php endif; ?>
</header>
<img src="data:image/jpeg;base64,<?= base64_encode($album->jpeg); ?>" alt="cover de l'album" />