Notifications
Clear all

wpForo 1.x.x [Closed] How to stop voting on closed topics

5 Posts
2 Users
0 Reactions
1,274 Views
JorgeW
Posts: 107
Topic starter
(@jorgew)
Estimable Member
Joined: 6 years ago

Hi Support

If I think of a closed topic, I think of a topic where I can do nothing: no reply, no comment, no answer, no up or down voting, no nothing.

The case is that currently I can up/down vote and like/unlike any closed topic and their replies or answers in these wpforo forums. 

For example I just up-voted on ‪this closed topic‬ in Q&A forum from "0" to "1":

 

In my case this is potentially problematic. Is there a way to avoid this and stop any more liking/voting on closed topics?

4 Replies
Sofy
Posts: 4900
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @jorgew,

There is no option for this, but you can use js code for this purpose. Try this js code: 

jQuery(document).ready(function ($){
if ($('.wpforo-open').length) {
$('.wpforo-post-voting').remove();
$('.wpforo-like').remove();
}
});

 

3 Replies
JorgeW
(@jorgew)
Joined: 6 years ago

Estimable Member
Posts: 107
Posted by: Sofy

Hi @jorgew,

There is no option for this, but you can use js code for this purpose. Try this js code: 

jQuery(document).ready(function ($){
if ($('.wpforo-open').length) {
$('.wpforo-post-voting').remove();
$('.wpforo-like').remove();
}
});

 

Thanks @sofy

-> And which is the best file to insert this code? 

-> Will it work on the Q&A layout as well?

Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

@jorgew,

And which is the best file to insert this code? 

you should add the js code in your active theme's js files. 

Will it work on the Q&A layout as well?

yes, it'll work for wpForo Q&A layout. 

JorgeW
(@jorgew)
Joined: 6 years ago

Estimable Member
Posts: 107

@sofy

I pasted code at the end of all these 11 js files of my active theme.

It works fine, but only on replies in Threaded layout, not on topics and only if I refresh page once topic has been closed (refresh seems to be automatic when topic has been opened)

It doesn't seem to work in Q&A layout: voting option persists after closing Question on the question itself and on all answers.