*/
$tags = array (
array ("name" => "Technorati tags:",
"url" => "http://technorati.com/tag/"),
array ("name" => "Taggar på Bloggar.se:",
"url" => "http://bloggar.se/om/")
);
$tag_url = "http://technorati.com/tag/";
function simpleTags($text) {
global $tags;
$tag_pattern = '/(\[tag\](.*?)\[\/tag\])/i';
$tags_pattern = '/((?:
)?\s*\[tags\](.*?)\[\/tags\]\s*(?:<\/p>)?)/i';
$tags_count = 0;
$taglist_exists = 0; # Set to 1 if the tags list is present
$technotags = "
\n";
foreach ($tags as $tag) {
if ($tags_count > 0) { $technotags .= "\n
\n"; }
$tags_count = 0;
$technotags .= $tag["name"]." ";
# Check for in-post [tag] [/tag]
if (preg_match_all ($tag_pattern, $text, $matches)) {
for ($m=0; $m' .
trim($ttags[$i]) . '';
if ($i 0) {
$technotags .= ", ";
}
unset($ttags);
$ttags = explode(",", $matches[2]);
for ($i=0; $i' .
trim($ttags[$i]) . '';
if ($i0) {
if ($taglist_exists == 1) {
$text = preg_replace($tags_pattern,$technotags,$text);
} else {
$text .= $technotags;
}
}
return $text;
}
add_filter('the_content', 'simpleTags');
?>