Method code to realize the statistical effect of running days of Z-Blog blog

Channel: Technical Tutorial Date: Browse: 276

By default, the z-blog system carries statistics on the total number of articles, comments, references, browses, and messages, but there is no statistics on the running days of z-blog blogs since they were installed to the present day. Therefore, to implement the statistics on the running days of z-blog, you need to manually add code. The implementation method is also very simple, just add a few javascript statements. Here are the steps of adding javascript introduced by Blogbar.

Statistics of active running days of z-blog blog:

Add the following js code before the default.html, catalog.html, search.html, tags.html, and single.html files</head>:

 <script language=JavaScript>   var urodz= new Date("5/30/2011");    var now = new Date();    var ile = now.getTime() - urodz.getTime();    var dni = Math.floor(ile / (1000 * 60 * 60 * 24));    document.write(+dni)  </script>

Modify the time when the blog was created on May 30/2011

Then add the following calling code where you want to display the running days

 <script language="JavaScript">document.write(+dni)</script>

Save the file.