Click the pencil icon in the bottom right to start a new topic
Send
Write a reply...
document.addEventListener('DOMContentLoaded', function() { // Function to create stats container if it doesn't exist function ensureStatsContainer() { if (!document.querySelector('.nav-stats')) { const headerControls = document.querySelector('.header-controls'); if (headerControls) { const navStats = document.createElement('div'); navStats.className = 'nav-stats'; navStats.innerHTML = `
0
0
0
`; headerControls.insertBefore(navStats, headerControls.firstChild); return true; } return false; } return true; } // Function to update statistics function updateStats() { // Make sure stats container exists if (!ensureStatsContainer()) return; const stats = document.querySelector('.ForumStatistics'); if (stats) { const items = stats.querySelectorAll('#ForumStatisticsList li'); if (items.length >= 4) { document.getElementById('navDiscussions').textContent = items[0].textContent.replace('Discussions:', '').trim(); document.getElementById('navPosts').textContent = items[1].textContent.replace('Posts:', '').trim(); document.getElementById('navMembers').textContent = items[2].textContent.replace('Members:', '').trim(); } } } // Run immediately and check until stats are loaded updateStats(); const statsCheck = setInterval(function() { if (document.getElementById('navDiscussions').textContent === '0') { updateStats(); } else { clearInterval(statsCheck); } }, 500); // Handle SPA navigation if your forum uses it if (typeof m !== 'undefined' && m.route) { const originalRoute = m.route; m.route = function() { originalRoute.apply(this, arguments); setTimeout(updateStats, 100); // Small delay to allow DOM update }; } });

Powered by: FreeFlarum.
(remove this footer)