feat: social media aggregator (YouTube, Instagram, TikTok, WordPress)
This commit is contained in:
+33
-68
@@ -1,88 +1,53 @@
|
||||
<!-- Sidebar de navigation -->
|
||||
<nav class="sidebar" role="navigation" aria-label="Navigation principale">
|
||||
<a href="/" class="logo" aria-label="Retour à l'accueil">
|
||||
<img src="img/logo.png" alt="Logo kaubuntu.re">
|
||||
<img src="img/logo.png" alt="Logo <?php echo htmlspecialchars(SITE_NAME); ?>">
|
||||
</a>
|
||||
|
||||
<?php
|
||||
// Détecter la page courante et ses paramètres
|
||||
$currentPage = basename($_SERVER['PHP_SELF']);
|
||||
$currentCategoryId = isset($_GET['id']) ? intval($_GET['id']) : null;
|
||||
$currentQuery = isset($_GET['q']) ? trim($_GET['q']) : '';
|
||||
$isTagSearch = !empty($currentQuery) && substr($currentQuery, 0, 1) === '#';
|
||||
$currentTag = $isTagSearch ? substr($currentQuery, 1) : '';
|
||||
$isHome = ($currentPage === 'index.php' || $currentPage === '/');
|
||||
?>
|
||||
|
||||
<div class="sidebar-nav">
|
||||
<a href="/" class="nav-item <?php echo ($currentPage === 'index.php') ? 'active' : ''; ?>" data-title="Accueil" aria-current="<?php echo ($currentPage === 'index.php') ? 'page' : 'false'; ?>">
|
||||
<a href="/"
|
||||
class="nav-item <?php echo $isHome ? 'active' : ''; ?>"
|
||||
data-title="Accueil"
|
||||
aria-current="<?php echo $isHome ? 'page' : 'false'; ?>">
|
||||
<i class="fas fa-home" aria-hidden="true"></i> <span>Accueil</span>
|
||||
</a>
|
||||
<a href="direct.php" class="nav-item <?php echo ($currentPage === 'direct.php') ? 'active' : ''; ?>" data-title="Direct" aria-current="<?php echo ($currentPage === 'direct.php') ? 'page' : 'false'; ?>">
|
||||
<i class="fas fa-broadcast-tower" aria-hidden="true"></i> <span>Direct</span>
|
||||
|
||||
<div class="nav-divider"></div>
|
||||
|
||||
<a href="<?php echo $isHome ? '#youtube' : 'index.php#youtube'; ?>"
|
||||
class="nav-item"
|
||||
data-title="YouTube">
|
||||
<i class="fab fa-youtube icon-youtube" aria-hidden="true"></i> <span>YouTube</span>
|
||||
</a>
|
||||
<a href="<?php echo $isHome ? '#instagram' : 'index.php#instagram'; ?>"
|
||||
class="nav-item"
|
||||
data-title="Instagram">
|
||||
<i class="fab fa-instagram icon-instagram" aria-hidden="true"></i> <span>Instagram</span>
|
||||
</a>
|
||||
<a href="<?php echo $isHome ? '#tiktok' : 'index.php#tiktok'; ?>"
|
||||
class="nav-item"
|
||||
data-title="TikTok">
|
||||
<i class="fab fa-tiktok icon-tiktok" aria-hidden="true"></i> <span>TikTok</span>
|
||||
</a>
|
||||
<a href="<?php echo $isHome ? '#actualites' : 'index.php#actualites'; ?>"
|
||||
class="nav-item"
|
||||
data-title="Actualités">
|
||||
<i class="fas fa-newspaper" aria-hidden="true"></i> <span>Actualités</span>
|
||||
</a>
|
||||
|
||||
<?php if (defined('DONATIONS_ENABLED') && DONATIONS_ENABLED && !empty(PAYPAL_ME_URL)): ?>
|
||||
<a href="dons.php" class="nav-item donation-nav-link <?php echo ($currentPage === 'dons.php') ? 'active' : ''; ?>" data-title="Soutenir" aria-current="<?php echo ($currentPage === 'dons.php') ? 'page' : 'false'; ?>">
|
||||
<div class="nav-divider"></div>
|
||||
<a href="dons.php"
|
||||
class="nav-item donation-nav-link <?php echo ($currentPage === 'dons.php') ? 'active' : ''; ?>"
|
||||
data-title="Soutenir"
|
||||
aria-current="<?php echo ($currentPage === 'dons.php') ? 'page' : 'false'; ?>">
|
||||
<i class="fas fa-heart" aria-hidden="true"></i> <span>Soutenir</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="nav-divider"></div>
|
||||
|
||||
<?php
|
||||
// Afficher les catégories prioritaires
|
||||
if (defined('PRIORITY_CATEGORIES') && !empty(PRIORITY_CATEGORIES)) {
|
||||
// Tableau associatif des icônes pour les catégories
|
||||
$categoryIcons = [
|
||||
1 => 'fas fa-music', // Musique
|
||||
2 => 'fas fa-film', // Films
|
||||
3 => 'fas fa-car', // Véhicules
|
||||
4 => 'fas fa-palette', // Jeux
|
||||
5 => 'fas fa-running', // Sport
|
||||
6 => 'fas fa-laugh', // Humour
|
||||
7 => 'fas fa-gamepad', // Art
|
||||
8 => 'fas fa-person', // Personnalités
|
||||
9 => 'fas fa-face-grin-tears', // Comédie
|
||||
10 => 'fas fa-tv', // Divertissement
|
||||
11 => 'fas fa-globe', // Actualité & Politique
|
||||
12 => 'fas fa-chalkboard-user', // Tutoriel
|
||||
13 => 'fas fa-graduation-cap', // Education
|
||||
14 => 'fas fa-fist-raised', // Activisme
|
||||
15 => 'fas fa-microscope', // Science & Technologie
|
||||
16 => 'fas fa-paw', // Animaux
|
||||
17 => 'fas fa-child', // Enfants
|
||||
18 => 'fas fa-utensils' // Cuisine
|
||||
];
|
||||
|
||||
foreach (PRIORITY_CATEGORIES as $id => $name) {
|
||||
$isActive = ($currentPage === 'categories.php' && $currentCategoryId === $id);
|
||||
$icon = isset($categoryIcons[$id]) ? $categoryIcons[$id] : 'fas fa-folder';
|
||||
echo '<a href="categories.php?id=' . $id . '" class="nav-item ' . ($isActive ? 'active' : '') . '" data-title="' . htmlspecialchars($name) . '" aria-current="' . ($isActive ? 'page' : 'false') . '">';
|
||||
echo '<i class="' . $icon . '" aria-hidden="true"></i> <span>' . htmlspecialchars($name) . '</span>';
|
||||
echo '</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="nav-divider"></div>
|
||||
|
||||
<div class="category-title" role="heading" aria-level="2">
|
||||
<i class="fas fa-hashtag" aria-hidden="true"></i> <span>Hashtags</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (defined('IMPORTANT_TAGS') && !empty(IMPORTANT_TAGS)):
|
||||
foreach (IMPORTANT_TAGS as $tag):
|
||||
$encodedTag = urlencode('#' . $tag);
|
||||
$isActive = ($isTagSearch && strtolower($currentTag) === strtolower($tag));
|
||||
?>
|
||||
<a href="recherche.php?q=<?php echo $encodedTag; ?>" class="tag-item <?php echo $isActive ? 'active' : ''; ?>" data-title="<?php echo htmlspecialchars($tag); ?>" aria-current="<?php echo $isActive ? 'page' : 'false'; ?>">
|
||||
<i class="fas fa-hashtag tag-icon" aria-hidden="true"></i> <span><?php echo htmlspecialchars($tag); ?></span>
|
||||
</a>
|
||||
<?php
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user