]> git.p6c8.net - selfforum.git/blob - selfforum-cgi/user/fo_arcview.pl
46bd8e91e82afd1f9c9176b83d4d4b2b9a5215a2
[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_overview_as_HTML
42 print_year_as_HTML
43 print_month_as_HTML
44 print_thread_as_HTML
45 );
46
47 use CGI qw(param header path_info);
48
49 print header(-type => 'text/html');
50
51 my $conf = read_script_conf($Config, $Shared, $Script);
52 my $show = $conf->{'show'};
53 my $cgi = $show->{'assign'}->{'cgi'};
54 my $show_archive = $show->{'Archive'};
55 my $adminDefault = read_admin_conf($conf->{'files'}->{'adminDefault'});
56
57 my ($year, $month, $tid, $mid);
58
59 # tid is thread id, mid is not used yet
60 if (my $path_info = path_info()) {
61 (undef, $year, $month, $tid, $mid) = split "/", $path_info;
62 } else {
63 ($year, $month, $tid, $mid) =
64 (param($cgi->{'year'}), param($cgi->{'month'}), param($cgi->{'thread'}), param($cgi->{'posting'}));
65 }
66
67 if ($year) {
68 if ($month) {
69 if ($tid) {
70 if ($mid) {
71 # print_msg_as_HTML();
72 } else {
73 print_thread_as_HTML(
74 $conf->{'files'}->{'archivePath'} . $year .'/'. $month .'/t'. $tid . '.xml',
75 $show_archive->{'templateFile'},
76 {
77 'assign' => $show_archive->{'assign'},
78 'adminDefault' => $adminDefault,
79 'cgi' => $cgi,
80 'year' => $year,
81 'month' => $month,
82 'thread' => $tid,
83 'posting' => $mid,
84 'tree' => $show->{'assign'}->{'thread'}
85
86 }
87 );
88 }
89 } else {
90 print_month_as_HTML(
91 $conf->{'files'}->{'archivePath'} . $year . '/' . $month . '/' . $conf->{'files'}->{'archiveIndex'},
92 $show_archive->{'templateFile'},
93 {
94 'assign' => $show_archive->{'assign'},
95 'year' => $year,
96 'month' => $month
97 }
98 );
99 }
100 } else {
101 print_year_as_HTML(
102 $conf->{'files'}->{'archivePath'} . $year . '/',
103 $show_archive->{'templateFile'},
104 {
105 'assign' => $show_archive->{'assign'},
106 'year' => $year
107 }
108 );
109 }
110 } else {
111 print_overview_as_HTML(
112 $conf->{'files'}->{'archivePath'},
113 $show_archive->{'templateFile'},
114 {
115 'assign' => $show_archive->{'assign'}
116 }
117 );
118 }
119
120 #
121 #
122 ### end of fo_view.pl ##########################################################

patrick-canterino.de