refactor: change home links

This commit is contained in:
2025-07-20 16:29:16 +04:00
parent b5b2a3ab1b
commit ba7e1b6893
+11 -11
View File
@@ -1,9 +1,9 @@
<!-- Sidebar de navigation --> <!-- Sidebar de navigation -->
<div class="sidebar"> <div class="sidebar">
<a href="index.php" class="logo"> <a href="/" class="logo">
<img src="img/logo.png" alt="kaubuntu.re"> <img src="img/logo.png" alt="kaubuntu.re">
</a> </a>
<?php <?php
// Détecter la page courante et ses paramètres // Détecter la page courante et ses paramètres
$currentPage = basename($_SERVER['PHP_SELF']); $currentPage = basename($_SERVER['PHP_SELF']);
@@ -12,15 +12,15 @@
$isTagSearch = !empty($currentQuery) && substr($currentQuery, 0, 1) === '#'; $isTagSearch = !empty($currentQuery) && substr($currentQuery, 0, 1) === '#';
$currentTag = $isTagSearch ? substr($currentQuery, 1) : ''; $currentTag = $isTagSearch ? substr($currentQuery, 1) : '';
?> ?>
<nav class="sidebar-nav"> <nav class="sidebar-nav">
<a href="index.php" class="nav-item <?php echo ($currentPage === 'index.php') ? 'active' : ''; ?>" data-title="Accueil"> <a href="/" class="nav-item <?php echo ($currentPage === 'index.php') ? 'active' : ''; ?>" data-title="Accueil">
<i class="fas fa-home"></i> <span>Accueil</span> <i class="fas fa-home"></i> <span>Accueil</span>
</a> </a>
<a href="direct.php" class="nav-item <?php echo ($currentPage === 'direct.php') ? 'active' : ''; ?>" data-title="Direct"> <a href="direct.php" class="nav-item <?php echo ($currentPage === 'direct.php') ? 'active' : ''; ?>" data-title="Direct">
<i class="fas fa-broadcast-tower"></i> <span>Direct</span> <i class="fas fa-broadcast-tower"></i> <span>Direct</span>
</a> </a>
<div class="nav-divider"></div> <div class="nav-divider"></div>
<?php <?php
@@ -47,7 +47,7 @@
17 => 'fas fa-child', // Enfants 17 => 'fas fa-child', // Enfants
18 => 'fas fa-utensils' // Cuisine 18 => 'fas fa-utensils' // Cuisine
]; ];
foreach (PRIORITY_CATEGORIES as $id => $name) { foreach (PRIORITY_CATEGORIES as $id => $name) {
$isActive = ($currentPage === 'categories.php' && $currentCategoryId === $id); $isActive = ($currentPage === 'categories.php' && $currentCategoryId === $id);
$icon = isset($categoryIcons[$id]) ? $categoryIcons[$id] : 'fas fa-folder'; $icon = isset($categoryIcons[$id]) ? $categoryIcons[$id] : 'fas fa-folder';
@@ -57,14 +57,14 @@
} }
} }
?> ?>
<div class="nav-divider"></div> <div class="nav-divider"></div>
<div class="category-title"> <div class="category-title">
<i class="fas fa-hashtag"></i> <span>Hashtags</span> <i class="fas fa-hashtag"></i> <span>Hashtags</span>
</div> </div>
<?php <?php
if (defined('IMPORTANT_TAGS') && !empty(IMPORTANT_TAGS)): if (defined('IMPORTANT_TAGS') && !empty(IMPORTANT_TAGS)):
foreach (IMPORTANT_TAGS as $tag): foreach (IMPORTANT_TAGS as $tag):
$encodedTag = urlencode('#' . $tag); $encodedTag = urlencode('#' . $tag);
@@ -73,7 +73,7 @@
<a href="recherche.php?q=<?php echo $encodedTag; ?>" class="tag-item <?php echo $isActive ? 'active' : ''; ?>" data-title="<?php echo htmlspecialchars($tag); ?>"> <a href="recherche.php?q=<?php echo $encodedTag; ?>" class="tag-item <?php echo $isActive ? 'active' : ''; ?>" data-title="<?php echo htmlspecialchars($tag); ?>">
<i class="fas fa-hashtag tag-icon"></i> <span><?php echo htmlspecialchars($tag); ?></span> <i class="fas fa-hashtag tag-icon"></i> <span><?php echo htmlspecialchars($tag); ?></span>
</a> </a>
<?php <?php
endforeach; endforeach;
endif; endif;
?> ?>