diff --git a/lib/WebGUI/Discussion.pm b/lib/WebGUI/Discussion.pm index 21cb97a3d..b6dc8886b 100644 --- a/lib/WebGUI/Discussion.pm +++ b/lib/WebGUI/Discussion.pm @@ -398,13 +398,15 @@ sub showMessage { .'">'.WebGUI::International::get(577).'
'; } @data = WebGUI::SQL->quickArray("select max(messageId) from discussion - where wobjectId=$message{wobjectId} and pid=0 and messageId<$message{rid}".$sqlAdd); + where wobjectId=$message{wobjectId} and pid=0 and messageId<$message{rid} + and (userId=$session{user}{userId} or status='Approved') ".$sqlAdd); if ($data[0] ne "") { $html .= '« '.WebGUI::International::get(513).'
'; } @data = WebGUI::SQL->quickArray("select min(messageId) from discussion - where wobjectId=$message{wobjectId} and pid=0 and messageId>$message{rid}".$sqlAdd); + where wobjectId=$message{wobjectId} and pid=0 and messageId>$message{rid} + and (userId=$session{user}{userId} or status='Approved')".$sqlAdd); if ($data[0] ne "") { $html .= ''.WebGUI::International::get(512).' »
';