add mastodon configuration

This commit is contained in:
2025-04-08 17:14:34 +04:00
parent 6785e85a9a
commit 15374ab5b0
5 changed files with 50 additions and 11 deletions
+22
View File
@@ -142,3 +142,25 @@ define('PRIORITY_CATEGORIES', [
// Durée du cache en secondes // Durée du cache en secondes
// define('CACHE_DURATION', 3600); // 1 heure // define('CACHE_DURATION', 3600); // 1 heure
// =========================================
// Configuration Mastodon
// =========================================
// URL de l'instance Mastodon
// define('MASTODON_INSTANCE_URL', 'https://mastodon.social');
// Format de date pour l'affichage des posts
// define('MASTODON_DATE_FORMAT', 'fr-FR');
// Texte du bouton "Voir plus"
// define('MASTODON_BTN_SEE_MORE', 'Voir plus de post');
// Texte du bouton "Rafraichir"
// define('MASTODON_BTN_RELOAD', 'Rafraichir');
// Nombre maximum de posts à récupérer
// define('MASTODON_MAX_POST_FETCH', '10');
// Nombre maximum de posts à afficher
// define('MASTODON_MAX_POST_SHOW', '10');
+10
View File
@@ -38,6 +38,16 @@ if (!defined('PRIORITY_CATEGORIES')) {
]); ]);
} }
// =========================================
// Configuration Mastodon
// =========================================
if (!defined('MASTODON_INSTANCE_URL')) define('MASTODON_INSTANCE_URL', 'https://mamot.fr');
if (!defined('MASTODON_DATE_FORMAT')) define('MASTODON_DATE_FORMAT', 'fr-FR');
if (!defined('MASTODON_BTN_SEE_MORE')) define('MASTODON_BTN_SEE_MORE', 'Voir plus de post');
if (!defined('MASTODON_BTN_RELOAD')) define('MASTODON_BTN_RELOAD', 'Rafraichir');
if (!defined('MASTODON_MAX_POST_FETCH')) define('MASTODON_MAX_POST_FETCH', '10');
if (!defined('MASTODON_MAX_POST_SHOW')) define('MASTODON_MAX_POST_SHOW', '10');
// Informations du site // Informations du site
if (!defined('SITE_NAME')) define('SITE_NAME', 'Kaubuntu.re'); if (!defined('SITE_NAME')) define('SITE_NAME', 'Kaubuntu.re');
if (!defined('SITE_DESCRIPTION')) define('SITE_DESCRIPTION', 'Votre plateforme de médias libres'); if (!defined('SITE_DESCRIPTION')) define('SITE_DESCRIPTION', 'Votre plateforme de médias libres');
+1 -1
View File
@@ -395,6 +395,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="js/main.js"></script> <script src="js/main.js"></script>
<script src="js/mastodon-timeline.umd.js"></script> <script src="js/mastodon-timeline.umd.js"></script>
<script src="js/mastodon-config.js"></script> <script src="js/mastodon-config.php"></script>
</body> </body>
</html> </html>
-10
View File
@@ -1,10 +0,0 @@
window.addEventListener("load", () => {
const myTimeline = new MastodonTimeline.Init({
instanceUrl: 'https://mamot.fr',
dateFormatLocale: 'fr-FR',
btnSeeMore: "Voir plus de post",
btnReload: "Rafraichir",
maxNbPostFetch: '10',
maxNbPostShow: '10'
});
});
+17
View File
@@ -0,0 +1,17 @@
<?php
// Inclure la configuration
require_once '../includes/config.php';
// Définir le type de contenu en JavaScript
header('Content-Type: application/javascript');
?>
window.addEventListener("load", () => {
const mastodonTimeline = new MastodonTimeline.Init({
instanceUrl: '<?php echo MASTODON_INSTANCE_URL; ?>',
dateFormatLocale: '<?php echo MASTODON_DATE_FORMAT; ?>',
btnSeeMore: "<?php echo MASTODON_BTN_SEE_MORE; ?>",
btnReload: "<?php echo MASTODON_BTN_RELOAD; ?>",
maxNbPostFetch: '<?php echo MASTODON_MAX_POST_FETCH; ?>',
maxNbPostShow: '<?php echo MASTODON_MAX_POST_SHOW; ?>'
});
});