You are here

function plus1_get_vote in Plus 1 6

Return the number of votes for a given node ID/user ID pair.

Parameters

$nid: A node ID.

$uid: A user ID.

Return value

Integer Number of votes the user has cast on this node.

2 calls to plus1_get_vote()
plus1_jquery_widget in ./plus1.module
Create voting widget to display on the webpage.
plus1_vote in ./plus1.module
Called by jQuery. This submits the vote request and returns JSON to be parsed by jQuery.

File

./plus1.module, line 115
A simple +1 voting widget module.

Code

function plus1_get_vote($nid, $uid) {
  return (int) db_result(db_query('SELECT vote FROM {plus1_vote} WHERE nid = %d AND uid = %d', $nid, $uid));
}