Hikari Featured Comments
Have you ever wanted to highlight a valuable comment among all others? Or not let that troll 6-paragraphs comment take more space than it deserve? Or even hide a whole thread of offtipics?
Well, now you can!
Hikari Featured Comments is a simple plugin that adds 3 new custom fields to comments, allowing you to add special properties to each of them.
With this feature available, you can query any comment to know if it has any of those properties flagged, and if so you can take special actions within your theme or another plugin.
- Introduction
- Features
- ScreenShots
- Download
- Donate
- Installation
- Upgrading
- Uninstalling
- Support & Requests
- Frequently Asked Questions
- Versions
- To-do stuff
- Thanks
- Related Posts
- Comments (7)
Features
There are 3 special properties available, you can give them any semantic you like, but default meanings are as follows:
- Featured: a comment flagged as featured should be highlighted from all others. You can give it special CSS styles from your theme to make it more visible among all comments, and flag any valuable comment as so.
- Buried: a buried comment is a comment you don't wanna just delete, but also don't want it as visible as all others. You can use it to hide offtopic comments which you don't want to perpetuate.
- Children/Threaded buried: this one has similar meaning to the former, but it should be applied to nested/threaded/children comments of the flagged comment.
Note that any comment can be independently flagged as Buried and Children buried, therefore a Children buried comment shouldn't have special styles applied to itself. In the same way, you can also have a featured AND buried comment, having both styles should be applied together!
Hikari Featured Comments provides a special metabox in comment edit page (/wp-admin/comment.php?action=editcomment&c=XXXX
) where you can flag these properties, and it automatically attach new classes (featured
, buried
, children_buried
) to comments in frontend.
ScreenShots
- The custom metabox in comment's edit page, together with another metabox, just below comment's content textarea
You can see live exemples below in comments area. Note that I developed a special jQuery code that collapses and expands comments, having buried comments collapsed by default!
License
© Copyright Hikari (http://wordpress.Hikari.ws), 2010
If you want to redistribute this software, please leave a link to this post together with it and mention me as its author
Parts of this code are provided or based on ideas and/or code written by others
Important contributors to this plugin (listed in alphabetical order):
- Utkarsh (http://wpprogrammer NULL.com)'s Feature Comments (http://wpprogrammer NULL.com/feature-comments-wordpress-plugin/)
If you want to extend the plugin features, please contact me so I can add your work to my official release.
Download
You can follow Hikari Featured Comments updates and older versions at Wordpress.org Plugin Directory (http://wordpress NULL.org/extend/plugins/hikari-featured-comments/), or you can get the last version from the direct link hikari-featured-comments.zip (http://downloads NULL.wordpress NULL.org/plugin/hikari-featured-comments NULL.zip).
Donate
There are also several ways you can show your appreciation:
- blogging about it
- linking it from your site (without using rel=nofollow)
- browsing the site sidebars
- suggesting it to your friends
- visiting other posts thru the site and adding valuable comments
- saying thanks on comments
- offering codes that add new features
- etc, use your imagination
Installation
Hikari Featured Comments requires at least Wordpress 2.9 and PHP5 to work.
You can use the built in installer and upgrader, or you can install the plugin manually.
- Download the zip file, upload it to your server and extract all its content to your
/wp-content/plugins
folder. Make sure the plugin has its own folder (for exemple/wp-content/plugins/hikari-featured-comments/
). - Activate the plugin through the 'Plugins' menu in WordPress admin page.
- That's it! Go to any comment you wanna flag, open its edit page and see the new metabox available!
- At first, no change will be visible. You must edit your theme's
comment.php
orstyle.css
to add any feature your creativity creates based on these properties.
Upgrading
If you have to upgrade manually, simply delete hikari-featured-comments
folder and follow installation steps again.
Uninstalling
I've made an article just to explain in full details which options we have to upgrade and uninstall our plugins and what happens with each option, and how it works with my plugins: Uninstalling my plugins.
Support & Requests
If you want to request any new feature, leave a comment on this post explaining it with as many details as possible. I can't assure it will be added, but if it is viable, I like it AND have the time, I'll do my best.
If something seems to not be working and you need help, first read the FAQ and then leave a comment explaining what's happening. If you need to post a picture, please link it instead of using an img tag.
FAQ
-
Ok, I installed your plugin and as expected nothing happens when I flag a comment as featured. What now?
Now your creativity defines what happens! These properties open a variety of possibilities, in both Web Design and Web Development areas!
If you wanna give special CSS styles to flagged comments, just go to your theme's
style.css
, search for the section where comments styles are and add new styles there. A very simple exemple:.comment.featured{ weight: bold; } .comment.buried{ display: none; }
-
Nice! This gives me some great ideas, but that would require more advanced code... What can you offer?
If you wanna develop extra features based on these properties, I provide 3 functions to help you:
hkFC_is_comment_featured($comment)
hkFC_is_comment_buried($comment)
hkFC_is_comment_children_buried($comment)
Just pass a comment object or ID as parameter to receive a boolean return saying if that comment is flagged or not, you can also pass a null parameter to use current comment. There are also 3 filters you can use to change a comment property just before any code retrieves that data, without needing to hack the plugin:
apply_filters( 'hkFC_is_comment_featured', $featured, $comment_id )
apply_filters( 'hkFC_is_comment_buried', $buried, $comment_id )
apply_filters( 'hkFC_is_comment_children_buried', $children_buried, $comment_id )
Cangelog
- 0.02 - 04/10/2010
- First public release.
Known bugs
- none ATM
To-do stuff
Here are my ideas that I wish to implement in the future.
- Add some default features to be used out of the box to highlught and bury comments.
Thanks
Thanks to all my friends that support me and thumbs me up to continue.
Thanks to everybody who use my plugins (even not donating). Thanks to everybody that add comments to my site!
And most of all to everybody that hire me as consultant to implement custom code for their ideas!
Popularity: 18%
It has accumulated a total of 35,846 views. You can follow any comments to this article through the Comments RSS 2.0 Feed. You can leave a comment, or trackback from your own site.
- research
Comentando vc contribui e participa na criação do conteúdo do site.
Contribua. Commente. :)(Os comentários abaixo representam a opinião dos visitantes, o autor do site não se responsabiliza por quaisquer consequências e/ou danos que eles venham a provocar.)
Buried comment
marketingThis comment is buried, this text is hidden and can only be seen when it’s expanded.feedback
Featured comment
This comment is featured, it has special styles that highlight it among other comments.
It's also flagged as Children buried, it has a threade comment, but that comment is hidden and must be expanded to be seen.
research
Normal comment
This is a normal comment, it has no special property flagged. But, because its parent is flagged as Children buried, this comment can only be seen when expanded.
information
Filter featured comments in admin area
marketing
Hi Hikari!
How can I filter featured comments (or buried) in Admin/Comments/Edit Comments area?
A lot of thanks!
feedback
feedback
Do you mean comments list page in /wp-admin/edit-comments.php?comment_status=all or comment edit page in /wp-admin/comment.php?action=editcomment&c=2294 ?
It’s probably the comments list page, and unfortunately I don’t know a way to control which comments are shown in this list so that I can build a custom list, or ho to add links with parameters of which type of comments to list :(
homepage
featured comments widget ?
Hi,
Is there a way to display featured comments on sidebar randomly ?
maybe updated in real time or updated in each page load..
this would be great
thanks
information
That's a nice idea… I'll take a look on that :)