Add gavinc/plugin_list plugin.
[matthijs/upstream/blosxom-plugins.git] / barijaona / modiftime
1 # Blosxom plugin: modiftime
2 # Author(s): Barijaona Ramaholimihaso
3 # Version: 20040802
4 # Documentation: see bottom of file or perldoc title
5
6 package modiftime;
7
8 use File::stat;
9
10
11 # ---------------------------------------------------------
12
13 sub start { 1; }
14
15 sub story {
16   my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) =@_;
17         my $mtime;
18         $file = "$blosxom::datadir$path/$filename.$blosxom::file_extension";
19         $mtime = stat("$file")->mtime;
20         my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($mtime);
21                                         $year += 1900;
22                                         $mon += 1;
23                                         $hour = sprintf("%02d",$hour);
24                                         $min = sprintf("%02d",$min);
25                                         $sec = sprintf("%02d",$sec);
26         $modiftime ="$mday/$mon/$year $hour:$min";
27 }
28
29 1;
30
31 __END__
32 =head1 NAME
33
34 Blosxom Plug-in: modiftime
35
36 =head1 SYNOPSIS
37
38 Allows you to include the date and time when the file was last modified.
39
40 Useful if you want to include this info, while using a date caching plugin like entries_index or entriescache.
41
42 =head2 QUICK START
43
44 Put title in your plug-ins directory.
45
46 If required adapt the $modiftime variable.
47
48 Just place $modiftime::modiftime where you want to display the date and time when your story was last modified.
49
50 =head1 VERSION
51
52 20040802
53
54 =head2 CHANGES
55
56 20040802 - First "official" release
57
58 =head1 AUTHOR
59
60 Barijaona Ramaholimihaso <blosxom@barijaona.com>, http://homepage.mac.com/barijaona/
61
62 =head1 SEE ALSO
63
64 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net
65
66 Blosxom Plugin Docs: http://blosxom.sourceforge.net/plugins/
67
68 =head1 BUGS
69
70 None known; please send bug reports and feedback to the Blosxom development mailing list <blosxom-devel@lists.sourceforge.net>.
71
72 =head1 COPYRIGHT
73
74 This program is free software; you can redistribute
75 it and/or modify it under the same terms as Perl itself.
76
77 =cut