Tuesday, July 31, 2012
Comment Counter Code Available!
Good morning! I'm so excited that my programmer husband, Tom, made the COMMENT COUNTER gadget now work with the updated blogger stuff. Yeah! Thanks, Tom! You guys are welcome to copy and paste the code below as an HTML gadget to your Layout if you would like your comments to be numbered.
IMPORTANT: You MUST choose the EMBEDDED option in SETTINGS for COMMENTS. This numbering system will NOT work with pop-up comments.
Find step-by-step photos below. :)
ENJOY! This code is FREE if you'd like to use it. :)
<style type="text/css">
.commentNumber {
border: 0px solid Black;
padding-right:5px;
display: inline;
color: #6FA8DC;
font-weight: bold;
}
</style>
<script type="text/javascript">
function getElementsByClassName2(className, tag, elm){
var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
var tag = tag || "*";
var elm = elm || document;
var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
var returnElements = [];
var current;
var length = elements.length;
for(var i=0; i<length; i++){
current = elements[i];
if(testClass.test(current.className)){
returnElements.push(current);
}
}
return returnElements;
}
function addCounters()
{
var numBox, i, j;
var topComments = getElementsByClassName2("comment-thread")[0].firstChild.children;
for (i = 0, j = topComments.length; i < j; i++)
{
var commentBlock = getElementsByClassName2("comment-block", "*", topComments[i])[0];
numBox = document.createElement("span");
numBox.className = "commentNumber";
numBox.appendChild(document.createTextNode((i + 1) + ':'));
commentBlock .firstChild.insertBefore(numBox, commentBlock .firstChild.firstChild);
}
}
addCounters();
</script>
If you want to see what this looks like in use... as soon as someone leaves me at least 1 comment on this post, it will start the numbering. Just click on my BLOG TITLE so that this post and it's comments are the only thing showing on the page. You'll see the comments numbered. I just love that he did this for me and all my friends. Sure does make it easier when doing a give-away and using random.org to pick a winner and not having to count the comments.
Have a GREAT day!
:) Janis
Click on photos to enlarge for better viewing.
Subscribe to:
Post Comments (Atom)
Awesome! Tom Rocks!! TFS Janis :)
ReplyDeleteLucy
http://love2createitall.com
This is awesome!!! Thank you for sharing it Janis!!
ReplyDeleteHugs,
Jo
OMG! Thank you for sharing this information. I just did it! Wow! This makes it so much easier when looking for the winner of blog candy after using Random. Org. You are truly a life saver. Thanks to your hubby also.
ReplyDeleteHugs,
Patty
TFS! Awesome chance again :)
ReplyDeleteaustralian gifts for overseas
TFS and thanks for the step by step! This is so awesome and works perfectly!!!!
ReplyDeleteThanks Tom! I love it! TFS
ReplyDeleteOMG Please tell your hubby I love him so much!!!!!!!!! THANK YOU THANK YOU THANK YOU! I have been seriously trying to figure out how to # my comments and none was working and this worked.
ReplyDeleteThank you for sharing this Janis, really appreciate.
Hugs,
Kate
wow THANKS this is awesome...thanks Tom for your kindness in sharing this with us!! what a dandy Idea!!! I snagged it ... www.ktsangels.blogspot.com...tfs
ReplyDeletethank you so much janis this is real sweet of you to share. it works great. hugs
ReplyDeleteWOW, Thanks so much!
ReplyDeleteOh my stars...yes yes yes!!! Tom is the MAN! Give him a Big Kiss for me!
ReplyDeleteThank you so much for this, how super.
ReplyDeleteHugs
Laine
X
This is so awesome. Woot Woot GO TOM GO! Thank You both so much. I so need this. I will be sure to share the awesome new. THANKS TOM!
ReplyDeleteThis is great! Thanks so much! Makes giving out prizes easier!
ReplyDeleteHugs,
Chriss
WOW!!! Thanks SOOO much! Been trying to get something like this on my blog again! Had it once...then it disappeared for some reason! This is wonderful!!!
ReplyDeletehousesbuiltofcards@gmail.com
www.housesbuiltofcards.blogspot.com
Thanks to both of you for sharing this! I can't wait to see if it works!
ReplyDeleteLet's hear it for TOM and for JANIS who were kind enough to post easy peasy directions for comment numbering on our blog...it worked so y'all come down and comment to your hearts content so I can see how great it works!! This is why I LOVE my blogger peeps...they share ALL the good stuff!!!
ReplyDeletecreative Wishes,
Claire S.
www.scrapmyway.blogspot.com
THANK YOU FOR THIS AWESOME TUTORIAL!!! YAY!!! I have it on my challenge blog and will add it to my blog too. You rock!!!
ReplyDeleteIt doesn't work on either of my blogs either...not that I can see anyways. Bummer. I love this idea because I DO have contests and having the comments numbered would really help. Oh well! LOL!
ReplyDeleteThank you so much for this! Off to try it out now :)
ReplyDeleteGot it! Thank you!!
ReplyDeletePlease pass my thanks to your hubby. And thanks for the easy-to-follow installation instructions. I might have done it without them, but they really speeded things up.
ReplyDeleteThank you, thank you, thank you! Please tell hubby I said thanks too! This is going to be SO HELPFUL to me! I have a 4 year Blogaversary Candy going on through this month and it will certainly help with it comes time to draw a winner! Please feel free to come check it out ... and thanks ever so much again! I will be directing my friends to your site!
ReplyDeleteHugs from Ohio
Darlene
DAR'S CRAFTY CREATIONS
Thank you so much for posting this up! So sweet of you to post all the visiual insturctions, very helpful:)I just became a follwer and would love if you stopped by my blog and became a follower as well.
ReplyDeletePeace, Love, & Cricut Hugs!
Monica L.
Hey Janis. Thank you so much for this code. I finally remembered to link it with a new post and it worked great! Thanks so much Mrs Smarty Pants...hubby too. Holly :-)
ReplyDeleteJanis, that is so sweet of you to do this, not only the counter, but instructions too...wow! Your dh must love you very much...he's a keeper...lol. To both of you it's very much appreciated and a big thanks.
ReplyDeleteThanks a bunch!
Dee B
Crafdeecat
Ya thanks! I just added to my blog!
ReplyDeleteYou are amazing! I've been so sad that numbered comments have gone away. you made my day! Thanks to your husband for figuring it out and thanks to you for sharing! New follower...
ReplyDeleteJanis, please tell Tom THANK YOU SO MUCH!! I used to have my comments numbered and it just disappeared. I added this and voila, they're back!! Thank you, thank you, thank you and your hubby for sharing this!! Hugs my sweet friend :)
ReplyDeleteLisa
A Mermaid's Crafts
I am sure this is something I will want Janis when I do my next blog candy - I need to research more so I can understand where to install it on my blog - I am a newbie - learning the ropes you know! Tell your hubby Tom - I think it is a wonderful, kind thing he has done -Very much appreciated! Have a great week! ~ Gail ~
ReplyDeleteJnis Thank your Hubby I used this on my blog also -- I would have gon e bananas trying to count all the comments.
ReplyDeleteHUGS!
DIANA L
http://dianamlarson.blogspot.com