Changeset 7886

Show
Ignore:
Timestamp:
02/08/07 19:19:41 (1 year ago)
Author:
GamerZ
Message:

Commit For The Day

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-polls/trunk/polls/polls-add.php

    r7856 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    7676                  } 
    7777                  // Insert Poll 
    78                   $add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (0, '$pollq_question', '$pollq_timestamp', 0, $pollq_active, '$pollq_expiry', $pollq_multiple)"); 
     78                  $add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (0, '$pollq_question', '$pollq_timestamp', 0, $pollq_active, '$pollq_expiry', $pollq_multiple, 0)"); 
    7979                  if(!$add_poll_question) { 
    8080                        $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>'; 
  • wp-polls/trunk/polls/polls-admin-ajax.php

    r7836 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-polls/trunk/polls/polls-admin-js.php

    r7856 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-polls/trunk/polls/polls-css.css

    r7835 r7886  
    22+----------------------------------------------------------------+ 
    33|                                                                                                                                         | 
    4 |     WordPress 2.0 Plugin: WP-Polls 2.15                                                           | 
    5 |     Copyright (c) 2006 Lester "GaMerZ" Chan                                                 | 
     4|     WordPress 2.0 Plugin: WP-Polls 2.20                                                           | 
     5|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
    66|                                                                                                                                         | 
    77|     File Written By:                                                                                                  | 
  • wp-polls/trunk/polls/polls-js.php

    r7856 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    5757            poll_answer = eval("poll_form.poll_" + poll_id); 
    5858            poll_answer_id = ""; 
    59             poll_multiple_ans = parseInt(document.getElementById('poll_multiple_ans').value); 
     59            if(document.getElementById('poll_multiple_ans')) { 
     60                  poll_multiple_ans = parseInt(document.getElementById('poll_multiple_ans').value); 
     61            } else { 
     62                  poll_multiple_ans = 0; 
     63            } 
    6064            poll_multiple_ans_count = 0; 
    6165            if(poll_answer.length != null) { 
  • wp-polls/trunk/polls/polls-manager.php

    r7856 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    8383                        } 
    8484                  } 
     85                  // Mutilple Poll 
     86                  $pollq_multiple_yes = intval($_POST['pollq_multiple_yes']); 
     87                  $pollq_multiple = 0; 
     88                  if($pollq_multiple_yes == 1) { 
     89                        $pollq_multiple = intval($_POST['pollq_multiple']); 
     90                  } else { 
     91                        $pollq_multiple = 0; 
     92                  } 
    8593                  // Update Poll's Question 
    86                   $edit_poll_question = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_question = '$pollq_question', pollq_totalvotes = $pollq_totalvotes, pollq_expiry = '$pollq_expiry', pollq_active = $pollq_active $timestamp_sql WHERE pollq_id = $pollq_id"); 
     94                  $edit_poll_question = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_question = '$pollq_question', pollq_totalvotes = $pollq_totalvotes, pollq_expiry = '$pollq_expiry', pollq_active = $pollq_active, pollq_multiple = $pollq_multiple $timestamp_sql WHERE pollq_id = $pollq_id"); 
    8795                  if(!$edit_poll_question) { 
    8896                        $text = '<p style="color: blue">'.sprintf(__('No Changes Had Been Made To Poll\'s Question \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>'; 
     
    142150      // Edit A Poll 
    143151      case 'edit': 
    144             $poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active, pollq_expiry FROM $wpdb->pollsq WHERE pollq_id = $poll_id"); 
     152            $poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active, pollq_expiry, pollq_multiple FROM $wpdb->pollsq WHERE pollq_id = $poll_id"); 
    145153            $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY polla_aid ASC"); 
    146154            $poll_noquestion = $wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa WHERE polla_qid = $poll_id"); 
     
    150158            $poll_active = intval($poll_question->pollq_active); 
    151159            $poll_expiry = trim($poll_question->pollq_expiry); 
     160            $poll_multiple = intval($poll_question->pollq_multiple); 
    152161?> 
    153162            <script type="text/javascript"> 
     
    218227                        var poll_votes_count = document.createTextNode("0 "); 
    219228                        var poll_answer_bold = document.createElement("strong"); 
     229                        var poll_option = document.createElement("option"); 
     230                        var poll_option_text = document.createTextNode((count_poll_answer+1)); 
    220231                        count_poll_answer++; 
    221232                        count_poll_answer_new++; 
     
    229240                        poll_votes.setAttribute('value', "0"); 
    230241                        poll_votes.setAttribute('onblur', "check_totalvotes_new();"); 
     242                        // Elements - Options 
     243                        poll_option.setAttribute('value', count_poll_answer); 
     244                        poll_option.setAttribute('id', "pollq-multiple-" + (count_poll_answer+1)); 
    231245                        // Elements - TD/TR 
    232246                        if(count_poll_answer%2 != 0) { poll_tr.style.background = "#eee"; } 
     
    245259                        poll_td3.appendChild(poll_votes_count); 
    246260                        poll_td3.appendChild(poll_votes); 
     261                        poll_option.appendChild(poll_option_text); 
    247262                        document.getElementById("poll_answers").appendChild(poll_tr); 
     263                        document.getElementById("pollq_multiple").appendChild(poll_option); 
    248264                  } 
    249265                  function remove_poll_answer() { 
     
    252268                        } else { 
    253269                              document.getElementById("poll_answers").removeChild(document.getElementById("poll-answer-new-" + count_poll_answer_new)); 
     270                              document.getElementById("pollq_multiple").removeChild(document.getElementById("pollq-multiple-" + (count_poll_answer+1))); 
     271                              document.getElementById("pollq_multiple").value = count_poll_answer; 
    254272                              count_poll_answer--; 
    255273                              count_poll_answer_new--; 
    256274                              check_totalvotes_new(); 
     275                        } 
     276                  } 
     277                  function check_pollq_multiple() { 
     278                        if(parseInt(document.getElementById("pollq_multiple_yes").value) == 1) { 
     279                              document.getElementById("pollq_multiple").disabled = false; 
     280                        } else { 
     281                              document.getElementById("pollq_multiple").value = 1; 
     282                              document.getElementById("pollq_multiple").disabled = true; 
    257283                        } 
    258284                  } 
     
    320346                              </tr> 
    321347                        </tfoot> 
     348                  </table> 
     349                  <!-- Poll Multiple Answers --> 
     350                  <h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3> 
     351                  <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
     352                        <tr style="background-color: #eee;"> 
     353                              <td width="40%" valign="top"><strong><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></strong></td> 
     354                              <td width="60%"> 
     355                                    <select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();"> 
     356                                          <option value="0"<?php selected('0', $poll_multiple); ?>><?php _e('No', 'wp-polls'); ?></option> 
     357                                          <option value="1"<?php if($poll_multiple > 0) { echo ' selected="selected"'; } ?>><?php _e('Yes', 'wp-polls'); ?></option> 
     358                                    </select> 
     359                        </tr> 
     360                        <tr> 
     361                              <td width="40%" valign="top"><strong><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></strong></td> 
     362                              <td width="60%"> 
     363                                    <select name="pollq_multiple" id="pollq_multiple" size="1" <?php if($poll_multiple == 0) { echo 'disabled="true"'; } ?>> 
     364                                          <?php 
     365                                                for($i = 1; $i <= $poll_noquestion; $i++) { 
     366                                                      if($poll_multiple > 0 && $poll_multiple == $i) { 
     367                                                            echo "<option value=\"$i\" selected=\"selected\">$i</option>\n"; 
     368                                                      } else { 
     369                                                            echo "<option value=\"$i\">$i</option>\n"; 
     370                                                      } 
     371                                                } 
     372                                          ?> 
     373                                    </select> 
     374                              </td> 
     375                        </tr> 
    322376                  </table> 
    323377                  <!-- Poll Start/End Date --> 
  • wp-polls/trunk/polls/polls-options.php

    r7835 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    133133                        break; 
    134134                  case "votebody": 
    135                         default_template = "<li><input type=\"radio\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" /> <label for=\"poll-answer-%POLL_ANSWER_ID%\">%POLL_ANSWER%</label></li>"; 
     135                        default_template = "<li><input type=\"%POLL_CHECKBOX_RADIO%\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" /> <label for=\"poll-answer-%POLL_ANSWER_ID%\">%POLL_ANSWER%</label></li>"; 
    136136                        break; 
    137137                  case "votefooter": 
     
    142142                        break; 
    143143                  case "resultbody": 
    144                         default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>"; 
     144                        default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %POLL_ANSWER_VOTES% Votes)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>"; 
    145145                        break; 
    146146                  case "resultbody2": 
    147                         default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'wp-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>"; 
     147                        default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %POLL_ANSWER_VOTES% Votes)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'wp-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>"; 
    148148                        break; 
    149149                  case "resultfooter": 
    150                         default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Votes', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTES%</strong></p>\n</div>"; 
     150                        default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n</div>"; 
    151151                        break; 
    152152                  case "resultfooter2": 
    153                         default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Votes', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTES%</strong></p>\n<p style=\"text-align: center;\"><a href=\"#VotePoll\" onclick=\"poll_booth(%POLL_ID%); return false;\" title=\"<?php _e('Vote For This Poll', 'wp-polls'); ?>\"><?php _e('Vote', 'wp-polls'); ?></a></p>\n</div>"; 
     153                        default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n<p style=\"text-align: center;\"><a href=\"#VotePoll\" onclick=\"poll_booth(%POLL_ID%); return false;\" title=\"<?php _e('Vote For This Poll', 'wp-polls'); ?>\"><?php _e('Vote', 'wp-polls'); ?></a></p>\n</div>"; 
    154154                        break; 
    155155                  case "disable": 
     
    447447                              <td> 
    448448                                    <strong>%POLL_TOTALVOTES%</strong><br /> 
    449                                     <?php _e('Display the poll\'s total votes', 'wp-polls'); ?> 
     449                                    <?php _e('Display the poll\'s total votes NOT the number of people who voted for the poll', 'wp-polls'); ?> 
    450450                              </td> 
    451451                              <td> 
     
    509509                              </td> 
    510510                        </tr> 
     511                        <tr> 
     512                              <td><strong>%POLL_MULTIPLE_ANS_MAX%</strong><br /> 
     513                              <?php _e('Display the the maximum number of answers the user can choose if the poll supports multiple answers', 'wp-polls'); ?></td> 
     514                              <td> 
     515                                    <strong>%POLL_CHECKBOX_RADIO%</strong><br /> 
     516                                    <?php _e('Display "checkbox" or "radio" input types depending on the poll type', 'wp-polls'); ?> 
     517                              </td> 
     518                        </tr> 
     519                        <tr> 
     520                              <td><strong>%POLL_TOTALVOTERS%</strong><br /> 
     521                              <?php _e('Display the number of people who voted for the poll NOT the total votes of the poll', 'wp-polls'); ?></td> 
     522                              <td>&nbsp;</td> 
     523                        </tr> 
     524                        <tr> 
     525                              <td colspan="2"><strong><?php _e('Note:', 'wp-polls'); ?></strong><br /> 
     526                              <?php _e('<strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</strong> will be different if your poll supports multiple answers. If your poll allows only single answer, both value will be the same.', 'wp-polls'); ?></td> 
     527                        </tr> 
    511528                  </table> 
    512529            </fieldset> 
     
    522539                                    - %POLL_START_DATE%<br /> 
    523540                                    - %POLL_END_DATE%<br /> 
    524                                     - %POLL_TOTALVOTES%<br /><br /> 
     541                                    - %POLL_TOTALVOTES%<br /> 
     542                                    - %POLL_TOTALVOTERS%<br /> 
     543                                    - %POLL_MULTIPLE_ANS_MAX%<br /><br /> 
    525544                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('voteheader');" class="button" /> 
    526545                              </td> 
     
    534553                                    - %POLL_ANSWER_ID%<br /> 
    535554                                    - %POLL_ANSWER%<br /> 
    536                                     - %POLL_ANSWER_VOTES%<br /><br /> 
     555                                    - %POLL_ANSWER_VOTES%<br /> 
     556                                    - %POLL_CHECKBOX_RADIO%<br /><br /> 
    537557                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votebody');" class="button" /> 
    538558                              </td> 
     
    544564                                          <?php _e('Allowed Variables:', 'wp-polls'); ?><br /> 
    545565                                          - %POLL_ID%<br /> 
    546                                           - %POLL_RESULT_URL%<br /><br /> 
     566                                          - %POLL_RESULT_URL%<br /> 
     567                                          - %POLL_MULTIPLE_ANS_MAX%<br /><br /> 
    547568                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votefooter');" class="button" /> 
    548569                              </td> 
     
    562583                                    - %POLL_START_DATE%<br /> 
    563584                                    - %POLL_END_DATE%<br /> 
    564                                     - %POLL_TOTALVOTES%<br /><br /> 
     585                                    - %POLL_TOTALVOTES%<br /> 
     586                                    - %POLL_TOTALVOTERS%<br /> 
     587                                    - %POLL_MULTIPLE_ANS_MAX%<br /><br /> 
    565588                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultheader');" class="button" /> 
    566589                              </td> 
     
    603626                                    - %POLL_END_DATE%<br /> 
    604627                                    - %POLL_TOTALVOTES%<br /> 
     628                                    - %POLL_TOTALVOTERS%<br /> 
    605629                                    - %POLL_MOST_ANSWER%<br /> 
    606630                                    - %POLL_MOST_VOTES%<br /> 
     
    608632                                    - %POLL_LEAST_ANSWER%<br /> 
    609633                                    - %POLL_LEAST_VOTES%<br /> 
    610                                     - %POLL_LEAST_PERCENTAGE%<br /><br /> 
     634                                    - %POLL_LEAST_PERCENTAGE%<br /> 
     635                                    - %POLL_MULTIPLE_ANS_MAX%<br /><br /> 
    611636                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter');" class="button" /> 
    612637                              </td> 
     
    621646                                    - %POLL_END_DATE%<br /> 
    622647                                    - %POLL_TOTALVOTES%<br /> 
     648                                    - %POLL_TOTALVOTERS%<br /> 
    623649                                    - %POLL_MOST_ANSWER%<br /> 
    624650                                    - %POLL_MOST_VOTES%<br /> 
     
    626652                                    - %POLL_LEAST_ANSWER%<br /> 
    627653                                    - %POLL_LEAST_VOTES%<br /> 
    628                                     - %POLL_LEAST_PERCENTAGE%<br /><br /> 
     654                                    - %POLL_LEAST_PERCENTAGE%<br /> 
     655                                    - %POLL_MULTIPLE_ANS_MAX%<br /><br /> 
    629656                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter2');" class="button" /> 
    630657                              </td> 
  • wp-polls/trunk/polls/polls-uninstall.php

    r7835 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-polls/trunk/polls/polls-usage.php

    r7835 r7886  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.1 Plugin: WP-Polls 2.15                                                           | 
     5|     WordPress 2.1 Plugin: WP-Polls 2.20                                                           | 
    66|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-polls/trunk/polls/polls-widget.php

    r7835 r7886  
    44Plugin URI: http://www.lesterchan.net/portfolio/programming.php 
    55Description: Adds a Sidebar Widget To Display Poll From WP-Polls Plugin. You Need To Activate WP-Polls First. 
    6 Version: 2.15 
     6Version: 2.20 
    77Author: GaMerZ 
    88Author URI: http://www.lesterchan.net 
  • wp-polls/trunk/polls/polls.php

    r7856 r7886  
    44Plugin URI: http://www.lesterchan.net/portfolio/programming.php 
    55Description: Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page. 
    6 Version: 2.15 
     6Version: 2.20 
    77Author: GaMerZ 
    88Author URI: http://www.lesterchan.net 
     
    287287      $temp_pollvote = ''; 
    288288      // Get Poll Question Data 
    289       $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_timestamp, pollq_expiry, pollq_multiple FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1"); 
     289      $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_timestamp, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1"); 
    290290      // Poll Question Variables 
    291291      $poll_question_text = stripslashes($poll_question->pollq_question); 
    292292      $poll_question_id = intval($poll_question->pollq_id); 
    293293      $poll_question_totalvotes = intval($poll_question->pollq_totalvotes); 
     294      $poll_question_totalvoters = intval($poll_question->pollq_totalvoters); 
    294295      $poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp)); 
    295296      $poll_expiry = trim($poll_question->pollq_expiry); 
     
    304305      $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question); 
    305306      $template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question); 
     307      $template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question); 
    306308      $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question); 
    307309      $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 
     310      if($poll_multiple_ans > 0) { 
     311            $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question); 
     312      } else { 
     313            $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question); 
     314      } 
    308315      // Get Poll Answers Data 
    309316      $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_sortby').' '.get_option('poll_ans_sortorder')); 
     
    332339                  $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format($poll_answer_votes), $template_answer); 
    333340                  if($poll_multiple_ans > 0) { 
    334                         $template_answer = str_replace('type="radio"', 'type="checkbox"', $template_answer); 
     341                        $template_answer = str_replace("%POLL_CHECKBOX_RADIO%", 'checkbox', $template_answer); 
     342                  } else { 
     343                        $template_answer = str_replace("%POLL_CHECKBOX_RADIO%", 'radio', $template_answer); 
    335344                  } 
    336345                  // Print Out Voting Form Body Template 
     
    353362            $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer); 
    354363            $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer); 
     364            if($poll_multiple_ans > 0) { 
     365                  $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer); 
     366            } else { 
     367                  $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer); 
     368            } 
    355369            // Print Out Voting Form Footer Template 
    356370            $temp_pollvote .= "\t\t$template_footer\n"; 
     
    388402      $poll_least_percentage = 0; 
    389403      // Get Poll Question Data 
    390       $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_active, pollq_timestamp, pollq_expiry FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1"); 
     404      $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_active, pollq_timestamp, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1"); 
    391405      // Poll Question Variables 
    392406      $poll_question_text = stripslashes($poll_question->pollq_question); 
    393407      $poll_question_id = intval($poll_question->pollq_id); 
    394408      $poll_question_totalvotes = intval($poll_question->pollq_totalvotes); 
     409      $poll_question_totalvoters = intval($poll_question->pollq_totalvoters); 
    395410      $poll_question_active = intval($poll_question->pollq_active); 
    396411      $poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp)); 
     
    401416            $poll_end_date  = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry)); 
    402417      } 
     418      $poll_multiple_ans = intval($poll_question->pollq_multiple); 
    403419      $template_question = stripslashes(get_option('poll_template_resultheader')); 
    404420      $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question); 
    405421      $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question); 
    406422      $template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question); 
     423      $template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question); 
    407424      $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question); 
    408425      $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 
     426      if($poll_multiple_ans > 0) { 
     427            $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question); 
     428      } else { 
     429            $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question); 
     430      } 
    409431      // Get Poll Answers Data 
    410432      $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder')); 
     
    494516            $template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer); 
    495517            $template_footer = str_replace("%POLL_TOTALVOTES%", number_format($poll_question_totalvotes), $template_footer); 
     518            $template_footer = str_replace("%POLL_TOTALVOTERS%", number_format($poll_question_totalvoters), $template_footer); 
    496519            $template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer); 
    497520            $template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer); 
     
    500523            $template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer); 
    501524            $template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer); 
     525            if($poll_multiple_ans > 0) { 
     526                  $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer); 
     527            } else { 
     528                  $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer); 
     529            } 
    502530            // Print Out Results Footer Template 
    503531            $temp_pollresult .= "\t\t$template_footer\n"; 
     
    548576            $content = preg_replace( "/\[poll=(\d+)\]/ise", "display_poll('\\1')", $content); 
    549577      } else { 
    550             $content = preg_replace( "/\[poll=(\d+)\]/i", __('Note: There is a poll within this post, please visit the site to participate in this poll.', 'wp-polls'), $content); 
     578            $content = preg_replace( "/\[poll=(\d+)\]/i", __('Note: There is a poll within this post, please visit the site to participate in this post\'s poll.', 'wp-polls'), $content); 
    551579      } 
    552580    return $content; 
     
    605633function check_voted_multiple($poll_id) { 
    606634      global $polls_ips; 
    607       $temp_voted_aid = 0
    608       if(intval($_COOKIE["voted_$poll_id"]) > 0) { 
    609             $temp_voted_aid = intval($_COOKIE["voted_$poll_id"]); 
     635      $temp_voted_aid = array()
     636      if(!empty($_COOKIE["voted_$poll_id"])) { 
     637            $temp_voted_aid = explode(',', $_COOKIE["voted_$poll_id"]); 
    610638      } else { 
    611639            if($polls_ips) { 
    612640                  foreach($polls_ips as $polls_ip) { 
    613641                        if($polls_ip['qid'] == $poll_id) { 
    614                               $temp_voted_aid = $polls_ip['aid']; 
     642                              $temp_voted_aid[] = $polls_ip['aid']; 
    615643                        } 
    616644                  } 
     
    721749      if($questions) { 
    722750            foreach($questions as $question) { 
    723                   $polls_questions[] = array('id' => intval($question->pollq_id), 'question' => stripslashes($question->pollq_question), 'timestamp' => $question->pollq_timestamp, 'totalvotes' => intval($question->pollq_totalvotes), 'start' => $question->pollq_timestamp, 'end' => trim($question->pollq_expiry)); 
     751                  $polls_questions[] = array('id' => intval($question->pollq_id), 'question' => stripslashes($question->pollq_question), 'timestamp' => $question->pollq_timestamp, 'totalvotes' => intval($question->pollq_totalvotes), 'start' => $question->pollq_timestamp, 'end' => trim($question->pollq_expiry), 'multiple' => intval($question->pollq_multiple), 'totalvoters' => intval($question->pollq_totalvoters)); 
    724752                  $poll_questions_ids .= intval($question->pollq_id).', '; 
    725753            } 
     
    793821            $template_question = str_replace("%POLL_ID%", $polls_question['id'], $template_question); 
    794822            $template_question = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_question); 
     823            $template_question = str_replace("%POLL_TOTALVOTERS%", $polls_question['totalvoters'], $template_question); 
    795824            $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question); 
    796825            $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 
     826            if($polls_question['multiple'] > 0) { 
     827                  $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_question); 
     828            } else { 
     829                  $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question); 
     830            } 
    797831            // Print Out Result Header Template 
    798832            $pollsarchive_output_archive .= $template_question; 
     
    813847                        } 
    814848                        // Let User See What Options They Voted 
    815                         if(check_voted_multiple($polls_question['id']) == $polls_answer['aid']) {                      
     849                        if(in_array($polls_answer['aid'], check_voted_multiple($polls_question['id']))) {                    
    816850                              // Results Body Variables 
    817851                              $template_answer = stripslashes(get_option('poll_template_resultbody2')); 
     
    860894            $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer); 
    861895            $template_footer = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_footer); 
     896            $template_footer = str_replace("%POLL_TOTALVOTERS%", $polls_question['totalvoters'], $template_footer); 
    862897            $template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer); 
    863898            $template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer); 
     
    866901            $template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer); 
    867902            $template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer); 
     903            if($polls_question['multiple'] > 0) { 
     904                  $template_footer  = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_footer); 
     905            } else { 
     906                  $template_footer  = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer); 
     907            } 
    868908            // Print Out Results Footer Template 
    869909            $pollsarchive_output_archive .= $template_footer; 
     
    10531093                              $wpdb->query("UPDATE $wpdb->pollsa SET polla_votes = (polla_votes+1) WHERE polla_qid = $poll_id AND polla_aid = $polla_aid"); 
    10541094                        } 
    1055                         $vote_q = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes+1) WHERE pollq_id = $poll_id"); 
     1095                        $vote_q = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes+".sizeof($poll_aid_array)."), pollq_totalvoters = (pollq_totalvoters+1) WHERE pollq_id = $poll_id"); 
    10561096                        if($vote_q) { 
    10571097                              foreach($poll_aid_array as $polla_aid) { 
     
    10611101                              exit(); 
    10621102                        } else { 
    1063                               printf(__('Unable To Update Poll Total Votes. Poll ID #%s', 'wp-polls'), $poll_id); 
     1103                              printf(__('Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s', 'wp-polls'), $poll_id); 
    10641104                              exit();      
    10651105                        } // End if($vote_a) 
     
    10991139                                                      "pollq_expiry varchar(20) NOT NULL default '',". 
    11001140                                                      "pollq_multiple tinyint(3) NOT NULL default '0',". 
     1141                                                      "pollq_totalvoters int(10) NOT NULL default '0',". 
    11011142                                                      "PRIMARY KEY (pollq_id))"; 
    11021143      $create_table['pollsa'] = "CREATE TABLE $wpdb->pollsa (". 
     
    11381179      '<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'. 
    11391180      '<ul class="wp-polls-ul">', 'Template For Poll\'s Question'); 
    1140       add_option('poll_template_votebody',  '<li><input type="radio" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value="%POLL_ANSWER_ID%" /> <label for="poll-answer-%POLL_ANSWER_ID%">%POLL_ANSWER%</label></li>', 'Template For Poll\'s Answers'); 
     1181      add_option('poll_template_votebody',  '<li><input type="%POLL_CHECKBOX_RADIO%" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value="%POLL_ANSWER_ID%" /> <label for="poll-answer-%POLL_ANSWER_ID%">%POLL_ANSWER%</label></li>', 'Template For Poll\'s Answers'); 
    11411182      add_option('poll_template_votefooter', '</ul>'. 
    11421183      '<p style="text-align: center;"><input type="button" name="vote" value="   '.__('Vote', 'wp-polls').'   " class="Buttons" onclick="poll_vote(%POLL_ID%);" onkeypress="poll_result(%POLL_ID%);" /></p>'. 
     
    11491190      add_option('poll_template_resultbody2', '<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %POLL_ANSWER_VOTES% Votes)</small></i></strong><div class="pollbar" style="width: %POLL_ANSWER_IMAGEWIDTH%%;" title="'.__('You Have Voted For This Choice', 'wp-polls').' - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')"></div></li>', 'Template For Poll Results (User Voted)'); 
    11501191      add_option('poll_template_resultfooter', '</ul>'. 
    1151       '<p style="text-align: center;">'.__('Total Votes', 'wp-polls').': <strong>%POLL_TOTALVOTES%</strong></p>'. 
     1192      '<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'. 
    11521193      '</div>', 'Template For Poll Result Footer'); 
    11531194      add_option('poll_template_resultfooter2', '</ul>'. 
    1154       '<p style="text-align: center;">'.__('Total Votes', 'wp-polls').': <strong>%POLL_TOTALVOTES