Skip to content

Commit 833deaf

Browse files
committed
Issues-163: don't navigate to the latest comment
1 parent 2aa55da commit 833deaf

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

config/vanilla/config.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,7 @@
180180
$Configuration['Vanilla']['Activity']['SpamLock'] = '120';
181181
$Configuration['Vanilla']['ActivityComment']['SpamCount'] = '5';
182182
$Configuration['Vanilla']['ActivityComment']['SpamTime'] = '60';
183-
$Configuration['Vanilla']['ActivityComment']['SpamLock'] = '120';
183+
$Configuration['Vanilla']['ActivityComment']['SpamLock'] = '120';
184+
185+
// Should users be automatically pushed to the last comment they read in a discussion?
186+
$Configuration['Vanilla']['Comments']['AutoOffset'] = false;

vanilla/applications/vanilla/views/discussion/index.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,25 @@
2727
$this->fireEvent('AfterPageTitle');
2828

2929
// Write the initial discussion.
30-
include $this->fetchViewLocation('discussion', 'discussion');
31-
echo '</div>'; // close discussion wrap
32-
$this->fireEvent('AfterDiscussion');
30+
if ($this->data('Page') == 1) {
31+
include $this->fetchViewLocation('discussion', 'discussion');
32+
echo '</div>'; // close discussion wrap
3333

34+
$this->fireEvent('AfterDiscussion');
35+
} else {
36+
?>
37+
<div class="Item ItemDiscussion">
38+
<div class="Item-BodyWrap">
39+
<div class="Item-Body">
40+
<?php
41+
Gdn::controller()->fireEvent('Replies');
42+
?>
43+
</div>
44+
</div>
45+
</div>
46+
<?php
47+
echo '</div>'; // close discussion wrap
48+
}
3449

3550
echo '<div class="CommentsWrap">';
3651

0 commit comments

Comments
 (0)