Changeset 2146 for plugins/pollsFactory/inc/class.pollsfactory.php
- Timestamp:
- 03/30/10 02:37:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/pollsFactory/inc/class.pollsfactory.php
r2139 r2146 47 47 if($ident > 0) 48 48 { 49 $params['option_type'] = 'pollsresponse'; 50 $params['post_id'] = $poll_id; 51 $params['option_title'] = $this->con->escape(http::realIP()); 52 53 $rs = $this->getOptions($params); 49 $rs = $this->con->select( 50 'SELECT option_id '. 51 'FROM '.$this->table.' '. 52 'WHERE post_id = '.$poll_id.' '. 53 "AND option_title = '".$this->con->escape(http::realIP())."' ". 54 "AND option_type = 'pollsresponse' ". 55 $this->con->limit(1) 56 ); 54 57 55 58 if (!$rs->isEmpty()) $chk = true; … … 76 79 "AND option_type = 'pollsresponse' ". 77 80 'GROUP BY option_title, post_id '. 78 'ORDER BY option_ upddtDESC '.81 'ORDER BY option_title DESC '. 79 82 $q 80 83 ); … … 84 87 public function countVotes($poll_id) 85 88 { 86 $params['option_type'] = 'pollsresponse'; 87 $params['post_id'] = (integer) $poll_id; 88 $params['group'] = 'option_title'; 89 $poll_id = (integer) $poll_id; 89 90 90 $rs = $this->getOptions($params); 91 92 return $rs->count(); 91 return $this->con->select( 92 'SELECT option_title '. 93 'FROM '.$this->table.' '. 94 'WHERE post_id = '.$poll_id.' '. 95 "AND option_type = 'pollsresponse' ". 96 'GROUP BY option_title ' 97 )->count(); 93 98 } 94 99
Note: See TracChangeset
for help on using the changeset viewer.