]> git.p6c8.net - selfforum.git/blob - selfforum-cgi/user/fo_arcview.pl
Added support for yearly (month) overview.
[selfforum.git] / selfforum-cgi / user / fo_arcview.pl
1 #!/usr/bin/perl -w
2
3 ################################################################################
4 # #
5 # File: user/fo_arcview.pl #
6 # #
7 # Authors: Frank Schoenmann <fs@tower.de>, 2001-06-02 #
8 # #
9 # Description: archive browser #
10 # #
11 ################################################################################
12
13 use strict;
14 use vars qw(
15 $Bin
16 $Shared
17 $Script
18 $Config
19 );
20
21 BEGIN {
22 my $null = $0; $null =~ s/\\/\//g; # for win :-(
23 $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.';
24 $Shared = "$Bin/../../cgi-shared";
25 $Config = "$Bin/../../cgi-config/forum";
26 $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null;
27
28 # my $null = $0; #$null =~ s/\\/\//g; # for win :-(
29 # $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.';
30 # $Config = "$Bin/../../../cgi-config/devforum";
31 # $Shared = "$Bin/../../../cgi-shared";
32 # $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null;
33 }
34
35 use lib "$Shared";
36 use CGI::Carp qw(fatalsToBrowser);
37
38 use Conf;
39 use Conf::Admin;
40 use Template::Archive qw(
41 print_year_as_HTML
42 print_month_as_HTML
43 print_thread_as_HTML
44 );
45
46 use CGI qw(param header path_info);
47
48 print header(-type => 'text/html');
49
50 my $conf = read_script_conf($Config, $Shared, $Script);
51 my $show = $conf->{'show'};
52 my $cgi = $show->{'assign'}->{'cgi'};
53 my $show_archive = $show->{'Archive'};
54 my $adminDefault = read_admin_conf($conf->{'files'}->{'adminDefault'});
55
56 my ($year, $month, $tid, $mid);
57
58 # tid is thread id, mid is not used yet
59 if (my $path_info = path_info()) {
60 (undef, $year, $month, $tid, $mid) = split "/", $path_info;
61 } else {
62 ($year, $month, $tid, $mid) =
63 (param($cgi->{'year'}), param($cgi->{'month'}), param($cgi->{'thread'}), param($cgi->{'posting'}));
64 }
65
66 if ($year) {
67 if ($month) {
68 if ($tid) {
69 if ($mid) {
70 # print_msg_as_HTML();
71 } else {
72 print_thread_as_HTML(
73 $conf->{'files'}->{'archivePath'} . $year .'/'. $month .'/t'. $tid . '.xml',
74 $show_archive->{'templateFile'},
75 {
76 'assign' => $show_archive->{'assign'},
77 'adminDefault' => $adminDefault,
78 'cgi' => $cgi,
79 'year' => $year,
80 'month' => $month,
81 'thread' => $tid,
82 'posting' => $mid,
83 'tree' => $show->{'assign'}->{'thread'}
84
85 }
86 );
87 }
88 } else {
89 print_month_as_HTML(
90 $conf->{'files'}->{'archivePath'} . $year . '/' . $month . '/' . $conf->{'files'}->{'archiveIndex'},
91 $show_archive->{'templateFile'},
92 {
93 'assign' => $show_archive->{'assign'},
94 'year' => $year,
95 'month' => $month
96 }
97 );
98 }
99 } else {
100 print_year_as_HTML(
101 $conf->{'files'}->{'archivePath'} . $year . '/',
102 $show_archive->{'templateFile'},
103 {
104 'assign' => $show_archive->{'assign'},
105 'year' => $year
106 }
107 );
108 }
109 } else {
110 # print_overview_as_HTML();
111 }
112
113 #
114 #
115 ### end of fo_view.pl ##########################################################

patrick-canterino.de