Revert rss20 to using $ENV{PATH_INFO} in self link.
[blosxom-plugins.git] / general / fullcategory
blob36831e44924336749d28ec91fda8b35d92452061
1 # Blosxom Plugin: fullcategory
2 # Author(s): Mark Ivey <zovirl@zovirl.com>
3 # Version: 0.0.2
4 # Documentation: See the bottom of this file or type: perldoc fullcategory
6 package fullcategory;
8 # --- Configurable variables -----
10 # --------------------------------
12 # print debug messages or not?
13 my $debug = 1;
15 sub start 
17     return 1;
20 sub filter 
22     my($pkg, $files_ref) = @_;
23     
24     my $path = "$blosxom::datadir/$blosxom::path_info";
25     
26     # if there is a flavor, this is a story and we don't have to help blosxom
27     return if ($path =~ m!\.[^/]*?$!); 
28     
29     # the / on the end of $path is what prevents partial matches
30     $path .= "/";
31     $path =~ s!//$!/!;  # remove extra trailing /'s 
33     warn "fullcategory: path is [$path]\n" if $debug >= 1; 
34     
35     foreach my $file (keys %$files_ref)
36     {
37         my $string = "fullcategory: checking file [$file]: ";
38         unless ($file =~ m!^$path!)
39         {
40             delete $files_ref->{$file};
41             $string .= "deleted\n";
42         }
43         else
44         {
45             $string .= "kept\n";
46         }
47         warn $string if $debug >= 1;
48         
49     }
51     return 1;
57 __END__
59 =head1 NAME
61 Blosxom Plug-in: fullcategory
63 =head1 SYNOPSIS
65 Changes blosxom behavior so full category names are required (partial names
66 will no longer work)
68 =head1 VERSION
70 0.0.2
72 =head1 AUTHOR
74 Mark Ivey <zovirl@zovirl.com>, http://zovirl.com
76 This plugin is now maintained by the Blosxom Sourceforge Team,
77 <blosxom-devel@lists.sourceforge.net>.
79 =head1 DESCRIPTION
81 fullcategory fixes blosxom so only complete category names will work.
82 By default, blosxom will return results for partial category name matches.
83 For example, if "telephone" is a category, these would all return posts about
84 telephones:
85 http://example.com/telephone
86 http://example.com/telepho
87 http://example.com/tele
89 (If "television" was also a category, that last example would include
90 posts from both the television & telephone categories)
92 =head1 SEE ALSO
94 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
96 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
98 parsedate() taken from Fletcher T. Penney's entriescache plugin:
99 http://www.blosxom.com/plugins/indexing/entries_cache.htm
101 =head1 BUGS
103 None known; please send bug reports and feedback to the Blosxom
104 development mailing list <blosxom-devel@lists.sourceforge.net>.
106 =head1 LICENSE
108 fullcategory Blosxom Plugin Copyright 2004, Mark Ivey
110 Permission is hereby granted, free of charge, to any person obtaining a
111 copy of this software and associated documentation files (the "Software"),
112 to deal in the Software without restriction, including without limitation
113 the rights to use, copy, modify, merge, publish, distribute, sublicense,
114 and/or sell copies of the Software, and to permit persons to whom the
115 Software is furnished to do so, subject to the following conditions:
117 The above copyright notice and this permission notice shall be included
118 in all copies or substantial portions of the Software.
120 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
121 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
122 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
123 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
124 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
125 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
126 OTHER DEALINGS IN THE SOFTWARE.