From 4c4feaf8c6669ba151bfa410370f348639cd3a43 Mon Sep 17 00:00:00 2001 From: Barijaona Ramaholimihaso Date: Thu, 13 Sep 2007 00:34:18 +0000 Subject: [PATCH] Added some plugins authored by Barijaona Ramaholimihaso --- barijaona/modiftime | 77 ++++++++++++++++++++++++++++++++++++++++++ barijaona/sort_reverse | 31 +++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 barijaona/modiftime create mode 100644 barijaona/sort_reverse diff --git a/barijaona/modiftime b/barijaona/modiftime new file mode 100644 index 0000000..c3640e7 --- /dev/null +++ b/barijaona/modiftime @@ -0,0 +1,77 @@ +# Blosxom plugin: modiftime +# Author(s): Barijaona Ramaholimihaso +# Version: 20040802 +# Documentation: see bottom of file or perldoc title + +package modiftime; + +use File::stat; + + +# --------------------------------------------------------- + +sub start { 1; } + +sub story { + my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) =@_; + my $mtime; + $file = "$blosxom::datadir$path/$filename.$blosxom::file_extension"; + $mtime = stat("$file")->mtime; + my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($mtime); + $year += 1900; + $mon += 1; + $hour = sprintf("%02d",$hour); + $min = sprintf("%02d",$min); + $sec = sprintf("%02d",$sec); + $modiftime ="$mday/$mon/$year $hour:$min"; +} + +1; + +__END__ +=head1 NAME + +Blosxom Plug-in: modiftime + +=head1 SYNOPSIS + +Allows you to include the date and time when the file was last modified. + +Useful if you want to include this info, while using a date caching plugin like entries_index or entriescache. + +=head2 QUICK START + +Put title in your plug-ins directory. + +If required adapt the $modiftime variable. + +Just place $modiftime::modiftime where you want to display the date and time when your story was last modified. + +=head1 VERSION + +20040802 + +=head2 CHANGES + +20040802 - First "official" release + +=head1 AUTHOR + +Barijaona Ramaholimihaso , http://homepage.mac.com/barijaona/ + +=head1 SEE ALSO + +Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net + +Blosxom Plugin Docs: http://blosxom.sourceforge.net/plugins/ + +=head1 BUGS + +None known; please send bug reports and feedback to the Blosxom development mailing list . + +=head1 COPYRIGHT + +This program is free software; you can redistribute +it and/or modify it under the same terms as Perl itself. + +=cut diff --git a/barijaona/sort_reverse b/barijaona/sort_reverse new file mode 100644 index 0000000..bb55d15 --- /dev/null +++ b/barijaona/sort_reverse @@ -0,0 +1,31 @@ +# Plugin name: sort_reverse +# Author: Barijaona Ramaholimihaso +# Version: 2004-08-22blosxom2 +# Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/ + +# Documentation: +# This is a pretty simple plugin; +# it simply sorts your entries in the chronological order +# (instead of the antichronological order usual to blogs) + +package sort_reverse; + +# --- Configurable variables ----- + +# (none) + +# -------------------------------- + +sub start { + 1; +} + +sub sort { + return sub { + my($files_ref) = @_; + return sort { $files_ref->{$a} <=> $files_ref->{$b} } keys %$files_ref; + }; +} + +1; + -- 2.30.2