]> git.p6c8.net - selfforum.git/blob - selfforum-cgi/user/fo_view.pl
0aefde4c943097b2e0884875cbdad29d560a15b0
[selfforum.git] / selfforum-cgi / user / fo_view.pl
1 #!/usr/bin/perl
2
3 use strict;
4
5 use vars qw($Bin $Shared $Script);
6
7 BEGIN {
8 my $null = $0; $null =~ s/\\/\//g; # for win :-(
9 ($Bin) = ($null =~ /^(.*)\/.*$/)? $1 : '.';
10 $Shared = "$Bin/../shared";
11 ($Script) = ($null =~ /^.*\/(.*)$/)? $1 : $null;
12 }
13
14 use lib "$Shared";
15 use CGI::Carp qw(fatalsToBrowser);
16
17 use Conf;
18 use Conf::Admin;
19 use Template::Forum;
20 use Template::Posting;
21
22 use CGI qw(param header);
23
24 print header(-type => 'text/html');
25
26 my $conf = read_script_conf ($Bin, $Shared, $Script);
27
28 #$conf -> {wwwRoot} = 'i:/i_selfhtml/htdocs' unless ($ENV{GATEWAY_INTERFACE} =~ /CGI/);
29
30 my $show = $conf -> {show};
31 my $show_forum = $show -> {Forum};
32 my $show_posting = $show -> {Posting};
33 my $cgi = $show -> {assign} -> {cgi};
34 my $tree = $show -> {assign} -> {thread};
35 my $adminDefault = read_admin_conf ($conf -> {files} -> {adminDefault});
36
37 my $forum_file = $conf -> {files} -> {forum};
38 my $message_path = $conf -> {files} -> {messagePath};
39
40 #use Lock qw(:ALL);release_file($forum_file);die;
41
42 my ($tid, $mid) = (param ($cgi -> {thread}), param ($cgi -> {posting}));
43
44 if (defined ($tid) and defined ($mid)) {
45 print_posting_as_HTML ($message_path,
46 $show_posting -> {templateFile},
47 {assign => $show_posting -> {assign},
48 thread => $tid,
49 posting => $mid,
50 adminDefault => $adminDefault,
51 messages => $show_posting -> {messages},
52 form => $show_posting -> {form},
53 cgi => $cgi,
54 tree => $tree
55 });}
56
57 else {
58 print_forum_as_HTML ($forum_file,
59 $show_forum -> {templateFile},
60 {assign => $show_forum -> {assign},
61 adminDefault => $adminDefault,
62 cgi => $cgi,
63 tree => $tree
64 });}
65 # eos

patrick-canterino.de