diff --git a/lib/WebGUI/Discussion.pm b/lib/WebGUI/Discussion.pm index 1d5bb6aa6..7945c9402 100644 --- a/lib/WebGUI/Discussion.pm +++ b/lib/WebGUI/Discussion.pm @@ -347,13 +347,10 @@ sub showReplyTree { sub showThreads { my ($sth, %data, $html, $sql); $sql = "select * from discussion where wobjectId=$session{form}{wid}"; - if ($session{form}{sid}) { - $sql .= " and subId=$session{form}{sid}"; - } - $sql .= " and pid=0"; + $sql .= " and subId=$session{form}{sid}" if ($session{form}{sid}); $html .= ''; if ($session{user}{discussionLayout} eq "threaded") { - $sql .= " order by dateOfPost desc"; + $sql .= " and pid=0 order by dateOfPost desc"; $sth = WebGUI::SQL->read($sql); $html .= '
'.WebGUI::International::get(229).' '.WebGUI::International::get(244).'