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
______________________________________________________________
This tutorial was written by: كونان2000
Using artificial intelligence