Skip to content

Commit

Permalink
discussion2 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Mar 29, 2006
1 parent cb9dbae commit 2082d04
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
28 changes: 19 additions & 9 deletions Slash/Slash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,8 @@ sub displayThread {
my $hidden = my $skipped = 0;
my $return = '';

my $discussion2 = $user->{discussion2} && $user->{discussion2} eq 'slashdot';

# FYI: 'archive' means we're to write the story to .shtml at the close
# of the discussion without page breaks. 'metamod' means we're doing
# metamoderation.
Expand Down Expand Up @@ -1121,26 +1123,33 @@ sub displayThread {
# ahead more, counting all the visible kids. --Pater
$skipped += $comment->{totalvisiblekids} if ($user->{mode} eq 'flat' || $user->{mode} eq 'nested');
$form->{startat} ||= 0;
next if $skipped <= $form->{startat};
next if $skipped <= $form->{startat} && !$discussion2;
$form->{startat} = 0; # Once We Finish Skipping... STOP

my $class = 'oneline';
if ($comment->{points} < $user->{threshold}) {
if ($user->{is_anon} || ($user->{uid} != $comment->{uid})) {
$hidden++;
next;
if ($discussion2) {
$class = 'hidden';
} else {
$hidden++;
next;
}
}
}

my $highlight = 1 if $comment->{points} >= $user->{highlightthresh};
$class = 'full' if $full || $highlight;
my $finish_list = 0;

if ($full || $highlight) {
if ($full || $highlight || $discussion2) {
if ($lvl && $indent) {
$return .= $const->{tablebegin} .
dispComment($comment) . $const->{tableend};
dispComment($comment, { class => $class }) .
$const->{tableend};
$cagedkids = 0;
} else {
$return .= dispComment($comment);
$return .= dispComment($comment, { class => $class });
}
$displayed++;
} else {
Expand All @@ -1165,11 +1174,11 @@ sub displayThread {
}

$return .= "$const->{commentend}" if $finish_list;
$return .= "$const->{fullcommentend}" if (($full || $highlight) && $user->{mode} ne 'flat');
$return .= "$const->{fullcommentend}" if (($full || $highlight || $discussion2) && $user->{mode} ne 'flat');

last if $displayed >= $user->{commentlimit};
last if $displayed >= $user->{commentlimit} && !$discussion2;
}
if ($hidden
if ($hidden && !$discussion2
&& ! $user->{hardthresh}
&& $user->{mode} ne 'archive'
&& $user->{mode} ne 'metamod') {
Expand Down Expand Up @@ -1298,6 +1307,7 @@ EOT
reasons => $reasons,
can_mod => $can_mod,
is_anon => isAnon($comment->{uid}),
class => $options->{class}
}, { Return => 1, Nocomm => 1 });
}

Expand Down
7 changes: 7 additions & 0 deletions themes/slashcode/htdocs/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,10 @@ cursor: pointer;
.show { display: inline; }


.comment > .hidden { display: none }
.comment > .full { display: inline }
.comment > .oneline { display: inline }
.comment > .oneline .details, .oneline .commentBody, .oneline .commentSub {
display: none;
}

8 changes: 4 additions & 4 deletions themes/slashcode/templates/dispComment;misc;default
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ __name__
dispComment
__template__
<li id="[% cid %]_tree" class="comment">
<div id="[% cid %]_comment">
<div id="[% cid %]_comment"[% IF user.discussion2 && (user.discussion2 == "slashdot" || user.discussion2 == "uofm") %] class="[% class %]"[% END %]>
<div class="commentTop">
<div class="title">
[% IF user.discussion2 && (user.discussion2 == "slashdot" || user.discussion2 == "uofm") %]
<script type="text/javascript">
displaymode[[% cid %]] = "full";
futuredisplaymode[[% cid %]] = "full";
displaymode[[% cid %]] = "[% class %]";
futuredisplaymode[[% cid %]] = "[% class %]";
</script>
<h4><a name="[% cid %]" onclick="setFocusComment(-[% cid %])">[% subject %]</a></h4>
<h4><a id="comment_link_[% cid %]" name="comment_link_[% cid %]" href="javascript:setFocusComment([% class == 'full' ? '-' : ''; cid %]);">[% subject %]</a></h4>
[% ELSE %]
<h4><a name="[% cid %]">[% subject %]</a></h4>
[% END %]
Expand Down

0 comments on commit 2082d04

Please sign in to comment.