Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Disable voting on comments (ie: allow votes only on threads)?
Hi, I'd like to use the voting addon as a way of tracking thread popularity. Is there a way to disable the per-comment voting? Thank you.
3
Comments
Find function:
public function DiscussionController_BeforeCommentMeta_Handler($Sender) {
Add code:
if(GetValue('VoteHeaderWritten', $Sender)) return;
Enjoy!![:) :)](https://open.vanillaforums.com/plugins/emojiextender/emoji/little/smile.png)
You'll also probably want to comment this out from
public function DiscussionController_BeforeCommentDisplay_Handler($Sender) {
echo ' sorted by <ul> <li'.(self::CommentSort() == 'popular' ? ' class="Active"' : '').'>'.Anchor('Votes', Url('?Sort=popular', TRUE), '', array('rel' => 'nofollow')).'</li> <li'.(self::CommentSort() == 'date' ? ' class="Active"' : '').'>'.Anchor('Date Added', Url('?Sort=date', TRUE), '', array('rel' => 'nofollow')).'</li> </ul>';
And then add in a
<br>
after the?>
So in total it should look like:
/* echo ' sorted by <ul> <li'.(self::CommentSort() == 'popular' ? ' class="Active"' : '').'>'.Anchor('Votes', Url('?Sort=popular', TRUE), '', array('rel' => 'nofollow')).'</li> <li'.(self::CommentSort() == 'date' ? ' class="Active"' : '').'>'.Anchor('Date Added', Url('?Sort=date', TRUE), '', array('rel' => 'nofollow')).'</li> </ul>'; */ ?> <br>
You also want this;
http://vanillaforums.org/discussion/14956/voting-addon-default-sort
I follow the above steps (but, the code has changed since then so I'll paste my exact steps below), and voting is indeed removed from the first comment but it is present in all subsequent comments.
PROCEDURE:
Add <br /> after line 198
Add the second and third line below after line 206:
OBSERVED RESULT:
Any idea?
Thanks,
David
Here is a screenshot to prove it... :-)
Hm, it seems when I refresh the screen that the unwanted voting buttons disappear - good!
So I guess this is not a killer.
Would be good to fix this bug though?