WP-Polls - Version 2.65

Version Description

N/A

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-Polls
Version 2.65
Comparing to
See all releases

Code changes from version 2.64 to 2.65

images/poll.png DELETED
Binary file
images/poll_admin_icon.png DELETED
Binary file
polls-add.php CHANGED
@@ -26,7 +26,7 @@ if(!current_user_can('manage_polls')) {
26
  $base_name = plugin_basename('wp-polls/polls-manager.php');
27
  $base_page = 'admin.php?page='.$base_name;
28
 
29
- ### Form Processing
30
  if(!empty($_POST['do'])) {
31
  // Decide What To Do
32
  switch($_POST['do']) {
@@ -92,7 +92,7 @@ if(!empty($_POST['do'])) {
92
  $latest_pollid = polls_latest_id();
93
  $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
94
  if(empty($text)) {
95
- $text = '<p style="color: green;">'.sprintf(__('Poll \'%s\' Added Successfully.', 'wp-polls'), stripslashes($pollq_question)).' <a href="'.$base_page.'">'.__('Manage Polls', 'wp-polls').'</a></p>';
96
  }
97
  cron_polls_place();
98
  break;
@@ -107,7 +107,6 @@ $count = 0;
107
  <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
108
  <?php wp_nonce_field('wp-polls_add-poll'); ?>
109
  <div class="wrap">
110
- <div id="icon-wp-polls" class="icon32"><br /></div>
111
  <h2><?php _e('Add Poll', 'wp-polls'); ?></h2>
112
  <!-- Poll Question -->
113
  <h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
26
  $base_name = plugin_basename('wp-polls/polls-manager.php');
27
  $base_page = 'admin.php?page='.$base_name;
28
 
29
+ ### Form Processing
30
  if(!empty($_POST['do'])) {
31
  // Decide What To Do
32
  switch($_POST['do']) {
92
  $latest_pollid = polls_latest_id();
93
  $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
94
  if(empty($text)) {
95
+ $text = '<p style="color: green;">'.sprintf(__('Poll \'%s\' (ID: %s) Added Successfully.', 'wp-polls'), stripslashes($pollq_question), $latest_pollid).' <a href="'.$base_page.'">'.__('Manage Polls', 'wp-polls').'</a></p>';
96
  }
97
  cron_polls_place();
98
  break;
107
  <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
108
  <?php wp_nonce_field('wp-polls_add-poll'); ?>
109
  <div class="wrap">
 
110
  <h2><?php _e('Add Poll', 'wp-polls'); ?></h2>
111
  <!-- Poll Question -->
112
  <h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
polls-admin-css.css CHANGED
@@ -1,21 +1,3 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress Plugin: WP-Polls |
5
- | Copyright (c) 2012 Lester "GaMerZ" Chan |
6
- | |
7
- | File Written By: |
8
- | - Lester "GaMerZ" Chan |
9
- | - http://lesterchan.net |
10
- | |
11
- | File Information: |
12
- | - Polls Admin CSS File |
13
- | - wp-content/plugins/wp-polls/polls-admin-css.css |
14
- | |
15
- +----------------------------------------------------------------+
16
- */
17
-
18
-
19
  #wp-polls-pollbar-bg {
20
  width: 25px;
21
  height: 25px;
@@ -25,7 +7,4 @@
25
  width: 25px;
26
  height: 25px;
27
  border: 1px solid #000000;
28
- }
29
- #icon-wp-polls {
30
- background: transparent url(images/poll_admin_icon.png) no-repeat;
31
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #wp-polls-pollbar-bg {
2
  width: 25px;
3
  height: 25px;
7
  width: 25px;
8
  height: 25px;
9
  border: 1px solid #000000;
 
 
 
10
  }
polls-admin-js.dev.js CHANGED
@@ -1,21 +1,3 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress Plugin: WP-Polls |
5
- | Copyright © 2012 Lester "GaMerZ" Chan |
6
- | |
7
- | File Written By: |
8
- | - Lester "GaMerZ" Chan |
9
- | - http://lesterchan.net |
10
- | |
11
- | File Information: |
12
- | - Polls Admin Javascript File |
13
- | - wp-content/plugins/wp-polls/polls-admin-js.js |
14
- | |
15
- +----------------------------------------------------------------+
16
- */
17
-
18
-
19
  var global_poll_id = 0;
20
  var global_poll_aid = 0;
21
  var global_poll_aid_votes = 0;
@@ -27,11 +9,13 @@ function delete_poll(poll_id, poll_confirm, nonce) {
27
  delete_poll_confirm = confirm(poll_confirm);
28
  if(delete_poll_confirm) {
29
  global_poll_id = poll_id;
30
- jQuery.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_poll + '&pollq_id=' + poll_id + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
31
- jQuery('#message').html(data);
32
- jQuery('#message').show();
33
- jQuery('#poll-' + global_poll_id).remove();
34
- }});
 
 
35
  }
36
  }
37
 
@@ -39,15 +23,17 @@ function delete_poll(poll_id, poll_confirm, nonce) {
39
  function delete_poll_logs(poll_confirm, nonce) {
40
  delete_poll_logs_confirm = confirm(poll_confirm);
41
  if(delete_poll_logs_confirm) {
42
- if(jQuery('#delete_logs_yes').is(':checked')) {
43
- jQuery.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_all_logs + '&delete_logs_yes=yes&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
44
- jQuery('#message').html(data);
45
- jQuery('#message').show();
46
- jQuery('#poll_logs').html(pollsAdminL10n.text_no_poll_logs);
47
- }});
48
- } else {
49
- alert(pollsAdminL10n.text_checkbox_delete_all_logs);
50
- }
 
 
51
  }
52
  }
53
 
@@ -55,18 +41,20 @@ function delete_poll_logs(poll_confirm, nonce) {
55
  function delete_this_poll_logs(poll_id, poll_confirm, nonce) {
56
  delete_poll_logs_confirm = confirm(poll_confirm);
57
  if(delete_poll_logs_confirm) {
58
- if(jQuery('#delete_logs_yes').is(':checked')) {
59
- global_poll_id = poll_id;
60
- jQuery.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_poll_logs + '&pollq_id=' + poll_id + '&delete_logs_yes=yes&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
61
- jQuery('#message').html(data);
62
- jQuery('#message').show();
63
- jQuery('#poll_logs').html(pollsAdminL10n.text_no_poll_logs);
64
- jQuery('#poll_logs_display').hide();
65
- jQuery('#poll_logs_display_none').show();
66
- }});
67
- } else {
68
- alert(pollsAdminL10n.text_checkbox_delete_poll_logs);
69
- }
 
 
70
  }
71
  }
72
 
@@ -78,15 +66,17 @@ function delete_poll_ans(poll_id, poll_aid, poll_aid_vote, poll_confirm, nonce)
78
  global_poll_aid = poll_aid;
79
  global_poll_aid_votes = poll_aid_vote;
80
  temp_vote_count = 0;
81
- jQuery.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_poll_ans + '&pollq_id=' + poll_id + '&polla_aid=' + poll_aid + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
82
- jQuery('#message').html(data);
83
- jQuery('#message').show();
84
- jQuery('#poll_total_votes').html((parseInt(jQuery('#poll_total_votes').html()) - parseInt(global_poll_aid_votes)));
85
- jQuery('#pollq_totalvotes').val(temp_vote_count);
86
- jQuery('#poll-answer-' + global_poll_aid).remove();
87
- check_totalvotes();
88
- reorder_answer_num();
89
- }});
 
 
90
  }
91
  }
92
 
@@ -95,12 +85,14 @@ function opening_poll(poll_id, poll_confirm, nonce) {
95
  open_poll_confirm = confirm(poll_confirm);
96
  if(open_poll_confirm) {
97
  global_poll_id = poll_id;
98
- jQuery.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_open_poll + '&pollq_id=' + poll_id + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
99
- jQuery('#message').html(data);
100
- jQuery('#message').show();
101
- jQuery('#open_poll').hide();
102
- jQuery('#close_poll').show();
103
- }});
 
 
104
  }
105
  }
106
 
@@ -109,99 +101,119 @@ function closing_poll(poll_id, poll_confirm, nonce) {
109
  close_poll_confirm = confirm(poll_confirm);
110
  if(close_poll_confirm) {
111
  global_poll_id = poll_id;
112
- jQuery.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_close_poll + '&pollq_id=' + poll_id + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
113
- jQuery('#message').html(data);
114
- jQuery('#message').show();
115
- jQuery('#open_poll').show();
116
- jQuery('#close_poll').hide();
117
- }});
 
 
118
  }
119
  }
120
 
121
  // Reoder Answer Answer
122
  function reorder_answer_num() {
123
- var pollq_multiple = jQuery('#pollq_multiple');
124
- var selected = pollq_multiple.val();
125
- var previous_size = jQuery('> option', pollq_multiple).size();
126
- pollq_multiple.empty();
127
- jQuery('#poll_answers tr > th').each(function (i) {
128
- jQuery(this).text(pollsAdminL10n.text_answer + ' ' + (i+1));
129
- jQuery(pollq_multiple).append('<option value="' + (i+1) + '">' + (i+1) + '</option>');
 
 
 
 
 
 
 
 
 
 
130
  });
131
- if(selected > 1)
132
- {
133
- var current_size = jQuery('> option', pollq_multiple).size();
134
- if(selected <= current_size)
135
- jQuery('> option', pollq_multiple).eq(selected - 1).attr('selected', 'selected');
136
- else if(selected == previous_size)
137
- jQuery('> option', pollq_multiple).eq(current_size - 1).attr('selected', 'selected');
138
- }
139
  }
140
 
141
  // Calculate Total Votes
142
  function check_totalvotes() {
143
  temp_vote_count = 0;
144
- jQuery("#poll_answers tr td input[size=4]").each(function (i) {
145
- if(isNaN(jQuery(this).val())) {
146
- temp_vote_count += 0;
147
- } else {
148
- temp_vote_count += parseInt(jQuery(this).val());
149
- }
 
 
 
150
  });
151
- jQuery('#pollq_totalvotes').val(temp_vote_count);
152
  }
153
 
154
  // Add Poll's Answer In Add Poll Page
155
  function add_poll_answer_add() {
156
- jQuery('#poll_answers').append('<tr id="poll-answer-' + count_poll_answer + '"><th width="20%" scope="row" valign="top"></th><td width="80%"><input type="text" size="50" maxlength="200" name="polla_answers[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="' + pollsAdminL10n.text_remove_poll_answer + '" onclick="remove_poll_answer_add(' + count_poll_answer + ');" class="button" /></td></tr>');
157
- count_poll_answer++;
158
- reorder_answer_num();
 
 
159
  }
160
 
161
  // Remove Poll's Answer in Add Poll Page
162
  function remove_poll_answer_add(poll_answer_id) {
163
- jQuery('#poll-answer-' + poll_answer_id).remove();
164
- reorder_answer_num();
 
 
165
  }
166
 
167
  // Add Poll's Answer In Edit Poll Page
168
  function add_poll_answer_edit() {
169
- jQuery('#poll_answers').append('<tr id="poll-answer-new-' + count_poll_answer_new + '"><th width="20%" scope="row" valign="top"></th><td width="60%"><input type="text" size="50" maxlength="200" name="polla_answers_new[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="' + pollsAdminL10n.text_remove_poll_answer + '" onclick="remove_poll_answer_edit(' + count_poll_answer_new + ');" class="button" /></td><td width="20%" align="' + pollsAdminL10n.text_direction + '">0 <input type="text" size="4" name="polla_answers_new_votes[]" value="0" onblur="check_totalvotes();" /></td></tr>');
170
- count_poll_answer_new++;
171
- reorder_answer_num();
 
 
172
  }
173
 
174
  // Remove Poll's Answer In Edit Poll Page
175
  function remove_poll_answer_edit(poll_answer_new_id) {
176
- jQuery('#poll-answer-new-' + poll_answer_new_id).remove();
177
- check_totalvotes();
178
- reorder_answer_num();
 
 
179
  }
180
 
181
  // Check Poll Whether It is Multiple Poll Answer
182
  function check_pollq_multiple() {
183
- if(parseInt(jQuery('#pollq_multiple_yes').val()) == 1) {
184
- jQuery('#pollq_multiple').attr('disabled', false);
185
- } else {
186
- jQuery('#pollq_multiple').val(1);
187
- jQuery('#pollq_multiple').attr('disabled', true);
188
- }
 
 
189
  }
190
 
191
  // Show/Hide Poll's Timestamp
192
  function check_polltimestamp() {
193
- if(jQuery('#edit_polltimestamp').is(':checked')) {
194
- jQuery('#pollq_timestamp').show();
195
- } else {
196
- jQuery('#pollq_timestamp').hide();
197
- }
 
 
198
  }
199
 
200
  // Show/Hide Poll's Expiry Date
201
  function check_pollexpiry() {
202
- if(jQuery('#pollq_expiry_no').is(':checked')) {
203
- jQuery('#pollq_expiry').hide();
204
- } else {
205
- jQuery('#pollq_expiry').show();
206
- }
 
 
207
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  var global_poll_id = 0;
2
  var global_poll_aid = 0;
3
  var global_poll_aid_votes = 0;
9
  delete_poll_confirm = confirm(poll_confirm);
10
  if(delete_poll_confirm) {
11
  global_poll_id = poll_id;
12
+ jQuery(document).ready(function($) {
13
+ $.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_poll + '&pollq_id=' + poll_id + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
14
+ $('#message').html(data);
15
+ $('#message').show();
16
+ $('#poll-' + global_poll_id).remove();
17
+ }});
18
+ });
19
  }
