1 # Blosxom Plugin: trackback_counts_display
2 # Author(s): Rael Dornfest <rael@oreilly.com>
4 # Documentation: See the bottom of this file or
5 # type: perldoc trackback_counts_display
7 package trackback_counts_display;
9 # --- Configurable variables -----
11 # What is the trackbacks base URL?
12 my $trackback_url = "http://www.example/tb.cgi";
14 # Where are trackbacks kept?
15 my $trackback_dir = "/Library/WebServer/Data/trackbacks";
17 # --------------------------------
19 use File::Spec::Functions;
21 $trackback; # use as $trackback_counts_display::trackback in flavour templates
24 -d $trackback_dir or return 0;
29 my($pkg, $path, $filename, $story_ref) = @_;
30 my $trackback_id = "$path/$filename";
31 $trackback_id =~ s!^/!!;
32 $trackback_id =~ tr/a-zA-Z0-9/_/cs;
35 my $trackback_count = -e "$trackback_dir/$trackback_id.stor" ? @{Storable::retrieve("$trackback_dir/$trackback_id.stor")} : 0;
36 my $trackback_text = $trackback_count == 1 ? 'trackback' : 'trackbacks';
38 $trackback = qq{<a href="$trackback_url?__mode=list&tb_id=$trackback_id" onclick="window.open(this.href, 'trackbacks', 'width=640,height=480,scrollbars=yes,status=yes'); return false">$trackback_count $trackback_text</a>};
49 Blosxom Plug-in: trackback_counts_display
53 Purpose: Incorporates TrackBack [http://www.movabletype.org/trackback/]
54 counts into Blosxom flavours. Populates $trackback_counts_display::trackback
55 with "n trackback(s)", n being the number of trackbacks associated with a
56 particular story. Further provides a popup link to the TrackBack CGI
57 for a view of current trackbacks for a particular story.
59 Assumes the MT Standalone TrackBack implementation is already up and running.
65 Version number coincides with the version of Blosxom with which the
66 current version was first bundled.
70 Rael Dornfest <rael@oreilly.com>, http://www.raelity.org/
72 This plugin is now maintained by the Blosxom Sourceforge Team,
73 <blosxom-devel@lists.sourceforge.net>.
77 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
79 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
83 None known; please send bug reports and feedback to the Blosxom
84 development mailing list <blosxom-devel@lists.sourceforge.net>.
88 Blosxom and this Blosxom Plug-in
89 Copyright 2003, Rael Dornfest
91 Permission is hereby granted, free of charge, to any person obtaining a
92 copy of this software and associated documentation files (the "Software"),
93 to deal in the Software without restriction, including without limitation
94 the rights to use, copy, modify, merge, publish, distribute, sublicense,
95 and/or sell copies of the Software, and to permit persons to whom the
96 Software is furnished to do so, subject to the following conditions:
98 The above copyright notice and this permission notice shall be included
99 in all copies or substantial portions of the Software.
101 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
104 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
105 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
106 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
107 OTHER DEALINGS IN THE SOFTWARE.