Smart Unread Comments “patch”

Another "must have" cool plugin. It has just been updated to v1.3
http://inner.geek.nz/archives/2005/02/11/wordpress-plugin-smart-unread-comments/

2 Issues I faced.

  1. Doesnt work with pages
  2. Almost destroy the layout of the "almost spring" theme.

Issue 1.
After diggin the source, Line 59,   I removed the comments of /* is_page() */
It does seems to work (for now).

Issue 2.
Make me feel like pulling my hair. Trace the problem to style.css

#sidebar ul ul li a {
    display: block;

Now display:block is the problem. It is used so the href can fill up the whole list on hover. This means clicking in the list, but not necessary over the link will enable the hyperlink which looks pretty cool.

I struggle with myself to either a)hack the css or b)modify the plugin.
If (a), (i) I need to sacrifice entire li for click. li could still be used for a mouseover effect (ii)something to do with the span tag of the comments list? i couldnt think how

So I took the easier option: (b) and changed line 175
$output .= "\n\t<li".$style."><a href='".get_permalink($post['post_id'])."’ title=’".$post['comment_date'].", ".$post['comment_author']."’>".$post['post_title']."</a>&nbsp;(<a href=’".get_permalink($post['post_id'])."#comment-".$post['comment_id']."’ title=’Oldest unread recent comment for this post’>".$post['comment_count']."</a>)</li>";
to this.
$output .= "\n\t<li".$style."><a href='".get_permalink($post['post_id'])."#comment-".$post['comment_id']."’ title=’Oldest unread recent comment for this post-".$post['comment_date'].", ".$post['comment_author']."’>".$post['post_title']."&nbsp;(".$post['comment_count'].")</a></li>";

This was a single <a> in the list make the style look better.

[update]
Seems… if i  add is_page(), smart commennts dont detect new comments. So maybe i’ll just have to wait for a new version to be loaded?

2 Responses to “Smart Unread Comments “patch””


  1. 1 Zz85

    Had to add “|| is_page()” to line 90. (fixing comment seen in page)

    now for fixing correct no. of more (although theoreticallymore processing)

    line 124, add $postcount = 0; after $counter = 0;

    line 125, remove count($posts)

  2. 2 3

    Thank you for the info!

Leave a Reply