The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

add the total number of views.

2 posters

Go down

add the total number of views. Empty add the total number of views.

Post by كونان2000 March 8th 2024, 3:24 am

Hello everyone,
This tutorial will help you add the total number of views.


add the total number of views. Ocia_a14
-------------------------------------------------------------------------------


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>
2 Save and publish add the total number of views. 644535217
------------------------------------


I hope you like it   Very Happy  


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
add the total number of views. Ocia_a10
______________________________________________________________


This tutorial was written by: كونان2000
Using artificial intelligence
كونان2000
كونان2000
Forumember

Male Posts : 204
Reputation : 93
Language : Arabic

https://anime.forumperso.com/

TonnyKamper, jucarese and poesia-verses like this post

Back to top Go down

add the total number of views. Empty Re: add the total number of views.

Post by poesia-verses March 8th 2024, 4:11 am

huge script!!!! my gratitude, cyclops rabbit flower
is it possible to exclude views of General Announcements?
poesia-verses
poesia-verses
Forumember

Male Posts : 527
Reputation : 20
Language : and small english

https://stihi-podval.forumotion.com/

كونان2000 likes this post

Back to top Go down

add the total number of views. Empty Re: add the total number of views.

Post by كونان2000 March 8th 2024, 6:39 am

poesia-verses wrote:huge script!!!! my gratitude, cyclops rabbit flower
is it possible to exclude views of General Announcements?
Thanks poesia-verses
I'm glad you like it Very Happy

The answer to your question
here https://help.forumotion.com/t163173-sum-of-section-topic-views-in-the-section-header#1146704
كونان2000
كونان2000
Forumember

Male Posts : 204
Reputation : 93
Language : Arabic

https://anime.forumperso.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum