# Blosxom Plugin: bugzilla_tag # Author: Dean Wilson (http://www.unixdaemon.net/about.html) # Version: 0.1 (20060902) # Plugin Homepage: # http://www.unixdaemon.net/blosxom_plugins.html#bugzilla_tag # License: GPL # Documentation: Please see the end of this file. package bugzilla_tag; sub start { 1; } sub story { my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; $$body_ref =~ s!(\d*)!return_link($1,$2)!esg; 1; } sub return_link { my $project = shift; my $bug_id = shift; # format - 'alias you use' => [ URL to bugzilla, pretty display name ] my %zillas = ( redhat => ['https://bugzilla.redhat.com/bugzilla/show_bug.cgi', 'Red Hat'], xensource => ['http://bugzilla.xensource.com/bugzilla/show_bug.cgi', 'Xen Source' ], mozilla => ['https://bugzilla.mozilla.org/show_bug.cgi', 'Mozilla.org' ], # short aliases I use rh => ['https://bugzilla.redhat.com/bugzilla/show_bug.cgi', 'Red Hat'], xen => ['http://bugzilla.xensource.com/bugzilla/show_bug.cgi', 'Xen Source' ], moz => ['https://bugzilla.mozilla.org/show_bug.cgi', 'Mozilla.org' ], ); # default to the mozilla bugzilla if the given project can't be found. $project = 'mozilla' unless exists $zillas{$project}; my $url = qq!$zillas{$project}[1] bug ID $bug_id!; return $url; } 1; __END__ =head1 NAME Blosxom Plugin: bugzilla_tag =head1 SYNOPSIS This extension allows you to link to bugs posted in a number of bugzilla instances (you can easily add your own projects instance to the list) in your blog posts without performing the usual tedious steps; getting the URL, putting it in an etc. You can specify a combination of bug ID and Bugzilla instance using the following syntax 84752 And it will be translated in to a full that points to the given bug ID on the specified server. This centralision also makes it easier to repoint your links in the future. =head2 Default Bugzilla You can specify a default bugzilla in the code, this is the bugzilla server used if you mistype the project name. =head1 VERSION 0.1 =head1 AUTHOR Dean Wilson (http://www.unixdaemon.net/about.html) =head1 LICENSE GPL =cut