]>
git.p6c8.net - selfforum.git/blob - selfforum-cgi/user/fo_view.pl
3 ################################################################################
5 # File: user/fo_view.pl #
7 # Authors: André Malo <nd@o3media.de> #
9 # Description: display the forum main file or a single posting #
11 ################################################################################
22 my $null = $0; $null =~ s/\\/\//g
; # for win :-(
23 $Bin = ($null =~ /^(.*)\/.*$/)?
$1 : '.';
24 $Shared = "$Bin/../shared";
25 $Config = "$Bin/config";
26 $Script = ($null =~ /^.*\/(.*)$/)?
$1 : $null;
29 # $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.';
30 # $Config = "$Bin/../../daten/forum/config";
31 # $Shared = "$Bin/../../cgi-shared";
32 # $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null;
35 # setting umask, remove or comment it, if you don't need
40 use CGI
::Carp
qw(fatalsToBrowser);
45 use Template
::Posting
;
52 ################################################################################
60 sub VERSION
{(q
$Revision$ =~ /([\d.]+)\s*$/)[0] or '0.0'}
67 my $conf = read_script_conf
($Config, $Shared, $Script);
69 my $show = $conf -> {show
};
70 my $show_forum = $show -> {Forum
};
72 my $forum_file = $conf -> {files
} -> {forum
};
74 # check on closed forum
76 my $main = new Lock
($forum_file);
77 if ($main -> masterlocked
) {
79 my $template = new Template
$show_forum -> {templateFile
};
81 $template -> printscrap
(
82 $show_forum -> {assign
} -> {errorDoc
},
83 { $show_forum -> {assign
} -> {errorText
} => $template -> insert
($show_forum -> {assign
} -> {'notAvailable'}) }
88 my $cgi = $show -> {assign
} -> {cgi
};
89 my $tree = $show -> {assign
} -> {thread
};
90 my $adminDefault = read_admin_conf
($conf -> {files
} -> {adminDefault
});
92 my ($tid, $mid) = (param
($cgi -> {thread
}), param
($cgi -> {posting
}));
94 if (defined ($tid) and defined ($mid)) {
95 my $show_posting = $show -> {Posting
};
97 print_posting_as_HTML
(
98 $conf -> {files
} -> {messagePath
},
99 $show_posting -> {templateFile
},
100 { assign
=> $show_posting -> {assign
},
103 adminDefault
=> $adminDefault,
104 messages
=> $conf -> {template
} -> {messages
},
105 form
=> $show_posting -> {form
},
109 cachepath
=> $conf -> {files
} -> {cachePath
}
115 print_forum_as_HTML
(
117 $show_forum -> {templateFile
},
118 { assign
=> $show_forum -> {assign
},
119 adminDefault
=> $adminDefault,
130 ### end of fo_view.pl ##########################################################
patrick-canterino.de