Skip to content

Commit

Permalink
Big bugfix - this allows users to post to discussions that don't already
Browse files Browse the repository at this point in the history
have any comments.  The bug was that the menu data and "Reply" button
were disabled so there was no (obvious) way to start the first comment.
Oops.
  • Loading branch information
jamiemccarthy committed Jun 20, 2002
1 parent 3f18084 commit 922169d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Slash/Slash.pm
Expand Up @@ -92,12 +92,7 @@ sub selectComments {
$cid,
$cache_read_only
);
# i don't know why this line had || !@$thisComment, but it
# breaks things (most notably, things relying on hitparade,
# like slash:hitparade in rss, selectThreshold in comments,
# etc.) when there are no comments YET, but the discussion
# is valid -- pudge
if (!$thisComment) { #|| !@$thisComment) {
if (!$thisComment) {
_print_cchp($header);
return ( {}, 0 );
}
Expand Down Expand Up @@ -191,6 +186,8 @@ sub selectComments {

# Cascade comment point totals down to the lowest score, so
# (2, 1, 3, 5, 4, 2, 1) becomes (18, 16, 15, 12, 7, 3, 1).
# We do a bit of a weird thing here, returning this data in
# the fields for a fake comment with "cid 0"...
for my $x (reverse(0..$num_scores-2)) {
$comments->{0}{totals}[$x] += $comments->{0}{totals}[$x + 1];
}
Expand Down Expand Up @@ -262,7 +259,7 @@ sub reparentComments {

# You know, we do assume comments are linear -Brian
for my $x (sort { $a <=> $b } keys %$comments) {
next if $x == 0;
next if $x == 0; # exclude the fake "cid 0" comment

my $pid = $comments->{$x}{pid};
my $reparent;
Expand Down Expand Up @@ -417,9 +414,10 @@ sub printComments {

# Should I index or just display normally?
my $cc = 0;
if ($comments->{$cidorpid} && $comments->{$cidorpid}{visiblekids}) {
$cc = $comments->{$cidorpid}{visiblekids};
}
$cc = $comments->{$cidorpid}{visiblekids}
if $cidorpid
&& $comments->{$cidorpid}
&& $comments->{$cidorpid}{visiblekids};

$lvl++ if $user->{mode} ne 'flat' && $user->{mode} ne 'archive'
&& $cc > $user->{commentspill}
Expand Down

0 comments on commit 922169d

Please sign in to comment.