i am a cute bear
biography stuffies chingu(s) home entry

  


Older Post >> | << Newer Post
TUTORIAL ALERT LAST VISIT
TUTORIAL ALERT LAST VISIT


1.Dashboard > Design > Add Gadget > HTML javascript
2.korg copy code kat bawah ni di ruangan HTML tuh

&lt;script type = &quot;text/javascript&quot;&gt;//var days = 730; // days until cookie expires = 2 years.var lastvisit=new Object();var firstvisitmsg=&quot;Welcome to my blog dear!&quot;;lastvisit.subsequentvisitmsg=&quot;Welcome back dear&lt;b&gt;[displaydate]&lt;/b&gt;&quot;;lastvisit.getCookie=function(Name){var re=new RegExp(Name+&quot;=[^;]+&quot;, &quot;i&quot;);if (document.cookie.match(re))return document.cookie.match(re)[0].split(&quot;=&quot;)[1];return'';}lastvisit.setCookie=function(name, value, days){var expireDate = new Date();var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days));document.cookie = name+&quot;=&quot;+value+&quot;; expires=&quot;+expireDate.toGMTString()+&quot;; path=/&quot;;}lastvisit.showmessage = function() {var wh = new Date();if (lastvisit.getCookie(&quot;visitc&quot;) == &quot;&quot;) {lastvisit.setCookie(&quot;visitc&quot;, wh, days);document.write(firstvisitmsg);}else {var lv = lastvisit.getCookie(&quot;visitc&quot;);var lvp = Date.parse(lv);var now = new Date();now.setTime(lvp);var day = new Array(&quot;Sun&quot;, &quot;Mon&quot;, &quot;Tues&quot;, &quot;Wed&quot;, &quot;Thur&quot;, &quot;Fri&quot;, &quot;Sat&quot;);var month = new Array (&quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;, &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;);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 = &quot;AM&quot;;if (hh &gt;= 12) {ampm = &quot;PM&quot;}if (hh &gt;12){hh = hh - 12};if (hh == 0) {hh = 12}if (hh &lt; 10) {hh = &quot;0&quot; + hh};var mins = now.getMinutes();if (mins &lt; 10) {mins = &quot;0&quot;+ mins}var secs = now.getSeconds();if (secs &lt; 10) {secs = &quot;0&quot; + secs}var dispDate = dy + &quot;, &quot; + mn + &quot; &quot; + dd + &quot;, &quot; + yy + &quot; &quot; + hh + &quot;:&quot; + mins + &quot;:&quot; + secs + &quot; &quot; + ampmdocument.write(lastvisit.subsequentvisitmsg.replace(&quot;\[displaydate\]&quot;, dispDate))}lastvisit.setCookie(&quot;visitc&quot;, wh, days);}lastvisit.showmessage();&lt;/script&gt;
3.Warna oren dan merah tukarkan kepada ayat korg sendiri
4.Save dan lihat hasilnya


SELAMAT MENCUBA


KALAU NAK COPY TICK CTRL+C DENGAN SERENTAK

Labels:



0 Comments:

Post a Comment