NEW EasyBlog App for iPad OS and Android tablets! Try them out today! 📲 🚀



As far as I can see who can accept answer in easydiscuss is controlled by user group.
I wanted to set it so that only the person who posted the question can accept the answer, and I found some tickets about this issue without a solution. I came up with the following solution.

I share it so that others can use it, and for the Easydiscuss team to evaluate it. Please tell me if it's a good solution.
Thank you!

Change the file: components/com_easydiscuss/themes/wireframe/post/default.actions.php

Add the following code in the line 59 under <?php if ($post->canAcceptAsAnswer()) { ?>

$usert = JFactory::getUser()->id;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->where('id =' . $post->id);
$parentidet = $db->loadObjectlist();
$postp = $parentidet[0]->parent_id;

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->where('id =' . $postp);
$idet = $db->loadObjectlist();
$userp = $idet[0]->user_id;

$userad = JFactory::getUser();
$groups = $userad->get('groups');
foreach($groups as $group) {
if( $group == 8 or $userp == $usert){ ?>

And don't forget to add another two } above the line <?php if ($post->canReply()) { ?>

so that it looks like:

<?php }}} ?>

By doing this only users in user group 8 and question owner can accept answer.

Please let me know if it's a good idea to use this solution.

Thank you!
Love Stackideas.

This section can only be seen by users with a valid subscription.
If you have a valid subscription, please login now

Your time
Stack Ideas HQ
Support is

It is currently off working hours and most of us aren't around.

Rest assured that we will get back to your issues as soon as the day starts tomorrow!

Buy Us Coffee

Are you happy with our support and would like to buy us a cup of coffee?

Enjoy the Coffee!
Service via PayPal
Subscribe for product updates & promotions