Forum breadcrumbs – You are here:Asgaros Support ForumSupportCustomize Reactions
Please or Register to create posts and topics.

Customize Reactions

When the reactions feature was first released, I modified the code to remove the negative option (just wanted a like button). Now the code has changed and I can’t figure out  how to do it anymore. Can you help?

Thanks!

Hello @heatherlly

Can you post the code you used before so I can have a look?

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

I’m sorry. I wrote over the old file and I don’t have a backup, it seems. I know I made a direct change to the HTML, though – I just removed the code that displayed the down arrow.

Now the code looks like this:

foreach ($this->reactions_list as $reaction) {
                    $counter = (isset($this->post_reactions[$post_id][$reaction])) ? number_format_i18n(count($this->post_reactions[$post_id][$reaction])) : 0;
                    $output = '<span class="reaction '.$reaction.'"><span class="reaction-icon dashicons-before dashicons-thumbs-'.$reaction.' '.$active[$reaction].'"></span><span class="reaction-number">'.$counter.'</span></span>';

The newer versions are written to accommodate either reaction. It’s no longer a separate bit of code for each, which is why I can’t remove it anymore.

If there’s no easy fix, I completely understand. Just thought it was worth asking.

Hello @heatherlly

I think there is a relatively simple workaround for this. In the file /includes/forum-reactions.php somewhere at the beginning you will find the following line:

private $reactions_list = array('down', 'up');

Just change it to this:

private $reactions_list = array('up');

That should be all. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Works like a charm. Thank you so much!

Asgaros has reacted to this post.
Asgaros