9 Nov 2010

Tutorial Widget Kali Terakhir Pembaca Ke Belog Pada....


Assalamualaikum.


I dapat request daripada DAK IENA untuk buat tutorial benda alah ni. I tak tahu nak bagi nama dia apa. HAHAHA. Tapi yang pasti benda bawah ni yang i dah bontalkan. OPS! HAHA



Nampak tak ? Agak2 u tahu tak apa nama mahkluk pelikk tu ? Sumpah i tak tahu T__T



Tak senang nak dapat buat widget ni. Dahlah susah nak carik tuto dia. Banyak tak jadik. I kena pulak try banyak kali tukar2 coding baru siapp kot. HAIHH. Susah T____T Jadi, hari ni i nak senangkan u. Dapat kod tukar sikit pastu siap. Amacam, ada hokeyy ? :D


* * *

1 ) Layout -> Page Elements -> Add Gadget -> HTML/JavaScript


2 ) Copy paste code kat bawah :


<center><script type = "text/javascript">
//
var days = 730; // days until cookie expires = 2 years.
var lastvisit=new Object();
var firstvisitmsg="Terima Kasih Kerana Sudi Berkunjung Ke Laman Ini. Welcome!";
lastvisit.subsequentvisitmsg="Olala! Kali Terakhir U singgah di belog comot ini 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 yang kaler pink dalam coding atas tu, u boleh tukar guna ayat u sendiri. Jangan usik apa2 selain yang pink tu ok.



4 ) Save dan tengok hasil dia ! :)


Gudluck guys ! Sape yang dah jadikk buat tu habak mai okey :D Dan siapa nak tutorial lagi haaa isi borang formspring kat sidebar tu. Sekian :)

15 comments:

  1. thanks for sharing :)
    nak cuba buat jugak. hehe

    ReplyDelete
  2. wah~~ menarik untuk diaplikasi

    ReplyDelete
  3. yay!! tq dear sbb buat tuto nih...suka3

    ReplyDelete
  4. @Miza Yusof try laa buat :) hehe. gudluck ! :D

    ReplyDelete
  5. @dak eina welcome eina :) gudluck buat ! :D

    ReplyDelete
  6. @Nadia Yusoff nadia. try amek kod baru i dah uba :D btw, make sure u tak sentuh pape code selen yang kaler pink tu. sebab dia sangat sensitif. salah sikit memang takleh guna. try banyak kali sure boleh :)

    ReplyDelete
  7. @Nadia Yusoff sure welcome dear :) thanks god u dah boleh buat huhu

    ReplyDelete
  8. @Ct Arina hihi. its ok dear :) try buat pelan2 mesti boleh :)

    ReplyDelete

Sebijik komen dari anda memberikan satu kepuasan impak maksima yang sangat superb. Terima kasih :)



We're specialized in Potrait & Wedding Photography!
If you're searching for a reasonable price and good quality of photographer,
you are right by choosing us! Quality is our priority :)
Click at the image below for direct to Faridisim Photography Facebook