Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pater is a dumbass, and confused arrays with hashrefs

  • Loading branch information...
commit 9e9e055b08816427c6cd0a18466f22d82ecbc87f 1 parent 98f5980
Jon 'CowboyNeal' Pater authored
Showing with 13 additions and 6 deletions.
  1. +13 −6 Slash/Slash.pm
View
19 Slash/Slash.pm
@@ -101,12 +101,6 @@ sub selectComments {
return ( {}, 0 );
}
- if ($constants->{ubb_like_forums} && $user->{mode} eq 'parents') {
- # don't display the comment that describes the forums
- my $forum_desc = $slashdb->getForumFirstPostHashref($header->{id});
- delete $thisComment->{$forum_desc->{cid}};
- }
-
my $max_uid = $reader->countUsers({ max => 1 });
my $reasons = $reader->getReasons();
# We first loop through the comments and assign bonuses and
@@ -144,10 +138,23 @@ sub selectComments {
} @$thisComment;
}
+ my $forum_desc;
+ if ($constants->{ubb_like_forums} && $user->{mode} eq 'parents') {
+ # don't display the comment that describes the forums
+ # we get the comment here and save it for later use
+ $forum_desc = $slashdb->getForumFirstPostHashref($header->{id});
+ }
+
# This loop mainly takes apart the array and builds
# a hash with the comments in it. Each comment is
# is in the index of the hash (based on its cid).
for my $C (@$thisComment) {
+ # If this is a forum, we skip the first comment in a
+ # discussion, since it's the description
+ next if $constants->{ubb_like_forums}
+ && ($user->{mode} eq 'parents')
+ && ($C->{cid} == $forum_desc->{cid});
+
# So we save information. This will only have data if we have
# happened through this cid while it was a pid for another
# comments. -Brian
Please sign in to comment.
Something went wrong with that request. Please try again.