How can I avoid that users vote for their own posts? I want to avoid that users can vote for their own posts, as it happens on Stack Exchange sites. For this, I created the following rule:


ON event "User votes on a node", the condition is "execute PHP code" and the code is the following one:

global $user;
return $node-&gt;uid != $user-&gt;uid;



Still, users can vote on their own posts. What should I do?

Using the following code, I get an error message given below.

global $user;

dpr($user);
dpr($node);

return $node-&gt;uid != $user-&gt;uid;
The rate module allows you to do this in its settings. You have to create a widget for this : admin/structure/rate (just add a new one and then you'll see the option). 
You will be asked to choose the content type and the position of the widget in the page that you need to define to see the vote system. I didn't try nor with views integration, neither with Drupal 6.