add the total number of views. Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    add the total number of views.

    كونان2000
    كونان2000
    Forumember


    Male Posts : 205
    Reputation : 93
    Language : Arabic

    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

    TonnyKamper, jucarese and poesia-verses like this post

    poesia-verses
    poesia-verses
    Forumember


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

    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?

    كونان2000 likes this post

    كونان2000
    كونان2000
    Forumember


    Male Posts : 205
    Reputation : 93
    Language : Arabic

    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