basic project skeleton
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// Dans un vrai projet, ces données viendraient d'une API PeerTube
|
||||
// Pour cet exemple, on utilise des données statiques
|
||||
$categories = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'Technologie',
|
||||
'image' => 'img/categories/tech.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'Culture',
|
||||
'image' => 'img/categories/culture.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Éducation',
|
||||
'image' => 'img/categories/education.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'name' => 'Divertissement',
|
||||
'image' => 'img/categories/entertainment.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'name' => 'Cuisine',
|
||||
'image' => 'img/categories/cuisine.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'name' => 'Voyage',
|
||||
'image' => 'img/categories/travel.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'name' => 'Sport',
|
||||
'image' => 'img/categories/sport.jpg'
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'name' => 'Musique',
|
||||
'image' => 'img/categories/music.jpg'
|
||||
]
|
||||
];
|
||||
|
||||
// Affichage des catégories
|
||||
foreach ($categories as $category) :
|
||||
?>
|
||||
<a href="categories.php?id=<?php echo $category['id']; ?>" class="category-card">
|
||||
<img src="<?php echo $category['image']; ?>" alt="<?php echo $category['name']; ?>" data-src="<?php echo $category['image']; ?>">
|
||||
<div class="category-overlay">
|
||||
<div class="category-name"><?php echo $category['name']; ?></div>
|
||||
</div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration de Kaubuntu.re
|
||||
*
|
||||
* Ce fichier contient les paramètres de configuration pour connecter
|
||||
* la plateforme à une instance PeerTube et personnaliser le site.
|
||||
*/
|
||||
|
||||
// URL de base de votre instance PeerTube
|
||||
define('PEERTUBE_URL', 'https://gade.o-k-i.net');
|
||||
|
||||
// Paramètres d'API (si nécessaire)
|
||||
define('API_KEY', ''); // Laissez vide si pas nécessaire
|
||||
|
||||
// Pagination et affichage
|
||||
define('VIDEOS_PER_PAGE', 12);
|
||||
define('FEATURED_VIDEOS_COUNT', 3);
|
||||
define('RECENT_VIDEOS_COUNT', 6);
|
||||
|
||||
// Informations du site
|
||||
define('SITE_NAME', 'Kaubuntu.re');
|
||||
define('SITE_DESCRIPTION', 'Votre plateforme de médias libres');
|
||||
define('SITE_LOGO', 'img/logo.png');
|
||||
define('SITE_FAVICON', 'img/favicon.png');
|
||||
|
||||
// Réseaux sociaux
|
||||
define('FACEBOOK_URL', '#');
|
||||
define('TWITTER_URL', '#');
|
||||
define('INSTAGRAM_URL', '#');
|
||||
define('YOUTUBE_URL', '#');
|
||||
|
||||
// Contacts
|
||||
define('CONTACT_EMAIL', 'contact@kaubuntu.re');
|
||||
|
||||
// Fonctionnalités
|
||||
define('ENABLE_COMMENTS', true);
|
||||
define('ENABLE_SEARCH', true);
|
||||
define('ENABLE_USER_ACCOUNTS', false); // À implémenter dans une future version
|
||||
|
||||
// Cache
|
||||
define('CACHE_ENABLED', false);
|
||||
define('CACHE_DURATION', 3600); // En secondes (1 heure)
|
||||
|
||||
// Locale et fuseau horaire
|
||||
setlocale(LC_TIME, 'fr_FR.UTF-8');
|
||||
date_default_timezone_set('Indian/Reunion');
|
||||
|
||||
/**
|
||||
* Fonction utilitaire pour appeler l'API PeerTube
|
||||
*
|
||||
* @param string $endpoint Point de terminaison de l'API
|
||||
* @param array $params Paramètres optionnels pour la requête
|
||||
* @return array Données retournées par l'API
|
||||
*/
|
||||
function callPeerTubeApi($endpoint, $params = []) {
|
||||
$url = PEERTUBE_URL . '/api/v1/' . $endpoint;
|
||||
|
||||
// Ajouter les paramètres à l'URL
|
||||
if (!empty($params)) {
|
||||
$url .= '?' . http_build_query($params);
|
||||
}
|
||||
|
||||
// Initialiser cURL
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Ajouter la clé API si définie
|
||||
if (defined('API_KEY') && !empty(API_KEY)) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Authorization: ApiKey ' . API_KEY
|
||||
]);
|
||||
}
|
||||
|
||||
// Exécuter la requête
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
// Traiter la réponse
|
||||
if ($response === false) {
|
||||
// En cas d'erreur, retourner un tableau vide
|
||||
return [];
|
||||
}
|
||||
|
||||
// Décoder la réponse JSON
|
||||
$data = json_decode($response, true);
|
||||
|
||||
return $data ?: [];
|
||||
}
|
||||
|
||||
// Pour une version future: implémenter un système de mise en cache des requêtes API
|
||||
?>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
// Dans un vrai projet, ces données viendraient d'une API PeerTube
|
||||
// Pour cet exemple, on utilise des données statiques
|
||||
$featuredVideos = [
|
||||
[
|
||||
'id' => 1,
|
||||
'title' => 'Introduction à la culture libre et aux logiciels open source',
|
||||
'thumbnail' => 'img/video-thumbnails/featured-1.jpg',
|
||||
'duration' => 1245, // en secondes
|
||||
'channel' => 'Tech Libre',
|
||||
'views' => 15420,
|
||||
'date' => '2023-11-15'
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'title' => 'La Réunion: Découverte des sentiers cachés',
|
||||
'thumbnail' => 'img/video-thumbnails/featured-2.jpg',
|
||||
'duration' => 843,
|
||||
'channel' => 'Île Aventure',
|
||||
'views' => 8745,
|
||||
'date' => '2023-12-02'
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'title' => 'Comment installer Linux sur un ancien ordinateur',
|
||||
'thumbnail' => 'img/video-thumbnails/featured-3.jpg',
|
||||
'duration' => 723,
|
||||
'channel' => 'Tech Libre',
|
||||
'views' => 24680,
|
||||
'date' => '2023-10-25'
|
||||
]
|
||||
];
|
||||
|
||||
// Affichage des vidéos
|
||||
foreach ($featuredVideos as $video) :
|
||||
?>
|
||||
<div class="video-card" data-video-id="<?php echo $video['id']; ?>">
|
||||
<div class="video-thumbnail">
|
||||
<img src="<?php echo $video['thumbnail']; ?>" alt="<?php echo $video['title']; ?>" data-src="<?php echo $video['thumbnail']; ?>">
|
||||
<div class="video-duration"><?php echo formatDuration($video['duration']); ?></div>
|
||||
</div>
|
||||
<div class="video-info">
|
||||
<h3 class="video-title"><?php echo $video['title']; ?></h3>
|
||||
<div class="video-channel"><?php echo $video['channel']; ?></div>
|
||||
<div class="video-metadata">
|
||||
<span class="video-views"><?php echo formatViewCount($video['views']); ?> vues</span>
|
||||
<span class="video-date"><?php echo formatDate($video['date']); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php
|
||||
// Fonctions utilitaires (dans un vrai projet, ces fonctions seraient dans un fichier séparé)
|
||||
function formatDuration($seconds) {
|
||||
$hours = floor($seconds / 3600);
|
||||
$minutes = floor(($seconds % 3600) / 60);
|
||||
$remainingSeconds = $seconds % 60;
|
||||
|
||||
if ($hours > 0) {
|
||||
return sprintf('%d:%02d:%02d', $hours, $minutes, $remainingSeconds);
|
||||
} else {
|
||||
return sprintf('%d:%02d', $minutes, $remainingSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
function formatViewCount($views) {
|
||||
if ($views >= 1000000) {
|
||||
return round($views / 1000000, 1) . 'M';
|
||||
} elseif ($views >= 1000) {
|
||||
return round($views / 1000, 1) . 'K';
|
||||
} else {
|
||||
return $views;
|
||||
}
|
||||
}
|
||||
|
||||
function formatDate($dateString) {
|
||||
$date = new DateTime($dateString);
|
||||
$now = new DateTime();
|
||||
$interval = $now->diff($date);
|
||||
|
||||
if ($interval->days == 0) {
|
||||
return 'Aujourd\'hui';
|
||||
} elseif ($interval->days == 1) {
|
||||
return 'Hier';
|
||||
} elseif ($interval->days < 7) {
|
||||
return 'Il y a ' . $interval->days . ' jours';
|
||||
} elseif ($interval->days < 30) {
|
||||
$weeks = floor($interval->days / 7);
|
||||
return 'Il y a ' . $weeks . ' semaine' . ($weeks > 1 ? 's' : '');
|
||||
} elseif ($interval->days < 365) {
|
||||
$months = floor($interval->days / 30);
|
||||
return 'Il y a ' . $months . ' mois';
|
||||
} else {
|
||||
$years = floor($interval->days / 365);
|
||||
return 'Il y a ' . $years . ' an' . ($years > 1 ? 's' : '');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="footer-container">
|
||||
<div class="footer-column">
|
||||
<h3>À propos</h3>
|
||||
<ul>
|
||||
<li><a href="about.php">Qui sommes-nous</a></li>
|
||||
<li><a href="mission.php">Notre mission</a></li>
|
||||
<li><a href="team.php">L'équipe</a></li>
|
||||
<li><a href="partners.php">Partenaires</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-column">
|
||||
<h3>Catégories</h3>
|
||||
<ul>
|
||||
<li><a href="categories.php?id=1">Technologie</a></li>
|
||||
<li><a href="categories.php?id=2">Culture</a></li>
|
||||
<li><a href="categories.php?id=3">Éducation</a></li>
|
||||
<li><a href="categories.php?id=4">Divertissement</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-column">
|
||||
<h3>Aide</h3>
|
||||
<ul>
|
||||
<li><a href="faq.php">FAQ</a></li>
|
||||
<li><a href="contact.php">Contact</a></li>
|
||||
<li><a href="privacy.php">Politique de confidentialité</a></li>
|
||||
<li><a href="terms.php">Conditions d'utilisation</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-column">
|
||||
<h3>Suivez-nous</h3>
|
||||
<ul>
|
||||
<li><a href="#"><i class="fab fa-facebook"></i> Facebook</a></li>
|
||||
<li><a href="#"><i class="fab fa-twitter"></i> Twitter</a></li>
|
||||
<li><a href="#"><i class="fab fa-instagram"></i> Instagram</a></li>
|
||||
<li><a href="#"><i class="fab fa-youtube"></i> YouTube</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-bottom">
|
||||
<p>© <?php echo date('Y'); ?> Kaubuntu.re - Tous droits réservés</p>
|
||||
<p>Propulsé par <a href="https://joinpeertube.org/" target="_blank">PeerTube</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
@@ -0,0 +1,25 @@
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="header-container">
|
||||
<div class="logo">
|
||||
<a href="index.php">
|
||||
<img src="img/logo.png" alt="Kaubuntu.re">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<nav class="desktop-nav">
|
||||
<ul>
|
||||
<li><a href="index.php">Accueil</a></li>
|
||||
<li><a href="categories.php">Catégories</a></li>
|
||||
<li><a href="channels.php">Chaînes</a></li>
|
||||
<li><a href="about.php">À propos</a></li>
|
||||
<li><a href="contact.php">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<button class="mobile-menu-toggle">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -0,0 +1,42 @@
|
||||
<div class="mobile-menu">
|
||||
<div class="mobile-menu-header">
|
||||
<div class="logo">
|
||||
<a href="index.php">
|
||||
<img src="img/logo.png" alt="Kaubuntu.re">
|
||||
</a>
|
||||
</div>
|
||||
<button class="mobile-menu-close">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<nav class="mobile-menu-nav">
|
||||
<ul>
|
||||
<li><a href="index.php"><i class="fas fa-home"></i> Accueil</a></li>
|
||||
<li><a href="categories.php"><i class="fas fa-th-large"></i> Catégories</a></li>
|
||||
<li><a href="channels.php"><i class="fas fa-users"></i> Chaînes</a></li>
|
||||
<li><a href="about.php"><i class="fas fa-info-circle"></i> À propos</a></li>
|
||||
<li><a href="contact.php"><i class="fas fa-envelope"></i> Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="mobile-menu-section">
|
||||
<h3>Catégories populaires</h3>
|
||||
<ul>
|
||||
<li><a href="categories.php?id=1">Technologie</a></li>
|
||||
<li><a href="categories.php?id=2">Culture</a></li>
|
||||
<li><a href="categories.php?id=3">Éducation</a></li>
|
||||
<li><a href="categories.php?id=4">Divertissement</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mobile-menu-section">
|
||||
<h3>Suivez-nous</h3>
|
||||
<div class="social-icons">
|
||||
<a href="#"><i class="fab fa-facebook"></i></a>
|
||||
<a href="#"><i class="fab fa-twitter"></i></a>
|
||||
<a href="#"><i class="fab fa-instagram"></i></a>
|
||||
<a href="#"><i class="fab fa-youtube"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// Dans un vrai projet, ces données viendraient d'une API PeerTube
|
||||
// Pour cet exemple, on utilise des données statiques
|
||||
$recentVideos = [
|
||||
[
|
||||
'id' => 4,
|
||||
'title' => 'Festival Sakifo 2023 - Les meilleurs moments',
|
||||
'thumbnail' => 'img/video-thumbnails/recent-1.jpg',
|
||||
'duration' => 1832, // en secondes
|
||||
'channel' => 'Culture 974',
|
||||
'views' => 3420,
|
||||
'date' => '2023-12-15'
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'title' => 'Cuisine créole: Recette du rougail saucisse traditionnel',
|
||||
'thumbnail' => 'img/video-thumbnails/recent-2.jpg',
|
||||
'duration' => 685,
|
||||
'channel' => 'Saveurs des Îles',
|
||||
'views' => 7245,
|
||||
'date' => '2023-12-10'
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'title' => 'Tutoriel: Créer votre première application web avec PHP',
|
||||
'thumbnail' => 'img/video-thumbnails/recent-3.jpg',
|
||||
'duration' => 1540,
|
||||
'channel' => 'CodeMastery',
|
||||
'views' => 2180,
|
||||
'date' => '2023-12-08'
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'title' => 'Les plus belles plages de La Réunion en 2023',
|
||||
'thumbnail' => 'img/video-thumbnails/recent-4.jpg',
|
||||
'duration' => 925,
|
||||
'channel' => 'Île Aventure',
|
||||
'views' => 5690,
|
||||
'date' => '2023-12-05'
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'title' => 'Débat: L\'avenir du numérique à La Réunion',
|
||||
'thumbnail' => 'img/video-thumbnails/recent-5.jpg',
|
||||
'duration' => 3245,
|
||||
'channel' => 'Tech Libre',
|
||||
'views' => 1250,
|
||||
'date' => '2023-12-01'
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'title' => 'Concert live: Groupe Sakili au Téat Plein Air',
|
||||
'thumbnail' => 'img/video-thumbnails/recent-6.jpg',
|
||||
'duration' => 4512,
|
||||
'channel' => 'Culture 974',
|
||||
'views' => 4325,
|
||||
'date' => '2023-11-28'
|
||||
]
|
||||
];
|
||||
|
||||
// Affichage des vidéos
|
||||
foreach ($recentVideos as $video) :
|
||||
?>
|
||||
<div class="video-card" data-video-id="<?php echo $video['id']; ?>">
|
||||
<div class="video-thumbnail">
|
||||
<img src="<?php echo $video['thumbnail']; ?>" alt="<?php echo $video['title']; ?>" data-src="<?php echo $video['thumbnail']; ?>">
|
||||
<div class="video-duration"><?php echo formatDuration($video['duration']); ?></div>
|
||||
</div>
|
||||
<div class="video-info">
|
||||
<h3 class="video-title"><?php echo $video['title']; ?></h3>
|
||||
<div class="video-channel"><?php echo $video['channel']; ?></div>
|
||||
<div class="video-metadata">
|
||||
<span class="video-views"><?php echo formatViewCount($video['views']); ?> vues</span>
|
||||
<span class="video-date"><?php echo formatDate($video['date']); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
Reference in New Issue
Block a user