a few more discussion tweaks

This commit is contained in:
JT Smith 2003-10-18 22:02:22 +00:00
parent 0281564473
commit dfd8b046b6
9 changed files with 45 additions and 23 deletions

View file

@ -39,7 +39,14 @@ sub get {
sub getReplies {
my ($self) = @_;
my @replies = ();
my $sth = WebGUI::SQL->read("select forumPostId from forumPost where parentId=".$self->get("forumPostId")." order by forumPostId");
my $query = "select forumPostId from forumPost where parentId=".$self->get("forumPostId")." and ";
if ($self->getThread->getForum->isModerator) {
$query .= "(status='approved' or status='pending' or status='denied'";
} else {
$query .= "(status='approved'";
}
$query .= " or userId=$session{user}{userId}) order by forumPostId";
my $sth = WebGUI::SQL->read($query);
while (my @data = $sth->array) {
push(@replies,WebGUI::Forum::Post->new($data[0]));
}