From 1972da7ade862ee58c54513e0c651de07d0e11bc Mon Sep 17 00:00:00 2001 From: fox_two <> Date: Tue, 27 Feb 2001 20:54:19 +0000 Subject: [PATCH] recover_posting(): delete 'invisibility' flag of a posting. --- selfforum-cgi/shared/Posting/Handle.pm | 30 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/selfforum-cgi/shared/Posting/Handle.pm b/selfforum-cgi/shared/Posting/Handle.pm index dd05a40..27c211b 100644 --- a/selfforum-cgi/shared/Posting/Handle.pm +++ b/selfforum-cgi/shared/Posting/Handle.pm @@ -1,5 +1,4 @@ -package Handle; -#package Posting::Handle; +package Posting::Handle; ################################################################################ # # @@ -16,7 +15,7 @@ use strict; use vars qw(@EXPORT); use base qw(Exporter); -@EXPORT = qw(hide_posting); +@EXPORT = qw(hide_posting recover_posting); use Posting::_lib; @@ -29,7 +28,7 @@ use XML::DOM; # Params: $forum Path and filename of forum # $tpath Path to thread files # \%hashref Reference: 'thread', 'posting', 'indexFile' -# Return: Boolean +# Return: -none- # sub hide_posting($$$) { @@ -43,9 +42,30 @@ sub hide_posting($$$) change_posting_visibility($forum, $tid, $mid, 1); } +### recover_posting() ########################################################## +# +# Recover a posting: delete 'invisible' flag +# +# Params: $forum Path and filename of forum +# $tpath Path to thread files +# \%hashref Reference: 'thread', 'posting', 'indexFile' +# Return: -none- +# +sub recover_posting($$$) +{ + my ($forum, $tpath, $info) = @_; + my ($tid, $mid, $indexFile) = ('t' . $info->{'thread'}, + 'm' . $info->{'posting'}, + $info->{'indexFile'}); + + my $tfile = $tpath . '/' . $tid . '.xml'; + change_posting_visibility($tfile, $tid, $mid, 0); + change_posting_visibility($forum, $tid, $mid, 0); +} + ### change_posting_visibility () ############################################### # -# -desc- +# Set a postings visibility flag to $invisible # # Params: $fname Filename # $tid Thread ID -- 2.34.1