forked from bentglasstube/blosxom-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrop_path-v1i0b
41 lines (28 loc) · 867 Bytes
/
crop_path-v1i0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Blosxom Plugin: crop_path
# Author(s): Tony Williams <[email protected]> http://honestpuck.com/
# Version: 1.0b
# Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
# Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
# Copyright 2003 Tony Williams
# Released under the same License as Blosxom
package crop_path;
use CGI qw/:standard/;
# --- Configurable variables -----
# the number of bits you want
$length = 1;
# what you want at the start
$prefix = '/';
# what you want between bits
$path_sep = '/';
# --------------------------------
$path; # use as $crop_path::path in flavour templates
sub start {
1;
}
sub date {
my ($pkg, $date_ref, $mtime, $dw,$mo,$mo_num,$da,$ti,$yr) = @_;
@bits = split('/', $blosxom::path);
@pbits = splice(@bits, 0 - 1, 1);
$path = $prefix . join($path_sep, @pbits);
}
1;