Version 5.0.0 beta 9
This commit is contained in:
1 parent
214f649f1d
commit
56979f8ee8
202 files changed
+4403
-1123
No files matched your search
@@ -350,22 +350,24 @@ class Smf extends Software
|
||||
$poll_data = $this->db->select( '*', 'polls', array( "id_poll=?", $row['id_poll'] ) )->first();
|
||||
|
||||
$options = $this->db->select( '*', 'poll_choices', array( "id_poll=?", $poll_data['id_poll'] ) );
|
||||
|
||||
$choices = array();
|
||||
$votes = 0;
|
||||
|
||||
$choices = $votes = $search = [];
|
||||
$index = 1;
|
||||
foreach( $options AS $option )
|
||||
{
|
||||
$choices[ $option['id_choice'] ] = $option['label'];
|
||||
$votes += $option['votes'];
|
||||
$choices[ $index ] = $option['label'];
|
||||
$votes[ $index ] = $option['votes'];
|
||||
$search[ $index ] = $option['id_choice'];
|
||||
$index++;
|
||||
}
|
||||
|
||||
$member_votes = array();
|
||||
foreach( $this->db->select( '*', 'log_polls', array( "id_poll=?", $poll_data['id_poll'] ) ) AS $vote )
|
||||
{
|
||||
$member_votes[$vote['id_member']] = array(
|
||||
$member_votes[ $vote['id_member'] ] = [
|
||||
'member_id' => $vote['id_member'],
|
||||
'member_choices' => array( $vote['id_choice'] )
|
||||
);
|
||||
'member_choices' => [ 1 => array_search( $vote['id_choice'], $search ) ]
|
||||
];
|
||||
}
|
||||
|
||||
$poll = array(
|
||||
|
||||
Reference in new issue
Block a user