diff options
author | PayBas <contact@paybas.com> | 2014-04-06 22:18:52 +0200 |
---|---|---|
committer | PayBas <contact@paybas.com> | 2014-04-06 22:18:52 +0200 |
commit | b64c5f84abf64a040b5d81b1ab7a214676039c19 (patch) | |
tree | ee8b35ea175069ce72e4e84fd57d7f07bcf781c9 | |
parent | 3384e87b6f1f6ba3532257585392a8b7e1034a18 (diff) | |
download | forums-b64c5f84abf64a040b5d81b1ab7a214676039c19.tar forums-b64c5f84abf64a040b5d81b1ab7a214676039c19.tar.gz forums-b64c5f84abf64a040b5d81b1ab7a214676039c19.tar.bz2 forums-b64c5f84abf64a040b5d81b1ab7a214676039c19.tar.xz forums-b64c5f84abf64a040b5d81b1ab7a214676039c19.zip |
[ticket/12363] changed _winner_ to _most-votes_
PHPBB3-12363
-rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 4 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewtopic_body.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/viewtopic_body.html | 2 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 2a96c6090c..97f7f7c9b4 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -244,12 +244,12 @@ phpbb.addAjaxCallback('vote_poll', function(res) { var option = $(this); var option_id = option.attr('data-poll-option-id'); var voted = (typeof res.user_votes[option_id] !== 'undefined') ? true : false; - var winner = (res.vote_counts[option_id] == most_votes) ? true : false; + var most_votes = (res.vote_counts[option_id] == most_votes) ? true : false; var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[option_id] / res.total_votes) * 100); var percent_rel = (most_votes == 0) ? 0 : Math.round((res.vote_counts[option_id] / most_votes) * 100); option.toggleClass('voted', voted); - option.toggleClass('winner', winner); + option.toggleClass('most-votes', most_votes); // Update the bars var bar = option.find('.resultbar div'); diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index d01d50d07b..649129923a 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -72,7 +72,7 @@ <fieldset class="polls"> <!-- BEGIN poll_option --> - <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_WINNER --> winner<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}"> + <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}"> <dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt> <!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF --> <dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index c348c25402..307ed0f391 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -80,7 +80,7 @@ <!-- BEGIN poll_option --> <tr> <!-- IF S_CAN_VOTE --> - <td<!-- IF poll_option.POLL_OPTION_WINNER --> class="winner"<!-- ENDIF -->> + <td<!-- IF poll_option.POLL_OPTION_MOST_VOTES --> class="most-votes"<!-- ENDIF -->> <!-- IF S_IS_MULTI_CHOICE --> <input type="checkbox" class="radio" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /> <!-- ELSE --> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 422ca1d12f..e7358d682d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -864,7 +864,7 @@ if (!empty($topic_data['poll_start'])) $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100)); $option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0; $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100)); - $option_winner = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; + $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; $template->assign_block_vars('poll_option', array( 'POLL_OPTION_ID' => $poll_option['poll_option_id'], @@ -875,7 +875,7 @@ if (!empty($topic_data['poll_start'])) 'POLL_OPTION_PCT' => round($option_pct * 100), 'POLL_OPTION_WIDTH' => round($option_pct * 250), 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false, - 'POLL_OPTION_WINNER' => $option_winner, + 'POLL_OPTION_MOST_VOTES' => $option_most_votes, )); } |