/[drupal]/contributions/modules/nodevote/nodevote.module
ViewVC logotype

Diff of /contributions/modules/nodevote/nodevote.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.28.2.3, Sun Jun 22 16:11:59 2008 UTC revision 1.28.2.4, Wed Oct 15 16:53:38 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2    
3  //$Id: nodevote.module,v 1.28.2.2 2007/08/22 11:15:09 kbahey Exp $  //$Id: nodevote.module,v 1.28.2.3 2008/06/22 16:11:59 kbahey Exp $
4    
5  // Copyright 2005 Khalid Baheyeldin http://2bits.com  // Copyright 2005 Khalid Baheyeldin http://2bits.com
6    
# Line 270  function nodevote_page() { Line 270  function nodevote_page() {
270    
271        if (_nodevote_validate_vote($vote)) {        if (_nodevote_validate_vote($vote)) {
272          if (_nodevote_user_voted($user->uid, $nid)){          if (_nodevote_user_voted($user->uid, $nid)){
273            $result = db_query("UPDATE {nodevote} SET  vote = $vote WHERE  uid = %d AND nid = %d" , $user->uid , $nid);            $result = db_query("UPDATE {nodevote} SET vote = %d WHERE  uid = %d AND nid = %d", $vote, $user->uid , $nid);
274          }          }
275          else {          else {
276            // check to see if the user has voted too many times today            // check to see if the user has voted too many times today
# Line 521  function nodevote_rate_form($node) { Line 521  function nodevote_rate_form($node) {
521  }  }
522    
523  function _nodevote_validate_vote($vote) {  function _nodevote_validate_vote($vote) {
524    if (($vote < NODEVOTE_MIN_SCORE) || ($vote > NODEVOTE_MAX_SCORE)) {    if (!is_numeric($vote)) {
525      return FALSE;      return FALSE;
526    }    }
527    return TRUE;  
528      if ($vote >= NODEVOTE_MIN_SCORE && $vote <= NODEVOTE_MAX_SCORE) {
529        return TRUE;
530      }
531    
532      return FALSE;
533  }  }
534    
535  function nodevote_userpoints($op, $points = 0, $uid = 0, $event = '') {  function nodevote_userpoints($op, $points = 0, $uid = 0, $event = '') {

Legend:
Removed from v.1.28.2.3  
changed lines
  Added in v.1.28.2.4

  ViewVC Help
Powered by ViewVC 1.1.2