tagging: Allow using titles in for related stories.
[matthijs/upstream/blosxom-plugins.git] / barijaona / pagetype
1 # Blosxom plugin: pagetype
2 # Author(s): Barijaona Ramaholimihaso
3 # Version: 2006-01-01blosxom2
4 # Documentation: see bottom of file or perldoc title
5
6 package pagetype;
7
8 # ------------------ Config variables ---------------------
9
10 use vars qw($pagetype $static);
11 $pagetype = "" ;
12
13 # ---------------------------------------------------------
14 sub start { 
15 $static = ($blosxom::static_or_dynamic eq 'static');
16 1; }
17
18 sub skip {
19
20         if ($blosxom::path_info_yr ne '' )
21                 {$pagetype = 'chrono' ; }
22         elsif ($static && ( $blosxom::path_info =~ m!^(\d{4})!))
23                 {$pagetype = 'chrono' ; }
24         elsif (($blosxom::path_info =~ /$blosxom::flavour$/) or (($blosxom::path_info =~ /$blosxom::file_extension$/) && $static))
25                 {$pagetype = 'story' ; }
26         elsif ($blosxom::path_info eq "")
27                 {$pagetype = 'main' ; }
28         else
29                 { $pagetype = 'category';};
30
31         # let blosxom continue
32         return undef;
33 }
34
35
36 1;
37
38 __END__
39 =head1 NAME
40
41 Blosxom Plug-in: pagetype
42
43 =head1 SYNOPSIS
44
45 The variable $pagetype::pagetype is to be used with interpolate_fancy.
46
47 You can test it in your templates to know what kind of page Blosxom is currently rendering :
48
49 main : the root of the blog
50 category : a category archive page
51 chrono : a chronological archive page (per year, per month, per day...)
52 story : an individual story page
53
54 =head1 VERSION
55
56 2004-08-22blosxom2
57
58 =head2 CHANGES
59
60 2006-01-01blosxom2 : take into account the corrections of $path_info in recent versions of blosxom.cgi 
61
62 2004-08-22blosxom2 : First published version
63
64 =head1 AUTHOR
65
66 Barijaona Ramaholimihaso <blosxom@barijaona.com>
67
68 =head1 SEE ALSO
69
70 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net
71
72 Blosxom Plugin Docs: http://blosxom.sourceforge.net/plugins/
73
74 =head1 BUGS
75
76 None known; please send bug reports and feedback to the Blosxom development mailing list <blosxom-devel@lists.sourceforge.net>.
77
78 =head1 COPYRIGHT
79
80 This program is free software; you can redistribute
81 it and/or modify it under the same terms as Perl itself.
82
83 =cut