How to Fix The TechnoTag Plugin
I found that the TechnoTag plugin had a bug in it when I tried to place multiple tags within the same post. Every tag linked to the first tags target. If I had 3 tags linking to “Spiders”, “Bugs”, and “Spooky” - then all three tags would link to “Spiders”.
After looking at a discussion about TechnoTags, I had found that other people had the same problem as well. No one had a solution so I started taking a look at the
It appears that the author tried to solve another problem regarding how to
After learning a few things about regular expressions, I came up with a solution that looped through each match of a regular expression.
The following is the new code that I replaced the technotag($text) function with:
3 $pattern = ‘/<ttag[^>]*?(\s+word=”([^”]*)”)?[^>]*?>(.+?)<\/ttag>/i’;
4 return preg_replace_callback($pattern, ‘technotagreplace’, $text);
5 }
6 function technotagreplace($match){
7 global $ttag_image_small, $ttag_link;
8 $tag = $caption = $match[3];
9 if($match[2] != “”) $tag = $match[2];
10 return ‘<a href=”‘ . $ttag_link . urlencode($tag) . ‘” rel=”tag” title=”See posts from other blogs talking about "’ . $tag . ‘" on Technorati.com”>’ .
11 $caption . ‘<img src=”‘ . $ttag_image_small . ‘” style=”vertical-align:middle;padding-left:2px;padding-right:2px;border-width:0px;” alt=”‘ . $ttag_alt . ‘” /></a>’;
12 }
October 6th, 2005 at 12:31 pm
I’d like to see you put up a page that lists your active plug-ins… Your configuration is getting more interesting every day.
October 6th, 2005 at 12:32 pm
Oh, you can also get Gravatars back into your comments with a WP plug-in for that.
October 6th, 2005 at 12:33 pm
Sorry to comment bomb you, but I just realized that in my first comment I forgot to mention “there’s a plug-in for that, too!” - I think I saw one that will list your active plug-ins for you.
October 6th, 2005 at 12:35 pm
It’s ok. I’m still in the middle of fixing my templates back to how they were at blogger and haloscan. Gravatars are one thing that I will be working on.
October 8th, 2005 at 3:23 am
[…] The other day I had made a tweak to the TechnoTag plugin for WordPress. As I am using the plugin heavily, I had found another feature that I needed. Any space and comma are treated as delimiters for a list of tags in the ttaglist custom field for each post. I wanted to add a phrase with spaces. The first thing that I tried was to put quotes around it, but it didn’t work. […]
November 1st, 2005 at 5:47 pm
I tried installing this function and keep getting an parsing error on “line 17″. The above example is a little bit difficult to cut and paste, although I tried. I haven’t been able to resolve the parsing problems since I know little about the php language and structure syntax.
December 31st, 2005 at 2:46 pm
[…] I have now added some automated Technorati integration to this Wordpress blog which will hopefully make it more integrated with a tag based internet. I addded the Wordpress TechnoTag which allows you to add <ttag>’s around a term that relates to the subject of the post or comment. The TechnoTag plugin has a little bit of breakage though. It will make subsequent tags link to the first tag name in a post. There is a fix listed here which you can use to patch it up. Do take care to convert the fancy quotes to real ones so PHP doesn’t s|it the bed on you. […]