# #
# File: shared/Template/Forum.pm #
# #
-# Authors: André Malo <nd@o3media.de>, 2001-06-16 #
+# Authors: André Malo <nd@o3media.de> #
# #
# Description: print Forum main file to STDOUT #
# #
use strict;
use vars qw(
@EXPORT
- $VERSION
);
-use Lock qw(:READ);
+use Lock;
use Encode::Plain; $Encode::Plain::utf8 = 1;
use Posting::_lib qw(
get_all_threads
#
# Version check
#
-$VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+# last modified:
+# $Date$ (GMT)
+# by $Author$
+#
+sub VERSION {(q$Revision$ =~ /([\d.]+)\s*$/)[0] or '0.0'}
################################################################################
#
my $template = new Template $tempfile;
my ($threads, $stat);
+ my $main = new Lock ($mainfile);
- unless ($stat = lock_file ($mainfile)) {
- if (defined $stat) {
- violent_unlock_file ($mainfile);
+ unless ($main -> lock (LH_SHARED)) {
+ unless ($main -> masterlocked) {
print ${$template -> scrap (
$assign -> {errorDoc},
{ $assign -> {errorText} => $template -> insert ($assign -> {'occupied'}) }
#
eval {setpriority 0,0,1};
- $threads = get_all_threads ($mainfile, $param -> {showDeleted}, $view -> {sortedMsg});
- violent_unlock_file ($mainfile) unless (unlock_file ($mainfile));
+ $threads = get_all_threads ($main -> filename, $param -> {showDeleted}, $view -> {sortedMsg});
+ $main -> unlock;
print ${$template -> scrap (
$assign -> {mainDocStart},
for (@threads) {
$tpar -> {thread} = "$_";
- $|++;
print ${html_thread ($threads -> {$_}, $template, $tpar)},"\n",'<dd> </dd>',"\n";}
print "</dl>\n",${$template -> scrap ($assign -> {mainDocEnd})};}