+ }elsif($board){ #List threads in this board
+ $BODY->param(ViewBoard => 1);
+ $BODY->param(Title => $board->{board});
+ $BODY->param(Post => $board->{post});
+ $BODY->param(Moderate => $board->{moderate});
+ $BODY->param(Id => $board->{id});
+ $BODY->param(FBID => $board->{id});
+ $BODY->param(Board => $board->{board});
+ my ($time) = $DBH->selectrow_array('SELECT now()::timestamp',undef);
+ $BODY->param(Date => $time);
+ $threads->execute($board->{id},$ND::UID,0) or $ND::ERROR .= p($DBH->errstr);
+ my $i = 0;
+ my @threads;
+ while (my $thread = $threads->fetchrow_hashref){
+ $i++;
+ $thread->{Odd} = $i % 2;
+ push @threads,$thread;
+ }
+ $BODY->param(Threads => \@threads);
+
+ if ($board->{moderate}){
+ $categories->execute or $ND::ERROR .= p($DBH->errstr);
+ my @categories;
+ while (my $category = $categories->fetchrow_hashref){
+ $boards->execute($category->{id},$ND::UID) or $ND::ERROR .= p($DBH->errstr);
+ if ($category->{id} == $board->{fcid}){
+ $BODY->param(Category => $category->{category});
+ }
+
+ my @boards;
+ while (my $b = $boards->fetchrow_hashref){
+ next if (not $b->{post} or $b->{id} == $board->{id});
+ delete $b->{post};
+ push @boards,$b;
+ }
+ $category->{Boards} = \@boards;
+ delete $category->{id};
+ push @categories,$category if @boards;
+ }
+ $BODY->param(Categories => \@categories);
+ }
+