20
  }
21
 
23
  function delete_poll_logs(poll_confirm, nonce) {
24
  delete_poll_logs_confirm = confirm(poll_confirm);
25
  if(delete_poll_logs_confirm) {
26
+ jQuery(document).ready(function($) {
27
+ if($('#delete_logs_yes').is(':checked')) {
28
+ $.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_all_logs + '&delete_logs_yes=yes&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
29
+ $('#message').html(data);
30
+ $('#message').show();
31
+ $('#poll_logs').html(pollsAdminL10n.text_no_poll_logs);
32
+ }});
33
+ } else {
34
+ alert(pollsAdminL10n.text_checkbox_delete_all_logs);
35
+ }
36
+ });
37
  }
38
  }
39
 
41
  function delete_this_poll_logs(poll_id, poll_confirm, nonce) {
42
  delete_poll_logs_confirm = confirm(poll_confirm);
43
  if(delete_poll_logs_confirm) {
44
+ jQuery(document).ready(function($) {
45
+ if($('#delete_logs_yes').is(':checked')) {
46
+ global_poll_id = poll_id;
47
+ $.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_poll_logs + '&pollq_id=' + poll_id + '&delete_logs_yes=yes&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
48
+ $('#message').html(data);
49
+ $('#message').show();
50
+ $('#poll_logs').html(pollsAdminL10n.text_no_poll_logs);
51
+ $('#poll_logs_display').hide();
52
+ $('#poll_logs_display_none').show();
53
+ }});
54
+ } else {
55
+ alert(pollsAdminL10n.text_checkbox_delete_poll_logs);
56
+ }
57
+ });
58
  }
59
  }
60
 
66
  global_poll_aid = poll_aid;
67
  global_poll_aid_votes = poll_aid_vote;
68
  temp_vote_count = 0;
69
+ jQuery(document).ready(function($) {
70
+ $.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_delete_poll_ans + '&pollq_id=' + poll_id + '&polla_aid=' + poll_aid + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
71
+ $('#message').html(data);
72
+ $('#message').show();
73
+ $('#poll_total_votes').html((parseInt($('#poll_total_votes').html()) - parseInt(global_poll_aid_votes)));
74
+ $('#pollq_totalvotes').val(temp_vote_count);
75
+ $('#poll-answer-' + global_poll_aid).remove();
76
+ check_totalvotes();
77
+ reorder_answer_num();
78
+ }});
79
+ });
80
  }
81
  }
82
 
85
  open_poll_confirm = confirm(poll_confirm);
86
  if(open_poll_confirm) {
87
  global_poll_id = poll_id;
88
+ jQuery(document).ready(function($) {
89
+ $.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_open_poll + '&pollq_id=' + poll_id + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
90
+ $('#message').html(data);
91
+ $('#message').show();
92
+ $('#open_poll').hide();
93
+ $('#close_poll').show();
94
+ }});
95
+ });
96
  }
97
  }
98
 
101
  close_poll_confirm = confirm(poll_confirm);
102
  if(close_poll_confirm) {
103
  global_poll_id = poll_id;
104
+ jQuery(document).ready(function($) {
105
+ $.ajax({type: 'POST', url: pollsAdminL10n.admin_ajax_url, data: 'do=' + pollsAdminL10n.text_close_poll + '&pollq_id=' + poll_id + '&action=polls-admin&_ajax_nonce=' + nonce, cache: false, success: function (data) {
106
+ $('#message').html(data);
107
+ $('#message').show();
108
+ $('#open_poll').show();
109
+ $('#close_poll').hide();
110
+ }});
111
+ });
112
  }
113
  }
114
 
115
  // Reoder Answer Answer
116
  function reorder_answer_num() {
117
+ jQuery(document).ready(function($) {
118
+ var pollq_multiple = $('#pollq_multiple');
119
+ var selected = pollq_multiple.val();
120
+ var previous_size = $('> option', pollq_multiple).size();
121
+ pollq_multiple.empty();
122
+ $('#poll_answers tr > th').each(function (i) {
123
+ $(this).text(pollsAdminL10n.text_answer + ' ' + (i+1));
124
+ $(pollq_multiple).append('<option value="' + (i+1) + '">' + (i+1) + '</option>');
125
+ });
126
+ if(selected > 1)
127
+ {
128
+ var current_size = $('> option', pollq_multiple).size();
129
+ if(selected <= current_size)
130
+ $('> option', pollq_multiple).eq(selected - 1).attr('selected', 'selected');
131
+ else if(selected == previous_size)
132
+ $('> option', pollq_multiple).eq(current_size - 1).attr('selected', 'selected');
133
+ }
134
  });
 
 
 
 
 
 
 
 
135
  }
136
 
137
  // Calculate Total Votes
138
  function check_totalvotes() {
139
  temp_vote_count = 0;
140
+ jQuery(document).ready(function($) {
141
+ $("#poll_answers tr td input[size=4]").each(function (i) {
142
+ if(isNaN($(this).val())) {
143
+ temp_vote_count += 0;
144
+ } else {
145
+ temp_vote_count += parseInt($(this).val());
146
+ }
147
+ });
148
+ $('#pollq_totalvotes').val(temp_vote_count);
149
  });
 
150
  }
151
 
152
  // Add Poll's Answer In Add Poll Page
153
  function add_poll_answer_add() {
154
+ jQuery(document).ready(function($) {
155
+ $('#poll_answers').append('<tr id="poll-answer-' + count_poll_answer + '"><th width="20%" scope="row" valign="top"></th><td width="80%"><input type="text" size="50" maxlength="200" name="polla_answers[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="' + pollsAdminL10n.text_remove_poll_answer + '" onclick="remove_poll_answer_add(' + count_poll_answer + ');" class="button" /></td></tr>');
156
+ count_poll_answer++;
157
+ reorder_answer_num();
158
+ });
159
  }
160
 
161
  // Remove Poll's Answer in Add Poll Page
162
  function remove_poll_answer_add(poll_answer_id) {
163
+ jQuery(document).ready(function($) {
164
+ $('#poll-answer-' + poll_answer_id).remove();
165
+ reorder_answer_num();
166
+ });
167
  }
168
 
169
  // Add Poll's Answer In Edit Poll Page
170
  function add_poll_answer_edit() {
171
+ jQuery(document).ready(function($) {
172
+ $('#poll_answers').append('<tr id="poll-answer-new-' + count_poll_answer_new + '"><th width="20%" scope="row" valign="top"></th><td width="60%"><input type="text" size="50" maxlength="200" name="polla_answers_new[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="' + pollsAdminL10n.text_remove_poll_answer + '" onclick="remove_poll_answer_edit(' + count_poll_answer_new + ');" class="button" /></td><td width="20%" align="' + pollsAdminL10n.text_direction + '">0 <input type="text" size="4" name="polla_answers_new_votes[]" value="0" onblur="check_totalvotes();" /></td></tr>');
173
+ count_poll_answer_new++;
174
+ reorder_answer_num();
175
+ });
176
  }
177
 
178
  // Remove Poll's Answer In Edit Poll Page
179
  function remove_poll_answer_edit(poll_answer_new_id) {
180
+ jQuery(document).ready(function($) {
181
+ $('#poll-answer-new-' + poll_answer_new_id).remove();
182
+ check_totalvotes();
183
+ reorder_answer_num();
184
+ });
185
  }
186
 
187
  // Check Poll Whether It is Multiple Poll Answer
188
  function check_pollq_multiple() {
189
+ jQuery(document).ready(function($) {
190
+ if(parseInt($('#pollq_multiple_yes').val()) == 1) {
191
+ $('#pollq_multiple').attr('disabled', false);
192
+ } else {
193
+ $('#pollq_multiple').val(1);
194
+ $('#pollq_multiple').attr('disabled', true);
195
+ }
196
+ });
197
  }
198
 
199
  // Show/Hide Poll's Timestamp
200
  function check_polltimestamp() {
201
+ jQuery(document).ready(function($) {
202
+ if($('#edit_polltimestamp').is(':checked')) {
203
+ $('#pollq_timestamp').show();
204
+ } else {
205
+ $('#pollq_timestamp').hide();
206
+ }
207
+ });
208
  }
209
 
210
  // Show/Hide Poll's Expiry Date
211
  function check_pollexpiry() {
212
+ jQuery(document).ready(function($) {
213
+ if($('#pollq_expiry_no').is(':checked')) {
214
+ $('#pollq_expiry').hide();
215
+ } else {
216
+ $('#pollq_expiry').show();
217
+ }
218
+ });
219
  }
