Tutorial : Stats

Post by Adilla Shahirah | 4:11 am | 7 Nutella |
Assalammualaikum. Eyra just has a request from someone. so now i want share to you all. but some of you know the tutorial :) *Bad English*

Preview :

Template/Denim : Paste dekat HTML/javascript
Blogskin : paste dekat bawah </style>

<style>
.statioo{font-family:tinytots;
font-size:8px;
text-align:center;
background:#FFE0C2;
-webkit-transition:All 0.4s ease;
-moz-transition:All 0.4s ease;
-o-transition:All 0.4s ease;
color:#000;
margin:1px;
width:200px;
border-right:20px solid pink;
padding:5px 5px 5px 20px;
box-shadow: inset 20px 0 0px 0  pink;
line-height:11px;text-decoration:none;
}
@font-face {
font-family: "tinytots";
src: url('http://static.tumblr.com/rmj06l2/Usellxb4i/tinytots.ttf');}
.statioo:hover{
box-shadow: inset 450px 0 0px 0 pink;
-webkit-transition:All 0.4s ease;
-moz-transition:All 0.4s ease;
-o-transition:All 0.4s ease;}
</style>
<center>
<div class="statioo">
<script src="http://fastwebcounter.com/secure.php?s=blogurl">hits</script> hits
</div>
<div class="statioo">
<script src="http://st2.freeonlineusers.com/on3.php?id=idanda" type="text/javascript"> </script> online user</div>
<div class="statioo">
<div class="widget">
<div class="textwidget">
<script>
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
</script>
<script>
document.write("you have been here <b>" + amt() + "</b> times. ")
</script>
</div>
</div>
</div>
<div class="statioo">
<script type="text/javascript">
var days = 730; // days until cookie expires = 2 years.
var lastvisit=new Object();
var firstvisitmsg="This is your first time been here.";
lastvisit.subsequentvisitmsg="Last visits <b>[displaydate]</b>";
lastvisit.getCookie=function(Name){
var re=new RegExp(Name+"=[^;]+", "i");
if (document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1];
return'';
}
lastvisit.setCookie=function(name, value, days){
var expireDate = new Date();
var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days));
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}
lastvisit.showmessage = function() {
var wh = new Date();
if (lastvisit.getCookie("visitc") == "") {
lastvisit.setCookie("visitc", wh, days);
document.write(firstvisitmsg);
}
else {
var lv = lastvisit.getCookie("visitc");
var lvp = Date.parse(lv);
var now = new Date();
now.setTime(lvp);
var day = new Array("Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat");
var month = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
var dd = now.getDate();
var dy = now.getDay();
dy = day[dy];
var mn = now.getMonth();
mn = month[mn];
yy = now.getFullYear();
var hh = now.getHours();
var ampm = "AM";
if (hh >= 12) {ampm = "PM"}
if (hh >12){hh = hh - 12};
if (hh == 0) {hh = 12}
if (hh < 10) {hh = "0" + hh};
var mins = now.getMinutes();
if (mins < 10) {mins = "0"+ mins}
var secs = now.getSeconds();
if (secs < 10) {secs = "0" + secs}
var dispDate = dy + ", " + mn + " " + dd + ", " + yy + " " + hh + ":" + mins + ":" + secs + " " + ampm
document.write(lastvisit.subsequentvisitmsg.replace("\[displaydate\]", dispDate))
}
lastvisit.setCookie("visitc", wh, days);
}
lastvisit.showmessage();

</script></div>
</center>

Credit : Afiqah


Terima kasih baca entry ni. Jangan lupa datang lagi ke sini!

7 comments:

fatin amalina husna said...

rajin bertutorial..=)

singgah sini main dgn cursor..=D

Afiqah Junizan said...

please don't re-post my code! please delete this post !

nashya (นิชคุณ) said...

thanks for the tutorials :) I've used all of your superb tutorials :) Thanks <3 Love it !