]> git.p6c8.net - selfforum.git/blob - selfforum-cgi/user/fo_arcview.pl
added methods: joinlist, printscrap and scrap2file
[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 $VERSION
20 );
21
22 BEGIN {
23 my $null = $0; $null =~ s/\\/\//g; # for win :-(
24 $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.';
25 $Shared = "$Bin/../../cgi-shared";
26 $Config = "$Bin/../../cgi-config/forum";
27 $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null;
28
29 # my $null = $0;
30 # $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.';
31 # $Config = "$Bin/../../daten/forum/config";
32 # $Shared = "$Bin/../../cgi-shared";
33 # $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null;
34 }
35
36 # setting umask, remove or comment it, if you don't need
37 #
38 umask 006;
39
40 use lib "$Shared";
41 use CGI::Carp qw(fatalsToBrowser);
42
43 use Conf;
44 use Conf::Admin;
45 use Template::Archive qw(
46 print_overview_as_HTML
47 print_year_as_HTML
48 print_month_as_HTML
49 print_thread_as_HTML
50 );
51
52 use CGI qw(param header path_info);
53
54 # Version check
55 #
56 $VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
57
58 print header(-type => 'text/html');
59
60 my $conf = read_script_conf($Config, $Shared, $Script);
61 my $show = $conf->{'show'};
62 my $cgi = $show->{'assign'}->{'cgi'};
63 my $show_archive = $show->{'Archive'};
64 my $adminDefault = read_admin_conf($conf->{'files'}->{'adminDefault'});
65
66 my ($year, $month, $tid, $mid);
67
68 # tid is thread id, mid is not used yet
69 if (my $path_info = path_info()) {
70 (undef, $year, $month, $tid, $mid) = split "/", $path_info;
71 } else {
72 ($year, $month, $tid, $mid) =
73 (param($cgi->{'year'}), param($cgi->{'month'}), param($cgi->{'thread'}), param($cgi->{'posting'}));
74 }
75
76 if ($year) {
77 if ($month) {
78 if ($tid) {
79 if ($mid) {
80 # print_msg_as_HTML();
81 } else {
82 print_thread_as_HTML(
83 $conf->{'files'}->{'archivePath'} . $year .'/'. $month .'/t'. $tid . '.xml',
84 $show_archive->{'templateFile'},
85 {
86 'assign' => $show_archive->{'assign'},
87 'adminDefault' => $adminDefault,
88 'cgi' => $cgi,
89 'year' => $year,
90 'month' => $month,
91 'thread' => $tid,
92 'posting' => $mid,
93 'tree' => $show->{'assign'}->{'thread'}
94
95 }
96 );
97 }
98 } else {
99 print_month_as_HTML(
100 $conf->{'files'}->{'archivePath'} . $year . '/' . $month . '/' . $conf->{'files'}->{'archiveIndex'},
101 $show_archive->{'templateFile'},
102 {
103 'assign' => $show_archive->{'assign'},
104 'year' => $year,
105 'month' => $month
106 }
107 );
108 }
109 } else {
110 print_year_as_HTML(
111 $conf->{'files'}->{'archivePath'} . $year . '/',
112 $show_archive->{'templateFile'},
113 {
114 'assign' => $show_archive->{'assign'},
115 'year' => $year
116 }
117 );
118 }
119 } else {
120 print_overview_as_HTML(
121 $conf->{'files'}->{'archivePath'},
122 $show_archive->{'templateFile'},
123 {
124 'assign' => $show_archive->{'assign'}
125 }
126 );
127 }
128
129 #
130 #
131 ### end of fo_view.pl ##########################################################

patrick-canterino.de