Tuesday, February 15, 2011

Tutorial Buat Welcome Code

Baik tak baik takkkkkk! Tengah - tengahari buat tutorial. Cuaca tengah panas macam ni boleh lagi I dengan semangat berkasih - sayang sesama insan buat tutorial untuk pembaca blog yang dikasihi. Ewah ayat menyampah betul nak baca. Dah - dah. Straight to the point! Ecehcehhhh speaking! =.="

Nak tak ada code di blog macam kat bawah ni?
Comel kan? Yang "Korang last sekodeng sini adalah pada.."

Haaa hari ni I nak ajar buat code begitu. Mari semua sebelum mulakan apa - apa mari baca Bismillah dulu. Tadah tangannnnn! Baca!
Okeh. Mari kita mulakan.

1 . Design --> Page Elements --> Add A Gadget > HTML

2. Copy code di bawah ni then pastekan okeh!

<center><script type = "text/javascript">
//
var days = 730; // days until cookie expires = 2 years.
var lastvisit=new Object();
var firstvisitmsg="hohoi , terima kasihlah datang sini !";
lastvisit.subsequentvisitmsg="korang last sekodeng sini adalah pada <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>
</center>
3. Tulisan warna merah tu gantikan dengan ayat yang korang suka eh. Jangan tulis yang lucah - lucah or mencarut dahlah eh.
4. Preview dulu. Kalau berjaya bolehlah save lepas tu lompat bintang! Hohoi!

Meh peluk I sambil kata "Baiknyaaaaa Kakak Bunga!"

Tutorial original di sini.

Dah. Babai!

5 comments:

FR said...

pelukkk puluk dgn kaka bungaaa :D
thanks share ^^

Cik Puan Bunga said...

@fathiahRAIHANAhaha sama - sama. kongsi adalah ambil berat. haha

Azreen Farhani binti Azman said...

best ney . nak try la :)

Cik Puan Bunga said...

@miss ANGINCubalah. anda pasti teruja auwww! :)

Cik Nursya said...

thanks kak Bunga.. Nursya tiruk nih tau...