>>Show Blogger Navigation Bar ... <<
to search the blog; sign in and out of blogger; etc. etc.

Please note that blogger uses cookies to personalise content and ads, to provide social media features and to analyse traffic to this page.
It also shares information about your use of this site with blogger's social media, advertising and analytics partners who
may combine it with other information you've provided to them or have been collected from your use of their services
(for more information, please read more here).

This page (set up just so I could see how Blogger works) is a portal
to our adventures in food and drink, recipes, disasters, triumphs...

Please use the links below or go directly to the real blog from OUR kitchen

15 April 2010

Display links to recent comments on Blogger sidebar

(reposted 15 June, 15 March, 15 September, 15 November 2009; 15 September, 15 November, 1 July 2007; 1 November, 1 August, 1 February 2006; 1 October 2005)
(originally posted 17 April 2005)


You can display links to recent comments on the sidebar by adding the recent comments hack

Add up to 10 links to most recent comments on your blogger sidebar. Go to: Found at:

recent comments hack from bloggerhacks.blogspot.com (http://bloggerhacks.blogspot.com/2004/09/farrago-recent-comments-hack-103.html)

to see how. Select ALL of the following coding. Copy and paste it into your sidebar coding where you want to see the recent comments listed.

<!-- Version 1.03 -->
<!-- Copyright &copy; 2004 Ebenezer Orthodoxy -->
<!-- was at http://boggerhacks.blogspot.com -->
<!-- ************** OPTIONS *************** -->
<script type="text/javascript" language="JavaScript1.2">
var titleText = "Recent Comments"; // heading on sidebar
var numberToShow = 5; // number of comments to show on sidebar
var displayTemplate = "[name]:<br/>[title]"; // formatting of comment link
var nameIsLink = true; // whether to add links to commenters' profiles
<!-- ********* CODE DO NOT CHANGE ******** -->
<script type="text/javascript" language="JavaScript1.2">
var comments=new Array(0);var title = "";
var itemurl = "";
function getSortDate(strDate){var d=new Date(strDate);
var day=''+d.getDate();if(day.length==1)day='0'+day;
var month=''+(d.getMonth()+1);if(month.length==1)
month='0'+month;var hour=''+d.getHours();
if(hour.length==1)hour='0'+hour;var min=''+
d.getMinutes();if(min.length==1)min='0'+min;var sec=''+
d.getSeconds();if(sec.length==1)sec= '0'+sec;
var sortDate=''+d.getFullYear()+month+day+hour+min+sec;
return sortDate;}
function recentComment(t,u,i,a,d){var rcmnt=
while(rcmnt.indexOf("\n") > -1)rcmnt=
rcmnt.replace("\n","");while(rcmnt.indexOf(" />") > -1)
rcmnt=rcmnt.replace(" />","/>");
while(rcmnt.indexOf(" <a/>") > -1)rcmnt=
rcmnt.replace(" <a/>","<a/>");var author=a;var pos=
rcmnt.toLowerCase().lastIndexOf('<br><a></a>posted by');
var pos2=
var pos3=
var pos4=
var aoffset=pos+6;if (pos3 > -1) pos2=pos3;
if (pos4 > -1) pos2=pos4;
if (pos2 > -1){pos=pos2;aoffset=
rcmnt.toLowerCase().lastIndexOf('<a><b> </b></a>');
if (aoffset==-1)aoffset=
if (pos > -1){author=
rcmnt.substr(aoffset+15,rcmnt.length-1);var expt="";
else expt=rcmnt.replace(/(<([^>]+)>)/ig,"");
author=author.replace("<A ","<a ");
if (expt.length > 50){expt=expt.substr(0,50);
if (expt.lastIndexOf(' ') > -1)
expt=expt.substr(0,expt.lastIndexOf(' '));expt+='...';}
if (!nameIsLink)author=author.replace(/(<([^>]+)>)/ig,"");
var st=getSortDate(d)+'<li>'+displayTemplate+'</li>';
st=st.replace('[title]','<a title="'+expt+'" href="'+
<MainPage><h2 class="sidebar-title">
<script type="text/javascript" language="JavaScript1.2">
<span id="frcht<$BlogItemNumber$>"
<script type="text/javascript" language="JavaScript1.2">
<span id="frch<$BlogCommentNumber$>"
<script type="text/javascript" language="JavaScript1.2">
<script type="text/javascript" language="JavaScript1.2">
for (i=0; i<10 && i < comments.length && i < numberToShow; i++){
var s=comments[i];s=s.substr(14,s.length-1); document.write(s);}
style="font-size:7pt;text-align:center;width:100%;border-top:1px dashed;">
<a title="Farrago Recent Comments Hack from BloggerHacks was at http://bloggerhacks.blogspot.com"
name="bloggerhacks.blogspot.com">BloggerHacks</a> </span>

To customize the hack, look for
var titleText = "Recent Comments"; // heading on sidebar
You can put anything you want inside the quotation marks.

To change the number of recent comments that are shown on the sidebar, look for:
var numberToShow = 5; // number of comments to show on sidebar
Where the "5" is, you can type any number between 1 and 10

To customize what is shown for each link, look for:
var displayTemplate = "[name]:<br/>[title]"; // formatting of comment link
[name] is the name of the commenter; <br/> puts a line break after the name of the commenter; [title] is the title of the post being commented on.

To link to commenters' profiles or not, look for:
var nameIsLink = true; // whether to add links to commenters' profiles
true adds the link; false displays just the commenters' names without linking to their profiles.


Blogger ejm said...

Add up to 10 links on your blogger sidebar to most recent comments. Go to:


to see how.

9/13/2005 06:26:00 pm  
Blogger ejm said...

bloggerhacks.blogspot.com is no longer there. But the recent comments hack still works. Use the coding in the post.

7/05/2010 08:38:00 am  

<< Home