Pergunta de Nome e Informar Quantas Vezes a Pessoa Visitou o seu Blog
Autor: Unknown | Publicado: 2010-12-01T20:05:00-02:00





Olá como pedido do Ezequiel vou postas como colocar esse sistema incrível !
É Muito Fácil e Rápido!




1° Abra o Blogger Painel e crie um widget do tipo HTML/JavaScript no blog que você quer por o sistema.
2° Coloque o seguinte código no widget


&gt;&gt;




&lt;script language = "JavaScript"&gt;&nbsp;
var expDays = 30;
var exp = new Date();&nbsp;
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function Who(info){
  var VisitorName = GetCookie('VisitorName')
  if (VisitorName == null) {
   VisitorName = prompt("Qual é seu nome");
   SetCookie ('VisitorName', VisitorName, exp);
  }
 return VisitorName;
}
function When(info){
  &nbsp; &nbsp; var rightNow = new Date()
  var WWHTime = 0;
  WWHTime = GetCookie('WWhenH')
  WWHTime = WWHTime * 1
  var lastHereFormatting = new Date(WWHTime);  &nbsp; &nbsp; &nbsp;   var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
  &nbsp; &nbsp; &nbsp; &nbsp;var lastHereInDateFormat = "" + lastHereFormatting;&nbsp;
  &nbsp; &nbsp; &nbsp; &nbsp;var dayOfWeek = lastHereInDateFormat.substring(0,3)
  &nbsp; &nbsp; &nbsp; &nbsp;var dateMonth = lastHereInDateFormat.substring(4,11)
  &nbsp; &nbsp; &nbsp; &nbsp;var timeOfDay = lastHereInDateFormat.substring(11,16)
  &nbsp; &nbsp; &nbsp; &nbsp;var year = lastHereInDateFormat.substring(23,25)
  &nbsp; &nbsp; &nbsp; &nbsp;var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDay 
  SetCookie ("WWhenH", rightNow.getTime(), exp)
 return WWHText;
}
function Count(info){
  var WWHCount = GetCookie('WWHCount')
  if (WWHCount == null) {
   WWHCount = 0;
  }
  else{
   WWHCount++;
  }
  SetCookie ('WWHCount', WWHCount, exp);


 return WWHCount;
}
function set(){
 VisitorName = prompt("Como vai você?");
 SetCookie ('VisitorName', VisitorName, exp);
 SetCookie ('WWHCount', 0, exp);
 SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (offset) { &nbsp;
 var endstr = document.cookie.indexOf (";", offset); &nbsp;
 if (endstr == -1) &nbsp; &nbsp;
  endstr = document.cookie.length; &nbsp;
  return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) { &nbsp;
 var arg = name + "="; &nbsp;
 var alen = arg.length; &nbsp;
 var clen = document.cookie.length; &nbsp;
 var i = 0; &nbsp;
 while (i &lt; clen) { &nbsp; &nbsp;
 var j = i + alen; &nbsp; &nbsp;
 if (document.cookie.substring(i, j) == arg) &nbsp; &nbsp; &nbsp;
  return getCookieVal (j); &nbsp; &nbsp;
  i = document.cookie.indexOf(" ", i) + 1; &nbsp; &nbsp;
  if (i == 0) break; &nbsp;&nbsp;
 } &nbsp;
 return null;
}
function SetCookie (name, value) { &nbsp;
 var argv = SetCookie.arguments; &nbsp;
 var argc = SetCookie.arguments.length; &nbsp;
 var expires = (argc &gt; 2) ? argv[2] : null; &nbsp;
 var path = (argc &gt; 3) ? argv[3] : null; &nbsp;
 var domain = (argc &gt; 4) ? argv[4] : null; &nbsp;
 var secure = (argc &gt; 5) ? argv[5] : false; &nbsp;
 document.cookie = name + "=" + escape (value) +&nbsp;
 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +&nbsp;
 ((path == null) ? "" : ("; path=" + path)) + &nbsp;
 ((domain == null) ? "" : ("; domain=" + domain)) + &nbsp; &nbsp;
 ((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) { &nbsp;
 var exp = new Date(); &nbsp;
 exp.setTime (exp.getTime() - 1); &nbsp;
 var cval = GetCookie (name); &nbsp;
 document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
&lt;/script&gt;&nbsp;
&lt;script&gt;&nbsp;
 document.write("Olá!! &lt;b&gt;" + Who() + "&lt;/b&gt;. Esta é a &nbsp;&lt;b&gt;" + Count() + "º&lt;/b&gt; vez que visita nosso site.")
&lt;/script&gt;&nbsp;
&lt;a href="JavaScript:set()"&gt;Mudar nome.&lt;/a&gt;


3° Clique em salvar e pronto ! Você colocou o sistema excluisivo da Mult Downs em seu site