[wp-hackers] Plugin for attributing a value to comments

Jared Bangs jared at pacific22.com
Thu Oct 9 04:49:28 GMT 2008


On Wed, Oct 8, 2008 at 8:10 PM, Daniel Cameron <dan at sproutventure.com> wrote:
> Good to be back...it's been a while.
> I'm looking to build a plugin that will attribute a value to a comment.
> Values would be designated by the post author and site admin only. The
> values would also need to be attributed to the registered user so a widget
> could be made to pull in the top commenters with X value.
>
> I'm planning to build this from scratch but if someone could throw me a bone
> with either suggestions or share any similar plugins that already exist it
> would help.
>
> Much appreciated.

I think a plugin that allowed a defined level of user (admin, editor,
author, etc.) to "tag" comments would be the way to go for handling
the "values" you're referring to.

I don't know if such a plugin already exists, but I would think it
should be based on the WP terms / taxonomy system (see
wp-includes/taxonomy.php for the API methods and the terms,
term_taxonomy, and taxonomy_relationship tables for how they're
stored).

It's a perfect fit for the taxonomy system, since it's designed to
allow you to associate "terms" with various wp objects.

For example:
"Tags" are an association of type "post_tags" between a term and a post.
"Categories" are an association of type "category" between a term and a post.
"Link Categories" are an association of type "link_category" between a
term and a link.

I believe these are the only "out of the box" taxonomies provided in
the core, but they do clearly illustrate the point: you can
potentially use this model to associate anything with an ID (in this
case, a comment) with a term; you just have to come up with a name for
that "association type" - the taxonomy.

You could then build the sort of widgets, etc. you were talking about
and they could make use of the methods provided in the taxonomy API.

Just my 2 cents; hope that helps.

- Jared


More information about the wp-hackers mailing list