]>
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/../../cgi-config/forum";
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
};
71 my $show_posting = $show -> {Posting
};
72 my $cgi = $show -> {assign
} -> {cgi
};
73 my $tree = $show -> {assign
} -> {thread
};
74 my $adminDefault = read_admin_conf
($conf -> {files
} -> {adminDefault
});
76 my $forum_file = $conf -> {files
} -> {forum
};
77 my $message_path = $conf -> {files
} -> {messagePath
};
79 my ($tid, $mid) = (param
($cgi -> {thread
}), param
($cgi -> {posting
}));
81 if (defined ($tid) and defined ($mid)) {
82 print_posting_as_HTML
(
84 $show_posting -> {templateFile
},
85 { assign
=> $show_posting -> {assign
},
88 adminDefault
=> $adminDefault,
89 messages
=> $conf -> {template
} -> {messages
},
90 form
=> $show_posting -> {form
},
94 cachepath
=> $conf -> {files
} -> {cachePath
}
100 print_forum_as_HTML
(
102 $show_forum -> {templateFile
},
103 { assign
=> $show_forum -> {assign
},
104 adminDefault
=> $adminDefault,
113 ### end of fo_view.pl ##########################################################
patrick-canterino.de