diff --git a/config/vanilla/bootstrap.before.php b/config/vanilla/bootstrap.before.php
index a5a07e8..db34b93 100644
--- a/config/vanilla/bootstrap.before.php
+++ b/config/vanilla/bootstrap.before.php
@@ -883,26 +883,30 @@ function writeInlineDiscussionOptions($discussionRow) {
echo '
';
- // Write the items.
+ $sender = Gdn::controller();
+
+ $sender->EventArguments['Object'] = $discussionRow;
+ $sender->EventArguments['Type'] = 'Discussion';
+ $sender->fireEvent('BeforeInlineDiscussionOptions');
+
// DropdownModule
$discussionDropdown = getDiscussionOptionsDropdown($discussionRow);
// Allow plugins to edit the dropdown.
- $sender = Gdn::controller();
$sender->EventArguments['DiscussionOptions'] = &$discussionDropdown ;
$sender->EventArguments['Discussion'] = $discussionRow;
$sender->fireEvent('InlineDiscussionOptions');
- $discussionDropdownItems = $discussionDropdown->toArray()['items'];
+ $discussionDropdownItems = $discussionDropdown->toArray()['items'];
- unset($discussionDropdownItems['announce']);
- unset($discussionDropdownItems['sink']);
- unset($discussionDropdownItems['close']);
- unset($discussionDropdownItems['dismiss']);
- unset($discussionDropdownItems['move']);
- unset($discussionDropdownItems['tag']);
+ unset($discussionDropdownItems['announce']);
+ unset($discussionDropdownItems['sink']);
+ unset($discussionDropdownItems['close']);
+ unset($discussionDropdownItems['dismiss']);
+ unset($discussionDropdownItems['move']);
+ unset($discussionDropdownItems['tag']);
- if (!empty($discussionDropdownItems) && is_array($discussionDropdownItems)) {
+ if (!empty($discussionDropdownItems) && is_array($discussionDropdownItems)) {
array_walk($discussionDropdownItems, function(&$value, $key) {
$anchor = anchor($value['text'], $value['url'], val('cssClass', $value, $key));
$value = '
'.$anchor.'';
@@ -926,6 +930,11 @@ function writeInlineCommentOptions($comment) {
echo '
';
echo '
';
+ $sender = Gdn::controller();
+ $sender->EventArguments['Object'] = $comment;
+ $sender->EventArguments['Type'] = 'Comment';
+ $sender->fireEvent('BeforeInlineCommentOptions');
+
// Write the items.
$items = getCommentOptions($comment);
if (!empty($items) && is_array($items)) {
diff --git a/config/vanilla/config.php b/config/vanilla/config.php
index 731eb9f..6b0b919 100644
--- a/config/vanilla/config.php
+++ b/config/vanilla/config.php
@@ -26,6 +26,7 @@
$Configuration['EnabledPlugins']['stubcontent'] = false;
$Configuration['EnabledPlugins']['Topcoder'] = true;
$Configuration['EnabledPlugins']['TopcoderEditor'] = true;
+$Configuration['EnabledPlugins']['Voting'] = true;
$Configuration['EnabledPlugins']['rich-editor'] = true;
$Configuration['EnabledPlugins']['editor'] = false;
$Configuration['EnabledPlugins']['emojiextender'] = true;
diff --git a/vanilla/applications/vanilla/models/class.discussionmodel.php b/vanilla/applications/vanilla/models/class.discussionmodel.php
index a953cb9..d6007bb 100644
--- a/vanilla/applications/vanilla/models/class.discussionmodel.php
+++ b/vanilla/applications/vanilla/models/class.discussionmodel.php
@@ -64,8 +64,11 @@ class DiscussionModel extends Gdn_Model {
protected static $allowedSorts = [
'hot' => ['key' => 'hot', 'name' => 'Hot', 'orderBy' => ['DateLastComment' => 'desc']],
'top' => ['key' => 'top', 'name' => 'Top', 'orderBy' => ['Score' => 'desc', 'DateInserted' => 'desc']],
+ 'views' => ['key' => 'views', 'name' => 'Top Views', 'orderBy' => ['CountViews' => 'desc', 'DateInserted' => 'desc']],
+ 'comments' => ['key' => 'comments', 'name' => 'Top Comments', 'orderBy' => ['CountComments' => 'desc', 'DateInserted' => 'desc']],
'new' => ['key' => 'new', 'name' => 'New', 'orderBy' => ['LastDiscussionCommentsDate' => 'desc']],
- 'old' => ['key' => 'old', 'name' => 'Old', 'orderBy' => ['LastDiscussionCommentsDate' => 'asc']]
+ 'old' => ['key' => 'old', 'name' => 'Old', 'orderBy' => ['LastDiscussionCommentsDate' => 'asc']],
+ 'name' => ['key' => 'name', 'name' => 'Title', 'orderBy' => ['Name' => 'asc']]
];
/**