# Blosxom Plugin: same_category # Author(s): Kyo Nagashima # Version: 2004-07-16 # Blosxom Home/Docs/Licensing: http://www.blosxom.com/ package same_category; use strict; use vars qw($list); # --- Configurable variables ----------- # number to display my $num = 5; # prefix my $prefix = <<"_EOD_";

Recent entries from same category

_EOD_ # postfix my $postfix = <<"_EOD_";
_EOD_ # --- Plug-in package variables -------- my $curr_path; # -------------------------------------- use FileHandle; sub start { return 0 unless $blosxom::path_info =~ /\./; $curr_path = $blosxom::path_info; $curr_path =~ s!/.*?$!!; $curr_path = "$blosxom::datadir/$curr_path"; return 1; } sub filter { my($pkg, $files_ref) = @_; $list .= qq!$prefix\n$postfix!; chomp $list; return 1; } sub getinfo { my $file = shift; my($path, $fn) = $file =~ m!^$blosxom::datadir/(?:(.*)/)?(.*)\.$blosxom::file_extension!; my $url = "$blosxom::url/$path/$fn.$blosxom::flavour"; my $fh = new FileHandle; my $title = ''; if (-f $file && $fh->open("< $file")) { chomp($title = <$fh>); $fh->close; } return($url, $title); } 1;