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

patrick-canterino.de