Recent Topics

1 Aug 28, 2008 03:09    

Version 2.4.2

Hello guys.

Forgive me if this has been covered I looked on the forums but could not find anything.

I am looking to put the Comment List Widget in one of my sidebars and have it list the last 5 or so comments. But! I want to exclude comments by the blog post author. This is because I reply to many comments and don't want my own name on the Comment List 5 or 6 times in a row.

Thanks in advance.

2 Aug 28, 2008 04:30

Hi sharky,

This is a very crude hack but it works.
Open /inc/widgets/widgets/_coll_comment_list.widget.php and change this codesnippet starting on line 150:

		while( $Comment = & $CommentList->get_next() )
		{ // Loop through comments:
			if ( @$Comment->author_user_ID != '1' )
			{
				// Load comment's Item object:
				$Comment->get_Item();
				echo $this->disp_params[ 'item_start' ];
				$Comment->author( '', ' ', '', ' ', 'htmlbody', $this->disp_params[ 'author_links' ] );
				echo T_( 'on ' );
				$Comment->permanent_link( array(
					'text'        => $Comment->Item->title,
					'title'       => $this->disp_params[ 'hover_text' ],
					) );
				echo $this->disp_params[ 'item_end' ];
			}
		}	// End of comment loop.}


Only change is the new if statement.
Change the number (1 in this example) to your User_ID (is probably 1 as well but may be different).

I did have a look at more sophisticated solutions but that seams to require a lot more coding.

Good luck

3 Aug 28, 2008 20:39

Thanks Afwas. Let me try it out and I'll let you know what happens.

4 Sep 01, 2008 08:21

Hi Afwas.

I tried the hack but it doesn't seem to work.

I get this message:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/summerof/public_html/thechumslick/inc/widgets/widgets/_coll_comment_list.widget.php on line 174


Form is loading...