Welcome here! Please leave your comment and follow my blog. Use CTRL+C to copy (no right click allowed)
This blog is full of tutorials. Please use them, by clicking the "STUFF" page above^^ Thanks for your visit!!
I'm Gifta, I can't online everyday /^-^\/>

Thank you for your visit, please use my tutorials...!
August 05, 2016

Sunday, February 22, 2015

Tutorial Menambahkan 'Terakhir kali kamu mengunjungi blogku:'

Hai... Gifta sudah post banyak segmen, sekarang Gifta nak post tutorial! CEKIDOT
Kalian tau maksudnya? lihat gambar di bawah ya

Itu kalau baru pertama kali datang ke blogmu. Kalau sudah kedua / lebih, beda lagi
Oke, kalau sudah tau, sekarang follow stepnya!

1. Blogger >>> Layout >>> Add a Gadget >>> HTML/JavaScript
2. Then, copy this code:
<center>
<div style="background: url('URL Background') repeat;
padding: 5px;">
<script type = "text/javascript">
//
var days = 730; // days until cookie expires = 2 years.
var lastvisit=new Object();
var firstvisitmsg="Bla bla bla";
lastvisit.subsequentvisitmsg="Bli blu bli<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>
Panjang ya? Iya emang! Hahahaha...! Aku pertamanya juga bingung.

3. Paste kode tadi di kolom kode HTML/JavaScript
4. Preview! Kalau sudah berhasil, save!

Note:
Merah: ganti dengan Background widget kamu. Males cari di google. Ke sini aja
Biru: untuk pertama kalinya visit
Hijau: ganti dengan "Pertama kalinya kamu mengunjungi blogku:" atau "Terima kasih sudah visit lagi. Terakhir kali kamu visit:" pokoknya terserah. Be creative!


No comments

Post a Comment