Active
Project:
Vote Up/Down
Version:
7.x-1.x-dev
Component:
vud_field
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Jan 2013 at 19:56 UTC
Updated:
15 Nov 2017 at 23:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
marvil07 commentedThat is currently not possible via a setting option, but it is possible, in fact, a hook was added some time ago thinking in that use case. See vud.api.php for details on the example code (which solves your problem).
Comment #2
Sk8erPeter commentedmarvil07, thanks for your quick response!
I tested it (after setting the correct permissions) with the shown example code in my custom module (after clearing cache), denying access to all the users except the administrator with uid 1 (this is good for testing):
This is the result I get when voting with a logged in user:
I should just get a normal error message via alert() or a regular message next to the voting arrows, not the whole page's source code.
Why is that?
Thanks in advance!
Comment #3
marvil07 commentedI have opened another issue for the problem mentioned: #1895594: Custom hook_vud_access() is producing an error
I think the original question on this issue is already solved, so closing it for now.
PS: When you use vud_field, you do not need vud_node, vud_comment or vud_term; actually they are broken now on D7 version and as you know will be removed.
Comment #4
Sk8erPeter commentedThanks for your feedback! I subscribed to the other issue.
Yes, I experienced that the other submodules cause a problem on D7. ;)
I think the new vud_field is a much better and much more flexible approach, so it's a great initiative. Thanks!
Comment #6
mermemladeK commentedHello guys,
Could I call the hook_vud_access from my theme template.php?
I basically want to do the same without creating a new module. Is this possible? What code should I write?
Thank you
Comment #7
mermemladeK commentedAnother question is:
This hook is basically acting after the author votes his node/comment. Wouldn't it be way nice to simply disable the widget so that the user cannot vote in the first place? Am I saying non sense?
Comment #8
wfragakis commentedAnother (very late to the party) request to keep users from voting on their own nodes and comments yet still view the results.