polls-admin-js.js CHANGED
@@ -1,15 +1,16 @@
1
- var global_poll_id=0,global_poll_aid=0,global_poll_aid_votes=0,count_poll_answer_new=0,count_poll_answer=3;function delete_poll(a,b,c){if(delete_poll_confirm=confirm(b))global_poll_id=a,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#poll-"+global_poll_id).remove()}})}
2
- function delete_poll_logs(a,b){(delete_poll_logs_confirm=confirm(a))&&(jQuery("#delete_logs_yes").is(":checked")?jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_all_logs+"&delete_logs_yes=yes&action=polls-admin&_ajax_nonce="+b,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#poll_logs").html(pollsAdminL10n.text_no_poll_logs)}}):alert(pollsAdminL10n.text_checkbox_delete_all_logs))}
3
- function delete_this_poll_logs(a,b,c){if(delete_poll_logs_confirm=confirm(b))jQuery("#delete_logs_yes").is(":checked")?(global_poll_id=a,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll_logs+"&pollq_id="+a+"&delete_logs_yes=yes&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#poll_logs").html(pollsAdminL10n.text_no_poll_logs);jQuery("#poll_logs_display").hide();jQuery("#poll_logs_display_none").show()}})):
4
- alert(pollsAdminL10n.text_checkbox_delete_poll_logs)}
5
- function delete_poll_ans(a,b,c,d,e){if(delete_poll_ans_confirm=confirm(d))global_poll_id=a,global_poll_aid=b,global_poll_aid_votes=c,temp_vote_count=0,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll_ans+"&pollq_id="+a+"&polla_aid="+b+"&action=polls-admin&_ajax_nonce="+e,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#poll_total_votes").html(parseInt(jQuery("#poll_total_votes").html())-parseInt(global_poll_aid_votes));
6
- jQuery("#pollq_totalvotes").val(temp_vote_count);jQuery("#poll-answer-"+global_poll_aid).remove();check_totalvotes();reorder_answer_num()}})}
7
- function opening_poll(a,b,c){if(open_poll_confirm=confirm(b))global_poll_id=a,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_open_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#open_poll").hide();jQuery("#close_poll").show()}})}
8
- function closing_poll(a,b,c){if(close_poll_confirm=confirm(b))global_poll_id=a,jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_close_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(a){jQuery("#message").html(a);jQuery("#message").show();jQuery("#open_poll").show();jQuery("#close_poll").hide()}})}
9
- function reorder_answer_num(){var a=jQuery("#pollq_multiple"),b=a.val(),c=jQuery("> option",a).size();a.empty();jQuery("#poll_answers tr > th").each(function(b){jQuery(this).text(pollsAdminL10n.text_answer+" "+(b+1));jQuery(a).append('<option value="'+(b+1)+'">'+(b+1)+"</option>")});if(1<b){var d=jQuery("> option",a).size();b<=d?jQuery("> option",a).eq(b-1).attr("selected","selected"):b==c&&jQuery("> option",a).eq(d-1).attr("selected","selected")}}
10
- function check_totalvotes(){temp_vote_count=0;jQuery("#poll_answers tr td input[size=4]").each(function(){temp_vote_count=isNaN(jQuery(this).val())?temp_vote_count+0:temp_vote_count+parseInt(jQuery(this).val())});jQuery("#pollq_totalvotes").val(temp_vote_count)}
11
- function add_poll_answer_add(){jQuery("#poll_answers").append('<tr id="poll-answer-'+count_poll_answer+'"><th width="20%" scope="row" valign="top"></th><td width="80%"><input type="text" size="50" maxlength="200" name="polla_answers[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+pollsAdminL10n.text_remove_poll_answer+'" onclick="remove_poll_answer_add('+count_poll_answer+');" class="button" /></td></tr>');count_poll_answer++;reorder_answer_num()}
12
- function remove_poll_answer_add(a){jQuery("#poll-answer-"+a).remove();reorder_answer_num()}
13
- function add_poll_answer_edit(){jQuery("#poll_answers").append('<tr id="poll-answer-new-'+count_poll_answer_new+'"><th width="20%" scope="row" valign="top"></th><td width="60%"><input type="text" size="50" maxlength="200" name="polla_answers_new[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+pollsAdminL10n.text_remove_poll_answer+'" onclick="remove_poll_answer_edit('+count_poll_answer_new+');" class="button" /></td><td width="20%" align="'+pollsAdminL10n.text_direction+'">0 <input type="text" size="4" name="polla_answers_new_votes[]" value="0" onblur="check_totalvotes();" /></td></tr>');
14
- count_poll_answer_new++;reorder_answer_num()}function remove_poll_answer_edit(a){jQuery("#poll-answer-new-"+a).remove();check_totalvotes();reorder_answer_num()}function check_pollq_multiple(){1==parseInt(jQuery("#pollq_multiple_yes").val())?jQuery("#pollq_multiple").attr("disabled",!1):(jQuery("#pollq_multiple").val(1),jQuery("#pollq_multiple").attr("disabled",!0))}
15
- function check_polltimestamp(){jQuery("#edit_polltimestamp").is(":checked")?jQuery("#pollq_timestamp").show():jQuery("#pollq_timestamp").hide()}function check_pollexpiry(){jQuery("#pollq_expiry_no").is(":checked")?jQuery("#pollq_expiry").hide():jQuery("#pollq_expiry").show()};
 
1
+ var global_poll_id=0,global_poll_aid=0,global_poll_aid_votes=0,count_poll_answer_new=0,count_poll_answer=3;function delete_poll(a,c,d){if(delete_poll_confirm=confirm(c))global_poll_id=a,jQuery(document).ready(function(b){b.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+d,cache:!1,success:function(a){b("#message").html(a);b("#message").show();b("#poll-"+global_poll_id).remove()}})})}
2
+ function delete_poll_logs(a,c){(delete_poll_logs_confirm=confirm(a))&&jQuery(document).ready(function(a){a("#delete_logs_yes").is(":checked")?a.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_all_logs+"&delete_logs_yes=yes&action=polls-admin&_ajax_nonce="+c,cache:!1,success:function(b){a("#message").html(b);a("#message").show();a("#poll_logs").html(pollsAdminL10n.text_no_poll_logs)}}):alert(pollsAdminL10n.text_checkbox_delete_all_logs)})}
3
+ function delete_this_poll_logs(a,c,d){(delete_poll_logs_confirm=confirm(c))&&jQuery(document).ready(function(b){b("#delete_logs_yes").is(":checked")?(global_poll_id=a,b.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll_logs+"&pollq_id="+a+"&delete_logs_yes=yes&action=polls-admin&_ajax_nonce="+d,cache:!1,success:function(a){b("#message").html(a);b("#message").show();b("#poll_logs").html(pollsAdminL10n.text_no_poll_logs);b("#poll_logs_display").hide();b("#poll_logs_display_none").show()}})):
4
+ alert(pollsAdminL10n.text_checkbox_delete_poll_logs)})}
5
+ function delete_poll_ans(a,c,d,b,e){if(delete_poll_ans_confirm=confirm(b))global_poll_id=a,global_poll_aid=c,global_poll_aid_votes=d,temp_vote_count=0,jQuery(document).ready(function(b){b.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll_ans+"&pollq_id="+a+"&polla_aid="+c+"&action=polls-admin&_ajax_nonce="+e,cache:!1,success:function(a){b("#message").html(a);b("#message").show();b("#poll_total_votes").html(parseInt(b("#poll_total_votes").html())-parseInt(global_poll_aid_votes));
6
+ b("#pollq_totalvotes").val(temp_vote_count);b("#poll-answer-"+global_poll_aid).remove();check_totalvotes();reorder_answer_num()}})})}
7
+ function opening_poll(a,c,d){if(open_poll_confirm=confirm(c))global_poll_id=a,jQuery(document).ready(function(b){b.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_open_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+d,cache:!1,success:function(a){b("#message").html(a);b("#message").show();b("#open_poll").hide();b("#close_poll").show()}})})}
8
+ function closing_poll(a,c,d){if(close_poll_confirm=confirm(c))global_poll_id=a,jQuery(document).ready(function(b){b.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_close_poll+"&pollq_id="+a+"&action=polls-admin&_ajax_nonce="+d,cache:!1,success:function(a){b("#message").html(a);b("#message").show();b("#open_poll").show();b("#close_poll").hide()}})})}
9
+ function reorder_answer_num(){jQuery(document).ready(function(a){var c=a("#pollq_multiple"),d=c.val(),b=a("> option",c).size();c.empty();a("#poll_answers tr > th").each(function(b){a(this).text(pollsAdminL10n.text_answer+" "+(b+1));a(c).append('<option value="'+(b+1)+'">'+(b+1)+"</option>")});if(1<d){var e=a("> option",c).size();d<=e?a("> option",c).eq(d-1).attr("selected","selected"):d==b&&a("> option",c).eq(e-1).attr("selected","selected")}})}
10
+ function check_totalvotes(){temp_vote_count=0;jQuery(document).ready(function(a){a("#poll_answers tr td input[size=4]").each(function(c){temp_vote_count=isNaN(a(this).val())?temp_vote_count+0:temp_vote_count+parseInt(a(this).val())});a("#pollq_totalvotes").val(temp_vote_count)})}
11
+ function add_poll_answer_add(){jQuery(document).ready(function(a){a("#poll_answers").append('<tr id="poll-answer-'+count_poll_answer+'"><th width="20%" scope="row" valign="top"></th><td width="80%"><input type="text" size="50" maxlength="200" name="polla_answers[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+pollsAdminL10n.text_remove_poll_answer+'" onclick="remove_poll_answer_add('+count_poll_answer+');" class="button" /></td></tr>');count_poll_answer++;reorder_answer_num()})}
12
+ function remove_poll_answer_add(a){jQuery(document).ready(function(c){c("#poll-answer-"+a).remove();reorder_answer_num()})}
13
+ function add_poll_answer_edit(){jQuery(document).ready(function(a){a("#poll_answers").append('<tr id="poll-answer-new-'+count_poll_answer_new+'"><th width="20%" scope="row" valign="top"></th><td width="60%"><input type="text" size="50" maxlength="200" name="polla_answers_new[]" />&nbsp;&nbsp;&nbsp;<input type="button" value="'+pollsAdminL10n.text_remove_poll_answer+'" onclick="remove_poll_answer_edit('+count_poll_answer_new+');" class="button" /></td><td width="20%" align="'+pollsAdminL10n.text_direction+
14
+ '">0 <input type="text" size="4" name="polla_answers_new_votes[]" value="0" onblur="check_totalvotes();" /></td></tr>');count_poll_answer_new++;reorder_answer_num()})}function remove_poll_answer_edit(a){jQuery(document).ready(function(c){c("#poll-answer-new-"+a).remove();check_totalvotes();reorder_answer_num()})}
15
+ function check_pollq_multiple(){jQuery(document).ready(function(a){1==parseInt(a("#pollq_multiple_yes").val())?a("#pollq_multiple").attr("disabled",!1):(a("#pollq_multiple").val(1),a("#pollq_multiple").attr("disabled",!0))})}function check_polltimestamp(){jQuery(document).ready(function(a){a("#edit_polltimestamp").is(":checked")?a("#pollq_timestamp").show():a("#pollq_timestamp").hide()})}
16
+ function check_pollexpiry(){jQuery(document).ready(function(a){a("#pollq_expiry_no").is(":checked")?a("#pollq_expiry").hide():a("#pollq_expiry").show()})};
polls-js.dev.js CHANGED
@@ -1,21 +1,3 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress Plugin: WP-Polls |
5
- | Copyright © 2012 Lester "GaMerZ" Chan |
6
- | |
7
- | File Written By: |
8
- | - Lester "GaMerZ" Chan |
9
- | - http://lesterchan.net |
10
- | |
11
- | File Information: |
12
- | - Polls Javascript File |
13
- | - wp-content/plugins/wp-polls/polls-js.js |
14
- | |
15
- +----------------------------------------------------------------+
16
- */
17
-
18
-
19
  // Variables
20
  var poll_id = 0;
21
  var poll_answer_id = '';
@@ -23,133 +5,143 @@ var is_being_voted = false;
23
  pollsL10n.show_loading = parseInt(pollsL10n.show_loading);
24
  pollsL10n.show_fading = parseInt(pollsL10n.show_fading);
25
 
26
- // When User Vote For Poll
27
  function poll_vote(current_poll_id) {
28
- if(!is_being_voted) {
29
- set_is_being_voted(true);
30
- poll_id = current_poll_id;
31
- poll_answer_id = '';
32
- poll_multiple_ans = 0;
33
- poll_multiple_ans_count = 0;
34
- if(jQuery('#poll_multiple_ans_' + poll_id).length) {
35
- poll_multiple_ans = parseInt(jQuery('#poll_multiple_ans_' + poll_id).val());
36
- }
37
- jQuery('#polls_form_' + poll_id + ' input:checkbox, #polls_form_' + poll_id + ' input:radio, #polls_form_' + poll_id + ' option').each(function(i){
38
- if (jQuery(this).is(':checked') || jQuery(this).is(':selected')) {
39
- if(poll_multiple_ans > 0) {
40
- poll_answer_id = jQuery(this).val() + ',' + poll_answer_id;
41
- poll_multiple_ans_count++;
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  } else {
43
- poll_answer_id = parseInt(jQuery(this).val());
 
44
  }
45
- }
46
- });
47
- if(poll_multiple_ans > 0) {
48
- if(poll_multiple_ans_count > 0 && poll_multiple_ans_count <= poll_multiple_ans) {
49
- poll_answer_id = poll_answer_id.substring(0, (poll_answer_id.length-1));
50
- poll_process();
51
- } else if(poll_multiple_ans_count == 0) {
52
- set_is_being_voted(false);
53
- alert(pollsL10n.text_valid);
54
  } else {
55
- set_is_being_voted(false);
56
- alert(pollsL10n.text_multiple + ' ' + poll_multiple_ans);
 
 
 
 
57
  }
58
  } else {
59
- if(poll_answer_id > 0) {
60
- poll_process();
61
- } else {
62
- set_is_being_voted(false);
63
- alert(pollsL10n.text_valid);
64
- }
65
  }
66
- } else {
67
- alert(pollsL10n.text_wait);
68
- }
69
  }
70
 
71
  // Process Poll (User Click "Vote" Button)
72
  function poll_process() {
73
- poll_nonce = jQuery('#poll_' + poll_id + '_nonce').val();
74
- if(pollsL10n.show_fading) {
75
- jQuery('#polls-' + poll_id).fadeTo('def', 0, function () {
 
 
 
 
 
 
 
76
  if(pollsL10n.show_loading) {
77
- jQuery('#polls-' + poll_id + '-loading').show();
78
  }
79
- jQuery.ajax({type: 'POST', url: pollsL10n.ajax_url, data: 'action=polls&view=process&poll_id=' + poll_id + '&poll_' + poll_id + '=' + poll_answer_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
80
- });
81
- } else {
82
- if(pollsL10n.show_loading) {
83
- jQuery('#polls-' + poll_id + '-loading').show();
84
  }
85
- jQuery.ajax({type: 'POST', url: pollsL10n.ajax_url, data: 'action=polls&view=process&poll_id=' + poll_id + '&poll_' + poll_id + '=' + poll_answer_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
86
- }
87
  }
88
 
89
  // Poll's Result (User Click "View Results" Link)
90
  function poll_result(current_poll_id) {
91
- if(!is_being_voted) {
92
- set_is_being_voted(true);
93
- poll_id = current_poll_id;
94
- poll_nonce = jQuery('#poll_' + poll_id + '_nonce').val();
95
- if(pollsL10n.show_fading) {
96
- jQuery('#polls-' + poll_id).fadeTo('def', 0, function () {
 
 
 
 
 
 
 
97
  if(pollsL10n.show_loading) {
98
- jQuery('#polls-' + poll_id + '-loading').show();
99
  }
100
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
101
- });
102
- } else {
103
- if(pollsL10n.show_loading) {
104
- jQuery('#polls-' + poll_id + '-loading').show();
105
  }
106
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
 
107
  }
108
- } else {
109
- alert(pollsL10n.text_wait);
110
- }
111
  }
112
 
113
  // Poll's Voting Booth (User Click "Vote" Link)
114
  function poll_booth(current_poll_id) {
115
- if(!is_being_voted) {
116
- set_is_being_voted(true);
117
- poll_id = current_poll_id;
118
- poll_nonce = jQuery('#poll_' + poll_id + '_nonce').val();
119
- if(pollsL10n.show_fading) {
120
- jQuery('#polls-' + poll_id).fadeTo('def', 0, function () {
 
 
 
 
 
 
 
121
  if(pollsL10n.show_loading) {
122
- jQuery('#polls-' + poll_id + '-loading').show();
123
  }
124
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
125
- });
126
- } else {
127
- if(pollsL10n.show_loading) {
128
- jQuery('#polls-' + poll_id + '-loading').show();
129
  }
130
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
 
131
  }
132
- } else {
133
- alert(pollsL10n.text_wait);
134
- }
135
  }
136
 
137
  // Poll Process Successfully
138
  function poll_process_success(data) {
139
- jQuery('#polls-' + poll_id).replaceWith(data);
140
- if(pollsL10n.show_loading) {
141
- jQuery('#polls-' + poll_id + '-loading').hide();
142
- }
143
- if(pollsL10n.show_fading) {
144
- jQuery('#polls-' + poll_id).fadeTo('def', 1, function () {
145
- set_is_being_voted(false);
146
- });
147
- } else {
148
- set_is_being_voted(false);
149
- }
 
 
150
  }
151
 
152
  // Set is_being_voted Status
153
  function set_is_being_voted(voted_status) {
154
  is_being_voted = voted_status;
155
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  // Variables
2
  var poll_id = 0;
3
  var poll_answer_id = '';
5
  pollsL10n.show_loading = parseInt(pollsL10n.show_loading);
6
  pollsL10n.show_fading = parseInt(pollsL10n.show_fading);
7
 
8
+ // When User Vote For Poll
9
  function poll_vote(current_poll_id) {
10
+ jQuery(document).ready(function($) {
11
+ if(!is_being_voted) {
12
+ set_is_being_voted(true);
13
+ poll_id = current_poll_id;
14
+ poll_answer_id = '';
15
+ poll_multiple_ans = 0;
16
+ poll_multiple_ans_count = 0;
17
+ if($('#poll_multiple_ans_' + poll_id).length) {
18
+ poll_multiple_ans = parseInt($('#poll_multiple_ans_' + poll_id).val());
19
+ }
20
+ $('#polls_form_' + poll_id + ' input:checkbox, #polls_form_' + poll_id + ' input:radio, #polls_form_' + poll_id + ' option').each(function(i){
21
+ if ($(this).is(':checked') || $(this).is(':selected')) {
22
+ if(poll_multiple_ans > 0) {
23
+ poll_answer_id = $(this).val() + ',' + poll_answer_id;
24
+ poll_multiple_ans_count++;
25
+ } else {
26
+ poll_answer_id = parseInt($(this).val());
27
+ }
28
+ }
29
+ });
30
+ if(poll_multiple_ans > 0) {
31
+ if(poll_multiple_ans_count > 0 && poll_multiple_ans_count <= poll_multiple_ans) {
32
+ poll_answer_id = poll_answer_id.substring(0, (poll_answer_id.length-1));
33
+ poll_process();
34
+ } else if(poll_multiple_ans_count == 0) {
35
+ set_is_being_voted(false);
36
+ alert(pollsL10n.text_valid);
37
  } else {
38
+ set_is_being_voted(false);
39
+ alert(pollsL10n.text_multiple + ' ' + poll_multiple_ans);
40
  }
 
 
 
 
 
 
 
 
 
41
  } else {
42
+ if(poll_answer_id > 0) {
43
+ poll_process();
44
+ } else {
45
+ set_is_being_voted(false);
46
+ alert(pollsL10n.text_valid);
47
+ }
48
  }
49
  } else {
50
+ alert(pollsL10n.text_wait);
 
 
 
 
 
51
  }
52
+ });
 
 
53
  }
54
 
55
  // Process Poll (User Click "Vote" Button)
56
  function poll_process() {
57
+ jQuery(document).ready(function($) {
58
+ poll_nonce = $('#poll_' + poll_id + '_nonce').val();
59
+ if(pollsL10n.show_fading) {
60
+ $('#polls-' + poll_id).fadeTo('def', 0, function () {
61
+ if(pollsL10n.show_loading) {
62
+ $('#polls-' + poll_id + '-loading').show();
63
+ }
64
+ $.ajax({type: 'POST', xhrFields: {withCredentials: true}, url: pollsL10n.ajax_url, data: 'action=polls&view=process&poll_id=' + poll_id + '&poll_' + poll_id + '=' + poll_answer_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
65
+ });
66
+ } else {
67
  if(pollsL10n.show_loading) {
68
+ $('#polls-' + poll_id + '-loading').show();
69
  }
70
+ $.ajax({type: 'POST', xhrFields: {withCredentials: true}, url: pollsL10n.ajax_url, data: 'action=polls&view=process&poll_id=' + poll_id + '&poll_' + poll_id + '=' + poll_answer_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
 
 
 
 
71
  }
72
+ });
 
73
  }
74
 
75
  // Poll's Result (User Click "View Results" Link)
76
  function poll_result(current_poll_id) {
77
+ jQuery(document).ready(function($) {
78
+ if(!is_being_voted) {
79
+ set_is_being_voted(true);
80
+ poll_id = current_poll_id;
81
+ poll_nonce = $('#poll_' + poll_id + '_nonce').val();
82
+ if(pollsL10n.show_fading) {
83
+ $('#polls-' + poll_id).fadeTo('def', 0, function () {
84
+ if(pollsL10n.show_loading) {
85
+ $('#polls-' + poll_id + '-loading').show();
86
+ }
87
+ $.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
88
+ });
89
+ } else {
90
  if(pollsL10n.show_loading) {
91
+ $('#polls-' + poll_id + '-loading').show();
92
  }
93
+ $.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=result&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
 
 
 
 
94
  }
95
+ } else {
96
+ alert(pollsL10n.text_wait);
97
  }
98
+ });
 
 
99
  }
100
 
101
  // Poll's Voting Booth (User Click "Vote" Link)
102
  function poll_booth(current_poll_id) {
103
+ jQuery(document).ready(function($) {
104
+ if(!is_being_voted) {
105
+ set_is_being_voted(true);
106
+ poll_id = current_poll_id;
107
+ poll_nonce = $('#poll_' + poll_id + '_nonce').val();
108
+ if(pollsL10n.show_fading) {
109
+ $('#polls-' + poll_id).fadeTo('def', 0, function () {
110
+ if(pollsL10n.show_loading) {
111
+ $('#polls-' + poll_id + '-loading').show();
112
+ }
113
+ $.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
114
+ });
115
+ } else {
116
  if(pollsL10n.show_loading) {
117
+ $('#polls-' + poll_id + '-loading').show();
118
  }
119
+ $.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'action=polls&view=booth&poll_id=' + poll_id + '&poll_' + poll_id + '_nonce=' + poll_nonce, cache: false, success: poll_process_success});
 
 
 
 
120
  }
121
+ } else {
122
+ alert(pollsL10n.text_wait);
123
  }
124
+ });
 
 
125
  }
126
 
127
  // Poll Process Successfully
128
  function poll_process_success(data) {
129
+ jQuery(document).ready(function($) {
130
+ $('#polls-' + poll_id).replaceWith(data);
131
+ if(pollsL10n.show_loading) {
132
+ $('#polls-' + poll_id + '-loading').hide();
133
+ }
134
+ if(pollsL10n.show_fading) {
135
+ $('#polls-' + poll_id).fadeTo('def', 1, function () {
136
+ set_is_being_voted(false);
137
+ });
138
+ } else {
139
+ set_is_being_voted(false);
140
+ }
141
+ });
142
  }
143
 
144
  // Set is_being_voted Status
145
  function set_is_being_voted(voted_status) {
146
  is_being_voted = voted_status;
147
+ }
polls-js.js CHANGED
@@ -1 +1,10 @@
1
- var poll_id=0;var poll_answer_id='';var is_being_voted=false;pollsL10n.show_loading=parseInt(pollsL10n.show_loading);pollsL10n.show_fading=parseInt(pollsL10n.show_fading);function poll_vote(current_poll_id){if(!is_being_voted){set_is_being_voted(true);poll_id=current_poll_id;poll_answer_id='';poll_multiple_ans=0;poll_multiple_ans_count=0;if(jQuery('#poll_multiple_ans_'+poll_id).length){poll_multiple_ans=parseInt(jQuery('#poll_multiple_ans_'+poll_id).val())}jQuery('#polls_form_'+poll_id+' input:checkbox, #polls_form_'+poll_id+' input:radio, #polls_form_'+poll_id+' option').each(function(i){if(jQuery(this).is(':checked')||jQuery(this).is(':selected')){if(poll_multiple_ans>0){poll_answer_id=jQuery(this).val()+','+poll_answer_id;poll_multiple_ans_count++}else{poll_answer_id=parseInt(jQuery(this).val())}}});if(poll_multiple_ans>0){if(poll_multiple_ans_count>0&&poll_multiple_ans_count<=poll_multiple_ans){poll_answer_id=poll_answer_id.substring(0,(poll_answer_id.length-1));poll_process()}else if(poll_multiple_ans_count==0){set_is_being_voted(false);alert(pollsL10n.text_valid)}else{set_is_being_voted(false);alert(pollsL10n.text_multiple+' '+poll_multiple_ans)}}else{if(poll_answer_id>0){poll_process()}else{set_is_being_voted(false);alert(pollsL10n.text_valid)}}}else{alert(pollsL10n.text_wait)}}function poll_process(){poll_nonce=jQuery('#poll_'+poll_id+'_nonce').val();if(pollsL10n.show_fading){jQuery('#polls-'+poll_id).fadeTo('def',0,function(){if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').show()}jQuery.ajax({type:'POST',url:pollsL10n.ajax_url,data:'action=polls&view=process&poll_id='+poll_id+'&poll_'+poll_id+'='+poll_answer_id+'&poll_'+poll_id+'_nonce='+poll_nonce,cache:false,success:poll_process_success})})}else{if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').show()}jQuery.ajax({type:'POST',url:pollsL10n.ajax_url,data:'action=polls&view=process&poll_id='+poll_id+'&poll_'+poll_id+'='+poll_answer_id+'&poll_'+poll_id+'_nonce='+poll_nonce,cache:false,success:poll_process_success})}}function poll_result(current_poll_id){if(!is_being_voted){set_is_being_voted(true);poll_id=current_poll_id;poll_nonce=jQuery('#poll_'+poll_id+'_nonce').val();if(pollsL10n.show_fading){jQuery('#polls-'+poll_id).fadeTo('def',0,function(){if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').show()}jQuery.ajax({type:'GET',url:pollsL10n.ajax_url,data:'action=polls&view=result&poll_id='+poll_id+'&poll_'+poll_id+'_nonce='+poll_nonce,cache:false,success:poll_process_success})})}else{if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').show()}jQuery.ajax({type:'GET',url:pollsL10n.ajax_url,data:'action=polls&view=result&poll_id='+poll_id+'&poll_'+poll_id+'_nonce='+poll_nonce,cache:false,success:poll_process_success})}}else{alert(pollsL10n.text_wait)}}function poll_booth(current_poll_id){if(!is_being_voted){set_is_being_voted(true);poll_id=current_poll_id;poll_nonce=jQuery('#poll_'+poll_id+'_nonce').val();if(pollsL10n.show_fading){jQuery('#polls-'+poll_id).fadeTo('def',0,function(){if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').show()}jQuery.ajax({type:'GET',url:pollsL10n.ajax_url,data:'action=polls&view=booth&poll_id='+poll_id+'&poll_'+poll_id+'_nonce='+poll_nonce,cache:false,success:poll_process_success})})}else{if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').show()}jQuery.ajax({type:'GET',url:pollsL10n.ajax_url,data:'action=polls&view=booth&poll_id='+poll_id+'&poll_'+poll_id+'_nonce='+poll_nonce,cache:false,success:poll_process_success})}}else{alert(pollsL10n.text_wait)}}function poll_process_success(data){jQuery('#polls-'+poll_id).replaceWith(data);if(pollsL10n.show_loading){jQuery('#polls-'+poll_id+'-loading').hide()}if(pollsL10n.show_fading){jQuery('#polls-'+poll_id).fadeTo('def',1,function(){set_is_being_voted(false)})}else{set_is_being_voted(false)}}function set_is_being_voted(voted_status){is_being_voted=voted_status}
 
 
 
 
 
 
 
 
 
1
+ var poll_id=0,poll_answer_id="",is_being_voted=!1;pollsL10n.show_loading=parseInt(pollsL10n.show_loading);pollsL10n.show_fading=parseInt(pollsL10n.show_fading);
2
+ function poll_vote(a){is_being_voted?alert(pollsL10n.text_wait):(set_is_being_voted(!0),poll_id=a,poll_answer_id="",poll_multiple_ans_count=poll_multiple_ans=0,jQuery("#poll_multiple_ans_"+poll_id).length&&(poll_multiple_ans=parseInt(jQuery("#poll_multiple_ans_"+poll_id).val())),jQuery("#polls_form_"+poll_id+" input:checkbox, #polls_form_"+poll_id+" input:radio").each(function(){jQuery(this).is(":checked")&&(0<poll_multiple_ans?(poll_answer_id=jQuery(this).val()+","+poll_answer_id,poll_multiple_ans_count++):
3
+ poll_answer_id=parseInt(jQuery(this).val()))}),0<poll_multiple_ans?0<poll_multiple_ans_count&&poll_multiple_ans_count<=poll_multiple_ans?(poll_answer_id=poll_answer_id.substring(0,poll_answer_id.length-1),poll_process()):0==poll_multiple_ans_count?(set_is_being_voted(!1),alert(pollsL10n.text_valid)):(set_is_being_voted(!1),alert(pollsL10n.text_multiple+" "+poll_multiple_ans)):0<poll_answer_id?poll_process():(set_is_being_voted(!1),alert(pollsL10n.text_valid)))}
4
+ function poll_process(){poll_nonce=jQuery("#poll_"+poll_id+"_nonce").val();pollsL10n.show_fading?jQuery("#polls-"+poll_id).fadeTo("def",0,function(){pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"POST",xhrFields: {withCredentials: true},url:pollsL10n.ajax_url,data:"action=polls&view=process&poll_id="+poll_id+"&poll_"+poll_id+"="+poll_answer_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success})}):(pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show(),jQuery.ajax({type:"POST",xhrFields: {withCredentials: true},
5
+ url:pollsL10n.ajax_url,data:"action=polls&view=process&poll_id="+poll_id+"&poll_"+poll_id+"="+poll_answer_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success}))}
6
+ function poll_result(a){is_being_voted?alert(pollsL10n.text_wait):(set_is_being_voted(!0),poll_id=a,poll_nonce=jQuery("#poll_"+poll_id+"_nonce").val(),pollsL10n.show_fading?jQuery("#polls-"+poll_id).fadeTo("def",0,function(){pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"action=polls&view=result&poll_id="+poll_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success})}):(pollsL10n.show_loading&&jQuery("#polls-"+
7
+ poll_id+"-loading").show(),jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"action=polls&view=result&poll_id="+poll_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success})))}
8
+ function poll_booth(a){is_being_voted?alert(pollsL10n.text_wait):(set_is_being_voted(!0),poll_id=a,poll_nonce=jQuery("#poll_"+poll_id+"_nonce").val(),pollsL10n.show_fading?jQuery("#polls-"+poll_id).fadeTo("def",0,function(){pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").show();jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"action=polls&view=booth&poll_id="+poll_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success})}):(pollsL10n.show_loading&&jQuery("#polls-"+
9
+ poll_id+"-loading").show(),jQuery.ajax({type:"GET",url:pollsL10n.ajax_url,data:"action=polls&view=booth&poll_id="+poll_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success})))}function poll_process_success(a){jQuery("#polls-"+poll_id).replaceWith(a);pollsL10n.show_loading&&jQuery("#polls-"+poll_id+"-loading").hide();pollsL10n.show_fading?jQuery("#polls-"+poll_id).fadeTo("def",1,function(){set_is_being_voted(!1)}):set_is_being_voted(!1)}
10
+ function set_is_being_voted(a){is_being_voted=a};
polls-logs.php CHANGED
@@ -125,7 +125,6 @@ if(!empty($_POST['do'])) {
125
  ?>
126
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } else { echo '<div id="message" class="updated" style="display: none;"></div>'; } ?>
127
  <div class="wrap">
128
- <div id="icon-wp-polls" class="icon32"><br /></div>
129
  <h2><?php _e('Poll\'s Logs', 'wp-polls'); ?></h2>
130
  <h3><?php echo $poll_question; ?></h3>
131
  <p>
@@ -198,7 +197,7 @@ if(!empty($_POST['do'])) {
198
  </select>
199
  &nbsp;&nbsp;
200
  <select name="num_choices" size="1">
201
- <?php
202
  for($i = 1; $i <= $poll_multiple; $i++) {
203
  if($i == 1) {
204
  echo '<option value="1">'.__('1 Answer', 'wp-polls').'</option>';
@@ -229,7 +228,7 @@ if(!empty($_POST['do'])) {
229
  </form>
230
  <?php } else { ?>
231
  &nbsp;
232
- <?php } // End if($poll_multiple > -1) ?>
233
  </td>
234
  </tr>
235
  <tr>
@@ -264,7 +263,7 @@ if(!empty($_POST['do'])) {
264
  </form>
265
  <?php } else { ?>
266
  &nbsp;
267
- <?php } // End if($poll_multiple > -1) ?>
268
  </td>
269
  <td align="center"><input type="button" value="<?php _e('Clear Filter', 'wp-polls'); ?>" onclick="self.location.href = '<?php echo htmlspecialchars($base_page); ?>&amp;mode=logs&amp;id=<?php echo $poll_id; ?>';" class="button" /></td>
270
  </tr>
@@ -310,14 +309,14 @@ if(!empty($_POST['do'])) {
310
  echo "<td colspan=\"4\"><strong>".__('User', 'wp-polls')." ".number_format_i18n($k).": $pollip_user</strong></td>\n";
311
  echo '</tr>';
312
  $k++;
313
- }
314
  echo "<tr $style>\n";
315
  echo "<td>{$pollip_answers[$pollip_aid]}</td>\n";
316
- echo "<td><a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$pollip_ip\" title=\"$pollip_ip\">$pollip_ip</a></td>\n";
317
  echo "<td>$pollip_host</td>\n";
318
  echo "<td>$pollip_date</td>\n";
319
  echo "</tr>\n";
320
- $temp_pollip_user = $pollip_user;
321
  $i++;
322
  $j++;
323
  }
@@ -327,7 +326,7 @@ if(!empty($_POST['do'])) {
327
  $pollip_user = stripslashes($poll_ip->pollip_user);
328
  $pollip_ip = $poll_ip->pollip_ip;
329
  $pollip_host = $poll_ip->pollip_host;
330
- $pollip_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));
331
  if($pollip_aid != $poll_last_aid) {
332
  if($pollip_aid == 0) {
333
  echo "<tr class=\"highlight\">\n<td colspan=\"4\"><strong>$pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
@@ -351,7 +350,7 @@ if(!empty($_POST['do'])) {
351
  echo "<tr $style>\n";
352
  echo "<td>".number_format_i18n($i)."</td>\n";
353
  echo "<td>$pollip_user</td>\n";
354
- echo "<td><a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$pollip_ip\" title=\"$pollip_ip\">$pollip_ip</a> / $pollip_host</td>\n";
355
  echo "<td>$pollip_date</td>\n";
356
  echo "</tr>\n";
357
  $poll_last_aid = $pollip_aid;
@@ -383,7 +382,7 @@ if(!empty($_POST['do'])) {
383
  <strong><?php _e('Are You Sure You Want To Delete Logs For This Poll Only?', 'wp-polls'); ?></strong><br /><br />
384
  <input type="checkbox" id="delete_logs_yes" name="delete_logs_yes" value="yes" />&nbsp;<label for="delete_logs_yes"><?php _e('Yes', 'wp-polls'); ?></label><br /><br />
385
  <input type="button" name="do" value="<?php _e('Delete Logs For This Poll Only', 'wp-polls'); ?>" class="button" onclick="delete_this_poll_logs(<?php echo $poll_id; ?>, '<?php printf(esc_js(__('You are about to delete poll logs for this poll \'%s\' ONLY. This action is not reversible.', 'wp-polls')), htmlspecialchars($poll_question)); ?>', '<?php echo wp_create_nonce('wp-polls_delete-poll-logs'); ?>');" />
386
- <?php
387
  } else {
388
  _e('No poll logs available for this poll.', 'wp-polls');
389
  }
125
  ?>
126
  <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } else { echo '<div id="message" class="updated" style="display: none;"></div>'; } ?>
127
  <div class="wrap">
 
128
  <h2><?php _e('Poll\'s Logs', 'wp-polls'); ?></h2>
129
  <h3><?php echo $poll_question; ?></h3>
130
  <p>
197
  </select>
198
  &nbsp;&nbsp;
199
  <select name="num_choices" size="1">
200
+ <?php
201
  for($i = 1; $i <= $poll_multiple; $i++) {
202
  if($i == 1) {
203
  echo '<option value="1">'.__('1 Answer', 'wp-polls').'</option>';
228
  </form>
229
  <?php } else { ?>
230
  &nbsp;
231
+ <?php } // End if($poll_multiple > -1) ?>
232
  </td>
233
  </tr>
234
  <tr>
263
  </form>
264
  <?php } else { ?>
265
  &nbsp;
266
+ <?php } // End if($poll_multiple > -1) ?>
267
  </td>
268
  <td align="center"><input type="button" value="<?php _e('Clear Filter', 'wp-polls'); ?>" onclick="self.location.href = '<?php echo htmlspecialchars($base_page); ?>&amp;mode=logs&amp;id=<?php echo $poll_id; ?>';" class="button" /></td>
269
  </tr>
309
  echo "<td colspan=\"4\"><strong>".__('User', 'wp-polls')." ".number_format_i18n($k).": $pollip_user</strong></td>\n";
310
  echo '</tr>';
311
  $k++;
312
+ }
313
  echo "<tr $style>\n";
314
  echo "<td>{$pollip_answers[$pollip_aid]}</td>\n";
315
+ echo "<td><a href=\"http://ipinfo.io/$pollip_ip\" title=\"$pollip_ip\">$pollip_ip</a></td>\n";
316
  echo "<td>$pollip_host</td>\n";
317
  echo "<td>$pollip_date</td>\n";
318
  echo "</tr>\n";
319
+ $temp_pollip_user = $pollip_user;
320
  $i++;
321
  $j++;
322
  }
326
  $pollip_user = stripslashes($poll_ip->pollip_user);
327
  $pollip_ip = $poll_ip->pollip_ip;
328
  $pollip_host = $poll_ip->pollip_host;
329
+ $pollip_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));
330
  if($pollip_aid != $poll_last_aid) {
331
  if($pollip_aid == 0) {
332
  echo "<tr class=\"highlight\">\n<td colspan=\"4\"><strong>$pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
350
  echo "<tr $style>\n";
351
  echo "<td>".number_format_i18n($i)."</td>\n";
352
  echo "<td>$pollip_user</td>\n";
353
+ echo "<td><a href=\"http://ipinfo.io/$pollip_ip\" title=\"$pollip_ip\">$pollip_ip</a> / $pollip_host</td>\n";
354
  echo "<td>$pollip_date</td>\n";
355
  echo "</tr>\n";
356
  $poll_last_aid = $pollip_aid;
382
  <strong><?php _e('Are You Sure You Want To Delete Logs For This Poll Only?', 'wp-polls'); ?></strong><br /><br />
383
  <input type="checkbox" id="delete_logs_yes" name="delete_logs_yes" value="yes" />&nbsp;<label for="delete_logs_yes"><?php _e('Yes', 'wp-polls'); ?></label><br /><br />
384
  <input type="button" name="do" value="<?php _e('Delete Logs For This Poll Only', 'wp-polls'); ?>" class="button" onclick="delete_this_poll_logs(<?php echo $poll_id; ?>, '<?php printf(esc_js(__('You are about to delete poll logs for this poll \'%s\' ONLY. This action is not reversible.', 'wp-polls')), htmlspecialchars($poll_question)); ?>', '<?php echo wp_create_nonce('wp-polls_delete-poll-logs'); ?>');" />
385
+ <?php
386
  } else {
387
  _e('No poll logs available for this poll.', 'wp-polls');
388
  }
polls-manager.php CHANGED
@@ -173,7 +173,6 @@ switch($mode) {
173
  <input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
174
  <input type="hidden" name="pollq_active" value="<?php echo $poll_active; ?>" />
175
  <div class="wrap">
176
- <div id="icon-wp-polls" class="icon32"><br /></div>
177
  <h2><?php _e('Edit Poll', 'wp-polls'); ?></h2>
178
  <!-- Poll Question -->
179
  <h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
@@ -323,7 +322,6 @@ switch($mode) {
323
 
324
  <!-- Manage Polls -->
325
  <div class="wrap">
326
- <div id="icon-wp-polls" class="icon32"><br /></div>
327
  <h2><?php _e('Manage Polls', 'wp-polls'); ?></h2>
328
  <h3><?php _e('Polls', 'wp-polls'); ?></h3>
329
  <br style="clear" />
173
  <input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
174
  <input type="hidden" name="pollq_active" value="<?php echo $poll_active; ?>" />
175
  <div class="wrap">
 
176
  <h2><?php _e('Edit Poll', 'wp-polls'); ?></h2>
177
  <!-- Poll Question -->
178
  <h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
322
 
323
  <!-- Manage Polls -->
324
  <div class="wrap">
 
325
  <h2><?php _e('Manage Polls', 'wp-polls'); ?></h2>
326
  <h3><?php _e('Polls', 'wp-polls'); ?></h3>
327
  <br style="clear" />
polls-options.php CHANGED
@@ -125,7 +125,6 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
125
  <form id="poll_options_form" method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
126
  <?php wp_nonce_field('wp-polls_options'); ?>
127
  <div class="wrap">
128
- <div id="icon-wp-polls" class="icon32"><br /></div>
129
  <h2><?php _e('Poll Options', 'wp-polls'); ?></h2>
130
  <!-- Poll Bar Style -->
131
  <h3><?php _e('Poll Bar Style', 'wp-polls'); ?></h3>
125
  <form id="poll_options_form" method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
126
  <?php wp_nonce_field('wp-polls_options'); ?>
127
  <div class="wrap">
 
128
  <h2><?php _e('Poll Options', 'wp-polls'); ?></h2>
129
  <!-- Poll Bar Style -->
130
  <h3><?php _e('Poll Bar Style', 'wp-polls'); ?></h3>
polls-templates.php CHANGED
@@ -46,7 +46,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
46
  $poll_template_disable = trim($_POST['poll_template_disable']);
47
  $poll_template_error = trim($_POST['poll_template_error']);
48
  $update_poll_queries = array();
49
- $update_poll_text = array();
50
  $update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
51
  $update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
52
  $update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
@@ -153,8 +153,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
153
  <form id="poll_template_form" method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
154
  <?php wp_nonce_field('wp-polls_templates'); ?>
155
  <div class="wrap">
156
- <div id="icon-wp-polls" class="icon32"><br /></div>
157
- <h2><?php _e('Poll Templates', 'wp-polls'); ?></h2>
158
  <!-- Template Variables -->
159
  <h3><?php _e('Template Variables', 'wp-polls'); ?></h3>
160
  <table class="widefat">
@@ -293,7 +292,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
293
  </td>
294
  <td valign="top"><textarea cols="80" rows="15" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_voteheader'))); ?></textarea></td>
295
  </tr>
296
- <tr>
297
  <td width="30%" valign="top">
298
  <strong><?php _e('Voting Form Body:', 'wp-polls'); ?></strong><br /><br /><br />
299
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
@@ -304,9 +303,9 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
304
  <p style="margin: 2px 0">- %POLL_CHECKBOX_RADIO%</p><br />
305
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('votebody');" class="button" />
306
  </td>
307
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_votebody" name="poll_template_votebody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votebody'))); ?></textarea></td>
308
  </tr>
309
- <tr>
310
  <td width="30%" valign="top">
311
  <strong><?php _e('Voting Form Footer:', 'wp-polls'); ?></strong><br /><br /><br />
312
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
@@ -315,13 +314,13 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
315
  <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
316
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('votefooter');" class="button" />
317
  </td>
318
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votefooter'))); ?></textarea></td>
319
  </tr>
320
  </table>
321
-
322
  <!-- Poll Result Templates -->
323
  <h3><?php _e('Poll Result Templates', 'wp-polls'); ?></h3>
324
- <table class="form-table">
325
  <tr>
326
  <td width="30%" valign="top">
327
  <strong><?php _e('Result Header:', 'wp-polls'); ?></strong><br /><br /><br />
@@ -337,7 +336,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
337
  </td>
338
  <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultheader'))); ?></textarea></td>
339
  </tr>
340
- <tr>
341
  <td width="30%" valign="top">
342
  <strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
343
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
@@ -350,9 +349,9 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
350
  <p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
351
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody');" class="button" />
352
  </td>
353
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody'))); ?></textarea></td>
354
  </tr>
355
- <tr>
356
  <td width="30%" valign="top">
357
  <strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
358
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
@@ -365,9 +364,9 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
365
  <p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
366
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody2');" class="button" />
367
  </td>
368
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody2'))); ?></textarea></td>
369
  </tr>
370
- <tr>
371
  <td width="30%" valign="top">
372
  <strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
373
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
@@ -385,9 +384,9 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
385
  <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
386
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter');" class="button" />
387
  </td>
388
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter'))); ?></textarea></td>
389
  </tr>
390
- <tr>
391
  <td width="30%" valign="top">
392
  <strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
393
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
@@ -405,13 +404,13 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
405
  <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
406
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter2');" class="button" />
407
  </td>
408
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter2'))); ?></textarea></td>
409
  </tr>
410
  </table>
411
 
412
  <!-- Poll Archive Templates -->
413
  <h3><?php _e('Poll Archive Templates', 'wp-polls'); ?></h3>
414
- <table class="form-table">
415
  <tr>
416
  <td width="30%" valign="top">
417
  <strong><?php _e('Poll Archive Link', 'wp-polls'); ?></strong><br /><?php _e('Template For Displaying Poll Archive Link', 'wp-polls'); ?><br /><br />
@@ -471,7 +470,7 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
471
 
472
  <!-- Poll Misc Templates -->
473
  <h3><?php _e('Poll Misc Templates', 'wp-polls'); ?></h3>
474
- <table class="form-table">
475
  <tr>
476
  <td width="30%" valign="top">
477
  <strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The Poll Is Disabled', 'wp-polls'); ?><br /><br />
@@ -494,5 +493,5 @@ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
494
  <p class="submit">
495
  <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'wp-polls'); ?>" />
496
  </p>
497
- </div>
498
- </form>
46
  $poll_template_disable = trim($_POST['poll_template_disable']);
47
  $poll_template_error = trim($_POST['poll_template_error']);
48
  $update_poll_queries = array();
49
+ $update_poll_text = array();
50
  $update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
51
  $update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
52
  $update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
153
  <form id="poll_template_form" method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
154
  <?php wp_nonce_field('wp-polls_templates'); ?>
155
  <div class="wrap">
156
+ <h2><?php _e('Poll Templates', 'wp-polls'); ?></h2>
 
157
  <!-- Template Variables -->
158
  <h3><?php _e('Template Variables', 'wp-polls'); ?></h3>
159
  <table class="widefat">
292
  </td>
293
  <td valign="top"><textarea cols="80" rows="15" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_voteheader'))); ?></textarea></td>
294
  </tr>
295
+ <tr>
296
  <td width="30%" valign="top">
297
  <strong><?php _e('Voting Form Body:', 'wp-polls'); ?></strong><br /><br /><br />
298
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
303
  <p style="margin: 2px 0">- %POLL_CHECKBOX_RADIO%</p><br />
304
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('votebody');" class="button" />
305
  </td>
306
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_votebody" name="poll_template_votebody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votebody'))); ?></textarea></td>
307
  </tr>
308
+ <tr>
309
  <td width="30%" valign="top">
310
  <strong><?php _e('Voting Form Footer:', 'wp-polls'); ?></strong><br /><br /><br />
311
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
314
  <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
315
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('votefooter');" class="button" />
316
  </td>
317
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votefooter'))); ?></textarea></td>
318
  </tr>
319
  </table>
320
+
321
  <!-- Poll Result Templates -->
322
  <h3><?php _e('Poll Result Templates', 'wp-polls'); ?></h3>
323
+ <table class="form-table">
324
  <tr>
325
  <td width="30%" valign="top">
326
  <strong><?php _e('Result Header:', 'wp-polls'); ?></strong><br /><br /><br />
336
  </td>
337
  <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultheader'))); ?></textarea></td>
338
  </tr>
339
+ <tr>
340
  <td width="30%" valign="top">
341
  <strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
342
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
349
  <p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
350
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody');" class="button" />
351
  </td>
352
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody'))); ?></textarea></td>
353
  </tr>
354
+ <tr>
355
  <td width="30%" valign="top">
356
  <strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
357
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
364
  <p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
365
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody2');" class="button" />
366
  </td>
367
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody2'))); ?></textarea></td>
368
  </tr>
369
+ <tr>
370
  <td width="30%" valign="top">
371
  <strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
372
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
384
  <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
385
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter');" class="button" />
386
  </td>
387
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter'))); ?></textarea></td>
388
  </tr>
389
+ <tr>
390
  <td width="30%" valign="top">
391
  <strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
392
  <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
404
  <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
405
  <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter2');" class="button" />
406
  </td>
407
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter2'))); ?></textarea></td>
408
  </tr>
409
  </table>
410
 
411
  <!-- Poll Archive Templates -->
412
  <h3><?php _e('Poll Archive Templates', 'wp-polls'); ?></h3>
413
+ <table class="form-table">
414
  <tr>
415
  <td width="30%" valign="top">
416
  <strong><?php _e('Poll Archive Link', 'wp-polls'); ?></strong><br /><?php _e('Template For Displaying Poll Archive Link', 'wp-polls'); ?><br /><br />
470
 
471
  <!-- Poll Misc Templates -->
472
  <h3><?php _e('Poll Misc Templates', 'wp-polls'); ?></h3>
473
+ <table class="form-table">
474
  <tr>
475
  <td width="30%" valign="top">
476
  <strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The Poll Is Disabled', 'wp-polls'); ?><br /><br />
493
  <p class="submit">
494
  <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'wp-polls'); ?>" />
495
  </p>
496
+ </div>
497
+ </form>
polls-uninstall.php CHANGED
@@ -31,7 +31,7 @@ $polls_tables = array($wpdb->pollsq, $wpdb->pollsa, $wpdb->pollsip);
31
  $polls_settings = array('poll_template_voteheader', 'poll_template_votebody', 'poll_template_votefooter', 'poll_template_resultheader', 'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2', 'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll', 'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby', 'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show', 'poll_archive_url', 'poll_bar', 'poll_close', 'poll_ajax_style', 'poll_template_pollarchivelink', 'widget_polls', 'poll_archive_displaypoll', 'poll_template_pollarchiveheader', 'poll_template_pollarchivefooter', 'poll_cookielog_expiry', 'widget_polls-widget');
32
 
33
 
34
- ### Form Processing
35
  if(!empty($_POST['do'])) {
36
  // Decide What To Do
37
  switch($_POST['do']) {
@@ -58,7 +58,7 @@ if(!empty($_POST['do'])) {
58
  }
59
  }
60
  echo '</p>';
61
- echo '</div>';
62
  $mode = 'end-UNINSTALL';
63
  }
64
  break;
@@ -72,7 +72,6 @@ switch($mode) {
72
  case 'end-UNINSTALL':
73
  $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wp-polls/wp-polls.php', 'deactivate-plugin_wp-polls/wp-polls.php');
74
  echo '<div class="wrap">';
75
- echo '<div id="icon-wp-polls" class="icon32"><br /></div>';
76
  echo '<h2>'.__('Uninstall WP-Polls', 'wp-polls').'</h2>';
77
  echo '<p><strong>'.sprintf(__('<a href="%s">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically.', 'wp-polls'), $deactivate_url).'</strong></p>';
78
  echo '</div>';
@@ -84,7 +83,6 @@ switch($mode) {
84
  <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
85
  <?php wp_nonce_field('wp-polls_uninstall'); ?>
86
  <div class="wrap">
87
- <div id="icon-wp-polls" class="icon32"><br /></div>
88
  <h2><?php _e('Uninstall WP-Polls', 'wp-polls'); ?></h2>
89
  <p>
90
  <?php _e('Deactivating WP-Polls plugin does not remove any data that may have been created, such as the poll data and the poll\'s voting logs. To completely remove this plugin, you can uninstall it here.', 'wp-polls'); ?>
31
  $polls_settings = array('poll_template_voteheader', 'poll_template_votebody', 'poll_template_votefooter', 'poll_template_resultheader', 'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2', 'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll', 'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby', 'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show', 'poll_archive_url', 'poll_bar', 'poll_close', 'poll_ajax_style', 'poll_template_pollarchivelink', 'widget_polls', 'poll_archive_displaypoll', 'poll_template_pollarchiveheader', 'poll_template_pollarchivefooter', 'poll_cookielog_expiry', 'widget_polls-widget');
32
 
33
 
34
+ ### Form Processing
35
  if(!empty($_POST['do'])) {
36
  // Decide What To Do
37
  switch($_POST['do']) {
58
  }
59
  }
60
  echo '</p>';
61
+ echo '</div>';
62
  $mode = 'end-UNINSTALL';
63
  }
64
  break;
72
  case 'end-UNINSTALL':
73
  $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=wp-polls/wp-polls.php', 'deactivate-plugin_wp-polls/wp-polls.php');
74
  echo '<div class="wrap">';
 
75
  echo '<h2>'.__('Uninstall WP-Polls', 'wp-polls').'</h2>';
76
  echo '<p><strong>'.sprintf(__('<a href="%s">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically.', 'wp-polls'), $deactivate_url).'</strong></p>';
77
  echo '</div>';
83
  <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
84
  <?php wp_nonce_field('wp-polls_uninstall'); ?>
85
  <div class="wrap">
 
86
  <h2><?php _e('Uninstall WP-Polls', 'wp-polls'); ?></h2>
87
  <p>
88
  <?php _e('Deactivating WP-Polls plugin does not remove any data that may have been created, such as the poll data and the poll\'s voting logs. To completely remove this plugin, you can uninstall it here.', 'wp-polls'); ?>
readme.txt CHANGED
@@ -2,32 +2,21 @@
2
  Contributors: GamerZ
3
  Donate link: http://lesterchan.net/site/donation/
4
  Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
- Requires at least: 2.8
6
- Tested up to: 3.7
7
- Stable tag: trunk
8
 
9
  Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
10
 
11
  == Description ==
12
-
13
  WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
14
 
15
- = Previous Versions =
16
- * [WP-Polls 2.40 For WordPress 2.7.x](http://downloads.wordpress.org/plugin/wp-polls.2.40.zip "WP-Polls 2.40 For WordPress 2.7.x")
17
- * [WP-Polls 2.31 For WordPress 2.5.x And 2.6.x](http://downloads.wordpress.org/plugin/wp-polls.2.31.zip "WP-Polls 2.31 For WordPress 2.5.x And 2.6.x")
18
- * [WP-Polls 2.20 For WordPress 2.1.x, 2.2.x And 2.3.x](http://downloads.wordpress.org/plugin/wp-polls.2.20.zip "WP-Polls 2.20 For WordPress 2.1.x, 2.2.x And 2.3.x")
19
- * [WP-Polls 2.13 For WordPress 2.0.x](http://downloads.wordpress.org/plugin/wp-polls.2.13.zip "WP-Polls 2.13 For WordPress 2.0.x")
20
- * [WP-Polls 2.02a For WordPress 1.5.2](http://downloads.wordpress.org/plugin/wp-polls.2.02a.zip "WP-Polls 2.02a For WordPress 1.5.2")
21
-
22
  = Development =
23
- * [http://dev.wp-plugins.org/browser/wp-polls/](http://dev.wp-plugins.org/browser/wp-polls/ "http://dev.wp-plugins.org/browser/wp-polls/")
24
 
25
  = Translations =
26
  * [http://dev.wp-plugins.org/browser/wp-polls/i18n/](http://dev.wp-plugins.org/browser/wp-polls/i18n/ "http://dev.wp-plugins.org/browser/wp-polls/i18n/")
27
 
28
- = Support Forums =
29
- * [http://forums.lesterchan.net/index.php?board=15.0](http://forums.lesterchan.net/index.php?board=15.0 "http://forums.lesterchan.net/index.php?board=15.0")
30
-
31
  = Credits =
32
  * __ngetext() by [Anna Ozeritskaya](http://hweia.ru/ "Anna Ozeritskaya")
33
  * Right To Left Language Support by [Kambiz R. Khojasteh](http://persian-programming.com/ "Kambiz R. Khojasteh")
@@ -37,6 +26,15 @@ WP-Polls is extremely customizable via templates and css styles and there are to
37
 
38
  == Changelog ==
39
 
 
 
 
 
 
 
 
 
 
40
  = Version 2.64 =
41
  * NEW: Add in various filters in the plugin. Props Machiel.
42
  * FIXED: Deveral undefined variable / undefined index notices. Props Machiel.
@@ -68,7 +66,7 @@ WP-Polls is extremely customizable via templates and css styles and there are to
68
  * NEW: Renamed polls-js.js To polls-js.dev.js
69
  * NEW: Translate Javascript Variables Using wp_localize_script()
70
  * NEW: Add "Add Poll" To WordPress Favourite Actions
71
- * NEW: Minified editor_plugin.js And Added Non-Minified editor_plugin.dev.js
72
  * NEW: Able To Remove Individual Answers When Adding Or Editing A Poll
73
  * NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
74
  * NEW: Uses New Widget Class From WordPress
@@ -265,17 +263,17 @@ WP-Polls is extremely customizable via templates and css styles and there are to
265
 
266
  = General Usage (Without Widget) =
267
  1. Open `wp-content/themes/<YOUR THEME NAME>/sidebar.php`
268
- 2. Add:
269
  <code>
270
- <?php if (function_exists('vote_poll') && !in_pollarchive()): ?>
271
- <li>
272
- <h2>Polls</h2>
273
- <ul>
274
- <li><?php get_poll();?></li>
275
- </ul>
276
- <?php display_polls_archive_link(); ?>
277
- </li>
278
- <?php endif; ?>
279
  </code>
280
 
281
  * To show specific poll, use `<?php get_poll(2); ?>` where 2 is your poll id.
@@ -331,8 +329,8 @@ N/A
331
  * If you ARE NOT using nice permalinks, you need to go to `WP-Admin -> Polls -> Poll Options` and under `Poll Archive -> Polls Archive URL`, you need to fill in the URL to the Polls Archive Page you created above.
332
 
333
  = How Does WP-Polls Load CSS? =
334
- * WP-Polls will load 'polls-css.css' from your theme's directory if it exists.
335
- * If it doesn't exists, it will just load the default 'polls-css.css' that comes with WP-Polls.
336
  * This will allow you to upgrade WP-Polls without worrying about overwriting your polls styles that you have created.
337
 
338
  = Why In Internet Explorer (IE) The poll's Text Appear Jagged? =
@@ -356,40 +354,40 @@ N/A
356
  .wp-polls-ul li:nth-child(08) .pollbar{ background:#66cc9a}
357
  .wp-polls-ul li:nth-child(09) .pollbar{ background:#98CBCB}
358
  .wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
359
- .wp-polls-ul li .pollbar{-webkit-transition: background 0.7s ease-in-out}
360
- .wp-polls-ul li .pollbar:hover{background:#F00}
361
  </code>
362
 
363
  = Polls Stats (Outside WP Loop) =
364
 
365
  = To Display Total Polls =
366
- * Use:
367
  <code>
368
- <?php if (function_exists('get_pollquestions')): ?>
369
- <?php get_pollquestions(); ?>
370
- <?php endif; ?>
371
  </code>
372
 
373
  = To Display Total Poll Answers =
374
- * Use:
375
  <code>
376
- <?php if (function_exists('get_pollanswers')): ?>
377
- <?php get_pollanswers(); ?>
378
- <?php endif; ?>
379
  </code>
380
 
381
  = To Display Total Poll Votes =
382
- * Use:
383
  <code>
384
- <?php if (function_exists('get_pollvotes')): ?>
385
- <?php get_pollvotes(); ?>
386
- <?php endif; ?>
387
  </code>
388
 
389
  = To Display Total Poll Voters =
390
- * Use:
391
  <code>
392
- <?php if (function_exists('get_pollvoters')): ?>
393
- <?php get_pollvoters(); ?>
394
- <?php endif; ?>
395
  </code>
2
  Contributors: GamerZ
3
  Donate link: http://lesterchan.net/site/donation/
4
  Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
+ Requires at least: 3.9
6
+ Tested up to: 3.9
7
+ Stable tag: 2.65
8
 
9
  Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
10
 
11
  == Description ==
 
12
  WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
13
 
 
 
 
 
 
 
 
14
  = Development =
15
+ * [https://github.com/lesterchan/wp-polls](https://github.com/lesterchan/wp-polls "https://github.com/lesterchan/wp-polls")
16
 
17
  = Translations =
18
  * [http://dev.wp-plugins.org/browser/wp-polls/i18n/](http://dev.wp-plugins.org/browser/wp-polls/i18n/ "http://dev.wp-plugins.org/browser/wp-polls/i18n/")
19
 
 
 
 
20
  = Credits =
21
  * __ngetext() by [Anna Ozeritskaya](http://hweia.ru/ "Anna Ozeritskaya")
22
  * Right To Left Language Support by [Kambiz R. Khojasteh](http://persian-programming.com/ "Kambiz R. Khojasteh")
26
 
27
  == Changelog ==
28
 
29
+ = Version 2.65 =
30
+ * NEW: Use Dashicons
31
+ * NEW: Supports TinyMCE 4.0 For WordPress 3.9
32
+ * NEW: Added Poll ID after adding it
33
+ * FIXED: Use SITECOOKIEPATH instead of COOKIEPATH.
34
+ * FIXED: Use http://ipinfo.io instead of http://ws.arin.net to get check IP information.
35
+ * FIXED: Wrapped all JS function in jQuery.ready(). It is ugly, but it will do till I have time to rewrite it.
36
+ * FIXED: Add INDEX for wp_pollsip: pollip_ip_qid (pollip_ip, pollip_qid) to prevent full table scan. Thanks archon810 from AndroidPolice.
37
+
38
  = Version 2.64 =
39
  * NEW: Add in various filters in the plugin. Props Machiel.
40
  * FIXED: Deveral undefined variable / undefined index notices. Props Machiel.
66
  * NEW: Renamed polls-js.js To polls-js.dev.js
67
  * NEW: Translate Javascript Variables Using wp_localize_script()
68
  * NEW: Add "Add Poll" To WordPress Favourite Actions
69
+ * NEW: Minified plugin.js And Added Non-Minified plugin.min.js
70
  * NEW: Able To Remove Individual Answers When Adding Or Editing A Poll
71
  * NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
72
  * NEW: Uses New Widget Class From WordPress
263
 
264
  = General Usage (Without Widget) =
265
  1. Open `wp-content/themes/<YOUR THEME NAME>/sidebar.php`
266
+ 2. Add:
267
  <code>
268
+ &lt;?php if (function_exists('vote_poll') && !in_pollarchive()): ?&gt;
269
+ &nbsp;&nbsp;&lt;li&gt;
270
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;Polls&lt;/h2&gt;
271
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;
272
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;?php get_poll();?&gt;&lt;/li&gt;
273
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;
274
+ &nbsp;&nbsp;&nbsp;&nbsp;&lt;?php display_polls_archive_link(); ?&gt;
275
+ &nbsp;&nbsp;&lt;/li&gt;
276
+ &lt;?php endif; ?&gt;
277
  </code>
278
 
279
  * To show specific poll, use `<?php get_poll(2); ?>` where 2 is your poll id.
329
  * If you ARE NOT using nice permalinks, you need to go to `WP-Admin -> Polls -> Poll Options` and under `Poll Archive -> Polls Archive URL`, you need to fill in the URL to the Polls Archive Page you created above.
330
 
331
  = How Does WP-Polls Load CSS? =
332
+ * WP-Polls will load `polls-css.css` from your theme's directory if it exists.
333
+ * If it doesn't exists, it will just load the default `polls-css.css` that comes with WP-Polls.
334
  * This will allow you to upgrade WP-Polls without worrying about overwriting your polls styles that you have created.
335
 
336
  = Why In Internet Explorer (IE) The poll's Text Appear Jagged? =
354
  .wp-polls-ul li:nth-child(08) .pollbar{ background:#66cc9a}
355
  .wp-polls-ul li:nth-child(09) .pollbar{ background:#98CBCB}
356
  .wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
357
+ .wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out }
358
+ .wp-polls-ul li .pollbar:hover{ background:#F00 }
359
  </code>
360
 
361
  = Polls Stats (Outside WP Loop) =
362
 
363
  = To Display Total Polls =
364
+ * Use:
365
  <code>
366
+ &lt;?php if (function_exists('get_pollquestions')): ?&gt;
367
+ &nbsp;&nbsp;&lt;?php get_pollquestions(); ?&gt;
368
+ &lt;?php endif; ?&gt;
369
  </code>
370
 
371
  = To Display Total Poll Answers =
372
+ * Use:
373
  <code>
374
+ &lt;?php if (function_exists('get_pollanswers')): ?&gt;
375
+ &nbsp;&nbsp;&lt;?php get_pollanswers(); ?&gt;
376
+ &lt;?php endif; ?&gt;
377
  </code>
378
 
379
  = To Display Total Poll Votes =
380
+ * Use:
381
  <code>
382
+ &lt;?php if (function_exists('get_pollvotes')): ?&gt;
383
+ &nbsp;&nbsp;&lt;?php get_pollvotes(); ?&gt;
384
+ &lt;?php endif; ?&gt;
385
  </code>
386
 
387
  = To Display Total Poll Voters =
388
+ * Use:
389
  <code>
390
+ &lt;?php if (function_exists('get_pollvoters')): ?&gt;
391
+ &nbsp;&nbsp;&lt;?php get_pollvoters(); ?&gt;
392
+ &lt;?php endif; ?&gt;
393
  </code>
tinymce/plugins/polls/editor_plugin.dev.js DELETED
@@ -1,32 +0,0 @@
1
- (function() {
2
- tinymce.PluginManager.requireLangPack('polls');
3
- tinymce.create('tinymce.plugins.PollsPlugin', {
4
- init : function(ed, url) {
5
- ed.addCommand('mcePollInsert', function() {
6
- ed.execCommand('mceInsertContent', 0, insertPoll('visual', ''));
7
- });
8
- ed.addButton('polls', {
9
- title : 'polls.insert_poll',
10
- cmd : 'mcePollInsert',
11
- image : url + '/img/poll.gif'
12
- });
13
- ed.onNodeChange.add(function(ed, cm, n) {
14
- cm.setActive('polls', n.nodeName == 'IMG');
15
- });
16
- },
17
-
18
- createControl : function(n, cm) {
19
- return null;
20
- },
21
- getInfo : function() {
22
- return {
23
- longname : 'WP-Polls',
24
- author : 'Lester Chan',
25
- authorurl : 'http://lesterchan.net',
26
- infourl : 'http://lesterchan.net/portfolio/programming/php/',
27
- version : '2.62'
28
- };
29
- }
30
- });
31
- tinymce.PluginManager.add('polls', tinymce.plugins.PollsPlugin);
32
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tinymce/plugins/polls/editor_plugin.js DELETED
@@ -1 +0,0 @@
1
- (function(){tinymce.PluginManager.requireLangPack("polls");tinymce.create("tinymce.plugins.PollsPlugin",{init:function(a,b){a.addCommand("mcePollInsert",function(){a.execCommand("mceInsertContent",0,insertPoll("visual",""))});a.addButton("polls",{title:"polls.insert_poll",cmd:"mcePollInsert",image:b+"/img/poll.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("polls",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"WP-Polls",author:"Lester Chan",authorurl:"http://lesterchan.net",infourl:"http://lesterchan.net/portfolio/programming/php/",version:"2.62"}}});tinymce.PluginManager.add("polls",tinymce.plugins.PollsPlugin)})();
 
tinymce/plugins/polls/img/poll.gif DELETED
Binary file
tinymce/plugins/polls/langs/en.js DELETED
@@ -1,3 +0,0 @@
1
- tinyMCE.addI18n("en.polls", {
2
- insert_poll : 'Insert Poll'
3
- });
 
 
 
tinymce/plugins/polls/plugin.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.PluginManager.add('polls', function(editor, url) {
3
+ editor.addCommand('WP-Polls-Insert_Poll', function() {
4
+ var poll_id = jQuery.trim(prompt(pollsEdL10n.enter_poll_id));
5
+ while(isNaN(poll_id)) {
6
+ poll_id = jQuery.trim(prompt(pollsEdL10n.error_poll_id_numeric + "\n\n" + pollsEdL10n.enter_poll_id_again));
7
+ }
8
+ if (poll_id >= -1 && poll_id != null && poll_id != "") {
9
+ editor.insertContent('[poll="' + poll_id + '"]');
10
+ }
11
+ });
12
+ editor.addButton('polls', {
13
+ text: false,
14
+ tooltip: pollsEdL10n.insert_poll,
15
+ icon: 'polls dashicons-before dashicons-chart-bar',
16
+ onclick: function() {
17
+ tinyMCE.activeEditor.execCommand( 'WP-Polls-Insert_Poll' )
18
+ }
19
+ });
20
+ });
21
+ })();
tinymce/plugins/polls/plugin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){tinymce.PluginManager.add("polls",function(b,c){b.addCommand("WP-Polls-Insert_Poll",function(){for(var a=jQuery.trim(prompt(pollsEdL10n.enter_poll_id));isNaN(a);)a=jQuery.trim(prompt(pollsEdL10n.error_poll_id_numeric+"\n\n"+pollsEdL10n.enter_poll_id_again));-1<=a&&null!=a&&""!=a&&b.insertContent('[poll="'+a+'"]')});b.addButton("polls",{text:!1,tooltip:pollsEdL10n.insert_poll,icon:"polls dashicons-before dashicons-chart-bar",onclick:function(){tinyMCE.activeEditor.execCommand("WP-Polls-Insert_Poll")}})})})();
wp-polls.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Polls
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Adds an AJAX poll system to your WordPress blog. You can easily include a poll into your WordPress's blog post/page. WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
6
- Version: 2.64
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-polls
@@ -30,9 +30,9 @@ Text Domain: wp-polls
30
 
31
 
32
  ### Create Text Domain For Translations
33
- add_action('init', 'polls_textdomain');
34
  function polls_textdomain() {
35
- load_plugin_textdomain('wp-polls', false, 'wp-polls');
36
  }
37
 
38
 
@@ -46,16 +46,13 @@ $wpdb->pollsip = $wpdb->prefix.'pollsip';
46
  ### Function: Poll Administration Menu
47
  add_action('admin_menu', 'poll_menu');
48
  function poll_menu() {
49
- if (function_exists('add_menu_page')) {
50
- add_menu_page(__('Polls', 'wp-polls'), __('Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-manager.php', '', plugins_url('wp-polls/images/poll.png'));
51
- }
52
- if (function_exists('add_submenu_page')) {
53
- add_submenu_page('wp-polls/polls-manager.php', __('Manage Polls', 'wp-polls'), __('Manage Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-manager.php');
54
- add_submenu_page('wp-polls/polls-manager.php', __('Add Poll', 'wp-polls'), __('Add Poll', 'wp-polls'), 'manage_polls', 'wp-polls/polls-add.php');
55
- add_submenu_page('wp-polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'wp-polls/polls-options.php');
56
- add_submenu_page('wp-polls/polls-manager.php', __('Poll Templates', 'wp-polls'), __('Poll Templates', 'wp-polls'), 'manage_polls', 'wp-polls/polls-templates.php');
57
- add_submenu_page('wp-polls/polls-manager.php', __('Uninstall WP-Polls', 'wp-polls'), __('Uninstall WP-Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-uninstall.php');
58
- }
59
  }
60
 
61
 
@@ -256,47 +253,28 @@ add_action('admin_footer-post.php', 'poll_footer_admin');
256
  add_action('admin_footer-page-new.php', 'poll_footer_admin');
257
  add_action('admin_footer-page.php', 'poll_footer_admin');
258
  function poll_footer_admin() {
259
- // Javascript Code Courtesy Of WP-AddQuicktag (http://bueltge.de/wp-addquicktags-de-plugin/120/)
260
- echo '<script type="text/javascript">'."\n";
261
- echo '/* <![CDATA[ */'."\n";
262
- echo "\t".'var pollsEdL10n = {'."\n";
263
- echo "\t\t".'enter_poll_id: "'.esc_js(__('Enter Poll ID', 'wp-polls')).'",'."\n";
264
- echo "\t\t".'enter_poll_id_again: "'.esc_js(__('Error: Poll ID must be numeric', 'wp-polls')).'\n\n'.esc_js(__('Please enter Poll ID again', 'wp-polls')).'",'."\n";
265
- echo "\t\t".'poll: "'.esc_js(__('Poll', 'wp-polls')).'",'."\n";
266
- echo "\t\t".'insert_poll: "'.esc_js(__('Insert Poll', 'wp-polls')).'"'."\n";
267
- echo "\t".'};'."\n";
268
- echo "\t".'function insertPoll(where, myField) {'."\n";
269
- echo "\t\t".'var poll_id = jQuery.trim(prompt(pollsEdL10n.enter_poll_id));'."\n";
270
- echo "\t\t".'while(isNaN(poll_id)) {'."\n";
271
- echo "\t\t\t".'poll_id = jQuery.trim(prompt(pollsEdL10n.enter_poll_id_again));'."\n";
272
- echo "\t\t".'}'."\n";
273
- echo "\t\t".'if (poll_id >= -1 && poll_id != null && poll_id != "") {'."\n";
274
- echo "\t\t\t".'if(where == \'code\') {'."\n";
275
- echo "\t\t\t\t".'edInsertContent(myField, \'[poll id="\' + poll_id + \'"]\');'."\n";
276
- echo "\t\t\t".'} else {'."\n";
277
- echo "\t\t\t\t".'return \'[poll id="\' + poll_id + \'"]\';'."\n";
278
- echo "\t\t\t".'}'."\n";
279
- echo "\t\t".'}'."\n";
280
- echo "\t".'}'."\n";
281
- echo "\t".'if(document.getElementById("ed_toolbar")){'."\n";
282
- echo "\t\t".'edButtons[edButtons.length] = new edButton("ed_poll",pollsEdL10n.poll, "", "","");'."\n";
283
- echo "\t\t".'jQuery(document).ready(function($){'."\n";
284
- echo "\t\t\t".'$(\'#qt_content_ed_poll\').replaceWith(\'<input type="button" id="qt_content_ed_poll" accesskey="" class="ed_button" onclick="insertPoll(\\\'code\\\', edCanvas);" value="\' + pollsEdL10n.poll + \'" title="\' + pollsEdL10n.insert_poll + \'" />\');'."\n";
285
- echo "\t\t".'});'."\n";
286
- echo "\t".'}'."\n";
287
- echo '/* ]]> */'."\n";
288
- echo '</script>'."\n";
289
- }
290
-
291
-
292
- ### Function: Add Favourite Actions >= WordPress 2.7
293
- add_filter('favorite_actions', 'poll_favorite_actions');
294
- function poll_favorite_actions($favorite_actions) {
295
- $favorite_actions['admin.php?page=wp-polls/polls-add.php'] = array(__('Add Poll', 'wp-polls'), 'manage_polls');
296
- return $favorite_actions;
297
  }
298
 
299
-
300
  ### Function: Add Quick Tag For Poll In TinyMCE >= WordPress 2.5
301
  add_action('init', 'poll_tinymce_addbuttons');
302
  function poll_tinymce_addbuttons() {
@@ -313,7 +291,11 @@ function poll_tinymce_registerbutton($buttons) {
313
  return $buttons;
314
  }
315
  function poll_tinymce_addplugin($plugin_array) {
316
- $plugin_array['polls'] = plugins_url('wp-polls/tinymce/plugins/polls/editor_plugin.js');
 
 
 
 
317
  return $plugin_array;
318
  }
319
 
@@ -1339,7 +1321,7 @@ function vote_poll() {
1339
  if($cookie_expiry == 0) {
1340
  $cookie_expiry = 30000000;
1341
  }
1342
- $vote_cookie = setcookie('voted_'.$poll_id, $poll_aid, ($pollip_timestamp + $cookie_expiry), COOKIEPATH);
1343
  }
1344
  $i = 0;
1345
  foreach($poll_aid_array as $polla_aid) {
@@ -1670,7 +1652,8 @@ function create_poll_table() {
1670
  "pollip_userid int(10) NOT NULL default '0',".
1671
  "PRIMARY KEY (pollip_id),".
1672
  "KEY pollip_ip (pollip_id),".
1673
- "KEY pollip_qid (pollip_qid)".
 
1674
  ") $charset_collate;";
1675
  maybe_create_table($wpdb->pollsq, $create_table['pollsq']);
1676
  maybe_create_table($wpdb->pollsa, $create_table['pollsa']);
@@ -1757,6 +1740,9 @@ function create_poll_table() {
1757
  // Database Upgrade For WP-Polls 2.61
1758
  $wpdb->query("ALTER TABLE $wpdb->pollsip ADD INDEX pollip_ip (pollip_ip);");
1759
  $wpdb->query("ALTER TABLE $wpdb->pollsip ADD INDEX pollip_qid (pollip_qid);");
 
 
 
1760
  // Set 'manage_polls' Capabilities To Administrator
1761
  $role = get_role('administrator');
1762
  if(!$role->has_cap('manage_polls')) {
3
  Plugin Name: WP-Polls
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Adds an AJAX poll system to your WordPress blog. You can easily include a poll into your WordPress's blog post/page. WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
6
+ Version: 2.65
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-polls
30
 
31
 
32
  ### Create Text Domain For Translations
33
+ add_action( 'plugins_loaded', 'polls_textdomain' );
34
  function polls_textdomain() {
35
+ load_plugin_textdomain( 'wp-polls', false, dirname( plugin_basename( __FILE__ ) ) );
36
  }
37
 
38
 
46
  ### Function: Poll Administration Menu
47
  add_action('admin_menu', 'poll_menu');
48
  function poll_menu() {
49
+ add_menu_page(__('Polls', 'wp-polls'), __('Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-manager.php', '', 'dashicons-chart-bar');
50
+
51
+ add_submenu_page('wp-polls/polls-manager.php', __('Manage Polls', 'wp-polls'), __('Manage Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-manager.php');
52
+ add_submenu_page('wp-polls/polls-manager.php', __('Add Poll', 'wp-polls'), __('Add Poll', 'wp-polls'), 'manage_polls', 'wp-polls/polls-add.php');
53
+ add_submenu_page('wp-polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'wp-polls/polls-options.php');
54
+ add_submenu_page('wp-polls/polls-manager.php', __('Poll Templates', 'wp-polls'), __('Poll Templates', 'wp-polls'), 'manage_polls', 'wp-polls/polls-templates.php');
55
+ add_submenu_page('wp-polls/polls-manager.php', __('Uninstall WP-Polls', 'wp-polls'), __('Uninstall WP-Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-uninstall.php');
 
 
 
56
  }
57
 
58
 
253
  add_action('admin_footer-page-new.php', 'poll_footer_admin');
254
  add_action('admin_footer-page.php', 'poll_footer_admin');
255
  function poll_footer_admin() {
256
+ ?>
257
+ <script type="text/javascript">
258
+ var pollsEdL10n = {
259
+ enter_poll_id: "<?php echo esc_js(__('Enter Poll ID', 'wp-polls')); ?>"
260
+ , error_poll_id_numeric: "<?php echo esc_js(__('Error: Poll ID must be numeric', 'wp-polls')); ?>"
261
+ , enter_poll_id_again: "<?php echo esc_js(__('Please enter Poll ID again', 'wp-polls')); ?>"
262
+ , poll: "<?php echo esc_js(__('Poll', 'wp-polls')); ?>"
263
+ , insert_poll: "<?php echo esc_js(__('Insert Poll', 'wp-polls')) ; ?>"
264
+ };
265
+ QTags.addButton('ed_wp_polls', pollsEdL10n.poll, function() {
266
+ var poll_id = jQuery.trim(prompt(pollsEdL10n.enter_poll_id));
267
+ while(isNaN(poll_id)) {
268
+ poll_id = jQuery.trim(prompt(pollsEdL10n.error_poll_id_numeric + "\n\n" + pollsEdL10n.enter_poll_id_again));
269
+ }
270
+ if (poll_id >= -1 && poll_id != null && poll_id != "") {
271
+ QTags.insertContent('[poll="' + poll_id + '"]');
272
+ }
273
+ });
274
+ </script>
275
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  }
277
 
 
278
  ### Function: Add Quick Tag For Poll In TinyMCE >= WordPress 2.5
279
  add_action('init', 'poll_tinymce_addbuttons');
280
  function poll_tinymce_addbuttons() {
291
  return $buttons;
292
  }
293
  function poll_tinymce_addplugin($plugin_array) {
294
+ if(WP_DEBUG) {
295
+ $plugin_array['polls'] = plugins_url('wp-polls/tinymce/plugins/polls/plugin.js');
296
+ } else {
297
+ $plugin_array['polls'] = plugins_url('wp-polls/tinymce/plugins/polls/plugin.min.js');
298
+ }
299
  return $plugin_array;
300
  }
301
 
1321
  if($cookie_expiry == 0) {
1322
  $cookie_expiry = 30000000;
1323
  }
1324
+ $vote_cookie = setcookie('voted_'.$poll_id, $poll_aid, ($pollip_timestamp + $cookie_expiry), apply_filters('wp_polls_cookiepath', SITECOOKIEPATH));
1325
  }
1326
  $i = 0;
1327
  foreach($poll_aid_array as $polla_aid) {
1652
  "pollip_userid int(10) NOT NULL default '0',".
1653
  "PRIMARY KEY (pollip_id),".
1654
  "KEY pollip_ip (pollip_id),".
1655
+ "KEY pollip_qid (pollip_qid),".
1656
+ "KEY pollip_ip_qid (pollip_ip, pollip_qid)".
1657
  ") $charset_collate;";
1658
  maybe_create_table($wpdb->pollsq, $create_table['pollsq']);
1659
  maybe_create_table($wpdb->pollsa, $create_table['pollsa']);
1740
  // Database Upgrade For WP-Polls 2.61
1741
  $wpdb->query("ALTER TABLE $wpdb->pollsip ADD INDEX pollip_ip (pollip_ip);");
1742
  $wpdb->query("ALTER TABLE $wpdb->pollsip ADD INDEX pollip_qid (pollip_qid);");
1743
+ // Database Upgrade WP-Polls 2.65
1744
+ $wpdb->query("ALTER TABLE $wpdb->pollsip ADD INDEX pollip_ip_qid (pollip_ip, pollip_qid);");
1745
+
1746
  // Set 'manage_polls' Capabilities To Administrator
1747
  $role = get_role('administrator');
1748
  if(!$role->has_cap('manage_polls')) {