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/
74 Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
76 Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
80 Address bug reports and comments to the Blosxom mailing list
81 [http://www.yahoogroups.com/group/blosxom].
85 Blosxom and this Blosxom Plug-in
86 Copyright 2003, Rael Dornfest
88 Permission is hereby granted, free of charge, to any person obtaining a
89 copy of this software and associated documentation files (the "Software"),
90 to deal in the Software without restriction, including without limitation
91 the rights to use, copy, modify, merge, publish, distribute, sublicense,
92 and/or sell copies of the Software, and to permit persons to whom the
93 Software is furnished to do so, subject to the following conditions:
95 The above copyright notice and this permission notice shall be included
96 in all copies or substantial portions of the Software.
98 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
99 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
101 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
102 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
103 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
104 OTHER DEALINGS IN THE SOFTWARE.