tagging: Allow using titles in for related stories.
[matthijs/upstream/blosxom-plugins.git] / general / fauxami
1 # Blosxom Plugin: fauxami
2 # Author(s): Rael Dornfest <rael@oreilly.com> 
3 # Version: 2.0b4
4 # Documentation: See the bottom of this file or type: perldoc whoami
5
6 package fauxami;
7
8 # --- Configurable variables -----
9
10 # What should I consider a delimiter between poster's name 
11 # and the rest of the filename (e.g. . for jack.story1.txt)?
12 my $delimiter = '\.';
13
14 # What should I fall back to as the default name (leave blank for none)?
15 my $default_name = '';
16
17 # --------------------------------
18
19 $name;
20
21 use File::stat;
22
23 sub start {
24   1;
25 }
26
27 sub story {
28   my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
29
30   $name = $filename =~ m!^(.+)$delimiter(.+)$! ? $1 : $default_name;
31
32   1;
33 }
34
35 1;
36
37 __END__
38
39 =head1 NAME
40
41 Blosxom Plug-in: fauxami
42
43 =head1 SYNOPSIS
44
45 Populates $fauxami::name with the "name" of the person
46 posting the weblog entry, using anything before a specified delimiter
47 ( the default is . ) as the "name."  So, jack.story1.txt would yield
48 a $fauxami::name of jack and jill.story2.txt would yield a $fauxami::name
49 of jill.
50
51 You can optionally provide a $default_name, used when no faux name is
52 specified.
53
54 =head1 VERSION
55
56 2.0b4
57
58 Version number coincides with the version of Blosxom with which the 
59 current version was first bundled.
60
61 =head1 AUTHOR
62
63 Rael Dornfest  <rael@oreilly.com>, http://www.raelity.org/
64
65 This plugin is now maintained by the Blosxom Sourceforge Team,
66 <blosxom-devel@lists.sourceforge.net>.
67
68 =head1 SEE ALSO
69
70 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
71
72 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
73
74 =head1 BUGS
75
76 None known; please send bug reports and feedback to the Blosxom
77 development mailing list <blosxom-devel@lists.sourceforge.net>.
78
79 =head1 LICENSE
80
81 Blosxom and this Blosxom Plug-in
82 Copyright 2003, Rael Dornfest 
83
84 Permission is hereby granted, free of charge, to any person obtaining a
85 copy of this software and associated documentation files (the "Software"),
86 to deal in the Software without restriction, including without limitation
87 the rights to use, copy, modify, merge, publish, distribute, sublicense,
88 and/or sell copies of the Software, and to permit persons to whom the
89 Software is furnished to do so, subject to the following conditions:
90
91 The above copyright notice and this permission notice shall be included
92 in all copies or substantial portions of the Software.
93
94 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
95 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
96 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
97 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
98 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
99 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
100 OTHER DEALINGS IN THE SOFTWARE.