Added some plugins authored by Barijaona Ramaholimihaso
[matthijs/upstream/blosxom-plugins.git] / barijaona / modiftime
diff --git a/barijaona/modiftime b/barijaona/modiftime
new file mode 100644 (file)
index 0000000..c3640e7
--- /dev/null
@@ -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 <blosxom@barijaona.com>, 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 <blosxom-devel@lists.sourceforge.net>.
+
+=head1 COPYRIGHT
+
+This program is free software; you can redistribute
+it and/or modify it under the same terms as Perl itself.
+
+=cut