Currently that was not possible to configure from the module setting, but you can try add following code in this file location and see how it goes?
JoomlaFolder/administrator/components/com_easydiscuss/models/posts.php
// LINE 3226 until 3289
public function getMostVoted($limit, $options = array())
{
$count = isset($limit) ? $limit : 10;
$includeReplies = isset($options['includeReplies']) ? $options['includeReplies'] : null;
$db = ED::db();
$queryExclude = '';
$excludeCats = ED::getPrivateCategories();
if (!empty($excludeCats)) {
$queryExclude .= ' AND a.`category_id` NOT IN (' . implode(',', $excludeCats) . ')';
}
// posts
$query = 'select a.`isresolve`, a.`id`, a.`user_id`, a.`user_type`, a.`poster_name`, a.`title`, a.`id` as `parent_id`, a.category_id,';
$query .= ' (select count(1) from `#__discuss_votes` as b1 where b1.`post_id` = a.`id`) as `VotedCnt`, count( c.id ) as `num_replies`';
$query .= ' from `#__discuss_posts` as a ';
$query .= ' left join `#__discuss_posts` as c on a.`id` = c.`parent_id`';
$query .= ' and c.`published` = 1';
$query .= ' inner join `#__discuss_votes` as b on a.`id` = b.`post_id`';
$query .= ' where a.`parent_id` = 0';
$query .= ' and a.`published` = 1';
if (!empty($excludeCats)) {
$query .= ' AND a.`category_id` NOT IN (' . implode(',', $excludeCats) . ')';
}
$query .= ' group by a.`id`';
// union both posts and replies
$query .= ' union ';
// replies
$query .= ' select c.`isresolve`, a.`id`, a.`user_id`, a.`user_type`, a.`poster_name`, a.`title`, a.`parent_id`, c.category_id, ';
$query .= ' count( b.id ) as `VotedCnt`, 0 as `num_replies`';
$query .= ' from `#__discuss_posts` as a';
$query .= ' inner join `#__discuss_posts` as c on a.`parent_id` = c.`id`';
$query .= ' inner join `#__discuss_votes` as b on a.`id` = b.`post_id`';
$query .= ' where a.`published` = 1';
$query .= ' and c.`published` = 1';
if (!empty($excludeCats)) {
$query .= ' and c.`category_id` NOT IN (' . implode(',', $excludeCats) . ')';
}
if (!$includeReplies) {
$query .= ' and a.`parent_id` = 0';
}
$query .= ' group by a.`id`';
// ordring
$query .= ' order by VotedCnt desc';
if ($count > 0)
$query .= ' limit ' . $count ;
$db->setQuery($query);
$posts = $db->loadObjectList();
return $posts;
}
Replace with :
public function getMostVoted($limit, $options = array())
{
$count = isset($limit) ? $limit : 10;
$includeReplies = isset($options['includeReplies']) ? $options['includeReplies'] : null;
$db = ED::db();
$queryExclude = '';
$excludeCats = ED::getPrivateCategories();
if (!empty($excludeCats)) {
$queryExclude .= ' AND a.`category_id` NOT IN (' . implode(',', $excludeCats) . ')';
}
// posts
$query = 'select a.`isresolve`, a.`id`, a.`user_id`, a.`user_type`, a.`poster_name`, a.`title`, a.`id` as `parent_id`, a.category_id,';
$query .= ' a.`sum_totalvote` as `VotedCnt`, count( c.id ) as `num_replies`';
$query .= ' from `#__discuss_posts` as a ';
$query .= ' left join `#__discuss_posts` as c on a.`id` = c.`parent_id`';
$query .= ' and c.`published` = 1';
$query .= ' inner join `#__discuss_votes` as b on a.`id` = b.`post_id`';
$query .= ' where a.`parent_id` = 0';
$query .= ' and a.`published` = 1';
if (!empty($excludeCats)) {
$query .= ' AND a.`category_id` NOT IN (' . implode(',', $excludeCats) . ')';
}
$query .= ' group by a.`id`';
// union both posts and replies
$query .= ' union ';
// replies
$query .= ' select c.`isresolve`, a.`id`, a.`user_id`, a.`user_type`, a.`poster_name`, a.`title`, a.`parent_id`, c.category_id, ';
$query .= ' a.`sum_totalvote` as `VotedCnt`, 0 as `num_replies`';
$query .= ' from `#__discuss_posts` as a';
$query .= ' inner join `#__discuss_posts` as c on a.`parent_id` = c.`id`';
$query .= ' inner join `#__discuss_votes` as b on a.`id` = b.`post_id`';
$query .= ' where a.`published` = 1';
$query .= ' and c.`published` = 1';
if (!empty($excludeCats)) {
$query .= ' and c.`category_id` NOT IN (' . implode(',', $excludeCats) . ')';
}
if (!$includeReplies) {
$query .= ' and a.`parent_id` = 0';
}
$query .= ' group by a.`id`';
// ordring
$query .= ' order by VotedCnt desc';
if ($count > 0)
$query .= ' limit ' . $count ;
$db->setQuery($query);
$posts = $db->loadObjectList();
return $posts;
}