]> git.p6c8.net - selfforum.git/blob - selfforum-cgi/user/fo_arcview.pl
no comment
[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_month_as_HTML
42 print_thread_as_HTML
43 );
44 #use Template::Forum;
45 #use Template::Posting;
46
47 use CGI qw(param header path_info);
48
49 print header(-type => 'text/html');
50
51 #my $show = $conf->{show};
52 #my $tree = $show->{assign}->{thread};
53
54 #my $forum_file = $conf->{files}->{forum};
55 #my $message_path = $conf->{files}->{messagePath};
56
57 my $conf = read_script_conf($Config, $Shared, $Script);
58 my $show = $conf->{'show'};
59 my $cgi = $show->{'assign'}->{'cgi'};
60 my $show_archive = $show->{'Archive'};
61 my $adminDefault = read_admin_conf($conf->{'files'}->{'adminDefault'});
62
63 my ($year, $month, $tid, $mid);
64
65 # tid is thread id, mid is not used yet
66 if (my $path_info = path_info()) {
67 (undef, $year, $month, $tid, $mid) = split "/", $path_info;
68 } else {
69 ($year, $month, $tid, $mid) =
70 (param($cgi->{'year'}), param($cgi->{'month'}), param($cgi->{'thread'}), param($cgi->{'posting'}));
71 }
72
73 if ($year) {
74 if ($month) {
75 if ($tid) {
76 if ($mid) {
77 # print_msg_as_HTML();
78 } else {
79 print_thread_as_HTML(
80 $conf->{'files'}->{'archivePath'} . $year .'/'. $month .'/t'. $tid . '.xml',
81 # '/home/users/f/fo/fox_two/sf/data/forum/archive/2001/5/t23518',
82 $show_archive->{'templateFile'},
83 {
84 'assign' => $show_archive->{'assign'},
85 'adminDefault' => $adminDefault,
86 'cgi' => $cgi,
87 'year' => $year,
88 'month' => $month,
89 'thread' => $tid,
90 'posting' => $mid,
91 'tree' => $show->{'assign'}->{'thread'}
92
93 }
94 );
95 }
96 } else {
97 print_month_as_HTML(
98 $conf->{'files'}->{'archivePath'} . $year . '/' . $month . '/' . $conf->{'files'}->{'archiveIndex'},
99 $show_archive->{'templateFile'},
100 {
101 'assign' => $show_archive->{'assign'},
102 'year' => $year,
103 'month' => $month
104 }
105 );
106 }
107 } else {
108 # print_year_as_HTML();
109 }
110 } else {
111 # print_overview_as_HTML();
112 }
113
114
115 #if (defined ($tid) and defined ($mid)) {
116 # print_posting_as_HTML (
117 # $message_path,
118 # $show_posting -> {templateFile},
119 # { assign => $show_posting -> {assign},
120 # thread => $tid,
121 # posting => $mid,
122 # adminDefault => $adminDefault,
123 # messages => $conf -> {template} -> {messages},
124 # form => $show_posting -> {form},
125 # cgi => $cgi,
126 # tree => $tree,
127 # firsttime => 1,
128 # cachepath => $conf -> {files} -> {cachePath}
129 # }
130 # );
131 #}
132 #
133 #else {
134 # print_forum_as_HTML (
135 # $forum_file,
136 # $show_forum -> {templateFile},
137 # { assign => $show_forum -> {assign},
138 # adminDefault => $adminDefault,
139 # cgi => $cgi,
140 # tree => $tree
141 # }
142 # );
143 #}
144
145 #
146 #
147 ### end of fo_view.pl ##########################################################

patrick-canterino.de