Home » Featured, Web, Web Design

BloggerStat: contatore per Blogger

13 dicembre 2009 | Autore: Giuseppe T.

Fig. BloggerStat

BloggerStat è un semplice gadget per Blogger che ho realizzato, mostra il numero totale dei post e dei commenti presenti nel proprio blog. Nella sidebar di WebLogin è possibile vedere un esempio.

N.B. BloggerStat è distribuito sotto Licenza Creative Commons.

L’installazione è molto semplice, si tratta di un “gadget di tipo HTML/JavaScript“.

Installazione

  1. Caricare sul proprio spazio web (consiglio Photobucket) una delle due immagini presenti in BloggerStat.zip.
  2. Accedere a Layout->Elementi pagina e premere su “Aggiungi un gadget”.
  3. Scegliere il gadget di tipo “HTML/JavaScript”.
  4. Assegnare nella textbox “Titolo” un nome al gadget (Titolo può anche essere lasciato vuoto).
  5. Copiare e incollare il seguente codice nella textbox “Sezioni del sito”:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    
    <!-- BloggerStat: Begin -->
    <!-- Created by wiBlog (http://wiblog.it) --> 
    <style>
    .bloggerstat {
    width: 110px;
    height: 50px;
    padding-top: 4px;
    background: url(http://www.nome_sito.it/background_1.png) no-repeat;
    font-family: arial, sans-serif;
    font-size: 10px;
    line-height: 10px;
    font-weight: normal;
    text-decoration: none;
    text-align: center;
    color: #FFF;
    }
     
    .count_bloggerstat {
    height: 30px;
    margin-bottom: 3px;
    padding: 0px 1px 0px 1px;
    }
     
    .count_bloggerstat td {
    padding: 0px;
    background: none;
    border: none;
    font-family: arial, sans-serif;
    line-height: 10px;
    text-decoration: none;
    color: #FFF;
    }
     
    .type_bloggerstat {
    width: 48px;
    font-size: 11px;
    font-weight: bold;
    text-align: left;
    }
     
    .num_bloggerstat {
    width: 54px;
    font-size: 10px;
    font-weight: normal;
    text-align: right;
    }
    </style>
     
    <script style="text/javascript">
    function numberOfPosts(json) {
    document.write('<b>' + json.feed.openSearch$totalResults.$t + '</b>');
    }
     
    function numberOfComments(json) {
    document.write('<b>' + json.feed.openSearch$totalResults.$t + '</b>');
    }
    </script>
     
    <div class="bloggerstat">
    <table class="count_bloggerstat">
    <tr>
    <td class="type_bloggerstat">Post</td>
    <td class="num_bloggerstat"><script src="http://nome_blog.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></td>
    </tr>
    <tr>
    <td class="type_bloggerstat">Commenti</td>
    <td class="num_bloggerstat"><script src="http://nome_blog.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></td>
    </tr>
    </table>
    <a href="http://www.wiblog.it/2009/12/bloggerstat-contatore-per-blogger" style="text-decoration:none; color:#FFF;">By wiBlog.it</a>
    </div>
    <!-- BloggerStat: End -->
  6. Sostituire l’URL presente nella riga 8 del codice con quello dell’immagine caricata (punto 1 della procedura).
  7. Sostituire gli URL presenti nelle righe 63 e 67 del codice con quello del proprio blog.
  8. Salvare le modifiche premendo il bottone “Salva”.

, , , ,

blog comments powered by Disqus