Prikazi cijelu temu 10.02.2015 10:41
zxz Na mrezi
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Predhodna posjeta
PreuzmiIzvorni kôd (HTML):
  1. </head>
  2. <script type = "text/javascript">
  3.  
  4. var days = 730; // days until cookie expires = 2 years.
  5. var lastvisit=new Object();
  6. var firstvisitmsg="Pozdrav. Posljednji put ste bili na ovoj stranici: ";
  7. lastvisit.subsequentvisitmsg="Pozdrav. Vasa predhodna posjeta je bila:  <b>[displaydate]</b>";
  8.  
  9. lastvisit.getCookie=function(Name){
  10. var re=new RegExp(Name+"=[^;]+", "i");
  11. if (document.cookie.match(re))
  12. return document.cookie.match(re)[0].split("=")[1];
  13. return'';
  14. }
  15.  
  16. lastvisit.setCookie=function(name, value, days){
  17. var expireDate = new Date();
  18.  
  19. var expstring=expireDate.setDate(expireDate.getDate()+parseInt(days));
  20. document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
  21. }
  22.  
  23. lastvisit.showmessage = function() {
  24. var wh = new Date();
  25. if (lastvisit.getCookie("visitc") == "") {
  26. lastvisit.setCookie("visitc", wh, days);
  27. document.write(firstvisitmsg);
  28. }
  29.  
  30. else {
  31. var lv = lastvisit.getCookie("visitc");
  32. var lvp = Date.parse(lv);
  33. var now = new Date();
  34. now.setTime(lvp);
  35. var day = new Array("Ned","Pon", "Uto", "Sri", "Cet", "Pet", "Sub");
  36. var month = new Array ("Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
  37. var dd = now.getDate();
  38. var dy = now.getDay();
  39. dy = day[dy];
  40. var mn = now.getMonth();
  41. mn = month[mn];
  42. yy = now.getFullYear();
  43. var hh = now.getHours();
  44. var ampm = "AM";
  45. if (hh >= 12) {ampm = "PM"}
  46. if (hh >12){hh = hh - 12};
  47. if (hh == 0) {hh = 12}
  48. if (hh < 10) {hh = "0" + hh};
  49. var mins = now.getMinutes();
  50. if (mins < 10) {mins = "0"+ mins}
  51. var secs = now.getSeconds();
  52. if (secs < 10) {secs = "0" + secs}
  53. var dispDate = dy + ". " + dd + " " + mn + ". " + yy + " " + hh + ":" + mins + ":" + secs + " " + ampm
  54. document.write(lastvisit.subsequentvisitmsg.replace("\[displaydate\]", dispDate))
  55. }
  56.  
  57. lastvisit.setCookie("visitc", wh, days);
  58.  
  59. }
  60.  
  61. lastvisit.showmessage();
  62. </body>
  63. </html>

Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.