add the total number of views.
2 posters
Page 1 of 1
add the total number of views.
Hello everyone,
This tutorial will help you add the total number of views.
-------------------------------------------------------------------------------
This tutorial will help you add the total number of views.
-------------------------------------------------------------------------------
This modification is applicable to any forum version, so long as your templates are not heavily modified.
1 Go to Administration Panel > Display > Templates > General
Topics_list_box template
Add this to the Beginning of the template :
- Code:
<script>
$(document).ready(function(){
var total = 0;
$('.posts-statistics-views,dd.views,#main-content td:nth-child(6),td.tc3,#emptyidcc td:nth-child(6)').each(function(){
var value = parseInt($(this).text());
if (!isNaN(value)) {
total += value;
}
$('#total').text(total);
});
});
</script>
<style>
.Total-views {
display: block;
font-size: 17px;
border: solid #5c52529e 1px;
padding: 5px;
font-weight: 800;
background: #fdfdfd;
margin: 5px;
text-align: center;
}
</style>
<div class="Total-views">The total number of views of the topics below: <span id="total"></span></div>
------------------------------------
I hope you like it
Note..
The total number of views for all section topics is not displayed.
When visiting the first page, the total views of topics on the first page are calculated only
When you visit the second page, it calculates the total views of topics on the second page only
______________________________________________________________
Last edited by كونان2000 on September 17th 2024, 5:36 am; edited 2 times in total
TonnyKamper, Jucarese and poesia-verses like this post
Re: add the total number of views.
huge script!!!! my gratitude,
is it possible to exclude views of General Announcements?
is it possible to exclude views of General Announcements?
كونان2000 likes this post
Re: add the total number of views.
Thanks poesia-versespoesia-verses wrote:huge script!!!! my gratitude,
is it possible to exclude views of General Announcements?
I'm glad you like it
The answer to your question
here https://help.forumotion.com/t163173-sum-of-section-topic-views-in-the-section-header#1146704
Similar topics
» Add a number to the number of awards earned
» Topics views do not show the real number
» Number of total posts not decreased on post deletion
» New: Sort the list of topics by number of views, messages, by author, …
» The number of topics does not match the number of articles
» Topics views do not show the real number
» Number of total posts not decreased on post deletion
» New: Sort the list of topics by number of views, messages, by author, …
» The number of topics does not match the number of articles
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum