Try it at the bottom of the sidebar on this site, or in the Meta section of the sidebar on Webfroot!
]]>Also, I’ve changed a couple of the defaults; $limit now defaults to 5 and $output_when_more_unread_comments_than_limit now defaults to TRUE.
If you want to keep the old defaults, update your template’s command to this:
<?php echo get_smart_unread_comments(10, TRUE, FALSE); ?>
Also, I've moved my wordpress plugins to their own pages now
]]>Current Version: 1.3
What it does
Creates a list of posts with comments that haven’t been read by the user since their last visit/session. Uses cookies to track users last visit – no database required!
How it works:
Users are issued cookies which are used to track last visit. If this is their first visit, all comments in the last 14 days are unread. The plugin generates a list of unread comments. It keeps track of the user’s read posts for the session, removing them from the list as the user goes. Each page load updates the last unread timestamp cookie. Users can also mark all comments as read.
Installation:
Either:
wbft-smart-unread-comments.php
to your wp-content/plugins
directory. Log-in to your WP admin panel, go to the Plugins tab and activate the Smart Unread Comments plugin.Implementation:
In your template, add this code.
<ul><?php echo get_smart_unread_comments(); ?></ul>
get_smart_unread_comments() also takes options:
<li class="wbftSUC_NoComments" >
item containing $no_unread_comments_text<li class="wbftSUC_MoreComments" >
item containing $more_unread_comments_textDocumentation:
You’re looking at it!
CSS Classes output:
Remember, CSS classes are CASE SENSITIVE.
class='wbftSUC_MarkAsRead'
class='wbftSUC_Recent'
class='wbftSUC_MoreComments'
class='wbftSUC_NoComments'
Version History:
1.3: Now uses permalink structure, and sets cookies to your blog’s path. $limit defaults to 5 (not 10), and $output_when_more_unread_comments_than_limit defaults to TRUE.
1.21: Fixed broken (x)html validation due to stray
1.2: Fixed major bug with post title links.
1.11: Tables are now pulled from WP variables.
1.1: Initial Public Release.
Known Issues:
Comments on Pages (as opposed to posts) turn up on the list, but visiting the Page doesn’t mark those comments as unread.
Credit:
Bugs and Suggestions
Any bugs or suggestions, please email me – email link in the sidebar (RSS readers: drop by the site ).
Current Version: 1.1
How It Works:
If you are logged into your WordPress admin panel, and you make a comment, the plugin will see that you are an official WP user of your blog and mark the comment with your WP User ID.
When the page is rendered, that User ID is called up by the plugin functions, which you can use to change text, change CSS class, add images, whatever your imagination desires.
Installation
Either:
official-comments.php
to your wp-content/plugins
directory. Log-in to your WP admin panel, go to the Plugins tab and activate the Official Comments plugin.How to implement:
Simply add this somewhere within the Comments loop in wp-comments.php and/or wp-comments-popup.php:
<?php if(is_wpuser_comment() != 0) {echo "Official ";} ?>
Or get tricky and add a CSS Class to the LI:
<li class="comment <?php echo (is_wpuser_comment() ? ' commentOfficialUser' : ''); ?>" id="comment-<?php comment_ID() ?>">
and this very basic css example:
.commentOfficialUser { border: 1px solid black; background-color: #999999 }
Documentation
View Official Comments Readme.txt
Examples
There is a very basic example on this post, but more exciting examples available at Webfroot.
Known Issues
It only works with official comments made after the point of installation, as WordPress doesn’t automatically add the WP user ids to the comments field it already has.
Bugs and Suggestions
Any bugs or suggestions, please email me — email link in the sidebar (RSS readers: drop by the site ).