by Ange Tuteur September 24th 2015, 11:24 am
Hi smejker,
Do you use forum widgets ? If so, you can create a widget with the following content :
- Code:
<div style="display:none" id="getTopicCount">{FORUMCOUNTOPIC}</div>
( Make sure to tick "No" for table type ) then save and drag the widget onto your forum.
After this, you can get the topic count via JS :
- Code:
$(function() {
var sujets = document.getElementById('getTopicCount');
if (sujets) sujets.innerHTML; // topic count
});
To apply it, you just need to add an element in your template with an id, such as this :
- Code:
<span id="statsTopics">0</span>
Then we just modify the script to add the value to this element :
- Code:
$(function() {
var sujets = document.getElementById('getTopicCount'), target = document.getElementById('statsTopics');
if (sujets && target) target.innerHTML = sujets.innerHTML; // apply topic count
});