
Aziz of metaBLOG suggests that the new tags in Wordpress 2.3 can be used to create a “folksonomy” on Wordpress blogs. For those not in the know (including me until a couple days ago), a folksonomy is is the practice and method of collaboratively creating and managing tags to annotate and categorize content
according to Wikipedia. Basically it’s letting normal people (versus say artificial intelligence or an administrator) help describe things. For example, adding a tag on flickr or using del.icio.us.
So since Wordpress doesn’t currently have anything like a public “Add a Tag” and I haven’t coded a Wordpress plugin recently (although I did upgrade WP_MonsterID if anyone is using it), I thought I would code up a quick plugin to see how it works. So here is WP_Folksonomy. It’s fairly basic at the moment but I’d like to get it out there to see if it’s useful and if anyone is interested in it.
Since it uses Wordpress’s tagging features WP it’s only going to be compatible with Wordpress 2.3 and up.
Features
- Allow readers (or registered users) to add tags to posts
- Choose between immediately displaying tags and waiting for admin approval first
- Delete user submitted tags
- Delete or approve all tags by user/IP address
- RSS feed for monitoring added tags
- Javascript autocompletion for increased tag standardization
Current Version:
Installation instructions:
Unzip wp_folksonomy.zip. Upload wp_folksonomy.php to wp-content/plugins/ and activate in the Plugin Control Panel. Now the slightly difficult part. Unfortunately there is no automatic hook near the tags in Wordpress so you’ll have to make a minor change to one of your theme files. We’re aiming create a tiny form to allow your users to add tags. Many themes will be using the wordpress <?php the_tags('some','options');?> to list the tags. Try to find this function or a similar tag listing function. It’s often either in wp-content/themes/CurrenTheme/index.php or wp-content/themes/CurrenTheme/single.php. Once you find it add the following code <?php if(function_exists('wp_folksonomy_add_form')) wp_folksonomy_add_form();?> immediately after it. For example in the default Wordpress theme, it looks like:
<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
<?php if(function_exists('wp_folksonomy_add_form')) wp_folksonomy_add_form();?>
Sorry it’s not more automatic but if you’re having any trouble figuring out where to put it feel free to ask in the comments (make sure to tell me which theme you’re using). You can view and delete tags from the Folksonomy control panel in Settings or a little widget on the dashboard an RSS feed.
Change Log:
- v0.71 7-5-2008:
- Fixed deleting problem with term_id vs term_taxonomy_id
- v0.62 5-28-2008:
- Added caching compatibility
- v0.61 5-28-2008:
- Fixed invalid HTML
- v0.6 5-27-2008:
- Fixed missing
$wpdb->prefix causing missing table - Fixed installation directions (extra “function ”)
- Added javascript tag completion
- Fixed paging on tag display
- Removed dashboard widget
- Added an RSS feed for monitoring added tags
- Fixed missing
- v0.5 12-21-2007:
- Fixed undeleteable tags when tag had been created, deleted, created
- Fixed added tag not displaying on submitter’s page until after reload in themes with a late call to
wp_head()
- v0.4 12-19-2007:
- Approve all tags by user/IP
- Delete all tags by user/IP
- Tags added within post page (no longer needs $_GET variables)
- v0.3 12-17-2007:
- Limit tags to 25 characters
- Only allows users who can edit posts to approve/delete tags
- Fixed option update bug
- When Registered Users options set, only displays tag add form for registered users
- v0.21 12-15-2007:
- Fixed overlap between tag add and comment add $_POST variables
- v0.2 12-15-2007:
- Added Control Panel
- Added Subscribers Only and Authorize Tags options
- Tracks submitted tags
- Added Delete and Accept Tag actions
- v0.1 12-14-2007:
- A rough public tag adder
ScottS-M | 16-Dec-07 at 3:57 am | Permalink
I’m going to try to add the tag “collaborative” to see if I’m full of crap…
It worked so the plugin appears to be working OK. Hmm except somehow commenting has gotten messed up. Version 0.21 will be out in a few minutes.
ScottS-M | 16-Dec-07 at 4:17 am | Permalink
Was a tiny overlap with $_POST variables between comment and tag adding. Everything should be ok now.
ScottS-M | 13-May-08 at 4:51 pm | Permalink
Hey who added “potential mess”? :)
George | 21-May-08 at 4:47 am | Permalink
I’m trying this out on my photoblog - the problem I’ve found is that I can’t find anywhere to moderate the tags - they can be submitted, but from then on, I can’t find them in the admin panel.. Any ideas?
ScottS-M | 21-May-08 at 8:22 am | Permalink
There should be a little widget in the dashboard and a Folksonomy control page in the Settings. Are those missing or just understandably easy to overlook (I just realized I don’t have anything above about that)? I just started working on an RSS feed so people can keep track a little easier since I always manage to ignore the dashboard. There should be an update in a few days.
ScottS-M | 27-May-08 at 10:36 pm | Permalink
@George
Hmm I think I found an error in the plugin that would have mesed up the tag display and storage in some installs (missing
global). That might have been the problem. It should be fixed in the new version 0.6.Steven Smethurst | 28-May-08 at 10:07 pm | Permalink
Hello
Suggestions:
- Only allowed to add n tags, each user is only allowed to add 3 or 4 or n tags to a post. Add and remove would be nice.
- Users can only add predefined tags a post.
- Add tag weight. The more the users add this tag to a specific post the larger it gets.
ScottS-M | 28-May-08 at 11:06 pm | Permalink
@Steven
Good suggestions. Tag weight definitely could be fun. It could combine well with some predefined tags for a sort of multiple index rating system. I’ll think about that.