Replace atomfeed $feed_url with $path_info_full, for correct self links.
[blosxom-plugins.git] / barijaona / pagetype
blob961e23793e9bd94fa7a55e383362e9b4a270009c
1 # Blosxom plugin: pagetype
2 # Author(s): Barijaona Ramaholimihaso
3 # Version: 2006-01-01blosxom2
4 # Documentation: see bottom of file or perldoc title
6 package pagetype;
8 # ------------------ Config variables ---------------------
10 use vars qw($pagetype $static);
11 $pagetype = "" ;
13 # ---------------------------------------------------------
14 sub start { 
15 $static = ($blosxom::static_or_dynamic eq 'static');
16 1; }
18 sub skip {
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';};
31         # let blosxom continue
32         return undef;
38 __END__
39 =head1 NAME
41 Blosxom Plug-in: pagetype
43 =head1 SYNOPSIS
45 The variable $pagetype::pagetype is to be used with interpolate_fancy.
47 You can test it in your templates to know what kind of page Blosxom is currently rendering :
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
54 =head1 VERSION
56 2004-08-22blosxom2
58 =head2 CHANGES
60 2006-01-01blosxom2 : take into account the corrections of $path_info in recent versions of blosxom.cgi 
62 2004-08-22blosxom2 : First published version
64 =head1 AUTHOR
66 Barijaona Ramaholimihaso <blosxom@barijaona.com>
68 =head1 SEE ALSO
70 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net
72 Blosxom Plugin Docs: http://blosxom.sourceforge.net/plugins/
74 =head1 BUGS
76 None known; please send bug reports and feedback to the Blosxom development mailing list <blosxom-devel@lists.sourceforge.net>.
78 =head1 COPYRIGHT
80 This program is free software; you can redistribute
81 it and/or modify it under the same terms as Perl itself.
83 =cut