]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/shared/Template/Posting.pm
Bugfix to show thread list in deleted postings.
[selfforum.git] / selfforum-cgi / shared / Template / Posting.pm
index 7f0d94022fcba6058dee0c672e8b3c1107ea786c..3f75b8bccaab18c0df689f0ce1843fe352d0ebda 100644 (file)
@@ -4,7 +4,7 @@ package Template::Posting;
 #                                                                              #
 # File:        shared/Template/Posting.pm                                      #
 #                                                                              #
-# Authors:     Andre Malo       <nd@o3media.de>, 2001-06-16                    #
+# Authors:     André Malo <nd@o3media.de>                                      #
 #                                                                              #
 # Description: show HTML formatted posting                                     #
 #                                                                              #
@@ -13,7 +13,6 @@ package Template::Posting;
 use strict;
 use vars qw(
   @EXPORT
-  $VERSION
 );
 
 use Encode::Posting;
@@ -40,7 +39,11 @@ use XML::DOM;
 #
 # 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'}
 
 ################################################################################
 #
@@ -62,11 +65,12 @@ use base qw(Exporter);
 #
 # Return: -none-
 #
-sub print_posting_as_HTML ($$$) {
+sub print_posting_as_HTML ($$$;$) {
   my ($threadpath, $tempfile, $param) = @_;
 
   my $template = new Template $tempfile;
   my $assign = $param -> {assign};
+  my $show_deleted = $param->{showDeleted};
 
   my $view = get_view_params ({
     adminDefault => $param -> {adminDefault}
@@ -102,7 +106,8 @@ sub print_posting_as_HTML ($$$) {
       else {
         my ($mnode, $tnode) = get_message_node ($xml, 't'.$param -> {thread}, 'm'.$param -> {posting});
 
-        unless ($mnode and not $mnode->getAttribute('invisible')) {
+        # do not show if not wanted
+        if(!$mnode || ($mnode->getAttribute('invisible') && !$show_deleted)) { # and not $mnode->getAttribute('invisible')) {
           print ${$template -> scrap (
             $assign -> {errorDoc},
             { $assign -> {errorText} => $template -> insert ($assign -> {'notAvailable'}) }
@@ -254,4 +259,4 @@ sub message_as_HTML ($$$) {
 
 #
 #
-### end of Template::Posting ###################################################
\ No newline at end of file
+### end of Template::Posting ###################################################

patrick-canterino.de