# Blosxom Plugin: trackback_counts_display # Author(s): Rael Dornfest # Version: 2.0b2 # Documentation: See the bottom of this file or # type: perldoc trackback_counts_display package trackback_counts_display; # --- Configurable variables ----- # What is the trackbacks base URL? my $trackback_url = "http://www.example/tb.cgi"; # Where are trackbacks kept? my $trackback_dir = "/Library/WebServer/Data/trackbacks"; # -------------------------------- use File::Spec::Functions; $trackback; # use as $trackback_counts_display::trackback in flavour templates sub start { -d $trackback_dir or return 0; 1; } sub story { my($pkg, $path, $filename, $story_ref) = @_; my $trackback_id = "$path/$filename"; $trackback_id =~ s!^/!!; $trackback_id =~ tr/a-zA-Z0-9/_/cs; require Storable; my $trackback_count = -e "$trackback_dir/$trackback_id.stor" ? @{Storable::retrieve("$trackback_dir/$trackback_id.stor")} : 0; my $trackback_text = $trackback_count == 1 ? 'trackback' : 'trackbacks'; $trackback = qq{$trackback_count $trackback_text}; 1; } 1; __END__ =head1 NAME Blosxom Plug-in: trackback_counts_display =head1 SYNOPSIS Purpose: Incorporates TrackBack [http://www.movabletype.org/trackback/] counts into Blosxom flavours. Populates $trackback_counts_display::trackback with "n trackback(s)", n being the number of trackbacks associated with a particular story. Further provides a popup link to the TrackBack CGI for a view of current trackbacks for a particular story. Assumes the MT Standalone TrackBack implementation is already up and running. =head1 VERSION 2.0b2 Version number coincides with the version of Blosxom with which the current version was first bundled. =head1 AUTHOR Rael Dornfest , http://www.raelity.org/ This plugin is now maintained by the Blosxom Sourceforge Team, . =head1 SEE ALSO Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/ Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html =head1 BUGS None known; please send bug reports and feedback to the Blosxom development mailing list . =head1 LICENSE Blosxom and this Blosxom Plug-in Copyright 2003, Rael Dornfest Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.