Prevent self-vote?
manop - April 8, 2009 - 19:11
| Project: | Plus 1 |
| Version: | 6.x-2.6 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I would like to prevent self-vote from the node author. I skimmed all the code but have no idea how to work around this issue.

#1
A node author can vote once on his content.
Believe it or not, I had at some point someone sponsor the development of this module with a small amount of money, and he wanted authors to be able to vote once on their content. This wasn't possible before, and I made that possible.
You simply have to do a check before you store the vote in the code. If you propose a patch that makes this optional, I am willing to commit it.
#2
Thank you for the answer. I don't know much about the coding. So I hid the arrow key instead by changing the line
else if (user_access('vote on content')) {to
else if (user_access('vote on content') && !$is_author) {It works okay for me now.