BLOGCU ADMİN

İNDİRME LİNK'İNE SAYAÇ EKLEME

DİKKAT SİTE OTOMATİK DİLİ ÇEVİRMEYİ KAPATIN YOKSA KODLAR BOZULUR KODLAR İNGİLİZCEDİR 

The steps below are for blogspot blogs. Wordpress users may simply note down the method and apply accordingly on their WP powered blogs.


1-Go To Blogger > Template

2-Backup your template

3-Click Edit HTML

4-Search for </b:skin> Click the black arrow to expand the code.

compressed blogger stylesheet

5.  Paste the following Styles just above 

/*----- download counter by MBT-----*/


.mbtloading {

background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHHYkd_OUt2PdAsKRVoAXdwZzn1_uD9adlxAgcQ6nv0Cj96_7rXYabsfiM_XhW7Q-odBUlqPtlnwqr-ljQvwhyphenhyphen-PEC-yupuTEjvLpt3nEFMkfqnqAgl4mDZ4lhrCzLF5hYf0JG7Od-Pc4e/s320/mbtloading.gif') no-repeat left center;

width: 16px;

height: 16px;

}


.blog-stats {

color: #289728;

font: bold italic 18px georgia, arial;

float: right;

}


6. Now search  and just above it paste the following script:


<!--Download Counter by MBT starts-->



<script type="text/javascript">

    window.setTimeout(function() {

        document.body.className = document.body.className.replace(&#39;loading&#39;, &#39;&#39;);

      }, 10);

  </script>

<script src="https://cdn.firebase.com/v0/firebase.js" type="text/javascript">

<script>

$.each($(&#39;[data-download-count=true]&#39;), function (i, e) {

    var elem = $(e).parent().find(&#39;#download-count&#39;).addClass(&#39;mbtloading&#39;);

    var id = $(e).closest(&#39;.post-body&#39;).siblings(&#39;a[name]&#39;).attr(&#39;name&#39;) + &quot;-&quot; + $(e).attr(&#39;id&#39;);

                          var downloadStats = new Firebase(&quot;https://mbtblogstats.firebaseio.com/downloads/id/&quot; + id);

    var data = {}, isnew = false;

    downloadStats.once(&#39;value&#39;, function (snapshot) {

        data = snapshot.val();

        if (data == null) {

            data = {};

            data.value = 0;

            data.url = window.location.href;

            data.id = id;

            isnew = true;

        }

        elem.removeClass(&#39;mbtloading&#39;).text(data.value);

    });

    $(e).click(function (e) {

        data.value++;

        if (isnew) downloadStats.set(data);

        else downloadStats.child(&#39;value&#39;).set(data.value);

    });

});

</script>


<!--Download Counter by MBT Ends-->


Replace mbtblogstats with your Firebase name that you created in step#2.


 7.  * Now search for <head>   and paste the following JQuery library just below <head>


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>

       

       

 8.   Save your blog and you are all done with coding!


Displaying Download stats in Posts

Now whenever you wish to display download stats for a particular file. Simple link to your file using the code below:


<div style="width: 120px;">

<a data-download-count="true" href="#">Download Now!</a>

<div class="blog-stats" id="download-count">

</div>

</div>

<br />

ÖRNEK:<br />

<div style="width: 100px;">

<a class="button button-red" data-download-count="true" href="https://blogcuadmin.blogspot.com/2017/05/blogda-indirme-linkine-sayac-ekleme.html"><b>BUTON BAŞLIK ADI</b></a>Sayfa Tıklama Sayısı:

<div class="blog-stats" id="download-count">

</div>

</div>

İSTEYENLER ORJİNAL İNGLİZCE SİTESİNE BAKABİLİRLER BURDAN

Hiç yorum yok :

Yorum Gönder