This is a unique counter that counts the number of times a person visits your blog, and allows them to see that count. It’s simple to add to your blog. It does make for an extra button for your guests to push to get to your blog (an OK button) so maybe you will ask for feedback to see if your readers like it. You can let me know what you think since I will try it on my blog for a bit.
Resource – Blogger Tips and Tricks
Step 1 – Customize the code to your specifics. Copy and paste the code onto a word document, so that you can scroll to find the message portion. For visits 1-10 you will give a little message, then after that, it will always be the last (tenth) message you wrote.
Here’s the code:
<script language="JavaScript">
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DisplayInfo() {
var expdate = new Date();
var visit;
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
if(!(visit = GetCookie("visit")))
visit = 0;
visit++;
SetCookie("visit", visit, expdate, "/", null, false);
var message;
if(visit == 1)
message=" Welcome to Easy Custom Blogs!";
if(visit== 2)
message=" I see you want to learn some more!";
if(visit == 3)
message=" Yippee Skippee, that makes 3!";
if(visit == 4)
message=" You are a wonderful learner!";
if(visit == 5)
message=" You're practically a blog genius!";
if(visit == 6)
message=" You're back!";
if(visit == 7)
message=" You ROCK!";
if(visit == 8)
message=" You're a real BLOG STAR!";
if(visit == 9)
message=" Need help? Click the contact me button";
if(visit >= 10)
message=" BLOG MASTER, welcome!";
alert("\n"+"Thanks for stopping by Easy Custom Blogs! I hope you've learned something new.That makes:\n"+""+visit+"\n"+"time(s)."+"\n"+"\n"+message);
}
function ResetCounts() {
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
visit = 0;
SetCookie("visit", visit, expdate , "/", null, false);
history.go(0);
}
window.onload=DisplayInfo
</script>
After you have made the changes you like, then you will add this code as a gadget.
Step 2 – Add a gadget
Go to CUSTOMIZE/LAYOUT/PAGE ELEMENT/ADD A GADGET
Select HTML Java Script
COPY (CTRL +C) the code from your word document, and then PASTE (CTRL +V) the code into the box for the gadget. Choose SAVE.
Here are the WORD DOCUMENT INSTRUCTIONS.
Make sure to comment to give me your thoughts…is the gadget a cool trick or a hassle?
I was irritated by the popup on my own blog, so I removed the code...sorry if you were enjoying it...
don't shoot me....i think it's a hassle, and it took a long time to load. I was reading your post, and halfway thru it, it popped up. Isn't that why we have pop up blockers?
ReplyDelete