# Blosxom Plugin: categorylist # Author: Keith Hudgins # Version: 0.2.5 (Any better ideas on a versioning scheme to be more blosxom-like?) # Plugin home: http://www.greenman.org/projects/categorylist package categorylist; ########################### ## ## Configurable variables ## ## ########################### # Set this to 1 if you want the slashes # removed from your display menu my $iDontWantSlashes = 1; # Make this 1 if you want XHTML-compliant # bulleted list for CSS site designs my $giveMeAList = 1; # Make this a 1 if you want article counts # tacked on to your category list my $iWantArticleCounts = 0; # Make this equal to what you want the # non-leading slashes replaced with. my $replacement = ": "; ########################### #use vars qw(@categorylist, $display); use File::Find; my @categorylist; sub start { find (sub { if (-d $File::Find::name) { my $categoryname = $File::Find::name; $categoryname =~ s/$blosxom::datadir//; if ($categoryname) { unless (-e "$blosxom::datadir/$categoryname/category.exclude") { my $catcount = 0; while (<$blosxom::datadir/$categoryname/*.$blosxom::file_extension>) { $catcount++; } $categorycount{$categoryname} = $catcount; push @categorylist, $categoryname if $categoryname; } } } }, $blosxom::datadir); @categorylist = sort @categorylist; if ($giveMeAList) { $display = "\n"; } return 1; } 1; __END__ =head1 NAME Blosxom Plugin: categorylist =head1 SYNOPSIS Purpose: Grants $categorylist::display, a list of all category directories with appropriate links for the blog sidebar. =head1 VERSION 0.2.5 Added Rick Crawford's page count patch. =head1 AUTHOR Keith Hudgins http://www.greenman.org =head1 BUGS I don't know of any. =head1 USAGE Just drop this into your blosxom plugins directory. Then, you can insert the variable: $categorylist::display into your flavour files wherever you want a list of your categories to go. Each line holds the name of one category, each one linked to the appropriate place in your blosxom weblog. If you want the directory path slashes removed, just look at the config variables. Set $iDontWantSlashes equal to 1, and change $replacement's assignment to whatever you want the non-leading slashes to be equal to. To print an unordered list instead of a series of break-tag separated links, set $giveMeAList to 1.It'll print a standard