ajout d'un pied de page

sur toutes les pages, indique le nom d'ICO avec lien de son dépôt + n° de la version courante
This commit is contained in:
Esenjin 2025-01-05 21:55:22 +01:00
parent 1a8073ceef
commit d920532fd4
16 changed files with 86 additions and 99 deletions

View File

@ -1,4 +1,5 @@
<?php
require_once 'fonctions.php';
session_start();
// Vérifier si un utilisateur est connecté
@ -45,6 +46,7 @@ function showLoginForm($error = null) {
<button type="submit" class="action-button">Se connecter</button>
</form>
</div>
<?php include 'footer.php'; ?>
</body>
</html>
<?php
@ -146,6 +148,7 @@ function showAdminInterface() {
</a>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>
<?php
@ -194,6 +197,7 @@ function showChangePasswordForm() {
</div>
</form>
</div>
<?php include 'footer.php'; ?>
</body>
</html>
<?php

View File

@ -112,5 +112,6 @@ if (!isSecurePath($parentPath)) {
});
});
</script>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -301,5 +301,6 @@ $currentAlbumInfo = getAlbumInfo($currentPath);
// Initialisation : masquer les boutons au chargement
document.addEventListener('DOMContentLoaded', updateActionButtons);
</script>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -600,5 +600,6 @@ $images = array_map(function($img) {
</form>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -431,5 +431,6 @@ function generatePrivateTree($path, $currentPath) {
}, 2000);
}
</script>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -350,5 +350,6 @@ function generateTree($path, $currentPath) {
}
}
</script>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -240,5 +240,6 @@ while ($row = $albumsResult->fetchArray(SQLITE3_ASSOC)) {
window.location.href = url;
}
</script>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -342,4 +342,16 @@ function cleanExpiredShareKeys() {
return $db->changes();
}
/**
* Récupère la version actuelle du projet
* @return string La version du projet
*/
function getVersion() {
$versionFile = __DIR__ . '/version.txt';
if (file_exists($versionFile)) {
return trim(file_get_contents($versionFile));
}
return 'inconnue'; // Version par défaut si le fichier n'existe pas
}
?>

12
footer.php Normal file
View File

@ -0,0 +1,12 @@
<?php
/**
* Footer commun à toutes les pages
* À inclure en fin de body
*/
?>
<footer class="site-footer">
<p class="footer-text">
Site propulsé grâce à <a href="https://git.crystalyx.net/camelia-studio/ICO" target="_blank" class="footer-link">ICO</a>
<span class="footer-version">version <?php echo htmlspecialchars(getVersion()); ?></span>
</p>
</footer>

View File

@ -168,5 +168,6 @@ if (empty($shareKey)) {
}
</script>
<?php endif; ?>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -141,5 +141,6 @@ if (!isSecurePath($parentPath)) {
}
}
</script>
<?php include 'footer.php'; ?>
</body>
</html>

View File

@ -1,4 +1,6 @@
<?php
require_once 'fonctions.php';
function getCarouselImages($limit = 5) {
$images = [];
$carouselDir = './img_carrousel';
@ -55,6 +57,8 @@ $carouselImages = getCarouselImages();
<a href="albums.php" class="cta-button">Accéder aux galeries</a>
</div>
<?php include 'footer.php'; ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
let currentSlide = 0;

View File

@ -24,105 +24,6 @@ $filename = basename($imageUrl);
<link rel="stylesheet" href="styles.css">
</head>
<body class="share-page">
<div class="share-container">
<div class="share-image">
<img src="<?php echo htmlspecialchars($imageUrl); ?>" alt="Image partagée">
</div>
<div class="share-actions">
<button class="action-button" onclick="shareImage()">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path>
<polyline points="16 6 12 2 8 6"></polyline>
<line x1="12" y1="2" x2="12" y2="15"></line>
</svg>
Partager
</button>
<button class="action-button" onclick="embedImage()">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="16 18 22 12 16 6"></polyline>
<polyline points="8 6 2 12 8 18"></polyline>
</svg>
Intégrer
</button>
<a href="<?php echo htmlspecialchars($imageUrl); ?>"
download="<?php echo htmlspecialchars($filename); ?>"
class="action-button">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
<polyline points="7 10 12 15 17 10"></polyline>
<line x1="12" y1="15" x2="12" y2="3"></line>
</svg>
Télécharger
</a>
</div>
</div>
<script>
function copyToClipboard(text, button) {
const input = document.createElement('input');
input.value = text;
document.body.appendChild(input);
input.select();
document.execCommand('copy');
document.body.removeChild(input);
// Sauvegarder l'HTML original
const originalHTML = button.innerHTML;
// Afficher la confirmation
button.innerHTML = `
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 6L9 17l-5-5"></path>
</svg>
Copié !
`;
// Restaurer l'état original après 2 secondes
setTimeout(() => {
button.innerHTML = originalHTML;
}, 2000);
}
function shareImage() {
copyToClipboard(window.location.href, document.querySelector('.action-button'));
}
function embedImage() {
const imageUrl = '<?php echo htmlspecialchars($imageUrl); ?>';
copyToClipboard(imageUrl, document.querySelector('.action-button:nth-child(2)'));
}
</script>
</body>
</html><?php
require_once 'functions.php';
// Vérifier que nous avons une URL d'image
$imageUrl = isset($_GET['image']) ? $_GET['image'] : null;
$returnUrl = isset($_GET['return']) ? $_GET['return'] : 'index.php';
// Si pas d'image, redirection
if (!$imageUrl) {
header('Location: ' . $returnUrl);
exit;
}
// Récupérer le nom du fichier pour le téléchargement
$filename = basename($imageUrl);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Partager l'image - ICO</title>
<link rel="stylesheet" href="styles.css">
</head>
<body class="share-page">
<!-- Remplacer le lien de retour par un bouton -->
<button onclick="window.close();" class="back-button">Retour à la galerie</button>
<div class="share-container">
@ -161,6 +62,8 @@ $filename = basename($imageUrl);
</div>
</div>
<?php include 'footer.php'; ?>
<script>
function copyToClipboard(text, button) {
const input = document.createElement('input');

View File

@ -572,6 +572,48 @@ body {
}
}
/* Styles pour le pied de page */
.site-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 0.5rem;
background-color: rgba(0, 0, 0, 0.3);
text-align: center;
z-index: 100;
pointer-events: none;
}
.footer-text {
color: rgba(255, 255, 255, 0.7);
font-size: 0.8rem;
margin: 0;
}
.footer-link {
color: rgba(255, 255, 255, 0.9);
text-decoration: none;
transition: color 0.3s ease;
pointer-events: auto;
}
.footer-link:hover {
color: #2196f3;
}
.footer-version {
margin-left: 0.5rem;
opacity: 0.7;
font-size: 0.8rem;
}
.gallery-grid,
.albums-grid,
.admin-content {
margin-bottom: 3rem;
}
/* Media Queries */
@media (min-width: 1400px) {
.albums-grid {

View File

@ -324,5 +324,6 @@ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
}
}
</script>
<?php include 'footer.php'; ?>
</body>
</html>

1
version.txt Normal file
View File

@ -0,0 +1 @@
1.0.0