WP-Polls - Version 2.64

Version Description

N/A

Download this release

Release Info

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

Code changes from version 2.50 to 2.64

polls-add.php CHANGED
@@ -1,180 +1,180 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Add Poll |
14
- | - wp-content/plugins/wp-polls/polls-add.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Polls
21
- if(!current_user_can('manage_polls')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Poll Manager
27
- $base_name = plugin_basename('wp-polls/polls-manager.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
-
30
-
31
- ### Form Processing
32
- if(!empty($_POST['do'])) {
33
- // Decide What To Do
34
- switch($_POST['do']) {
35
- // Add Poll
36
- case __('Add Poll', 'wp-polls'):
37
- // Poll Question
38
- $pollq_question = addslashes(trim($_POST['pollq_question']));
39
- // Poll Start Date
40
- $timestamp_sql = '';
41
- $pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
42
- $pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
43
- $pollq_timestamp_year = intval($_POST['pollq_timestamp_year']);
44
- $pollq_timestamp_hour = intval($_POST['pollq_timestamp_hour']);
45
- $pollq_timestamp_minute = intval($_POST['pollq_timestamp_minute']);
46
- $pollq_timestamp_second = intval($_POST['pollq_timestamp_second']);
47
- $pollq_timestamp = gmmktime($pollq_timestamp_hour, $pollq_timestamp_minute, $pollq_timestamp_second, $pollq_timestamp_month, $pollq_timestamp_day, $pollq_timestamp_year);
48
- if($pollq_timestamp > current_time('timestamp')) {
49
- $pollq_active = -1;
50
- } else {
51
- $pollq_active = 1;
52
- }
53
- // Poll End Date
54
- $pollq_expiry_no = intval($_POST['pollq_expiry_no']);
55
- if($pollq_expiry_no == 1) {
56
- $pollq_expiry = '';
57
- } else {
58
- $pollq_expiry_day = intval($_POST['pollq_expiry_day']);
59
- $pollq_expiry_month = intval($_POST['pollq_expiry_month']);
60
- $pollq_expiry_year = intval($_POST['pollq_expiry_year']);
61
- $pollq_expiry_hour = intval($_POST['pollq_expiry_hour']);
62
- $pollq_expiry_minute = intval($_POST['pollq_expiry_minute']);
63
- $pollq_expiry_second = intval($_POST['pollq_expiry_second']);
64
- $pollq_expiry = gmmktime($pollq_expiry_hour, $pollq_expiry_minute, $pollq_expiry_second, $pollq_expiry_month, $pollq_expiry_day, $pollq_expiry_year);
65
- if($pollq_expiry <= current_time('timestamp')) {
66
- $pollq_active = 0;
67
- }
68
- }
69
- // Mutilple Poll
70
- $pollq_multiple_yes = intval($_POST['pollq_multiple_yes']);
71
- $pollq_multiple = 0;
72
- if($pollq_multiple_yes == 1) {
73
- $pollq_multiple = intval($_POST['pollq_multiple']);
74
- } else {
75
- $pollq_multiple = 0;
76
- }
77
- // Insert Poll
78
- $add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (0, '$pollq_question', '$pollq_timestamp', 0, $pollq_active, '$pollq_expiry', $pollq_multiple, 0)");
79
- if(!$add_poll_question) {
80
- $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
81
- }
82
- // Add Poll Answers
83
- $polla_answers = $_POST['polla_answers'];
84
- $polla_qid = intval($wpdb->insert_id);
85
- foreach($polla_answers as $polla_answer) {
86
- $polla_answer = addslashes(trim($polla_answer));
87
- $add_poll_answers = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $polla_qid, '$polla_answer', 0)");
88
- if(!$add_poll_answers) {
89
- $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll\'s Answer \'%s\'.', 'wp-polls'), stripslashes($polla_answer)).'</p>';
90
- }
91
- }
92
- // Update Lastest Poll ID To Poll Options
93
- $latest_pollid = polls_latest_id();
94
- $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
95
- if(empty($text)) {
96
- $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>';
97
- }
98
- cron_polls_place();
99
- break;
100
- }
101
- }
102
-
103
- ### Add Poll Form
104
- $poll_noquestion = 2;
105
- $count = 0;
106
- ?>
107
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } ?>
108
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
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>
114
- <table class="form-table">
115
- <tr>
116
- <th width="20%" scope="row" valign="top"><?php _e('Question', 'wp-polls') ?></th>
117
- <td width="80%"><input type="text" size="70" name="pollq_question" value="" /></td>
118
- </tr>
119
- </table>
120
- <!-- Poll Answers -->
121
- <h3><?php _e('Poll Answers', 'wp-polls'); ?></h3>
122
- <table class="form-table">
123
- <tfoot>
124
- <tr>
125
- <td width="20%">&nbsp;</td>
126
- <td width="80%"><input type="button" value="<?php _e('Add Answer', 'wp-polls') ?>" onclick="add_poll_answer_add();" class="button" /></td>
127
- </tr>
128
- </tfoot>
129
- <tbody id="poll_answers">
130
- <?php
131
- for($i = 1; $i <= $poll_noquestion; $i++) {
132
- echo "<tr id=\"poll-answer-$i\">\n";
133
- echo "<th width=\"20%\" scope=\"row\" valign=\"top\">".sprintf(__('Answer %s', 'wp-polls'), number_format_i18n($i))."</th>\n";
134
- echo "<td width=\"80%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_answers[]\" />&nbsp;&nbsp;&nbsp;<input type=\"button\" value=\"".__('Remove', 'wp-polls')."\" onclick=\"remove_poll_answer_add(".$i.");\" class=\"button\" /></td>\n";
135
- echo "</tr>\n";
136
- $count++;
137
- }
138
- ?>
139
- </tbody>
140
- </table>
141
- <!-- Poll Multiple Answers -->
142
- <h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3>
143
- <table class="form-table">
144
- <tr>
145
- <th width="40%" scope="row" valign="top"><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></th>
146
- <td width="60%">
147
- <select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();">
148
- <option value="0"><?php _e('No', 'wp-polls'); ?></option>
149
- <option value="1"><?php _e('Yes', 'wp-polls'); ?></option>
150
- </select>
151
- </td>
152
- </tr>
153
- <tr>
154
- <th width="40%" scope="row" valign="top"><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></th>
155
- <td width="60%">
156
- <select name="pollq_multiple" id="pollq_multiple" size="1" disabled="disabled">
157
- <?php
158
- for($i = 1; $i <= $poll_noquestion; $i++) {
159
- echo "<option value=\"$i\">".number_format_i18n($i)."</option>\n";
160
- }
161
- ?>
162
- </select>
163
- </td>
164
- </tr>
165
- </table>
166
- <!-- Poll Start/End Date -->
167
- <h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3>
168
- <table class="form-table">
169
- <tr>
170
- <th width="20%" scope="row" valign="top"><?php _e('Start Date/Time', 'wp-polls') ?></th>
171
- <td width="80%"><?php poll_timestamp(current_time('timestamp')); ?></td>
172
- </tr>
173
- <tr>
174
- <th width="20%" scope="row" valign="top"><?php _e('End Date/Time', 'wp-polls') ?></th>
175
- <td width="80%"><input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" checked="checked" onclick="check_pollexpiry();" />&nbsp;&nbsp;<label for="pollq_expiry_no"><?php _e('Do NOT Expire This Poll', 'wp-polls'); ?></label><?php poll_timestamp(current_time('timestamp'), 'pollq_expiry', 'none'); ?></td>
176
- </tr>
177
- </table>
178
- <p style="text-align: center;"><input type="submit" name="do" value="<?php _e('Add Poll', 'wp-polls'); ?>" class="button" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></p>
179
- </div>
180
  </form>
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress Plugin: WP-Polls |
6
+ | Copyright (c) 2012 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Add Poll |
14
+ | - wp-content/plugins/wp-polls/polls-add.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Polls
21
+ if(!current_user_can('manage_polls')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+ ### Poll Manager
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']) {
33
+ // Add Poll
34
+ case __('Add Poll', 'wp-polls'):
35
+ check_admin_referer('wp-polls_add-poll');
36
+ // Poll Question
37
+ $pollq_question = addslashes(trim($_POST['pollq_question']));
38
+ // Poll Start Date
39
+ $timestamp_sql = '';
40
+ $pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
41
+ $pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
42
+ $pollq_timestamp_year = intval($_POST['pollq_timestamp_year']);
43
+ $pollq_timestamp_hour = intval($_POST['pollq_timestamp_hour']);
44
+ $pollq_timestamp_minute = intval($_POST['pollq_timestamp_minute']);
45
+ $pollq_timestamp_second = intval($_POST['pollq_timestamp_second']);
46
+ $pollq_timestamp = gmmktime($pollq_timestamp_hour, $pollq_timestamp_minute, $pollq_timestamp_second, $pollq_timestamp_month, $pollq_timestamp_day, $pollq_timestamp_year);
47
+ if($pollq_timestamp > current_time('timestamp')) {
48
+ $pollq_active = -1;
49
+ } else {
50
+ $pollq_active = 1;
51
+ }
52
+ // Poll End Date
53
+ $pollq_expiry_no = intval($_POST['pollq_expiry_no']);
54
+ if($pollq_expiry_no == 1) {
55
+ $pollq_expiry = '';
56
+ } else {
57
+ $pollq_expiry_day = intval($_POST['pollq_expiry_day']);
58
+ $pollq_expiry_month = intval($_POST['pollq_expiry_month']);
59
+ $pollq_expiry_year = intval($_POST['pollq_expiry_year']);
60
+ $pollq_expiry_hour = intval($_POST['pollq_expiry_hour']);
61
+ $pollq_expiry_minute = intval($_POST['pollq_expiry_minute']);
62
+ $pollq_expiry_second = intval($_POST['pollq_expiry_second']);
63
+ $pollq_expiry = gmmktime($pollq_expiry_hour, $pollq_expiry_minute, $pollq_expiry_second, $pollq_expiry_month, $pollq_expiry_day, $pollq_expiry_year);
64
+ if($pollq_expiry <= current_time('timestamp')) {
65
+ $pollq_active = 0;
66
+ }
67
+ }
68
+ // Mutilple Poll
69
+ $pollq_multiple_yes = intval($_POST['pollq_multiple_yes']);
70
+ $pollq_multiple = 0;
71
+ if($pollq_multiple_yes == 1) {
72
+ $pollq_multiple = intval($_POST['pollq_multiple']);
73
+ } else {
74
+ $pollq_multiple = 0;
75
+ }
76
+ // Insert Poll
77
+ $add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (0, '$pollq_question', '$pollq_timestamp', 0, $pollq_active, '$pollq_expiry', $pollq_multiple, 0)");
78
+ if(!$add_poll_question) {
79
+ $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
80
+ }
81
+ // Add Poll Answers
82
+ $polla_answers = $_POST['polla_answers'];
83
+ $polla_qid = intval($wpdb->insert_id);
84
+ foreach($polla_answers as $polla_answer) {
85
+ $polla_answer = addslashes(trim($polla_answer));
86
+ $add_poll_answers = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $polla_qid, '$polla_answer', 0)");
87
+ if(!$add_poll_answers) {
88
+ $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll\'s Answer \'%s\'.', 'wp-polls'), stripslashes($polla_answer)).'</p>';
89
+ }
90
+ }
91
+ // Update Lastest Poll ID To Poll Options
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;
99
+ }
100
+ }
101
+
102
+ ### Add Poll Form
103
+ $poll_noquestion = 2;
104
+ $count = 0;
105
+ ?>
106
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } ?>
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>
114
+ <table class="form-table">
115
+ <tr>
116
+ <th width="20%" scope="row" valign="top"><?php _e('Question', 'wp-polls') ?></th>
117
+ <td width="80%"><input type="text" size="70" name="pollq_question" value="" /></td>
118
+ </tr>
119
+ </table>
120
+ <!-- Poll Answers -->
121
+ <h3><?php _e('Poll Answers', 'wp-polls'); ?></h3>
122
+ <table class="form-table">
123
+ <tfoot>
124
+ <tr>
125
+ <td width="20%">&nbsp;</td>
126
+ <td width="80%"><input type="button" value="<?php _e('Add Answer', 'wp-polls') ?>" onclick="add_poll_answer_add();" class="button" /></td>
127
+ </tr>
128
+ </tfoot>
129
+ <tbody id="poll_answers">
130
+ <?php
131
+ for($i = 1; $i <= $poll_noquestion; $i++) {
132
+ echo "<tr id=\"poll-answer-$i\">\n";
133
+ echo "<th width=\"20%\" scope=\"row\" valign=\"top\">".sprintf(__('Answer %s', 'wp-polls'), number_format_i18n($i))."</th>\n";
134
+ echo "<td width=\"80%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_answers[]\" />&nbsp;&nbsp;&nbsp;<input type=\"button\" value=\"".__('Remove', 'wp-polls')."\" onclick=\"remove_poll_answer_add(".$i.");\" class=\"button\" /></td>\n";
135
+ echo "</tr>\n";
136
+ $count++;
137
+ }
138
+ ?>
139
+ </tbody>
140
+ </table>
141
+ <!-- Poll Multiple Answers -->
142
+ <h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3>
143
+ <table class="form-table">
144
+ <tr>
145
+ <th width="40%" scope="row" valign="top"><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></th>
146
+ <td width="60%">
147
+ <select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();">
148
+ <option value="0"><?php _e('No', 'wp-polls'); ?></option>
149
+ <option value="1"><?php _e('Yes', 'wp-polls'); ?></option>
150
+ </select>
151
+ </td>
152
+ </tr>
153
+ <tr>
154
+ <th width="40%" scope="row" valign="top"><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></th>
155
+ <td width="60%">
156
+ <select name="pollq_multiple" id="pollq_multiple" size="1" disabled="disabled">
157
+ <?php
158
+ for($i = 1; $i <= $poll_noquestion; $i++) {
159
+ echo "<option value=\"$i\">".number_format_i18n($i)."</option>\n";
160
+ }
161
+ ?>
162
+ </select>
163
+ </td>
164
+ </tr>
165
+ </table>
166
+ <!-- Poll Start/End Date -->
167
+ <h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3>
168
+ <table class="form-table">
169
+ <tr>
170
+ <th width="20%" scope="row" valign="top"><?php _e('Start Date/Time', 'wp-polls') ?></th>
171
+ <td width="80%"><?php poll_timestamp(current_time('timestamp')); ?></td>
172
+ </tr>
173
+ <tr>
174
+ <th width="20%" scope="row" valign="top"><?php _e('End Date/Time', 'wp-polls') ?></th>
175
+ <td width="80%"><input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" checked="checked" onclick="check_pollexpiry();" />&nbsp;&nbsp;<label for="pollq_expiry_no"><?php _e('Do NOT Expire This Poll', 'wp-polls'); ?></label><?php poll_timestamp(current_time('timestamp'), 'pollq_expiry', 'none'); ?></td>
176
+ </tr>
177
+ </table>
178
+ <p style="text-align: center;"><input type="submit" name="do" value="<?php _e('Add Poll', 'wp-polls'); ?>" class="button-primary" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></p>
179
+ </div>
180
  </form>
polls-admin-ajax.php DELETED
@@ -1,125 +0,0 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Polls AJAX For Admin Backend |
14
- | - wp-content/plugins/wp-polls/polls-admin-ajax.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Include wp-config.php
21
- $wp_root = '../../..';
22
- if (file_exists($wp_root.'/wp-load.php')) {
23
- require_once($wp_root.'/wp-load.php');
24
- } else {
25
- require_once($wp_root.'/wp-config.php');
26
- }
27
-
28
-
29
- ### Check Whether User Can Manage Polls
30
- if(!current_user_can('manage_polls')) {
31
- die('Access Denied');
32
- }
33
-
34
-
35
- ### Form Processing
36
- if(!empty($_POST['do'])) {
37
- // Set Header
38
- header('Content-Type: text/html; charset='.get_option('blog_charset').'');
39
-
40
- // Decide What To Do
41
- switch($_POST['do']) {
42
- // Delete Polls Logs
43
- case __('Delete All Logs', 'wp-polls'):
44
- if(trim($_POST['delete_logs_yes']) == 'yes') {
45
- $delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip");
46
- if($delete_logs) {
47
- echo '<p style="color: green;">'.__('All Polls Logs Have Been Deleted.', 'wp-polls').'</p>';
48
- } else {
49
- echo '<p style="color: red;">'.__('An Error Has Occured While Deleting All Polls Logs.', 'wp-polls').'</p>';
50
- }
51
- }
52
- break;
53
- // Delete Poll Logs For Individual Poll
54
- case __('Delete Logs For This Poll Only', 'wp-polls'):
55
- $pollq_id = intval($_POST['pollq_id']);
56
- $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
57
- if(trim($_POST['delete_logs_yes']) == 'yes') {
58
- $delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
59
- if($delete_logs) {
60
- echo '<p style="color: green;">'.sprintf(__('All Logs For \'%s\' Has Been Deleted.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
61
- } else {
62
- echo '<p style="color: red;">'.sprintf(__('An Error Has Occured While Deleting All Logs For \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
63
- }
64
- }
65
- break;
66
- // Delete Poll's Answer
67
- case __('Delete Poll Answer', 'wp-polls'):
68
- $pollq_id = intval($_POST['pollq_id']);
69
- $polla_aid = intval($_POST['polla_aid']);
70
- $poll_answers = $wpdb->get_row("SELECT polla_votes, polla_answers FROM $wpdb->pollsa WHERE polla_aid = $polla_aid AND polla_qid = $pollq_id");
71
- $polla_votes = intval($poll_answers->polla_votes);
72
- $polla_answers = stripslashes(trim($poll_answers->polla_answers));
73
- $delete_polla_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_aid = $polla_aid AND polla_qid = $pollq_id");
74
- $delete_pollip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id AND pollip_aid = $polla_aid");
75
- $update_pollq_totalvotes = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes-$polla_votes) WHERE pollq_id = $pollq_id");
76
- if($delete_polla_answers) {
77
- echo '<p style="color: green;">'.sprintf(__('Poll Answer \'%s\' Deleted Successfully.', 'wp-polls'), $polla_answers).'</p>';
78
- } else {
79
- echo '<p style="color: red;">'.sprintf(__('Error In Deleting Poll Answer \'%s\'.', 'wp-polls'), $polla_answers).'</p>';
80
- }
81
- break;
82
- // Open Poll
83
- case __('Open Poll', 'wp-polls'):
84
- $pollq_id = intval($_POST['pollq_id']);
85
- $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
86
- $open_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_id = $pollq_id;");
87
- if($open_poll) {
88
- echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Is Now Opened', 'wp-polls'), stripslashes($pollq_question)).'</p>';
89
- } else {
90
- echo '<p style="color: red;">'.sprintf(__('Error Opening Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
91
- }
92
- break;
93
- // Close Poll
94
- case __('Close Poll', 'wp-polls'):
95
- $pollq_id = intval($_POST['pollq_id']);
96
- $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
97
- $close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_id = $pollq_id;");
98
- if($close_poll) {
99
- echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Is Now Closed', 'wp-polls'), stripslashes($pollq_question)).'</p>';
100
- } else {
101
- echo '<p style="color: red;">'.sprintf(__('Error Closing Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
102
- }
103
- break;
104
- // Delete Poll
105
- case __('Delete Poll', 'wp-polls'):
106
- $pollq_id = intval($_POST['pollq_id']);
107
- $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
108
- $delete_poll_question = $wpdb->query("DELETE FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
109
- $delete_poll_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_qid = $pollq_id");
110
- $delete_poll_ip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
111
- $poll_option_lastestpoll = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'poll_latestpoll'");
112
- if(!$delete_poll_question) {
113
- echo '<p style="color: red;">'.sprintf(__('Error In Deleting Poll \'%s\' Question', 'wp-polls'), stripslashes($pollq_question)).'</p>';
114
- }
115
- if(empty($text)) {
116
- echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Deleted Successfully', 'wp-polls'), stripslashes($pollq_question)).'</p>';
117
- }
118
- // Update Lastest Poll ID To Poll Options
119
- $latest_pollid = polls_latest_id();
120
- $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
121
- break;
122
- }
123
- exit();
124
- }
125
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
polls-admin-css.css CHANGED
@@ -1,31 +1,31 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
5
- | Copyright (c) 2009 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;
22
- border: 1px solid #000000;
23
- }
24
- #wp-polls-pollbar-border {
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
+ /*
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;
22
+ border: 1px solid #000000;
23
+ }
24
+ #wp-polls-pollbar-border {
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
  }
polls-admin-js.dev.js CHANGED
@@ -1,196 +1,207 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
5
- | Copyright (c) 2009 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;
22
- var count_poll_answer_new = 0;
23
- var count_poll_answer = 3;
24
-
25
- // Delete Poll
26
- function delete_poll(poll_id, poll_confirm) {
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, 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
-
38
- // Delete Poll Logs
39
- function delete_poll_logs(poll_confirm) {
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', 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
-
54
- // Delete Individual Poll Logs
55
- function delete_this_poll_logs(poll_id, poll_confirm) {
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', 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
-
73
- // Delete Poll Answer
74
- function delete_poll_ans(poll_id, poll_aid, poll_aid_vote, poll_confirm) {
75
- delete_poll_ans_confirm = confirm(poll_confirm);
76
- if(delete_poll_ans_confirm) {
77
- global_poll_id = poll_id;
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, 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
-
93
- // Open Poll
94
- function opening_poll(poll_id, poll_confirm) {
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, 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
-
107
- // Close Poll
108
- function closing_poll(poll_id, poll_confirm) {
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, 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
- jQuery('#pollq_multiple').empty();
124
- jQuery('#poll_answers tr > th').each(function (i) {
125
- jQuery(this).text(pollsAdminL10n.text_answer + ' ' + (i+1));
126
- jQuery('#pollq_multiple').append('<option value="' + (i+1) + '">' + (i+1) + '</option>');
127
- });
128
- }
129
-
130
- // Calculate Total Votes
131
- function check_totalvotes() {
132
- temp_vote_count = 0;
133
- jQuery('#poll_answers tr > td:last input').each(function (i) {
134
- if(isNaN(jQuery(this).val())) {
135
- temp_vote_count += 0;
136
- } else {
137
- temp_vote_count += parseInt(jQuery(this).val());
138
- }
139
- });
140
- jQuery('#pollq_totalvotes').val(temp_vote_count);
141
- }
142
-
143
- // Add Poll's Answer In Add Poll Page
144
- function add_poll_answer_add() {
145
- 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>');
146
- count_poll_answer++;
147
- reorder_answer_num();
148
- }
149
-
150
- // Remove Poll's Answer in Add Poll Page
151
- function remove_poll_answer_add(poll_answer_id) {
152
- jQuery('#poll-answer-' + poll_answer_id).remove();
153
- reorder_answer_num();
154
- }
155
-
156
- // Add Poll's Answer In Edit Poll Page
157
- function add_poll_answer_edit() {
158
- 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>');
159
- count_poll_answer_new++;
160
- reorder_answer_num();
161
- }
162
-
163
- // Remove Poll's Answer In Edit Poll Page
164
- function remove_poll_answer_edit(poll_answer_new_id) {
165
- jQuery('#poll-answer-new-' + poll_answer_new_id).remove();
166
- check_totalvotes();
167
- reorder_answer_num();
168
- }
169
-
170
- // Check Poll Whether It is Multiple Poll Answer
171
- function check_pollq_multiple() {
172
- if(parseInt(jQuery('#pollq_multiple_yes').val()) == 1) {
173
- jQuery('#pollq_multiple').attr('disabled', false);
174
- } else {
175
- jQuery('#pollq_multiple').val(1);
176
- jQuery('#pollq_multiple').attr('disabled', true);
177
- }
178
- }
179
-
180
- // Show/Hide Poll's Timestamp
181
- function check_polltimestamp() {
182
- if(jQuery('#edit_polltimestamp').is(':checked')) {
183
- jQuery('#pollq_timestamp').show();
184
- } else {
185
- jQuery('#pollq_timestamp').hide();
186
- }
187
- }
188
-
189
- // Show/Hide Poll's Expiry Date
190
- function check_pollexpiry() {
191
- if(jQuery('#pollq_expiry_no').is(':checked')) {
192
- jQuery('#pollq_expiry').hide();
193
- } else {
194
- jQuery('#pollq_expiry').show();
195
- }
 
 
 
 
 
 
 
 
 
 
 
196
  }
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;
22
+ var count_poll_answer_new = 0;
23
+ var count_poll_answer = 3;
24
+
25
+ // Delete Poll
26
+ 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
+
38
+ // Delete Poll Logs
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
+
54
+ // Delete Individual Poll Logs
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
+
73
+ // Delete Poll Answer
74
+ function delete_poll_ans(poll_id, poll_aid, poll_aid_vote, poll_confirm, nonce) {
75
+ delete_poll_ans_confirm = confirm(poll_confirm);
76
+ if(delete_poll_ans_confirm) {
77
+ global_poll_id = poll_id;
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
+
93
+ // Open Poll
94
+ 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
+
107
+ // Close Poll
108
+ 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
  }
polls-admin-js.js CHANGED
@@ -1 +1,15 @@
1
- var global_poll_id=0;var global_poll_aid=0;var global_poll_aid_votes=0;var count_poll_answer_new=0;var count_poll_answer=3;function delete_poll(a,b){delete_poll_confirm=confirm(b);if(delete_poll_confirm){global_poll_id=a;jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll+"&pollq_id="+a,cache:false,success:function(c){jQuery("#message").html(c);jQuery("#message").show();jQuery("#poll-"+global_poll_id).remove()}})}}function delete_poll_logs(a){delete_poll_logs_confirm=confirm(a);if(delete_poll_logs_confirm){if(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",cache:false,success:function(b){jQuery("#message").html(b);jQuery("#message").show();jQuery("#poll_logs").html(pollsAdminL10n.text_no_poll_logs)}})}else{alert(pollsAdminL10n.text_checkbox_delete_all_logs)}}}function delete_this_poll_logs(a,b){delete_poll_logs_confirm=confirm(b);if(delete_poll_logs_confirm){if(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",cache:false,success:function(c){jQuery("#message").html(c);jQuery("#message").show();jQuery("#poll_logs").html(pollsAdminL10n.text_no_poll_logs);jQuery("#poll_logs_display").hide();jQuery("#poll_logs_display_none").show()}})}else{alert(pollsAdminL10n.text_checkbox_delete_poll_logs)}}}function delete_poll_ans(b,c,a,d){delete_poll_ans_confirm=confirm(d);if(delete_poll_ans_confirm){global_poll_id=b;global_poll_aid=c;global_poll_aid_votes=a;temp_vote_count=0;jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_delete_poll_ans+"&pollq_id="+b+"&polla_aid="+c,cache:false,success:function(e){jQuery("#message").html(e);jQuery("#message").show();jQuery("#poll_total_votes").html((parseInt(jQuery("#poll_total_votes").html())-parseInt(global_poll_aid_votes)));jQuery("#pollq_totalvotes").val(temp_vote_count);jQuery("#poll-answer-"+global_poll_aid).remove();check_totalvotes();reorder_answer_num()}})}}function opening_poll(a,b){open_poll_confirm=confirm(b);if(open_poll_confirm){global_poll_id=a;jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_open_poll+"&pollq_id="+a,cache:false,success:function(c){jQuery("#message").html(c);jQuery("#message").show();jQuery("#open_poll").hide();jQuery("#close_poll").show()}})}}function closing_poll(a,b){close_poll_confirm=confirm(b);if(close_poll_confirm){global_poll_id=a;jQuery.ajax({type:"POST",url:pollsAdminL10n.admin_ajax_url,data:"do="+pollsAdminL10n.text_close_poll+"&pollq_id="+a,cache:false,success:function(c){jQuery("#message").html(c);jQuery("#message").show();jQuery("#open_poll").show();jQuery("#close_poll").hide()}})}}function reorder_answer_num(){jQuery("#pollq_multiple").empty();jQuery("#poll_answers tr > th").each(function(a){jQuery(this).text(pollsAdminL10n.text_answer+" "+(a+1));jQuery("#pollq_multiple").append('<option value="'+(a+1)+'">'+(a+1)+"</option>")})}function check_totalvotes(){temp_vote_count=0;jQuery("#poll_answers tr > td:last input").each(function(a){if(isNaN(jQuery(this).val())){temp_vote_count+=0}else{temp_vote_count+=parseInt(jQuery(this).val())}});jQuery("#pollq_totalvotes").val(temp_vote_count)}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()}function remove_poll_answer_add(a){jQuery("#poll-answer-"+a).remove();reorder_answer_num()}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>');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(){if(parseInt(jQuery("#pollq_multiple_yes").val())==1){jQuery("#pollq_multiple").attr("disabled",false)}else{jQuery("#pollq_multiple").val(1);jQuery("#pollq_multiple").attr("disabled",true)}}function check_polltimestamp(){if(jQuery("#edit_polltimestamp").is(":checked")){jQuery("#pollq_timestamp").show()}else{jQuery("#pollq_timestamp").hide()}}function check_pollexpiry(){if(jQuery("#pollq_expiry_no").is(":checked")){jQuery("#pollq_expiry").hide()}else{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,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()};
polls-css-rtl.css CHANGED
@@ -1,29 +1,29 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
5
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
6
- | |
7
- | File Written By: |
8
- | - Lester "GaMerZ" Chan |
9
- | - http://lesterchan.net |
10
- | |
11
- | File Information: |
12
- | - Polls CSS File (RTL) |
13
- | - wp-content/plugins/wp-polls/polls-css.css |
14
- | |
15
- +----------------------------------------------------------------+
16
- */
17
-
18
-
19
- .wp-polls ul li, wp-polls-ul li, .wp-polls-ans ul li {
20
- text-align: right;
21
- }
22
-
23
- .wp-polls ul, .wp-polls-ul, .wp-polls-ans ul {
24
- text-align: right;
25
- }
26
-
27
- .wp-polls-ul {
28
- margin: 0px 10px 10px 0px;
29
  }
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 CSS File (RTL) |
13
+ | - wp-content/plugins/wp-polls/polls-css.css |
14
+ | |
15
+ +----------------------------------------------------------------+
16
+ */
17
+
18
+
19
+ .wp-polls ul li, .wp-polls-ul li, .wp-polls-ans ul li {
20
+ text-align: right;
21
+ }
22
+
23
+ .wp-polls ul, .wp-polls-ul, .wp-polls-ans ul {
24
+ text-align: right;
25
+ }
26
+
27
+ .wp-polls-ul {
28
+ margin: 0px 10px 10px 0px;
29
  }
polls-css.css CHANGED
@@ -1,119 +1,119 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
5
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
6
- | |
7
- | File Written By: |
8
- | - Lester "GaMerZ" Chan |
9
- | - http://lesterchan.net |
10
- | |
11
- | File Information: |
12
- | - Polls CSS File |
13
- | - wp-content/plugins/wp-polls/polls-css.css |
14
- | |
15
- +----------------------------------------------------------------+
16
- */
17
-
18
-
19
- .wp-polls-archive {
20
- /* background-color: #ffffff; */
21
- }
22
- .wp-polls, .wp-polls-form {
23
- /* background-color: #ffffff; */
24
- }
25
- .wp-polls ul li, wp-polls-ul li, .wp-polls-ans ul li {
26
- text-align: left;
27
- background-image: none;
28
- display: block;
29
- }
30
- .wp-polls ul, .wp-polls-ul, .wp-polls-ans ul {
31
- text-align: left;
32
- list-style: none;
33
- float: none;
34
- }
35
- .wp-polls ul li:before, wp-polls-ul li, .wp-polls-ans ul li:before, #sidebar ul ul li:before {
36
- content: '';
37
- }
38
- .wp-polls IMG, .wp-polls LABEL , .wp-polls INPUT, .wp-polls-loading IMG, .wp-polls-image IMG {
39
- display: inline;
40
- border: 0px;
41
- padding: 0px;
42
- margin: 0px;
43
- }
44
- .wp-polls-ul {
45
- padding: 0px;
46
- margin: 0px 0px 10px 10px;
47
- }
48
- .wp-polls-ans {
49
- width:100%;
50
- filter: alpha(opacity=100);
51
- -moz-opacity: 1;
52
- opacity: 1;
53
- /* background-color: #ffffff; */
54
- }
55
- .wp-polls-loading {
56
- display: none;
57
- text-align: center;
58
- height: 16px;
59
- line-height: 16px;
60
- }
61
- .wp-polls-image {
62
- border: 0px;
63
- }
64
- .wp-polls .Buttons {
65
- border:1px solid #c8c8c8;
66
- background-color: #f3f6f8;
67
- }
68
- /* Polls Archive Paging */
69
- .wp-polls-paging a, .wp-polls-paging a:link {
70
- padding: 2px 4px 2px 4px;
71
- margin: 2px;
72
- text-decoration: none;
73
- border: 1px solid #0066cc;
74
- color: #0066cc;
75
- background-color: #FFFFFF;
76
- }
77
- .wp-polls-paging a:visited {
78
- padding: 2px 4px 2px 4px;
79
- margin: 2px;
80
- text-decoration: none;
81
- border: 1px solid #0066cc;
82
- color: #0066cc;
83
- background-color: #FFFFFF;
84
- }
85
- .wp-polls-paging a:hover {
86
- border: 1px solid #000000;
87
- color: #000000;
88
- background-color: #FFFFFF;
89
- }
90
- .wp-polls-paging a:active {
91
- padding: 2px 4px 2px 4px;
92
- margin: 2px;
93
- text-decoration: none;
94
- border: 1px solid #0066cc;
95
- color: #0066cc;
96
- background-color: #FFFFFF;
97
- }
98
- .wp-polls-paging span.pages {
99
- padding: 2px 4px 2px 4px;
100
- margin: 2px 2px 2px 2px;
101
- color: #000000;
102
- border: 1px solid #000000;
103
- background-color: #FFFFFF;
104
- }
105
- .wp-polls-paging span.current {
106
- padding: 2px 4px 2px 4px;
107
- margin: 2px;
108
- font-weight: bold;
109
- border: 1px solid #000000;
110
- color: #000000;
111
- background-color: #FFFFFF;
112
- }
113
- .wp-polls-paging span.extend {
114
- padding: 2px 4px 2px 4px;
115
- margin: 2px;
116
- border: 1px solid #000000;
117
- color: #000000;
118
- background-color: #FFFFFF;
119
  }
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 CSS File |
13
+ | - wp-content/plugins/wp-polls/polls-css.css |
14
+ | |
15
+ +----------------------------------------------------------------+
16
+ */
17
+
18
+
19
+ .wp-polls-archive {
20
+ /* background-color: #ffffff; */
21
+ }
22
+ .wp-polls, .wp-polls-form {
23
+ /* background-color: #ffffff; */
24
+ }
25
+ .wp-polls ul li, .wp-polls-ul li, .wp-polls-ans ul li {
26
+ text-align: left;
27
+ background-image: none;
28
+ display: block;
29
+ }
30
+ .wp-polls ul, .wp-polls-ul, .wp-polls-ans ul {
31
+ text-align: left;
32
+ list-style: none;
33
+ float: none;
34
+ }
35
+ .wp-polls ul li:before, .wp-polls-ans ul li:before, #sidebar ul ul li:before {
36
+ content: '';
37
+ }
38
+ .wp-polls IMG, .wp-polls LABEL , .wp-polls INPUT, .wp-polls-loading IMG, .wp-polls-image IMG {
39
+ display: inline;
40
+ border: 0px;
41
+ padding: 0px;
42
+ margin: 0px;
43
+ }
44
+ .wp-polls-ul {
45
+ padding: 0px;
46
+ margin: 0px 0px 10px 10px;
47
+ }
48
+ .wp-polls-ans {
49
+ width:100%;
50
+ filter: alpha(opacity=100);
51
+ -moz-opacity: 1;
52
+ opacity: 1;
53
+ /* background-color: #ffffff; */
54
+ }
55
+ .wp-polls-loading {
56
+ display: none;
57
+ text-align: center;
58
+ height: 16px;
59
+ line-height: 16px;
60
+ }
61
+ .wp-polls-image {
62
+ border: 0px;
63
+ }
64
+ .wp-polls .Buttons {
65
+ border:1px solid #c8c8c8;
66
+ background-color: #f3f6f8;
67
+ }
68
+ /* Polls Archive Paging */
69
+ .wp-polls-paging a, .wp-polls-paging a:link {
70
+ padding: 2px 4px 2px 4px;
71
+ margin: 2px;
72
+ text-decoration: none;
73
+ border: 1px solid #0066cc;
74
+ color: #0066cc;
75
+ background-color: #FFFFFF;
76
+ }
77
+ .wp-polls-paging a:visited {
78
+ padding: 2px 4px 2px 4px;
79
+ margin: 2px;
80
+ text-decoration: none;
81
+ border: 1px solid #0066cc;
82
+ color: #0066cc;
83
+ background-color: #FFFFFF;
84
+ }
85
+ .wp-polls-paging a:hover {
86
+ border: 1px solid #000000;
87
+ color: #000000;
88
+ background-color: #FFFFFF;
89
+ }
90
+ .wp-polls-paging a:active {
91
+ padding: 2px 4px 2px 4px;
92
+ margin: 2px;
93
+ text-decoration: none;
94
+ border: 1px solid #0066cc;
95
+ color: #0066cc;
96
+ background-color: #FFFFFF;
97
+ }
98
+ .wp-polls-paging span.pages {
99
+ padding: 2px 4px 2px 4px;
100
+ margin: 2px 2px 2px 2px;
101
+ color: #000000;
102
+ border: 1px solid #000000;
103
+ background-color: #FFFFFF;
104
+ }
105
+ .wp-polls-paging span.current {
106
+ padding: 2px 4px 2px 4px;
107
+ margin: 2px;
108
+ font-weight: bold;
109
+ border: 1px solid #000000;
110
+ color: #000000;
111
+ background-color: #FFFFFF;
112
+ }
113
+ .wp-polls-paging span.extend {
114
+ padding: 2px 4px 2px 4px;
115
+ margin: 2px;
116
+ border: 1px solid #000000;
117
+ color: #000000;
118
+ background-color: #FFFFFF;
119
  }
polls-js.dev.js CHANGED
@@ -1,152 +1,155 @@
1
- /*
2
- +----------------------------------------------------------------+
3
- | |
4
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
5
- | Copyright (c) 2009 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 = '';
22
- 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 + ' :checkbox, #polls_form_' + poll_id + ' :radio').each(function(i){
38
- if (jQuery(this).is(':checked')) {
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
- if(pollsL10n.show_fading) {
74
- jQuery('#polls-' + poll_id).fadeTo('def', 0, function () {
75
- if(pollsL10n.show_loading) {
76
- jQuery('#polls-' + poll_id + '-loading').show();
77
- }
78
- jQuery.ajax({type: 'POST', url: pollsL10n.ajax_url, data: 'vote=true&poll_id=' + poll_id + '&poll_' + poll_id + '=' + poll_answer_id, cache: false, success: poll_process_success});
79
- });
80
- } else {
81
- if(pollsL10n.show_loading) {
82
- jQuery('#polls-' + poll_id + '-loading').show();
83
- }
84
- jQuery.ajax({type: 'POST', url: pollsL10n.ajax_url, data: 'vote=true&poll_id=' + poll_id + '&poll_' + poll_id + '=' + poll_answer_id, cache: false, success: poll_process_success});
85
- }
86
- }
87
-
88
- // Poll's Result (User Click "View Results" Link)
89
- function poll_result(current_poll_id) {
90
- if(!is_being_voted) {
91
- set_is_being_voted(true);
92
- poll_id = current_poll_id;
93
- if(pollsL10n.show_fading) {
94
- jQuery('#polls-' + poll_id).fadeTo('def', 0, function () {
95
- if(pollsL10n.show_loading) {
96
- jQuery('#polls-' + poll_id + '-loading').show();
97
- }
98
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'pollresult=' + poll_id, cache: false, success: poll_process_success});
99
- });
100
- } else {
101
- if(pollsL10n.show_loading) {
102
- jQuery('#polls-' + poll_id + '-loading').show();
103
- }
104
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'pollresult=' + poll_id, cache: false, success: poll_process_success});
105
- }
106
- } else {
107
- alert(pollsL10n.text_wait);
108
- }
109
- }
110
-
111
- // Poll's Voting Booth (User Click "Vote" Link)
112
- function poll_booth(current_poll_id) {
113
- if(!is_being_voted) {
114
- set_is_being_voted(true);
115
- poll_id = current_poll_id;
116
- if(pollsL10n.show_fading) {
117
- jQuery('#polls-' + poll_id).fadeTo('def', 0, function () {
118
- if(pollsL10n.show_loading) {
119
- jQuery('#polls-' + poll_id + '-loading').show();
120
- }
121
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'pollbooth=' + poll_id, cache: false, success: poll_process_success});
122
- });
123
- } else {
124
- if(pollsL10n.show_loading) {
125
- jQuery('#polls-' + poll_id + '-loading').show();
126
- }
127
- jQuery.ajax({type: 'GET', url: pollsL10n.ajax_url, data: 'pollbooth=' + poll_id, cache: false, success: poll_process_success});
128
- }
129
- } else {
130
- alert(pollsL10n.text_wait);
131
- }
132
- }
133
-
134
- // Poll Process Successfully
135
- function poll_process_success(data) {
136
- jQuery('#polls-' + poll_id).html(data);
137
- if(pollsL10n.show_loading) {
138
- jQuery('#polls-' + poll_id + '-loading').hide();
139
- }
140
- if(pollsL10n.show_fading) {
141
- jQuery('#polls-' + poll_id).fadeTo('def', 1, function () {
142
- set_is_being_voted(false);
143
- });
144
- } else {
145
- set_is_being_voted(false);
146
- }
147
- }
148
-
149
- // Set is_being_voted Status
150
- function set_is_being_voted(voted_status) {
151
- is_being_voted = voted_status;
 
 
 
152
  }
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 = '';
22
+ 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
  }
polls-js.js CHANGED
@@ -1 +1 @@
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(a){if(!is_being_voted){set_is_being_voted(true);poll_id=a;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+" :checkbox, #polls_form_"+poll_id+" :radio").each(function(b){if(jQuery(this).is(":checked")){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(){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:"vote=true&poll_id="+poll_id+"&poll_"+poll_id+"="+poll_answer_id,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:"vote=true&poll_id="+poll_id+"&poll_"+poll_id+"="+poll_answer_id,cache:false,success:poll_process_success})}}function poll_result(a){if(!is_being_voted){set_is_being_voted(true);poll_id=a;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:"pollresult="+poll_id,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:"pollresult="+poll_id,cache:false,success:poll_process_success})}}else{alert(pollsL10n.text_wait)}}function poll_booth(a){if(!is_being_voted){set_is_being_voted(true);poll_id=a;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:"pollbooth="+poll_id,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:"pollbooth="+poll_id,cache:false,success:poll_process_success})}}else{alert(pollsL10n.text_wait)}}function poll_process_success(a){jQuery("#polls-"+poll_id).html(a);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(a){is_being_voted=a};
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}
polls-logs.php CHANGED
@@ -1,382 +1,393 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Polls Logs |
14
- | - wp-content/plugins/wp-polls/polls-logs.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Polls
21
- if(!current_user_can('manage_polls')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables
27
- $pollip_answers = array();
28
- $poll_question_data = $wpdb->get_row("SELECT pollq_multiple, pollq_question, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
29
- $poll_question = stripslashes($poll_question_data->pollq_question);
30
- $poll_totalvoters = intval($poll_question_data->pollq_totalvoters);
31
- $poll_multiple = intval($poll_question_data->pollq_multiple);
32
- $poll_registered = $wpdb->get_var("SELECT COUNT(pollip_userid) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid > 0");
33
- $poll_comments = $wpdb->get_var("SELECT COUNT(pollip_user) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_user != '".__('Guest', 'wp-polls')."' AND pollip_userid = 0");
34
- $poll_guest = $wpdb->get_var("SELECT COUNT(pollip_user) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_user = '".__('Guest', 'wp-polls')."'");
35
- $poll_totalrecorded = ($poll_registered+$poll_comments+$poll_guest);
36
- $poll_answers_data = $wpdb->get_results("SELECT polla_aid, polla_answers FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY ".get_option('poll_ans_sortby').' '.get_option('poll_ans_sortorder'));
37
- $poll_voters = $wpdb->get_col("SELECT DISTINCT pollip_user FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_user != '".__('Guest', 'wp-polls')."' ORDER BY pollip_user ASC");
38
- $poll_logs_count = $wpdb->get_var("SELECT COUNT(pollip_id) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id");
39
-
40
-
41
- ### Process Filters
42
- if(!empty($_POST['do'])) {
43
- $registered_sql = '';
44
- $comment_sql = '';
45
- $guest_sql = '';
46
- $users_voted_for_sql = '';
47
- $what_user_voted_sql = '';
48
- $num_choices_sql = '';
49
- $num_choices_sign_sql = '';
50
- $order_by = '';
51
- switch(intval($_POST['filter'])) {
52
- case 1:
53
- $users_voted_for = intval($_POST['users_voted_for']);
54
- $exclude_registered = intval($_POST['exclude_registered']);
55
- $exclude_comment = intval($_POST['exclude_comment']);
56
- $exclude_guest = intval($_POST['exclude_guest']);
57
- $users_voted_for_sql = "AND pollip_aid = $users_voted_for";
58
- if($exclude_registered) {
59
- $registered_sql = 'AND pollip_userid = 0';
60
- }
61
- if($exclude_comment) {
62
- if(!$exclude_registered) {
63
- $comment_sql = 'AND pollip_userid > 0';
64
- } else {
65
- $comment_sql = 'AND pollip_user = \''.__('Guest', 'wp-polls').'\'';
66
- }
67
- }
68
- if($exclude_guest) {
69
- $guest_sql = 'AND pollip_user != \''.__('Guest', 'wp-polls').'\'';
70
- }
71
- $order_by = 'pollip_timestamp DESC';
72
- break;
73
- case 2:
74
- $exclude_registered_2 = intval($_POST['exclude_registered_2']);
75
- $exclude_comment_2 = intval($_POST['exclude_comment_2']);
76
- $num_choices = intval($_POST['num_choices']);
77
- $num_choices_sign = addslashes($_POST['num_choices_sign']);
78
- switch($num_choices_sign) {
79
- case 'more':
80
- $num_choices_sign_sql = '>';
81
- break;
82
- case 'more_exactly':
83
- $num_choices_sign_sql = '>=';
84
- break;
85
- case 'exactly':
86
- $num_choices_sign_sql = '=';
87
- break;
88
- case 'less_exactly':
89
- $num_choices_sign_sql = '<=';
90
- break;
91
- case 'less':
92
- $num_choices_sign_sql = '<';
93
- break;
94
- }
95
- if($exclude_registered_2) {
96
- $registered_sql = 'AND pollip_userid = 0';
97
- }
98
- if($exclude_comment_2) {
99
- if(!$exclude_registered_2) {
100
- $comment_sql = 'AND pollip_userid > 0';
101
- } else {
102
- $comment_sql = 'AND pollip_user = \''.__('Guest', 'wp-polls').'\'';
103
- }
104
- }
105
- $guest_sql = 'AND pollip_user != \''.__('Guest', 'wp-polls').'\'';
106
- $num_choices_query = $wpdb->get_col("SELECT pollip_user, COUNT(pollip_ip) AS num_choices FROM $wpdb->pollsip WHERE pollip_qid = $poll_id GROUP BY pollip_ip, pollip_user HAVING num_choices $num_choices_sign_sql $num_choices");
107
- $num_choices_sql = 'AND pollip_user IN (\''.implode('\',\'',$num_choices_query).'\')';
108
- $order_by = 'pollip_user, pollip_ip';
109
- break;
110
- case 3;
111
- $what_user_voted = addslashes($_POST['what_user_voted']);
112
- $what_user_voted_sql = "AND pollip_user = '$what_user_voted'";
113
- $order_by = 'pollip_user, pollip_ip';
114
- break;
115
- }
116
- $poll_ips = $wpdb->get_results("SELECT $wpdb->pollsip.* FROM $wpdb->pollsip WHERE pollip_qid = $poll_id $users_voted_for_sql $registered_sql $comment_sql $guest_sql $what_user_voted_sql $num_choices_sql ORDER BY $order_by");
117
- } else {
118
- $poll_ips = $wpdb->get_results("SELECT pollip_aid, pollip_ip, pollip_host, pollip_timestamp, pollip_user FROM $wpdb->pollsip WHERE pollip_qid = $poll_id ORDER BY pollip_aid ASC, pollip_user ASC LIMIT 100");
119
- }
120
- ?>
121
- <?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>'; } ?>
122
- <div class="wrap">
123
- <div id="icon-wp-polls" class="icon32"><br /></div>
124
- <h2><?php _e('Poll\'s Logs', 'wp-polls'); ?></h2>
125
- <h3><?php echo $poll_question; ?></h3>
126
- <p>
127
- <?php printf(_n('There are a total of <strong>%s</strong> recorded vote for this poll.', 'There are a total of <strong>%s</strong> recorded votes for this poll.', $poll_totalrecorded, 'wp-polls'), number_format_i18n($poll_totalrecorded)); ?><br />
128
- <?php printf(_n('<strong>&raquo;</strong> <strong>%s</strong> vote is casted by registered users', '<strong>&raquo;</strong> <strong>%s</strong> votes are casted by registered users', $poll_registered, 'wp-polls'), number_format_i18n($poll_registered)); ?><br />
129
- <?php printf(_n('<strong>&raquo;</strong> <strong>%s</strong> vote is casted by comment authors', '<strong>&raquo;</strong> <strong>%s</strong> votes are casted by comment authors', $poll_comments, 'wp-polls'), number_format_i18n($poll_comments)); ?><br />
130
- <?php printf(_n('<strong>&raquo;</strong> <strong>%s</strong> vote is casted by guests', '<strong>&raquo;</strong> <strong>%s</strong> votes are casted by guests', $poll_guest, 'wp-polls'), number_format_i18n($poll_guest)); ?>
131
- </p>
132
- </div>
133
- <?php if($poll_totalrecorded > 0) { ?>
134
- <div class="wrap">
135
- <h3><?php _e('Filter Poll\'s Logs', 'wp-polls') ?></h3>
136
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
137
- <tr>
138
- <td width="50%">
139
- <form method="post" action="<?php echo htmlspecialchars($base_page); ?>&amp;mode=logs&amp;id=<?php echo $poll_id; ?>">
140
- <p style="display: none;"><input type="hidden" name="filter" value="1" /></p>
141
- <table class="form-table">
142
- <tr>
143
- <th scope="row" valign="top"><?php _e('Display All Users That Voted For', 'wp-polls'); ?></th>
144
- <td>
145
- <select name="users_voted_for" size="1">
146
- <?php
147
- if($poll_answers_data) {
148
- foreach($poll_answers_data as $data) {
149
- $polla_id = intval($data->polla_aid);
150
- $polla_answers = stripslashes(strip_tags(htmlspecialchars($data->polla_answers)));
151
- if($polla_id == $users_voted_for) {
152
- echo '<option value="'.$polla_id .'" selected="selected">'.$polla_answers.'</option>';
153
- } else {
154
- echo '<option value="'.$polla_id .'">'.$polla_answers.'</option>';
155
- }
156
- $pollip_answers[$polla_id] = $polla_answers;
157
- }
158
- }
159
- ?>
160
- </select>
161
- </td>
162
- </tr>
163
- <tr>
164
- <th scope="row" valign="top"><?php _e('Voters To EXCLUDE', 'wp-polls'); ?></th>
165
- <td>
166
- <input type="checkbox" id="exclude_registered_1" name="exclude_registered" value="1" <?php checked('1', $exclude_registered); ?> />&nbsp;<label for="exclude_registered_1"><?php _e('Registered Users', 'wp-polls'); ?></label><br />
167
- <input type="checkbox" id="exclude_comment_1" name="exclude_comment" value="1" <?php checked('1', $exclude_comment); ?> />&nbsp;<label for="exclude_comment_1"><?php _e('Comment Authors', 'wp-polls'); ?></label><br />
168
- <input type="checkbox" id="exclude_guest_1" name="exclude_guest" value="1" <?php checked('1', $exclude_guest); ?> />&nbsp;<label for="exclude_guest_1"><?php _e('Guests', 'wp-polls'); ?></label>
169
- </td>
170
- </tr>
171
- <tr>
172
- <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
173
- </tr>
174
- </table>
175
- </form>
176
- </td>
177
- <td width="50%">
178
- <?php if($poll_multiple > 0) { ?>
179
- <form method="post" action="<?php echo htmlspecialchars($base_page); ?>&amp;mode=logs&amp;id=<?php echo $poll_id; ?>">
180
- <p style="display: none;"><input type="hidden" name="filter" value="2" /></p>
181
- <table class="form-table">
182
- <tr>
183
- <th scope="row" valign="top"><?php _e('Display Users That Voted For', 'wp-polls'); ?></th>
184
- <td>
185
- <select name="num_choices_sign" size="1">
186
- <option value="more" <?php selected('more', $num_choices_sign); ?>><?php _e('More Than', 'wp-polls'); ?></option>
187
- <option value="more_exactly" <?php selected('more_exactly', $num_choices_sign); ?>><?php _e('More Than Or Exactly', 'wp-polls'); ?></option>
188
- <option value="exactly" <?php selected('exactly', $num_choices_sign); ?>><?php _e('Exactly', 'wp-polls'); ?></option>
189
- <option value="less_exactly" <?php selected('less_exactly', $num_choices_sign); ?>><?php _e('Less Than Or Exactly', 'wp-polls'); ?></option>
190
- <option value="less" <?php selected('less', $num_choices_sign); ?>><?php _e('Less Than', 'wp-polls'); ?></option>
191
- </select>
192
- &nbsp;&nbsp;
193
- <select name="num_choices" size="1">
194
- <?php
195
- for($i = 1; $i <= $poll_multiple; $i++) {
196
- if($i == 1) {
197
- echo '<option value="1">'.__('1 Answer', 'wp-polls').'</option>';
198
- } else {
199
- if($i == $num_choices) {
200
- echo '<option value="'.$i.'" selected="selected">'.sprintf(_n('%s Answer', '%s Answers', $i, 'wp-polls'), number_format_i18n($i)).'</option>';
201
- } else {
202
- echo '<option value="'.$i.'">'.sprintf(_n('%s Answer', '%s Answers', $i, 'wp-polls'), number_format_i18n($i)).'</option>';
203
- }
204
- }
205
- }
206
- ?>
207
- </select>
208
- </td>
209
- </tr>
210
- <tr>
211
- <th scope="row" valign="top"><?php _e('Voters To EXCLUDE', 'wp-polls'); ?></th>
212
- <td>
213
- <input type="checkbox" id="exclude_registered_2" name="exclude_registered_2" value="1" <?php checked('1', $exclude_registered_2); ?> />&nbsp;<label for="exclude_registered_2"><?php _e('Registered Users', 'wp-polls'); ?></label><br />
214
- <input type="checkbox" id="exclude_comment_2" name="exclude_comment_2" value="1" <?php checked('1', $exclude_comment_2); ?> />&nbsp;<label for="exclude_comment_2"><?php _e('Comment Authors', 'wp-polls'); ?></label><br />
215
- <?php _e('Guests will automatically be excluded', 'wp-polls'); ?>
216
- </td>
217
- </tr>
218
- <tr>
219
- <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
220
- </tr>
221
- </table>
222
- </form>
223
- <?php } else { ?>
224
- &nbsp;
225
- <?php } // End if($poll_multiple > -1) ?>
226
- </td>
227
- </tr>
228
- <tr>
229
- <td>
230
- <?php if($poll_voters) { ?>
231
- <form method="post" action="<?php echo htmlspecialchars($base_page); ?>&amp;mode=logs&amp;id=<?php echo $poll_id; ?>">
232
- <p style="display: none;"><input type="hidden" name="filter" value="3" /></p>
233
- <table class="form-table">
234
- <tr>
235
- <th scope="row" valign="top"><?php _e('Display What This User Has Voted', 'wp-polls'); ?></th>
236
- <td>
237
- <select name="what_user_voted" size="1">
238
- <?php
239
- if($poll_voters) {
240
- foreach($poll_voters as $pollip_user) {
241
- if($pollip_user == $what_user_voted) {
242
- echo '<option value="'.stripslashes(htmlspecialchars($pollip_user)).'" selected="selected">'.stripslashes(htmlspecialchars($pollip_user)).'</option>';
243
- } else {
244
- echo '<option value="'.stripslashes(htmlspecialchars($pollip_user)).'">'.stripslashes(htmlspecialchars($pollip_user)).'</option>';
245
- }
246
- }
247
- }
248
- ?>
249
- </select>
250
- </td>
251
- </tr>
252
- <tr>
253
- <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
254
- </tr>
255
- </table>
256
- </form>
257
- <?php } else { ?>
258
- &nbsp;
259
- <?php } // End if($poll_multiple > -1) ?>
260
- </td>
261
- <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>
262
- </tr>
263
- </table>
264
- </div>
265
- <p>&nbsp;</p>
266
- <?php } // End if($poll_totalrecorded > 0) ?>
267
- <div class="wrap">
268
- <h3><?php _e('Poll Logs', 'wp-polls'); ?></h3>
269
- <div id="poll_logs_display">
270
- <?php
271
- if($poll_ips) {
272
- if(empty($_POST['do'])) {
273
- echo '<p>'.__('This default filter is limited to display only <strong>100</strong> records.', 'wp-polls').'</p>';
274
- }
275
- echo '<table class="widefat">'."\n";
276
- $k = 1;
277
- $j = 0;
278
- $poll_last_aid = -1;
279
- if(intval($_POST['filter']) > 1) {
280
- echo "<tr class=\"thead\">\n";
281
- echo "<th>".__('Answer', 'wp-polls')."</th>\n";
282
- echo "<th>".__('IP', 'wp-polls')."</th>\n";
283
- echo "<th>".__('Host', 'wp-polls')."</th>\n";
284
- echo "<th>".__('Date', 'wp-polls')."</th>\n";
285
- echo "</tr>\n";
286
- foreach($poll_ips as $poll_ip) {
287
- $pollip_aid = intval($poll_ip->pollip_aid);
288
- $pollip_user = stripslashes($poll_ip->pollip_user);
289
- $pollip_ip = $poll_ip->pollip_ip;
290
- $pollip_host = $poll_ip->pollip_host;
291
- $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));
292
- if($i%2 == 0) {
293
- $style = '';
294
- } else {
295
- $style = 'class="alternate"';
296
- }
297
- if($pollip_user != $temp_pollip_user) {
298
- echo '<tr class="highlight">'."\n";
299
- echo "<td colspan=\"4\"><strong>".__('User', 'wp-polls')." ".number_format_i18n($k).": $pollip_user</strong></td>\n";
300
- echo '</tr>';
301
- $k++;
302
- }
303
- echo "<tr $style>\n";
304
- echo "<td>{$pollip_answers[$pollip_aid]}</td>\n";
305
- echo "<td><a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$pollip_ip\" title=\"$pollip_ip\">$pollip_ip</a></td>\n";
306
- echo "<td>$pollip_host</td>\n";
307
- echo "<td>$pollip_date</td>\n";
308
- echo "</tr>\n";
309
- $temp_pollip_user = $pollip_user;
310
- $i++;
311
- $j++;
312
- }
313
- } else {
314
- foreach($poll_ips as $poll_ip) {
315
- $pollip_aid = intval($poll_ip->pollip_aid);
316
- $pollip_user = stripslashes($poll_ip->pollip_user);
317
- $pollip_ip = $poll_ip->pollip_ip;
318
- $pollip_host = $poll_ip->pollip_host;
319
- $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));
320
- if($pollip_aid != $poll_last_aid) {
321
- if($pollip_aid == 0) {
322
- echo "<tr class=\"highlight\">\n<td colspan=\"4\"><strong>$pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
323
- } else {
324
- echo "<tr class=\"highlight\">\n<td colspan=\"4\"><strong>".__('Answer', 'wp-polls')." ".number_format_i18n($k).": $pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
325
- $k++;
326
- }
327
- echo "<tr class=\"thead\">\n";
328
- echo "<th>".__('No.', 'wp-polls')."</th>\n";
329
- echo "<th>".__('User', 'wp-polls')."</th>\n";
330
- echo "<th>".__('IP/Host', 'wp-polls')."</th>\n";
331
- echo "<th>".__('Date', 'wp-polls')."</th>\n";
332
- echo "</tr>\n";
333
- $i = 1;
334
- }
335
- if($i%2 == 0) {
336
- $style = '';
337
- } else {
338
- $style = 'class="alternate"';
339
- }
340
- echo "<tr $style>\n";
341
- echo "<td>".number_format_i18n($i)."</td>\n";
342
- echo "<td>$pollip_user</td>\n";
343
- 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";
344
- echo "<td>$pollip_date</td>\n";
345
- echo "</tr>\n";
346
- $poll_last_aid = $pollip_aid;
347
- $i++;
348
- $j++;
349
- }
350
- }
351
- echo "<tr class=\"highlight\">\n";
352
- echo "<td colspan=\"4\">".sprintf(__('Total number of records that matches this filter: <strong>%s</strong>', 'wp-polls'), number_format_i18n($j))."</td>";
353
- echo "</tr>\n";
354
- echo '</table>'."\n";
355
- }
356
- ?>
357
- </div>
358
- <?php if(!empty($_POST['do'])) { ?>
359
- <br class="clear" /><div id="poll_logs_display_none" style="text-align: center; display: <?php if(!$poll_ips) { echo 'block'; } else { echo 'none'; } ?>;" ><?php _e('No poll logs matches the filter.', 'wp-polls'); ?></div>
360
- <?php } else { ?>
361
- <br class="clear" /><div id="poll_logs_display_none" style="text-align: center; display: <?php if(!$poll_logs_count) { echo 'block'; } else { echo 'none'; } ?>;" ><?php _e('No poll logs available for this poll.', 'wp-polls'); ?></div>
362
- <?php } ?>
363
- </div>
364
- <p>&nbsp;</p>
365
-
366
- <!-- Delete Poll Logs -->
367
- <div class="wrap">
368
- <h3><?php _e('Delete Poll Logs', 'wp-polls'); ?></h3>
369
- <br class="clear" />
370
- <div align="center" id="poll_logs">
371
- <?php if($poll_logs_count) { ?>
372
- <strong><?php _e('Are You Sure You Want To Delete Logs For This Poll Only?', 'wp-polls'); ?></strong><br /><br />
373
- <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 />
374
- <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(js_escape(__('You are about to delete poll logs for this poll \'%s\' ONLY. This action is not reversible.', 'wp-polls')), htmlspecialchars($poll_question)); ?>');" />
375
- <?php
376
- } else {
377
- _e('No poll logs available for this poll.', 'wp-polls');
378
- }
379
- ?>
380
- </div>
381
- <p><?php _e('Note: If your logging method is by IP and Cookie or by Cookie, users may still be unable to vote if they have voted before as the cookie is still stored in their computer.', 'wp-polls'); ?></p>
 
 
 
 
 
 
 
 
 
 
 
382
  </div>
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress Plugin: WP-Polls |
6
+ | Copyright (c) 2012 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Polls Logs |
14
+ | - wp-content/plugins/wp-polls/polls-logs.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Polls
21
+ if(!current_user_can('manage_polls')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+
26
+ ### Variables
27
+ $max_records = 2000;
28
+ $pollip_answers = array();
29
+ $poll_question_data = $wpdb->get_row("SELECT pollq_multiple, pollq_question, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
30
+ $poll_question = stripslashes($poll_question_data->pollq_question);
31
+ $poll_totalvoters = intval($poll_question_data->pollq_totalvoters);
32
+ $poll_multiple = intval($poll_question_data->pollq_multiple);
33
+ $poll_registered = $wpdb->get_var("SELECT COUNT(pollip_userid) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid > 0");
34
+ $poll_comments = $wpdb->get_var("SELECT COUNT(pollip_user) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_user != '".__('Guest', 'wp-polls')."' AND pollip_userid = 0");
35
+ $poll_guest = $wpdb->get_var("SELECT COUNT(pollip_user) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_user = '".__('Guest', 'wp-polls')."'");
36
+ $poll_totalrecorded = ($poll_registered+$poll_comments+$poll_guest);
37
+ $poll_answers_data = $wpdb->get_results("SELECT polla_aid, polla_answers FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY ".get_option('poll_ans_sortby').' '.get_option('poll_ans_sortorder'));
38
+ $poll_voters = $wpdb->get_col("SELECT DISTINCT pollip_user FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_user != '".__('Guest', 'wp-polls')."' ORDER BY pollip_user ASC");
39
+ $poll_logs_count = $wpdb->get_var("SELECT COUNT(pollip_id) FROM $wpdb->pollsip WHERE pollip_qid = $poll_id");
40
+
41
+ $exclude_registered = 0;
42
+ $exclude_comment = 0;
43
+ $exclude_guest = 0;
44
+
45
+ ### Process Filters
46
+ if(!empty($_POST['do'])) {
47
+ check_admin_referer('wp-polls_logs');
48
+ $registered_sql = '';
49
+ $comment_sql = '';
50
+ $guest_sql = '';
51
+ $users_voted_for_sql = '';
52
+ $what_user_voted_sql = '';
53
+ $num_choices_sql = '';
54
+ $num_choices_sign_sql = '';
55
+ $order_by = '';
56
+ switch(intval($_POST['filter'])) {
57
+ case 1:
58
+ $users_voted_for = intval($_POST['users_voted_for']);
59
+ $exclude_registered = isset($_POST['exclude_registered']) && intval($_POST['exclude_registered']) == 1;
60
+ $exclude_comment = isset($_POST['exclude_comment']) && intval($_POST['exclude_comment']) == 1;
61
+ $exclude_guest = isset($_POST['exclude_guest']) && intval($_POST['exclude_guest']) == 1;
62
+ $users_voted_for_sql = "AND pollip_aid = $users_voted_for";
63
+ if($exclude_registered) {
64
+ $registered_sql = 'AND pollip_userid = 0';
65
+ }
66
+ if($exclude_comment) {
67
+ if(!$exclude_registered) {
68
+ $comment_sql = 'AND pollip_userid > 0';
69
+ } else {
70
+ $comment_sql = 'AND pollip_user = \''.__('Guest', 'wp-polls').'\'';
71
+ }
72
+ }
73
+ if($exclude_guest) {
74
+ $guest_sql = 'AND pollip_user != \''.__('Guest', 'wp-polls').'\'';
75
+ }
76
+ $order_by = 'pollip_timestamp DESC';
77
+ break;
78
+ case 2:
79
+ $exclude_registered_2 = intval($_POST['exclude_registered_2']);
80
+ $exclude_comment_2 = intval($_POST['exclude_comment_2']);
81
+ $num_choices = intval($_POST['num_choices']);
82
+ $num_choices_sign = addslashes($_POST['num_choices_sign']);
83
+ switch($num_choices_sign) {
84
+ case 'more':
85
+ $num_choices_sign_sql = '>';
86
+ break;
87
+ case 'more_exactly':
88
+ $num_choices_sign_sql = '>=';
89
+ break;
90
+ case 'exactly':
91
+ $num_choices_sign_sql = '=';
92
+ break;
93
+ case 'less_exactly':
94
+ $num_choices_sign_sql = '<=';
95
+ break;
96
+ case 'less':
97
+ $num_choices_sign_sql = '<';
98
+ break;
99
+ }
100
+ if($exclude_registered_2) {
101
+ $registered_sql = 'AND pollip_userid = 0';
102
+ }
103
+ if($exclude_comment_2) {
104
+ if(!$exclude_registered_2) {
105
+ $comment_sql = 'AND pollip_userid > 0';
106
+ } else {
107
+ $comment_sql = 'AND pollip_user = \''.__('Guest', 'wp-polls').'\'';
108
+ }
109
+ }
110
+ $guest_sql = 'AND pollip_user != \''.__('Guest', 'wp-polls').'\'';
111
+ $num_choices_query = $wpdb->get_col("SELECT pollip_user, COUNT(pollip_ip) AS num_choices FROM $wpdb->pollsip WHERE pollip_qid = $poll_id GROUP BY pollip_ip, pollip_user HAVING num_choices $num_choices_sign_sql $num_choices");
112
+ $num_choices_sql = 'AND pollip_user IN (\''.implode('\',\'',$num_choices_query).'\')';
113
+ $order_by = 'pollip_user, pollip_ip';
114
+ break;
115
+ case 3;
116
+ $what_user_voted = addslashes($_POST['what_user_voted']);
117
+ $what_user_voted_sql = "AND pollip_user = '$what_user_voted'";
118
+ $order_by = 'pollip_user, pollip_ip';
119
+ break;
120
+ }
121
+ $poll_ips = $wpdb->get_results("SELECT $wpdb->pollsip.* FROM $wpdb->pollsip WHERE pollip_qid = $poll_id $users_voted_for_sql $registered_sql $comment_sql $guest_sql $what_user_voted_sql $num_choices_sql ORDER BY $order_by");
122
+ } else {
123
+ $poll_ips = $wpdb->get_results("SELECT pollip_aid, pollip_ip, pollip_host, pollip_timestamp, pollip_user FROM $wpdb->pollsip WHERE pollip_qid = $poll_id ORDER BY pollip_aid ASC, pollip_user ASC LIMIT $max_records");
124
+ }
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>
132
+ <?php printf(_n('There are a total of <strong>%s</strong> recorded vote for this poll.', 'There are a total of <strong>%s</strong> recorded votes for this poll.', $poll_totalrecorded, 'wp-polls'), number_format_i18n($poll_totalrecorded)); ?><br />
133
+ <?php printf(_n('<strong>&raquo;</strong> <strong>%s</strong> vote is casted by registered users', '<strong>&raquo;</strong> <strong>%s</strong> votes are casted by registered users', $poll_registered, 'wp-polls'), number_format_i18n($poll_registered)); ?><br />
134
+ <?php printf(_n('<strong>&raquo;</strong> <strong>%s</strong> vote is casted by comment authors', '<strong>&raquo;</strong> <strong>%s</strong> votes are casted by comment authors', $poll_comments, 'wp-polls'), number_format_i18n($poll_comments)); ?><br />
135
+ <?php printf(_n('<strong>&raquo;</strong> <strong>%s</strong> vote is casted by guests', '<strong>&raquo;</strong> <strong>%s</strong> votes are casted by guests', $poll_guest, 'wp-polls'), number_format_i18n($poll_guest)); ?>
136
+ </p>
137
+ </div>
138
+ <?php if($poll_totalrecorded > 0) { ?>
139
+ <div class="wrap">
140
+ <h3><?php _e('Filter Poll\'s Logs', 'wp-polls') ?></h3>
141
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
142
+ <tr>
143
+ <td width="50%">
144
+ <form method="post" action="<?php echo admin_url('admin.php?page='.$base_name.'&amp;mode=logs&amp;id='.$poll_id); ?>">
145
+ <?php wp_nonce_field('wp-polls_logs'); ?>
146
+ <p style="display: none;"><input type="hidden" name="filter" value="1" /></p>
147
+ <table class="form-table">
148
+ <tr>
149
+ <th scope="row" valign="top"><?php _e('Display All Users That Voted For', 'wp-polls'); ?></th>
150
+ <td>
151
+ <select name="users_voted_for" size="1">
152
+ <?php
153
+ if($poll_answers_data) {
154
+ foreach($poll_answers_data as $data) {
155
+ $polla_id = intval($data->polla_aid);
156
+ $polla_answers = stripslashes(strip_tags(htmlspecialchars($data->polla_answers)));
157
+ if($polla_id == $users_voted_for) {
158
+ echo '<option value="'.$polla_id .'" selected="selected">'.$polla_answers.'</option>';
159
+ } else {
160
+ echo '<option value="'.$polla_id .'">'.$polla_answers.'</option>';
161
+ }
162
+ $pollip_answers[$polla_id] = $polla_answers;
163
+ }
164
+ }
165
+ ?>
166
+ </select>
167
+ </td>
168
+ </tr>
169
+ <tr>
170
+ <th scope="row" valign="top"><?php _e('Voters To EXCLUDE', 'wp-polls'); ?></th>
171
+ <td>
172
+ <input type="checkbox" id="exclude_registered_1" name="exclude_registered" value="1" <?php checked('1', $exclude_registered); ?> />&nbsp;<label for="exclude_registered_1"><?php _e('Registered Users', 'wp-polls'); ?></label><br />
173
+ <input type="checkbox" id="exclude_comment_1" name="exclude_comment" value="1" <?php checked('1', $exclude_comment); ?> />&nbsp;<label for="exclude_comment_1"><?php _e('Comment Authors', 'wp-polls'); ?></label><br />
174
+ <input type="checkbox" id="exclude_guest_1" name="exclude_guest" value="1" <?php checked('1', $exclude_guest); ?> />&nbsp;<label for="exclude_guest_1"><?php _e('Guests', 'wp-polls'); ?></label>
175
+ </td>
176
+ </tr>
177
+ <tr>
178
+ <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
179
+ </tr>
180
+ </table>
181
+ </form>
182
+ </td>
183
+ <td width="50%">
184
+ <?php if($poll_multiple > 0) { ?>
185
+ <form method="post" action="<?php echo admin_url('admin.php?page='.$base_name.'&amp;mode=logs&amp;id='.$poll_id); ?>">
186
+ <?php wp_nonce_field('wp-polls_logs'); ?>
187
+ <p style="display: none;"><input type="hidden" name="filter" value="2" /></p>
188
+ <table class="form-table">
189
+ <tr>
190
+ <th scope="row" valign="top"><?php _e('Display Users That Voted For', 'wp-polls'); ?></th>
191
+ <td>
192
+ <select name="num_choices_sign" size="1">
193
+ <option value="more" <?php selected('more', $num_choices_sign); ?>><?php _e('More Than', 'wp-polls'); ?></option>
194
+ <option value="more_exactly" <?php selected('more_exactly', $num_choices_sign); ?>><?php _e('More Than Or Exactly', 'wp-polls'); ?></option>
195
+ <option value="exactly" <?php selected('exactly', $num_choices_sign); ?>><?php _e('Exactly', 'wp-polls'); ?></option>
196
+ <option value="less_exactly" <?php selected('less_exactly', $num_choices_sign); ?>><?php _e('Less Than Or Exactly', 'wp-polls'); ?></option>
197
+ <option value="less" <?php selected('less', $num_choices_sign); ?>><?php _e('Less Than', 'wp-polls'); ?></option>
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>';
205
+ } else {
206
+ if($i == $num_choices) {
207
+ echo '<option value="'.$i.'" selected="selected">'.sprintf(_n('%s Answer', '%s Answers', $i, 'wp-polls'), number_format_i18n($i)).'</option>';
208
+ } else {
209
+ echo '<option value="'.$i.'">'.sprintf(_n('%s Answer', '%s Answers', $i, 'wp-polls'), number_format_i18n($i)).'</option>';
210
+ }
211
+ }
212
+ }
213
+ ?>
214
+ </select>
215
+ </td>
216
+ </tr>
217
+ <tr>
218
+ <th scope="row" valign="top"><?php _e('Voters To EXCLUDE', 'wp-polls'); ?></th>
219
+ <td>
220
+ <input type="checkbox" id="exclude_registered_2" name="exclude_registered_2" value="1" <?php checked('1', $exclude_registered_2); ?> />&nbsp;<label for="exclude_registered_2"><?php _e('Registered Users', 'wp-polls'); ?></label><br />
221
+ <input type="checkbox" id="exclude_comment_2" name="exclude_comment_2" value="1" <?php checked('1', $exclude_comment_2); ?> />&nbsp;<label for="exclude_comment_2"><?php _e('Comment Authors', 'wp-polls'); ?></label><br />
222
+ <?php _e('Guests will automatically be excluded', 'wp-polls'); ?>
223
+ </td>
224
+ </tr>
225
+ <tr>
226
+ <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
227
+ </tr>
228
+ </table>
229
+ </form>
230
+ <?php } else { ?>
231
+ &nbsp;
232
+ <?php } // End if($poll_multiple > -1) ?>
233
+ </td>
234
+ </tr>
235
+ <tr>
236
+ <td>
237
+ <?php if($poll_voters) { ?>
238
+ <form method="post" action="<?php echo admin_url('admin.php?page='.$base_name.'&amp;mode=logs&amp;id='.$poll_id); ?>">
239
+ <?php wp_nonce_field('wp-polls_logs'); ?>
240
+ <p style="display: none;"><input type="hidden" name="filter" value="3" /></p>
241
+ <table class="form-table">
242
+ <tr>
243
+ <th scope="row" valign="top"><?php _e('Display What This User Has Voted', 'wp-polls'); ?></th>
244
+ <td>
245
+ <select name="what_user_voted" size="1">
246
+ <?php
247
+ if($poll_voters) {
248
+ foreach($poll_voters as $pollip_user) {
249
+ if($pollip_user == $what_user_voted) {
250
+ echo '<option value="'.stripslashes(htmlspecialchars($pollip_user)).'" selected="selected">'.stripslashes(htmlspecialchars($pollip_user)).'</option>';
251
+ } else {
252
+ echo '<option value="'.stripslashes(htmlspecialchars($pollip_user)).'">'.stripslashes(htmlspecialchars($pollip_user)).'</option>';
253
+ }
254
+ }
255
+ }
256
+ ?>
257
+ </select>
258
+ </td>
259
+ </tr>
260
+ <tr>
261
+ <td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
262
+ </tr>
263
+ </table>
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>
271
+ </table>
272
+ </div>
273
+ <p>&nbsp;</p>
274
+ <?php } // End if($poll_totalrecorded > 0) ?>
275
+ <div class="wrap">
276
+ <h3><?php _e('Poll Logs', 'wp-polls'); ?></h3>
277
+ <div id="poll_logs_display">
278
+ <?php
279
+ if($poll_ips) {
280
+ if(empty($_POST['do'])) {
281
+ echo '<p>'.sprintf(__('This default filter is limited to display only <strong>%s</strong> records.', 'wp-polls'), number_format_i18n($max_records)).'</p>';
282
+ }
283
+ echo '<table class="widefat">'."\n";
284
+ $k = 1;
285
+ $j = 0;
286
+ $poll_last_aid = -1;
287
+ $temp_pollip_user = null;
288
+ if(isset($_POST['filter']) && intval($_POST['filter']) > 1) {
289
+ echo "<tr class=\"thead\">\n";
290
+ echo "<th>".__('Answer', 'wp-polls')."</th>\n";
291
+ echo "<th>".__('IP', 'wp-polls')."</th>\n";
292
+ echo "<th>".__('Host', 'wp-polls')."</th>\n";
293
+ echo "<th>".__('Date', 'wp-polls')."</th>\n";
294
+ echo "</tr>\n";
295
+ foreach($poll_ips as $poll_ip) {
296
+ $pollip_aid = intval($poll_ip->pollip_aid);
297
+ $pollip_user = stripslashes($poll_ip->pollip_user);
298
+ $pollip_ip = $poll_ip->pollip_ip;
299
+ $pollip_host = $poll_ip->pollip_host;
300
+ $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));
301
+
302
+ $i = 0;
303
+ if($i % 2 == 0) {
304
+ $style = '';
305
+ } else {
306
+ $style = 'class="alternate"';
307
+ }
308
+ if($pollip_user != $temp_pollip_user) {
309
+ echo '<tr class="highlight">'."\n";
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
+ }
324
+ } else {
325
+ foreach($poll_ips as $poll_ip) {
326
+ $pollip_aid = intval($poll_ip->pollip_aid);
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";
334
+ } else {
335
+ echo "<tr class=\"highlight\">\n<td colspan=\"4\"><strong>".__('Answer', 'wp-polls')." ".number_format_i18n($k).": $pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
336
+ $k++;
337
+ }
338
+ echo "<tr class=\"thead\">\n";
339
+ echo "<th>".__('No.', 'wp-polls')."</th>\n";
340
+ echo "<th>".__('User', 'wp-polls')."</th>\n";
341
+ echo "<th>".__('IP/Host', 'wp-polls')."</th>\n";
342
+ echo "<th>".__('Date', 'wp-polls')."</th>\n";
343
+ echo "</tr>\n";
344
+ $i = 1;
345
+ }
346
+ if($i%2 == 0) {
347
+ $style = '';
348
+ } else {
349
+ $style = 'class="alternate"';
350
+ }
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;
358
+ $i++;
359
+ $j++;
360
+ }
361
+ }
362
+ echo "<tr class=\"highlight\">\n";
363
+ echo "<td colspan=\"4\">".sprintf(__('Total number of records that matches this filter: <strong>%s</strong>', 'wp-polls'), number_format_i18n($j))."</td>";
364
+ echo "</tr>\n";
365
+ echo '</table>'."\n";
366
+ }
367
+ ?>
368
+ </div>
369
+ <?php if(!empty($_POST['do'])) { ?>
370
+ <br class="clear" /><div id="poll_logs_display_none" style="text-align: center; display: <?php if(!$poll_ips) { echo 'block'; } else { echo 'none'; } ?>;" ><?php _e('No poll logs matches the filter.', 'wp-polls'); ?></div>
371
+ <?php } else { ?>
372
+ <br class="clear" /><div id="poll_logs_display_none" style="text-align: center; display: <?php if(!$poll_logs_count) { echo 'block'; } else { echo 'none'; } ?>;" ><?php _e('No poll logs available for this poll.', 'wp-polls'); ?></div>
373
+ <?php } ?>
374
+ </div>
375
+ <p>&nbsp;</p>
376
+
377
+ <!-- Delete Poll Logs -->
378
+ <div class="wrap">
379
+ <h3><?php _e('Delete Poll Logs', 'wp-polls'); ?></h3>
380
+ <br class="clear" />
381
+ <div align="center" id="poll_logs">
382
+ <?php if($poll_logs_count) { ?>
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
+ }
390
+ ?>
391
+ </div>
392
+ <p><?php _e('Note: If your logging method is by IP and Cookie or by Cookie, users may still be unable to vote if they have voted before as the cookie is still stored in their computer.', 'wp-polls'); ?></p>
393
  </div>
polls-manager.php CHANGED
@@ -1,482 +1,474 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Manage Your Polls |
14
- | - wp-content/plugins/wp-polls/polls-manager.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Polls
21
- if(!current_user_can('manage_polls')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables Variables Variables
27
- $base_name = plugin_basename('wp-polls/polls-manager.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
- $mode = trim($_GET['mode']);
30
- $poll_id = intval($_GET['id']);
31
- $poll_aid = intval($_GET['aid']);
32
-
33
-
34
- ### Form Processing
35
- if(!empty($_POST['do'])) {
36
- // Decide What To Do
37
- switch($_POST['do']) {
38
- // Edit Poll
39
- case __('Edit Poll', 'wp-polls'):
40
- // Poll ID
41
- $pollq_id = intval($_POST['pollq_id']);
42
- // Poll Total Votes
43
- $pollq_totalvotes = intval($_POST['pollq_totalvotes']);
44
- // Poll Total Voters
45
- $pollq_totalvoters = intval($_POST['pollq_totalvoters']);
46
- // Poll Question
47
- $pollq_question = addslashes(trim($_POST['pollq_question']));
48
- // Poll Active
49
- $pollq_active = intval($_POST['pollq_active']);
50
- // Poll Start Date
51
- $edit_polltimestamp = intval($_POST['edit_polltimestamp']);
52
- $timestamp_sql = '';
53
- if($edit_polltimestamp == 1) {
54
- $pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
55
- $pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
56
- $pollq_timestamp_year = intval($_POST['pollq_timestamp_year']);
57
- $pollq_timestamp_hour = intval($_POST['pollq_timestamp_hour']);
58
- $pollq_timestamp_minute = intval($_POST['pollq_timestamp_minute']);
59
- $pollq_timestamp_second = intval($_POST['pollq_timestamp_second']);
60
- $pollq_timestamp = gmmktime($pollq_timestamp_hour, $pollq_timestamp_minute, $pollq_timestamp_second, $pollq_timestamp_month, $pollq_timestamp_day, $pollq_timestamp_year);
61
- $timestamp_sql = ", pollq_timestamp = '$pollq_timestamp'";
62
- if($pollq_timestamp > current_time('timestamp')) {
63
- $pollq_active = -1;
64
- }
65
- }
66
- // Poll End Date
67
- $pollq_expiry_no = intval($_POST['pollq_expiry_no']);
68
- if($pollq_expiry_no == 1) {
69
- $pollq_expiry = '';
70
- } else {
71
- $pollq_expiry_day = intval($_POST['pollq_expiry_day']);
72
- $pollq_expiry_month = intval($_POST['pollq_expiry_month']);
73
- $pollq_expiry_year = intval($_POST['pollq_expiry_year']);
74
- $pollq_expiry_hour = intval($_POST['pollq_expiry_hour']);
75
- $pollq_expiry_minute = intval($_POST['pollq_expiry_minute']);
76
- $pollq_expiry_second = intval($_POST['pollq_expiry_second']);
77
- $pollq_expiry = gmmktime($pollq_expiry_hour, $pollq_expiry_minute, $pollq_expiry_second, $pollq_expiry_month, $pollq_expiry_day, $pollq_expiry_year);
78
- if($pollq_expiry <= current_time('timestamp')) {
79
- $pollq_active = 0;
80
- }
81
- if($edit_polltimestamp == 1) {
82
- if($pollq_expiry < $pollq_timestamp) {
83
- $pollq_active = 0;
84
- }
85
- }
86
- }
87
- // Mutilple Poll
88
- $pollq_multiple_yes = intval($_POST['pollq_multiple_yes']);
89
- $pollq_multiple = 0;
90
- if($pollq_multiple_yes == 1) {
91
- $pollq_multiple = intval($_POST['pollq_multiple']);
92
- } else {
93
- $pollq_multiple = 0;
94
- }
95
- // Update Poll's Question
96
- $edit_poll_question = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_question = '$pollq_question', pollq_totalvotes = $pollq_totalvotes, pollq_expiry = '$pollq_expiry', pollq_active = $pollq_active, pollq_multiple = $pollq_multiple, pollq_totalvoters = $pollq_totalvoters $timestamp_sql WHERE pollq_id = $pollq_id");
97
- if(!$edit_poll_question) {
98
- $text = '<p style="color: blue">'.sprintf(__('No Changes Had Been Made To Poll\'s Question \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
99
- }
100
- // Update Polls' Answers
101
- $polla_aids = array();
102
- $get_polla_aids = $wpdb->get_results("SELECT polla_aid FROM $wpdb->pollsa WHERE polla_qid = $pollq_id ORDER BY polla_aid ASC");
103
- if($get_polla_aids) {
104
- foreach($get_polla_aids as $get_polla_aid) {
105
- $polla_aids[] = intval($get_polla_aid->polla_aid);
106
- }
107
- foreach($polla_aids as $polla_aid) {
108
- $polla_answers = addslashes(trim($_POST['polla_aid-'.$polla_aid]));
109
- $polla_votes = intval($_POST['polla_votes-'.$polla_aid]);
110
- $edit_poll_answer = $wpdb->query("UPDATE $wpdb->pollsa SET polla_answers = '$polla_answers', polla_votes = $polla_votes WHERE polla_qid = $pollq_id AND polla_aid = $polla_aid");
111
- if(!$edit_poll_answer) {
112
- $text .= '<p style="color: blue">'.sprintf(__('No Changes Had Been Made To Poll\'s Answer \'%s\'.', 'wp-polls'), stripslashes($polla_answers)).'</p>';
113
- } else {
114
- $text .= '<p style="color: green">'.sprintf(__('Poll\'s Answer \'%s\' Edited Successfully.', 'wp-polls'), stripslashes($polla_answers)).'</p>';
115
- }
116
- }
117
- } else {
118
- $text .= '<p style="color: red">'.sprintf(__('Invalid Poll \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
119
- }
120
- // Add Poll Answers (If Needed)
121
- $polla_answers_new = $_POST['polla_answers_new'];
122
- if(!empty($polla_answers_new)) {
123
- $i = 0;
124
- $polla_answers_new_votes = $_POST['polla_answers_new_votes'];
125
- foreach($polla_answers_new as $polla_answer_new) {
126
- $polla_answer_new = addslashes(trim($polla_answer_new));
127
- if(!empty($polla_answer_new)) {
128
- $polla_answer_new_vote = intval($polla_answers_new_votes[$i]);
129
- $add_poll_answers = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $pollq_id, '$polla_answer_new', $polla_answer_new_vote)");
130
- if(!$add_poll_answers) {
131
- $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll\'s Answer \'%s\'.', 'wp-polls'), stripslashes($polla_answer_new)).'</p>';
132
- } else {
133
- $text .= '<p style="color: green;">'.sprintf(__('Poll\'s Answer \'%s\' Added Successfully.', 'wp-polls'), stripslashes($polla_answer_new)).'</p>';
134
- }
135
- }
136
- $i++;
137
- }
138
- }
139
- if(empty($text)) {
140
- $text = '<p style="color: green">'.sprintf(__('Poll \'%s\' Edited Successfully.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
141
- }
142
- // Update Lastest Poll ID To Poll Options
143
- $latest_pollid = polls_latest_id();
144
- $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
145
- cron_polls_place();
146
- break;
147
- }
148
- }
149
-
150
-
151
- ### Determines Which Mode It Is
152
- switch($mode) {
153
- // Poll Logging
154
- case 'logs':
155
- require('polls-logs.php');
156
- break;
157
- ?>
158
- <?php
159
- break;
160
- // Edit A Poll
161
- case 'edit':
162
- $last_col_align = ('rtl' == $text_direction) ? 'left' : 'right';
163
- $poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
164
- $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY polla_aid ASC");
165
- $poll_noquestion = $wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa WHERE polla_qid = $poll_id");
166
- $poll_question_text = stripslashes($poll_question->pollq_question);
167
- $poll_totalvotes = intval($poll_question->pollq_totalvote);
168
- $poll_timestamp = $poll_question->pollq_timestamp;
169
- $poll_active = intval($poll_question->pollq_active);
170
- $poll_expiry = trim($poll_question->pollq_expiry);
171
- $poll_multiple = intval($poll_question->pollq_multiple);
172
- $poll_totalvoters = intval($poll_question->pollq_totalvoters);
173
- ?>
174
- <?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>'; } ?>
175
-
176
- <!-- Edit Poll -->
177
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>&amp;mode=edit&amp;id=<?php echo $poll_id; ?>">
178
- <input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
179
- <input type="hidden" name="pollq_active" value="<?php echo $poll_active; ?>" />
180
- <div class="wrap">
181
- <div id="icon-wp-polls" class="icon32"><br /></div>
182
- <h2><?php _e('Edit Poll', 'wp-polls'); ?></h2>
183
- <!-- Poll Question -->
184
- <h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
185
- <table class="form-table">
186
- <tr>
187
- <th width="20%" scope="row" valign="top"><?php _e('Question', 'wp-polls') ?></th>
188
- <td width="80%"><input type="text" size="70" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" /></td>
189
- </tr>
190
- </table>
191
- <!-- Poll Answers -->
192
- <h3><?php _e('Poll Answers', 'wp-polls'); ?></h3>
193
- <table class="form-table">
194
- <thead>
195
- <tr>
196
- <th width="20%" scope="row" valign="top"><?php _e('Answer No.', 'wp-polls') ?></th>
197
- <th width="60%" scope="row" valign="top"><?php _e('Answer Text', 'wp-polls') ?></th>
198
- <th width="20%" scope="row" valign="top" style="text-align: <?php echo $last_col_align; ?>;"><?php _e('No. Of Votes', 'wp-polls') ?></th>
199
- </tr>
200
- </thead>
201
- <tbody id="poll_answers">
202
- <?php
203
- $i=1;
204
- $poll_actual_totalvotes = 0;
205
- if($poll_answers) {
206
- $pollip_answers = array();
207
- $pollip_answers[0] = __('Null Votes', 'wp-polls');
208
- foreach($poll_answers as $poll_answer) {
209
- $polla_aid = intval($poll_answer->polla_aid);
210
- $polla_answers = stripslashes($poll_answer->polla_answers);
211
- $polla_votes = intval($poll_answer->polla_votes);
212
- $pollip_answers[$polla_aid] = $polla_answers;
213
- echo "<tr id=\"poll-answer-$polla_aid\">\n";
214
- echo '<th width="20%" scope="row" valign="top">'.sprintf(__('Answer %s', 'wp-polls'), number_format_i18n($i)).'</th>'."\n";
215
- echo "<td width=\"60%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_aid-$polla_aid\" value=\"".htmlspecialchars($polla_answers)."\" />&nbsp;&nbsp;&nbsp;";
216
- echo "<input type=\"button\" value=\"".__('Delete', 'wp-polls')."\" onclick=\"delete_poll_ans($poll_id, $polla_aid, $polla_votes, '".sprintf(js_escape(__('You are about to delete this poll\'s answer \'%s\'.', 'wp-polls')), js_escape(htmlspecialchars($polla_answers)))."');\" class=\"button\" /></td>\n";
217
- echo '<td width="20%" align="'.$last_col_align.'">'.number_format_i18n($polla_votes)." <input type=\"text\" size=\"4\" id=\"polla_votes-$polla_aid\" name=\"polla_votes-$polla_aid\" value=\"$polla_votes\" onblur=\"check_totalvotes();\" /></td>\n</tr>\n";
218
- $poll_actual_totalvotes += $polla_votes;
219
- $i++;
220
- }
221
- }
222
- ?>
223
- </tbody>
224
- <tbody>
225
- <tr>
226
- <td width="20%">&nbsp;</td>
227
- <td width="60%"><input type="button" value="<?php _e('Add Answer', 'wp-polls') ?>" onclick="add_poll_answer_edit();" class="button" /></td>
228
- <td width="20%" align="<?php echo $last_col_align; ?>"><strong><?php _e('Total Votes:', 'wp-polls'); ?></strong> <strong id="poll_total_votes"><?php echo number_format_i18n($poll_actual_totalvotes); ?></strong> <input type="text" size="4" readonly="readonly" id="pollq_totalvotes" name="pollq_totalvotes" value="<?php echo $poll_actual_totalvotes; ?>" onblur="check_totalvotes();" /></td>
229
- </tr>
230
- <tr>
231
- <td width="20%">&nbsp;</td>
232
- <td width="60%">&nbsp;</td>
233
- <td width="20%" align="<?php echo $last_col_align; ?>"><strong><?php _e('Total Voters:', 'wp-polls'); ?> <?php echo number_format_i18n($poll_totalvoters); ?></strong> <input type="text" size="4" name="pollq_totalvoters" value="<?php echo $poll_totalvoters; ?>" /></td>
234
- </tr>
235
- </tbody>
236
- </table>
237
- <!-- Poll Multiple Answers -->
238
- <h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3>
239
- <table class="form-table">
240
- <tr>
241
- <th width="40%" scope="row" valign="top"><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></th>
242
- <td width="60%">
243
- <select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();">
244
- <option value="0"<?php selected('0', $poll_multiple); ?>><?php _e('No', 'wp-polls'); ?></option>
245
- <option value="1"<?php if($poll_multiple > 0) { echo ' selected="selected"'; } ?>><?php _e('Yes', 'wp-polls'); ?></option>
246
- </select>
247
- </td>
248
- </tr>
249
- <tr>
250
- <th width="40%" scope="row" valign="top"><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></th>
251
- <td width="60%">
252
- <select name="pollq_multiple" id="pollq_multiple" size="1" <?php if($poll_multiple == 0) { echo 'disabled="disabled"'; } ?>>
253
- <?php
254
- for($i = 1; $i <= $poll_noquestion; $i++) {
255
- if($poll_multiple > 0 && $poll_multiple == $i) {
256
- echo "<option value=\"$i\" selected=\"selected\">".number_format_i18n($i)."</option>\n";
257
- } else {
258
- echo "<option value=\"$i\">".number_format_i18n($i)."</option>\n";
259
- }
260
- }
261
- ?>
262
- </select>
263
- </td>
264
- </tr>
265
- </table>
266
- <!-- Poll Start/End Date -->
267
- <h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3>
268
- <table class="form-table">
269
- <tr>
270
- <th width="20%" scope="row" valign="top"><?php _e('Start Date/Time', 'wp-polls'); ?></th>
271
- <td width="80%">
272
- <?php echo mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?><br />
273
- <input type="checkbox" name="edit_polltimestamp" id="edit_polltimestamp" value="1" onclick="check_polltimestamp()" />&nbsp;<label for="edit_polltimestamp"><?php _e('Edit Start Date/Time', 'wp-polls'); ?></label><br />
274
- <?php poll_timestamp($poll_timestamp, 'pollq_timestamp', 'none'); ?>
275
- </td>
276
- </tr>
277
- <tr>
278
- <th width="20%" scope="row" valign="top"><?php _e('End Date/Time', 'wp-polls'); ?></th>
279
- <td width="80%">
280
- <?php
281
- if(empty($poll_expiry)) {
282
- _e('This Poll Will Not Expire', 'wp-polls');
283
- } else {
284
- echo mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
285
- }
286
- ?>
287
- <br />
288
- <input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" onclick="check_pollexpiry();" <?php if(empty($poll_expiry)) { echo 'checked="checked"'; } ?> />
289
- <label for="pollq_expiry_no"><?php _e('Do NOT Expire This Poll', 'wp-polls'); ?></label><br />
290
-
291
- <?php
292
- if(empty($poll_expiry)) {
293
- poll_timestamp(current_time('timestamp'), 'pollq_expiry', 'none');
294
- } else {
295
- poll_timestamp($poll_expiry, 'pollq_expiry');
296
- }
297
- ?>
298
-
299
- </td>
300
- </tr>
301
- </table>
302
- <p style="text-align: center;">
303
- <input type="submit" name="do" value="<?php _e('Edit Poll', 'wp-polls'); ?>" class="button" />&nbsp;&nbsp;
304
- <?php
305
- if($poll_active == 1) {
306
- $poll_open_display = 'none';
307
- $poll_close_display = 'inline';
308
- } else {
309
- $poll_open_display = 'inline';
310
- $poll_close_display = 'none';
311
- }
312
- ?>
313
- <input type="button" class="button" name="do" id="close_poll" value="<?php _e('Close Poll', 'wp-polls'); ?>" onclick="closing_poll(<?php echo $poll_id; ?>, '<?php printf(js_escape(__('You are about to CLOSE this poll \'%s\'.', 'wp-polls')), htmlspecialchars(js_escape($poll_question_text))); ?>');" style="display: <?php echo $poll_close_display; ?>;" />
314
- <input type="button" class="button" name="do" id="open_poll" value="<?php _e('Open Poll', 'wp-polls'); ?>" onclick="opening_poll(<?php echo $poll_id; ?>, '<?php printf(js_escape(__('You are about to OPEN this poll \'%s\'.', 'wp-polls')), htmlspecialchars(js_escape($poll_question_text))); ?>');" style="display: <?php echo $poll_open_display; ?>;" />
315
- &nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" />
316
- </p>
317
- </div>
318
- </form>
319
- <?php
320
- break;
321
- // Main Page
322
- default:
323
- $polls = $wpdb->get_results("SELECT * FROM $wpdb->pollsq ORDER BY pollq_timestamp DESC");
324
- $total_ans = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->pollsa");
325
- $total_votes = 0;
326
- $total_voters = 0;
327
- ?>
328
- <!-- Last Action -->
329
- <div id="message" class="updated" style="display: none;"></div>
330
-
331
- <!-- Manage Polls -->
332
- <div class="wrap">
333
- <div id="icon-wp-polls" class="icon32"><br /></div>
334
- <h2><?php _e('Manage Polls', 'wp-polls'); ?></h2>
335
- <h3><?php _e('Polls', 'wp-polls'); ?></h3>
336
- <br style="clear" />
337
- <table class="widefat">
338
- <thead>
339
- <tr>
340
- <th><?php _e('ID', 'wp-polls'); ?></th>
341
- <th><?php _e('Question', 'wp-polls'); ?></th>
342
- <th><?php _e('Total Voters', 'wp-polls'); ?></th>
343
- <th><?php _e('Start Date/Time', 'wp-polls'); ?></th>
344
- <th><?php _e('End Date/Time', 'wp-polls'); ?></th>
345
- <th><?php _e('Status', 'wp-polls'); ?></th>
346
- <th colspan="3"><?php _e('Action', 'wp-polls'); ?></th>
347
- </tr>
348
- </thead>
349
- <tbody id="manage_polls">
350
- <?php
351
- if($polls) {
352
- if(function_exists('dynamic_sidebar')) {
353
- $options = get_option('widget_polls');
354
- $multiple_polls = explode(',', $options['multiple_polls']);
355
- } else {
356
- $multiple_polls = array();
357
- }
358
- $i = 0;
359
- $current_poll = intval(get_option('poll_currentpoll'));
360
- $latest_poll = intval(get_option('poll_latestpoll'));
361
- foreach($polls as $poll) {
362
- $poll_id = intval($poll->pollq_id);
363
- $poll_question = stripslashes($poll->pollq_question);
364
- $poll_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp));
365
- $poll_totalvotes = intval($poll->pollq_totalvotes);
366
- $poll_totalvoters = intval($poll->pollq_totalvoters);
367
- $poll_active = intval($poll->pollq_active);
368
- $poll_expiry = trim($poll->pollq_expiry);
369
- if(empty($poll_expiry)) {
370
- $poll_expiry_text = __('No Expiry', 'wp-polls');
371
- } else {
372
- $poll_expiry_text = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
373
- }
374
- if($i%2 == 0) {
375
- $style = 'class="alternate"';
376
- } else {
377
- $style = '';
378
- }
379
- if($current_poll > 0) {
380
- if($current_poll == $poll_id) {
381
- $style = 'class="highlight"';
382
- }
383
- } elseif($current_poll == 0) {
384
- if($poll_id == $latest_poll) {
385
- $style = 'class="highlight"';
386
- }
387
- } else if(in_array($poll_id, $multiple_polls)) {
388
- $style = 'class="highlight"';
389
- }
390
- echo "<tr id=\"poll-$poll_id\" $style>\n";
391
- echo '<td><strong>'.number_format_i18n($poll_id).'</strong></td>'."\n";
392
- echo '<td>';
393
- if($current_poll > 0) {
394
- if($current_poll == $poll_id) {
395
- echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
396
- }
397
- } elseif($current_poll == 0) {
398
- if($poll_id == $latest_poll) {
399
- echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
400
- }
401
- } else if(in_array($poll_id, $multiple_polls)) {
402
- echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
403
- }
404
- echo "$poll_question</td>\n";
405
- echo '<td>'.number_format_i18n($poll_totalvoters)."</td>\n";
406
- echo "<td>$poll_date</td>\n";
407
- echo "<td>$poll_expiry_text</td>\n";
408
- echo '<td>';
409
- if($poll_active == 1) {
410
- _e('Open', 'wp-polls');
411
- } elseif($poll_active == -1) {
412
- _e('Future', 'wp-polls');
413
- } else {
414
- _e('Closed', 'wp-polls');
415
- }
416
- echo "</td>\n";
417
- echo "<td><a href=\"$base_page&amp;mode=logs&amp;id=$poll_id\" class=\"edit\">".__('Logs', 'wp-polls')."</a></td>\n";
418
- echo "<td><a href=\"$base_page&amp;mode=edit&amp;id=$poll_id\" class=\"edit\">".__('Edit', 'wp-polls')."</a></td>\n";
419
- echo "<td><a href=\"#DeletePoll\" onclick=\"delete_poll($poll_id, '".sprintf(js_escape(__('You are about to delete this poll, \'%s\'.', 'wp-polls')), js_escape($poll_question))."')\" class=\"delete\">".__('Delete', 'wp-polls')."</a></td>\n";
420
- echo '</tr>';
421
- $i++;
422
- $total_votes+= $poll_totalvotes;
423
- $total_voters+= $poll_totalvoters;
424
-
425
- }
426
- } else {
427
- echo '<tr><td colspan="9" align="center"><strong>'.__('No Polls Found', 'wp-polls').'</strong></td></tr>';
428
- }
429
- ?>
430
- </tbody>
431
- </table>
432
- </div>
433
- <p>&nbsp;</p>
434
-
435
- <!-- Polls Stats -->
436
- <div class="wrap">
437
- <h3><?php _e('Polls Stats:', 'wp-polls'); ?></h3>
438
- <br style="clear" />
439
- <table class="widefat">
440
- <tr>
441
- <th><?php _e('Total Polls:', 'wp-polls'); ?></th>
442
- <td><?php echo number_format_i18n($i); ?></td>
443
- </tr>
444
- <tr class="alternate">
445
- <th><?php _e('Total Polls\' Answers:', 'wp-polls'); ?></th>
446
- <td><?php echo number_format_i18n($total_ans); ?></td>
447
- </tr>
448
- <tr>
449
- <th><?php _e('Total Votes Casted:', 'wp-polls'); ?></th>
450
- <td><?php echo number_format_i18n($total_votes); ?></td>
451
- </tr>
452
- <tr class="alternate">
453
- <th><?php _e('Total Voters:', 'wp-polls'); ?></th>
454
- <td><?php echo number_format_i18n($total_voters); ?></td>
455
- </tr>
456
- </table>
457
- </div>
458
- <p>&nbsp;</p>
459
-
460
- <!-- Delete Polls Logs -->
461
- <div class="wrap">
462
- <h3><?php _e('Polls Logs', 'wp-polls'); ?></h3>
463
- <br style="clear" />
464
- <div align="center" id="poll_logs">
465
- <?php
466
- $poll_ips = intval($wpdb->get_var("SELECT COUNT(pollip_id) FROM $wpdb->pollsip"));
467
- if($poll_ips > 0) {
468
- ?>
469
- <strong><?php _e('Are You Sure You Want To Delete All Polls Logs?', 'wp-polls'); ?></strong><br /><br />
470
- <input type="checkbox" name="delete_logs_yes" id="delete_logs_yes" value="yes" />&nbsp;<label for="delete_logs_yes"><?php _e('Yes', 'wp-polls'); ?></label><br /><br />
471
- <input type="button" value="<?php _e('Delete All Logs', 'wp-polls'); ?>" class="button" onclick="delete_poll_logs('<?php echo js_escape(__('You are about to delete all poll logs. This action is not reversible.', 'wp-polls')); ?>');" />
472
- <?php
473
- } else {
474
- _e('No poll logs available.', 'wp-polls');
475
- }
476
- ?>
477
- </div>
478
- <p><?php _e('Note: If your logging method is by IP and Cookie or by Cookie, users may still be unable to vote if they have voted before as the cookie is still stored in their computer.', 'wp-polls'); ?></p>
479
- </div>
480
- <?php
481
- } // End switch($mode)
482
- ?>
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress Plugin: WP-Polls |
6
+ | Copyright (c) 2012 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Manage Your Polls |
14
+ | - wp-content/plugins/wp-polls/polls-manager.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+ ### Check Whether User Can Manage Polls
20
+ if(!current_user_can('manage_polls')) {
21
+ die('Access Denied');
22
+ }
23
+
24
+ ### Variables Variables Variables
25
+ $base_name = plugin_basename('wp-polls/polls-manager.php');
26
+ $base_page = 'admin.php?page='.$base_name;
27
+ $mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
28
+ $poll_id = (isset($_GET['id']) ? intval($_GET['id']) : 0);
29
+ $poll_aid = (isset($_GET['aid']) ? intval($_GET['aid']) : 0);
30
+
31
+ ### Form Processing
32
+ if(!empty($_POST['do'])) {
33
+ // Decide What To Do
34
+ switch($_POST['do']) {
35
+ // Edit Poll
36
+ case __('Edit Poll', 'wp-polls'):
37
+ check_admin_referer('wp-polls_edit-poll');
38
+ // Poll ID
39
+ $pollq_id = intval($_POST['pollq_id']);
40
+ // Poll Total Votes
41
+ $pollq_totalvotes = intval($_POST['pollq_totalvotes']);
42
+ // Poll Total Voters
43
+ $pollq_totalvoters = intval($_POST['pollq_totalvoters']);
44
+ // Poll Question
45
+ $pollq_question = addslashes(trim($_POST['pollq_question']));
46
+ // Poll Active
47
+ $pollq_active = intval($_POST['pollq_active']);
48
+ // Poll Start Date
49
+ $edit_polltimestamp = isset($_POST['edit_polltimestamp']) && intval($_POST['edit_polltimestamp']) == 1;
50
+ $timestamp_sql = '';
51
+ if($edit_polltimestamp == 1) {
52
+ $pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
53
+ $pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
54
+ $pollq_timestamp_year = intval($_POST['pollq_timestamp_year']);
55
+ $pollq_timestamp_hour = intval($_POST['pollq_timestamp_hour']);
56
+ $pollq_timestamp_minute = intval($_POST['pollq_timestamp_minute']);
57
+ $pollq_timestamp_second = intval($_POST['pollq_timestamp_second']);
58
+ $pollq_timestamp = gmmktime($pollq_timestamp_hour, $pollq_timestamp_minute, $pollq_timestamp_second, $pollq_timestamp_month, $pollq_timestamp_day, $pollq_timestamp_year);
59
+ $timestamp_sql = ", pollq_timestamp = '$pollq_timestamp'";
60
+ if($pollq_timestamp > current_time('timestamp')) {
61
+ $pollq_active = -1;
62
+ }
63
+ }
64
+ // Poll End Date
65
+ $pollq_expiry_no = intval($_POST['pollq_expiry_no']);
66
+ if($pollq_expiry_no == 1) {
67
+ $pollq_expiry = '';
68
+ } else {
69
+ $pollq_expiry_day = intval($_POST['pollq_expiry_day']);
70
+ $pollq_expiry_month = intval($_POST['pollq_expiry_month']);
71
+ $pollq_expiry_year = intval($_POST['pollq_expiry_year']);
72
+ $pollq_expiry_hour = intval($_POST['pollq_expiry_hour']);
73
+ $pollq_expiry_minute = intval($_POST['pollq_expiry_minute']);
74
+ $pollq_expiry_second = intval($_POST['pollq_expiry_second']);
75
+ $pollq_expiry = gmmktime($pollq_expiry_hour, $pollq_expiry_minute, $pollq_expiry_second, $pollq_expiry_month, $pollq_expiry_day, $pollq_expiry_year);
76
+ if($pollq_expiry <= current_time('timestamp')) {
77
+ $pollq_active = 0;
78
+ }
79
+ if($edit_polltimestamp == 1) {
80
+ if($pollq_expiry < $pollq_timestamp) {
81
+ $pollq_active = 0;
82
+ }
83
+ }
84
+ }
85
+ // Mutilple Poll
86
+ $pollq_multiple_yes = intval($_POST['pollq_multiple_yes']);
87
+ $pollq_multiple = 0;
88
+ if($pollq_multiple_yes == 1) {
89
+ $pollq_multiple = intval($_POST['pollq_multiple']);
90
+ } else {
91
+ $pollq_multiple = 0;
92
+ }
93
+ // Update Poll's Question
94
+ $edit_poll_question = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_question = '$pollq_question', pollq_totalvotes = $pollq_totalvotes, pollq_expiry = '$pollq_expiry', pollq_active = $pollq_active, pollq_multiple = $pollq_multiple, pollq_totalvoters = $pollq_totalvoters $timestamp_sql WHERE pollq_id = $pollq_id");
95
+ if(!$edit_poll_question) {
96
+ $text = '<p style="color: blue">'.sprintf(__('No Changes Had Been Made To Poll\'s Question \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
97
+ }
98
+ // Update Polls' Answers
99
+ $polla_aids = array();
100
+ $get_polla_aids = $wpdb->get_results("SELECT polla_aid FROM $wpdb->pollsa WHERE polla_qid = $pollq_id ORDER BY polla_aid ASC");
101
+ if($get_polla_aids) {
102
+ foreach($get_polla_aids as $get_polla_aid) {
103
+ $polla_aids[] = intval($get_polla_aid->polla_aid);
104
+ }
105
+ foreach($polla_aids as $polla_aid) {
106
+ $polla_answers = addslashes(trim($_POST['polla_aid-'.$polla_aid]));
107
+ $polla_votes = intval($_POST['polla_votes-'.$polla_aid]);
108
+ $edit_poll_answer = $wpdb->query("UPDATE $wpdb->pollsa SET polla_answers = '$polla_answers', polla_votes = $polla_votes WHERE polla_qid = $pollq_id AND polla_aid = $polla_aid");
109
+ if(!$edit_poll_answer) {
110
+ $text .= '<p style="color: blue">'.sprintf(__('No Changes Had Been Made To Poll\'s Answer \'%s\'.', 'wp-polls'), stripslashes($polla_answers)).'</p>';
111
+ } else {
112
+ $text .= '<p style="color: green">'.sprintf(__('Poll\'s Answer \'%s\' Edited Successfully.', 'wp-polls'), stripslashes($polla_answers)).'</p>';
113
+ }
114
+ }
115
+ } else {
116
+ $text .= '<p style="color: red">'.sprintf(__('Invalid Poll \'%s\'.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
117
+ }
118
+ // Add Poll Answers (If Needed)
119
+ $polla_answers_new = isset($_POST['polla_answers_new']) ? $_POST['polla_answers_new'] : null;
120
+ if(!empty($polla_answers_new)) {
121
+ $i = 0;
122
+ $polla_answers_new_votes = $_POST['polla_answers_new_votes'];
123
+ foreach($polla_answers_new as $polla_answer_new) {
124
+ $polla_answer_new = addslashes(trim($polla_answer_new));
125
+ if(!empty($polla_answer_new)) {
126
+ $polla_answer_new_vote = intval($polla_answers_new_votes[$i]);
127
+ $add_poll_answers = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $pollq_id, '$polla_answer_new', $polla_answer_new_vote)");
128
+ if(!$add_poll_answers) {
129
+ $text .= '<p style="color: red;">'.sprintf(__('Error In Adding Poll\'s Answer \'%s\'.', 'wp-polls'), stripslashes($polla_answer_new)).'</p>';
130
+ } else {
131
+ $text .= '<p style="color: green;">'.sprintf(__('Poll\'s Answer \'%s\' Added Successfully.', 'wp-polls'), stripslashes($polla_answer_new)).'</p>';
132
+ }
133
+ }
134
+ $i++;
135
+ }
136
+ }
137
+ if(empty($text)) {
138
+ $text = '<p style="color: green">'.sprintf(__('Poll \'%s\' Edited Successfully.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
139
+ }
140
+ // Update Lastest Poll ID To Poll Options
141
+ $latest_pollid = polls_latest_id();
142
+ $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
143
+ cron_polls_place();
144
+ break;
145
+ }
146
+ }
147
+
148
+ ### Determines Which Mode It Is
149
+ switch($mode) {
150
+ // Poll Logging
151
+ case 'logs':
152
+ require('polls-logs.php');
153
+ break;
154
+ // Edit A Poll
155
+ case 'edit':
156
+ $last_col_align = ('rtl' == $text_direction) ? 'left' : 'right';
157
+ $poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
158
+ $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY polla_aid ASC");
159
+ $poll_noquestion = $wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa WHERE polla_qid = $poll_id");
160
+ $poll_question_text = stripslashes($poll_question->pollq_question);
161
+ $poll_totalvotes = intval($poll_question->pollq_totalvotes);
162
+ $poll_timestamp = $poll_question->pollq_timestamp;
163
+ $poll_active = intval($poll_question->pollq_active);
164
+ $poll_expiry = trim($poll_question->pollq_expiry);
165
+ $poll_multiple = intval($poll_question->pollq_multiple);
166
+ $poll_totalvoters = intval($poll_question->pollq_totalvoters);
167
+ ?>
168
+ <?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>'; } ?>
169
+
170
+ <!-- Edit Poll -->
171
+ <form method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__).'&amp;mode=edit&amp;id='.$poll_id); ?>">
172
+ <?php wp_nonce_field('wp-polls_edit-poll'); ?>
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>
180
+ <table class="form-table">
181
+ <tr>
182
+ <th width="20%" scope="row" valign="top"><?php _e('Question', 'wp-polls') ?></th>
183
+ <td width="80%"><input type="text" size="70" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" /></td>
184
+ </tr>
185
+ </table>
186
+ <!-- Poll Answers -->
187
+ <h3><?php _e('Poll Answers', 'wp-polls'); ?></h3>
188
+ <table class="form-table">
189
+ <thead>
190
+ <tr>
191
+ <th width="20%" scope="row" valign="top"><?php _e('Answer No.', 'wp-polls') ?></th>
192
+ <th width="60%" scope="row" valign="top"><?php _e('Answer Text', 'wp-polls') ?></th>
193
+ <th width="20%" scope="row" valign="top" style="text-align: <?php echo $last_col_align; ?>;"><?php _e('No. Of Votes', 'wp-polls') ?></th>
194
+ </tr>
195
+ </thead>
196
+ <tbody id="poll_answers">
197
+ <?php
198
+ $i=1;
199
+ $poll_actual_totalvotes = 0;
200
+ if($poll_answers) {
201
+ $pollip_answers = array();
202
+ $pollip_answers[0] = __('Null Votes', 'wp-polls');
203
+ foreach($poll_answers as $poll_answer) {
204
+ $polla_aid = intval($poll_answer->polla_aid);
205
+ $polla_answers = stripslashes($poll_answer->polla_answers);
206
+ $polla_votes = intval($poll_answer->polla_votes);
207
+ $pollip_answers[$polla_aid] = $polla_answers;
208
+ echo "<tr id=\"poll-answer-$polla_aid\">\n";
209
+ echo '<th width="20%" scope="row" valign="top">'.sprintf(__('Answer %s', 'wp-polls'), number_format_i18n($i)).'</th>'."\n";
210
+ echo "<td width=\"60%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_aid-$polla_aid\" value=\"".htmlspecialchars($polla_answers)."\" />&nbsp;&nbsp;&nbsp;";
211
+ echo "<input type=\"button\" value=\"".__('Delete', 'wp-polls')."\" onclick=\"delete_poll_ans($poll_id, $polla_aid, $polla_votes, '".sprintf(esc_js(__('You are about to delete this poll\'s answer \'%s\'.', 'wp-polls')), esc_js(htmlspecialchars($polla_answers)))."', '".wp_create_nonce('wp-polls_delete-poll-answer')."');\" class=\"button\" /></td>\n";
212
+ echo '<td width="20%" align="'.$last_col_align.'">'.number_format_i18n($polla_votes)." <input type=\"text\" size=\"4\" id=\"polla_votes-$polla_aid\" name=\"polla_votes-$polla_aid\" value=\"$polla_votes\" onblur=\"check_totalvotes();\" /></td>\n</tr>\n";
213
+ $poll_actual_totalvotes += $polla_votes;
214
+ $i++;
215
+ }
216
+ }
217
+ ?>
218
+ </tbody>
219
+ <tbody>
220
+ <tr>
221
+ <td width="20%">&nbsp;</td>
222
+ <td width="60%"><input type="button" value="<?php _e('Add Answer', 'wp-polls') ?>" onclick="add_poll_answer_edit();" class="button" /></td>
223
+ <td width="20%" align="<?php echo $last_col_align; ?>"><strong><?php _e('Total Votes:', 'wp-polls'); ?></strong> <strong id="poll_total_votes"><?php echo number_format_i18n($poll_actual_totalvotes); ?></strong> <input type="text" size="4" readonly="readonly" id="pollq_totalvotes" name="pollq_totalvotes" value="<?php echo $poll_actual_totalvotes; ?>" onblur="check_totalvotes();" /></td>
224
+ </tr>
225
+ <tr>
226
+ <td width="20%">&nbsp;</td>
227
+ <td width="60%">&nbsp;</td>
228
+ <td width="20%" align="<?php echo $last_col_align; ?>"><strong><?php _e('Total Voters:', 'wp-polls'); ?> <?php echo number_format_i18n($poll_totalvoters); ?></strong> <input type="text" size="4" name="pollq_totalvoters" value="<?php echo $poll_totalvoters; ?>" /></td>
229
+ </tr>
230
+ </tbody>
231
+ </table>
232
+ <!-- Poll Multiple Answers -->
233
+ <h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3>
234
+ <table class="form-table">
235
+ <tr>
236
+ <th width="40%" scope="row" valign="top"><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></th>
237
+ <td width="60%">
238
+ <select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();">
239
+ <option value="0"<?php selected('0', $poll_multiple); ?>><?php _e('No', 'wp-polls'); ?></option>
240
+ <option value="1"<?php if($poll_multiple > 0) { echo ' selected="selected"'; } ?>><?php _e('Yes', 'wp-polls'); ?></option>
241
+ </select>
242
+ </td>
243
+ </tr>
244
+ <tr>
245
+ <th width="40%" scope="row" valign="top"><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></th>
246
+ <td width="60%">
247
+ <select name="pollq_multiple" id="pollq_multiple" size="1" <?php if($poll_multiple == 0) { echo 'disabled="disabled"'; } ?>>
248
+ <?php
249
+ for($i = 1; $i <= $poll_noquestion; $i++) {
250
+ if($poll_multiple > 0 && $poll_multiple == $i) {
251
+ echo "<option value=\"$i\" selected=\"selected\">".number_format_i18n($i)."</option>\n";
252
+ } else {
253
+ echo "<option value=\"$i\">".number_format_i18n($i)."</option>\n";
254
+ }
255
+ }
256
+ ?>
257
+ </select>
258
+ </td>
259
+ </tr>
260
+ </table>
261
+ <!-- Poll Start/End Date -->
262
+ <h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3>
263
+ <table class="form-table">
264
+ <tr>
265
+ <th width="20%" scope="row" valign="top"><?php _e('Start Date/Time', 'wp-polls'); ?></th>
266
+ <td width="80%">
267
+ <?php echo mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?><br />
268
+ <input type="checkbox" name="edit_polltimestamp" id="edit_polltimestamp" value="1" onclick="check_polltimestamp()" />&nbsp;<label for="edit_polltimestamp"><?php _e('Edit Start Date/Time', 'wp-polls'); ?></label><br />
269
+ <?php poll_timestamp($poll_timestamp, 'pollq_timestamp', 'none'); ?>
270
+ </td>
271
+ </tr>
272
+ <tr>
273
+ <th width="20%" scope="row" valign="top"><?php _e('End Date/Time', 'wp-polls'); ?></th>
274
+ <td width="80%">
275
+ <?php
276
+ if(empty($poll_expiry)) {
277
+ _e('This Poll Will Not Expire', 'wp-polls');
278
+ } else {
279
+ echo mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
280
+ }
281
+ ?>
282
+ <br />
283
+ <input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" onclick="check_pollexpiry();" <?php if(empty($poll_expiry)) { echo 'checked="checked"'; } ?> />
284
+ <label for="pollq_expiry_no"><?php _e('Do NOT Expire This Poll', 'wp-polls'); ?></label><br />
285
+ <?php
286
+ if(empty($poll_expiry)) {
287
+ poll_timestamp(current_time('timestamp'), 'pollq_expiry', 'none');
288
+ } else {
289
+ poll_timestamp($poll_expiry, 'pollq_expiry');
290
+ }
291
+ ?>
292
+ </td>
293
+ </tr>
294
+ </table>
295
+ <p style="text-align: center;">
296
+ <input type="submit" name="do" value="<?php _e('Edit Poll', 'wp-polls'); ?>" class="button-primary" />&nbsp;&nbsp;
297
+ <?php
298
+ if($poll_active == 1) {
299
+ $poll_open_display = 'none';
300
+ $poll_close_display = 'inline';
301
+ } else {
302
+ $poll_open_display = 'inline';
303
+ $poll_close_display = 'none';
304
+ }
305
+ ?>
306
+ <input type="button" class="button" name="do" id="close_poll" value="<?php _e('Close Poll', 'wp-polls'); ?>" onclick="closing_poll(<?php echo $poll_id; ?>, '<?php printf(esc_js(__('You are about to CLOSE this poll \'%s\'.', 'wp-polls')), htmlspecialchars(esc_js($poll_question_text))); ?>', '<?php echo wp_create_nonce('wp-polls_close-poll'); ?>');" style="display: <?php echo $poll_close_display; ?>;" />
307
+ <input type="button" class="button" name="do" id="open_poll" value="<?php _e('Open Poll', 'wp-polls'); ?>" onclick="opening_poll(<?php echo $poll_id; ?>, '<?php printf(esc_js(__('You are about to OPEN this poll \'%s\'.', 'wp-polls')), htmlspecialchars(esc_js($poll_question_text))); ?>', '<?php echo wp_create_nonce('wp-polls_open-poll'); ?>');" style="display: <?php echo $poll_open_display; ?>;" />
308
+ &nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" />
309
+ </p>
310
+ </div>
311
+ </form>
312
+ <?php
313
+ break;
314
+ // Main Page
315
+ default:
316
+ $polls = $wpdb->get_results("SELECT * FROM $wpdb->pollsq ORDER BY pollq_timestamp DESC");
317
+ $total_ans = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->pollsa");
318
+ $total_votes = 0;
319
+ $total_voters = 0;
320
+ ?>
321
+ <!-- Last Action -->
322
+ <div id="message" class="updated" style="display: none;"></div>
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" />
330
+ <table class="widefat">
331
+ <thead>
332
+ <tr>
333
+ <th><?php _e('ID', 'wp-polls'); ?></th>
334
+ <th><?php _e('Question', 'wp-polls'); ?></th>
335
+ <th><?php _e('Total Voters', 'wp-polls'); ?></th>
336
+ <th><?php _e('Start Date/Time', 'wp-polls'); ?></th>
337
+ <th><?php _e('End Date/Time', 'wp-polls'); ?></th>
338
+ <th><?php _e('Status', 'wp-polls'); ?></th>
339
+ <th colspan="3"><?php _e('Action', 'wp-polls'); ?></th>
340
+ </tr>
341
+ </thead>
342
+ <tbody id="manage_polls">
343
+ <?php
344
+ if($polls) {
345
+ if(function_exists('dynamic_sidebar')) {
346
+ $options = get_option('widget_polls');
347
+ $multiple_polls = explode(',', $options['multiple_polls']);
348
+ } else {
349
+ $multiple_polls = array();
350
+ }
351
+ $i = 0;
352
+ $current_poll = intval(get_option('poll_currentpoll'));
353
+ $latest_poll = intval(get_option('poll_latestpoll'));
354
+ foreach($polls as $poll) {
355
+ $poll_id = intval($poll->pollq_id);
356
+ $poll_question = stripslashes($poll->pollq_question);
357
+ $poll_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp));
358
+ $poll_totalvotes = intval($poll->pollq_totalvotes);
359
+ $poll_totalvoters = intval($poll->pollq_totalvoters);
360
+ $poll_active = intval($poll->pollq_active);
361
+ $poll_expiry = trim($poll->pollq_expiry);
362
+ if(empty($poll_expiry)) {
363
+ $poll_expiry_text = __('No Expiry', 'wp-polls');
364
+ } else {
365
+ $poll_expiry_text = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
366
+ }
367
+ if($i%2 == 0) {
368
+ $style = 'class="alternate"';
369
+ } else {
370
+ $style = '';
371
+ }
372
+ if($current_poll > 0) {
373
+ if($current_poll == $poll_id) {
374
+ $style = 'class="highlight"';
375
+ }
376
+ } elseif($current_poll == 0) {
377
+ if($poll_id == $latest_poll) {
378
+ $style = 'class="highlight"';
379
+ }
380
+ } else if(in_array($poll_id, $multiple_polls)) {
381
+ $style = 'class="highlight"';
382
+ }
383
+ echo "<tr id=\"poll-$poll_id\" $style>\n";
384
+ echo '<td><strong>'.number_format_i18n($poll_id).'</strong></td>'."\n";
385
+ echo '<td>';
386
+ if($current_poll > 0) {
387
+ if($current_poll == $poll_id) {
388
+ echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
389
+ }
390
+ } elseif($current_poll == 0) {
391
+ if($poll_id == $latest_poll) {
392
+ echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
393
+ }
394
+ } else if(in_array($poll_id, $multiple_polls)) {
395
+ echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
396
+ }
397
+ echo "$poll_question</td>\n";
398
+ echo '<td>'.number_format_i18n($poll_totalvoters)."</td>\n";
399
+ echo "<td>$poll_date</td>\n";
400
+ echo "<td>$poll_expiry_text</td>\n";
401
+ echo '<td>';
402
+ if($poll_active == 1) {
403
+ _e('Open', 'wp-polls');
404
+ } elseif($poll_active == -1) {
405
+ _e('Future', 'wp-polls');
406
+ } else {
407
+ _e('Closed', 'wp-polls');
408
+ }
409
+ echo "</td>\n";
410
+ echo "<td><a href=\"$base_page&amp;mode=logs&amp;id=$poll_id\" class=\"edit\">".__('Logs', 'wp-polls')."</a></td>\n";
411
+ echo "<td><a href=\"$base_page&amp;mode=edit&amp;id=$poll_id\" class=\"edit\">".__('Edit', 'wp-polls')."</a></td>\n";
412
+ echo "<td><a href=\"#DeletePoll\" onclick=\"delete_poll($poll_id, '".sprintf(esc_js(__('You are about to delete this poll, \'%s\'.', 'wp-polls')), esc_js($poll_question))."', '".wp_create_nonce('wp-polls_delete-poll')."');\" class=\"delete\">".__('Delete', 'wp-polls')."</a></td>\n";
413
+ echo '</tr>';
414
+ $i++;
415
+ $total_votes+= $poll_totalvotes;
416
+ $total_voters+= $poll_totalvoters;
417
+
418
+ }
419
+ } else {
420
+ echo '<tr><td colspan="9" align="center"><strong>'.__('No Polls Found', 'wp-polls').'</strong></td></tr>';
421
+ }
422
+ ?>
423
+ </tbody>
424
+ </table>
425
+ </div>
426
+ <p>&nbsp;</p>
427
+
428
+ <!-- Polls Stats -->
429
+ <div class="wrap">
430
+ <h3><?php _e('Polls Stats:', 'wp-polls'); ?></h3>
431
+ <br style="clear" />
432
+ <table class="widefat">
433
+ <tr>
434
+ <th><?php _e('Total Polls:', 'wp-polls'); ?></th>
435
+ <td><?php echo number_format_i18n($i); ?></td>
436
+ </tr>
437
+ <tr class="alternate">
438
+ <th><?php _e('Total Polls\' Answers:', 'wp-polls'); ?></th>
439
+ <td><?php echo number_format_i18n($total_ans); ?></td>
440
+ </tr>
441
+ <tr>
442
+ <th><?php _e('Total Votes Casted:', 'wp-polls'); ?></th>
443
+ <td><?php echo number_format_i18n($total_votes); ?></td>
444
+ </tr>
445
+ <tr class="alternate">
446
+ <th><?php _e('Total Voters:', 'wp-polls'); ?></th>
447
+ <td><?php echo number_format_i18n($total_voters); ?></td>
448
+ </tr>
449
+ </table>
450
+ </div>
451
+ <p>&nbsp;</p>
452
+
453
+ <!-- Delete Polls Logs -->
454
+ <div class="wrap">
455
+ <h3><?php _e('Polls Logs', 'wp-polls'); ?></h3>
456
+ <br style="clear" />
457
+ <div align="center" id="poll_logs">
458
+ <?php
459
+ $poll_ips = intval($wpdb->get_var("SELECT COUNT(pollip_id) FROM $wpdb->pollsip"));
460
+ if($poll_ips > 0) {
461
+ ?>
462
+ <strong><?php _e('Are You Sure You Want To Delete All Polls Logs?', 'wp-polls'); ?></strong><br /><br />
463
+ <input type="checkbox" name="delete_logs_yes" id="delete_logs_yes" value="yes" />&nbsp;<label for="delete_logs_yes"><?php _e('Yes', 'wp-polls'); ?></label><br /><br />
464
+ <input type="button" value="<?php _e('Delete All Logs', 'wp-polls'); ?>" class="button" onclick="delete_poll_logs('<?php echo esc_js(__('You are about to delete all poll logs. This action is not reversible.', 'wp-polls')); ?>', '<?php echo wp_create_nonce('wp-polls_delete-polls-logs'); ?>');" />
465
+ <?php
466
+ } else {
467
+ _e('No poll logs available.', 'wp-polls');
468
+ }
469
+ ?>
470
+ </div>
471
+ <p><?php _e('Note: If your logging method is by IP and Cookie or by Cookie, users may still be unable to vote if they have voted before as the cookie is still stored in their computer.', 'wp-polls'); ?></p>
472
+ </div>
473
+ <?php
474
+ } // End switch($mode)
 
 
 
 
 
 
 
 
polls-options.php CHANGED
@@ -1,387 +1,382 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Configure Poll Options |
14
- | - wp-content/plugins/wp-polls/polls-options.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Polls
21
- if(!current_user_can('manage_polls')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables Variables Variables
27
- $base_name = plugin_basename('wp-polls/polls-options.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
- $id = intval($_GET['id']);
30
-
31
-
32
- ### If Form Is Submitted
33
- if($_POST['Submit']) {
34
- $poll_bar_style = strip_tags(trim($_POST['poll_bar_style']));
35
- $poll_bar_background = strip_tags(trim($_POST['poll_bar_bg']));
36
- $poll_bar_border = strip_tags(trim($_POST['poll_bar_border']));
37
- $poll_bar_height = intval($_POST['poll_bar_height']);
38
- $poll_bar = array('style' => $poll_bar_style, 'background' => $poll_bar_background, 'border' => $poll_bar_border, 'height' => $poll_bar_height);
39
- $poll_ajax_style = array('loading' => intval($_POST['poll_ajax_style_loading']), 'fading' => intval($_POST['poll_ajax_style_fading']));
40
- $poll_ans_sortby = strip_tags(trim($_POST['poll_ans_sortby']));
41
- $poll_ans_sortorder = strip_tags(trim($_POST['poll_ans_sortorder']));
42
- $poll_ans_result_sortby = strip_tags(trim($_POST['poll_ans_result_sortby']));
43
- $poll_ans_result_sortorder = strip_tags(trim($_POST['poll_ans_result_sortorder']));
44
- $poll_archive_perpage = intval($_POST['poll_archive_perpage']);
45
- $poll_archive_displaypoll = intval($_POST['poll_archive_displaypoll']);
46
- $poll_archive_url = strip_tags(trim($_POST['poll_archive_url']));
47
- $poll_archive_show = intval($_POST['poll_archive_show']);
48
- $poll_currentpoll = intval($_POST['poll_currentpoll']);
49
- $poll_close = intval($_POST['poll_close']);
50
- $poll_logging_method = intval($_POST['poll_logging_method']);
51
- $poll_cookielog_expiry = intval($_POST['poll_cookielog_expiry']);
52
- $poll_allowtovote = intval($_POST['poll_allowtovote']);
53
- $update_poll_queries = array();
54
- $update_poll_text = array();
55
- $update_poll_queries[] = update_option('poll_bar', $poll_bar);
56
- $update_poll_queries[] = update_option('poll_ajax_style', $poll_ajax_style);
57
- $update_poll_queries[] = update_option('poll_ans_sortby', $poll_ans_sortby);
58
- $update_poll_queries[] = update_option('poll_ans_sortorder', $poll_ans_sortorder);
59
- $update_poll_queries[] = update_option('poll_ans_result_sortby', $poll_ans_result_sortby);
60
- $update_poll_queries[] = update_option('poll_ans_result_sortorder', $poll_ans_result_sortorder);
61
- $update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage);
62
- $update_poll_queries[] = update_option('poll_archive_displaypoll', $poll_archive_displaypoll);
63
- $update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url);
64
- $update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show);
65
- $update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll);
66
- $update_poll_queries[] = update_option('poll_close', $poll_close);
67
- $update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method);
68
- $update_poll_queries[] = update_option('poll_cookielog_expiry', $poll_cookielog_expiry);
69
- $update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote);
70
- $update_poll_text[] = __('Poll Bar Style', 'wp-polls');
71
- $update_poll_text[] = __('Poll AJAX Style', 'wp-polls');
72
- $update_poll_text[] = __('Sort Poll Answers By Option', 'wp-polls');
73
- $update_poll_text[] = __('Sort Order Of Poll Answers Option', 'wp-polls');
74
- $update_poll_text[] = __('Sort Poll Results By Option', 'wp-polls');
75
- $update_poll_text[] = __('Sort Order Of Poll Results Option', 'wp-polls');
76
- $update_poll_text[] = __('Number Of Polls Per Page To Display In Poll Archive Option', 'wp-polls');
77
- $update_poll_text[] = __('Type Of Polls To Display In Poll Archive Option', 'wp-polls');
78
- $update_poll_text[] = __('Poll Archive URL Option', 'wp-polls');
79
- $update_poll_text[] = __('Show Poll Achive Link Option', 'wp-polls');
80
- $update_poll_text[] = __('Current Active Poll Option', 'wp-polls');
81
- $update_poll_text[] = __('Poll Close Option', 'wp-polls');
82
- $update_poll_text[] = __('Logging Method', 'wp-polls');
83
- $update_poll_text[] = __('Cookie And Log Expiry Option', 'wp-polls');
84
- $update_poll_text[] = __('Allow To Vote Option', 'wp-polls');
85
- $i=0;
86
- $text = '';
87
- foreach($update_poll_queries as $update_poll_query) {
88
- if($update_poll_query) {
89
- $text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />';
90
- }
91
- $i++;
92
- }
93
- if(empty($text)) {
94
- $text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>';
95
- }
96
- cron_polls_place();
97
- }
98
- ?>
99
- <script type="text/javascript">
100
- /* <![CDATA[*/
101
- function set_pollbar_height(height) {
102
- jQuery("#poll_bar_height").val(height);
103
- }
104
- function update_pollbar(where) {
105
- pollbar_background = "#" + jQuery("#poll_bar_bg").val();
106
- pollbar_border = "#" + jQuery("#poll_bar_border").val();
107
- pollbar_height = jQuery("#poll_bar_height").val() + "px";
108
- if(where == "background") {
109
- jQuery("#wp-polls-pollbar-bg").css("background-color", pollbar_background);
110
- } else if(where == "border") {
111
- jQuery("#wp-polls-pollbar-border").css("background-color", pollbar_border);
112
- } else if(where == "style") {
113
- pollbar_style = jQuery("input[name='poll_bar_style']:checked").val();
114
- if(pollbar_style == "use_css") {
115
- jQuery("#wp-polls-pollbar").css("background-image", "none");
116
- } else {
117
- jQuery("#wp-polls-pollbar").css("background-image", "url('<?php echo plugins_url('wp-polls/images/'); ?>" + pollbar_style + "/pollbg.gif')");
118
- }
119
- }
120
- jQuery("#wp-polls-pollbar").css({"background-color":pollbar_background, "border":"1px solid " + pollbar_border, "height":pollbar_height});
121
- }
122
- /* ]]> */
123
- </script>
124
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
125
- <form id="poll_options_form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
126
- <div class="wrap">
127
- <div id="icon-wp-polls" class="icon32"><br /></div>
128
- <h2><?php _e('Poll Options', 'wp-polls'); ?></h2>
129
- <!-- Poll Bar Style -->
130
- <h3><?php _e('Poll Bar Style', 'wp-polls'); ?></h3>
131
- <table class="form-table">
132
- <tr>
133
- <th scope="row" valign="top"><?php _e('Poll Bar Style', 'wp-polls'); ?></th>
134
- <td colspan="2">
135
- <?php
136
- $pollbar = get_option('poll_bar');
137
- $pollbar_url = plugins_url('wp-polls/images');
138
- $pollbar_path = WP_PLUGIN_DIR.'/wp-polls/images';
139
- if($handle = @opendir($pollbar_path)) {
140
- while (false !== ($filename = readdir($handle))) {
141
- if (substr($filename, 0, 1) != '.' && substr($filename, 0, 2) != '..') {
142
- if(is_dir($pollbar_path.'/'.$filename)) {
143
- echo '<p>'."\n";
144
- $pollbar_info = getimagesize($pollbar_path.'/'.$filename.'/pollbg.gif');
145
- if($pollbar['style'] == $filename) {
146
- echo '<input type="radio" id="poll_bar_style-'.$filename.'" name="poll_bar_style" value="'.$filename.'" checked="checked" onclick="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />';
147
- } else {
148
- echo '<input type="radio" id="poll_bar_style-'.$filename.'" name="poll_bar_style" value="'.$filename.'" onclick="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />';
149
- }
150
- echo '<label for="poll_bar_style-'.$filename.'">&nbsp;&nbsp;&nbsp;';
151
- echo '<img src="'.$pollbar_url.'/'.$filename.'/pollbg.gif" height="'.$pollbar_info[1].'" width="100" alt="pollbg.gif" />';
152
- echo '&nbsp;&nbsp;&nbsp;('.$filename.')</label>';
153
- echo '</p>'."\n";
154
- }
155
- }
156
- }
157
- closedir($handle);
158
- }
159
- ?>
160
- <input type="radio" id="poll_bar_style-use_css" name="poll_bar_style" value="use_css"<?php checked('use_css', $pollbar['style']); ?> onclick="update_pollbar('style');" /><label for="poll_bar_style-use_css"> <?php _e('Use CSS Style', 'wp-polls'); ?></label>
161
- </td>
162
- </tr>
163
- <tr>
164
- <th scope="row" valign="top"><?php _e('Poll Bar Background', 'wp-polls'); ?></th>
165
- <td width="10%" dir="ltr">#<input type="text" id="poll_bar_bg" name="poll_bar_bg" value="<?php echo $pollbar['background']; ?>" size="6" maxlength="6" onblur="update_pollbar('background');" /></td>
166
- <td><div id="wp-polls-pollbar-bg" style="background-color: #<?php echo $pollbar['background']; ?>;"></div></td>
167
- </tr>
168
- <tr>
169
- <th scope="row" valign="top"><?php _e('Poll Bar Border', 'wp-polls'); ?></th>
170
- <td width="10%" dir="ltr">#<input type="text" id="poll_bar_border" name="poll_bar_border" value="<?php echo $pollbar['border']; ?>" size="6" maxlength="6" onblur="update_pollbar('border');" /></td>
171
- <td><div id="wp-polls-pollbar-border" style="background-color: #<?php echo $pollbar['border']; ?>;"></div></td>
172
- </tr>
173
- <tr>
174
- <th scope="row" valign="top"><?php _e('Poll Bar Height', 'wp-polls'); ?></th>
175
- <td colspan="2" dir="ltr"><input type="text" id="poll_bar_height" name="poll_bar_height" value="<?php echo $pollbar['height']; ?>" size="2" maxlength="2" onblur="update_pollbar('height');" />px</td>
176
- </tr>
177
- <tr>
178
- <th scope="row" valign="top"><?php _e('Your poll bar will look like this', 'wp-polls'); ?></th>
179
- <td colspan="2">
180
- <?php
181
- if($pollbar['style'] == 'use_css') {
182
- echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'"></div>'."\n";
183
- } else {
184
- echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'; background-image: url(\''.plugins_url('wp-polls/images/'.$pollbar['style'].'/pollbg.gif').'\');"></div>'."\n";
185
- }
186
- ?>
187
- </td>
188
- </tr>
189
- </table>
190
-
191
- <!-- Polls AJAX Style -->
192
- <?php $poll_ajax_style = get_option('poll_ajax_style'); ?>
193
- <h3><?php _e('Polls AJAX Style', 'wp-polls'); ?></h3>
194
- <table class="form-table">
195
- <tr>
196
- <th scope="row" valign="top"><?php _e('Show Loading Image With Text', 'wp-polls'); ?></th>
197
- <td>
198
- <select name="poll_ajax_style_loading" size="1">
199
- <option value="0"<?php selected('0', $poll_ajax_style['loading']); ?>><?php _e('No', 'wp-polls'); ?></option>
200
- <option value="1"<?php selected('1', $poll_ajax_style['loading']); ?>><?php _e('Yes', 'wp-polls'); ?></option>
201
- </select>
202
- </td>
203
- </tr>
204
- <tr>
205
- <th scope="row" valign="top"><?php _e('Show Fading In And Fading Out Of Poll', 'wp-polls'); ?></th>
206
- <td>
207
- <select name="poll_ajax_style_fading" size="1">
208
- <option value="0"<?php selected('0', $poll_ajax_style['fading']); ?>><?php _e('No', 'wp-polls'); ?></option>
209
- <option value="1"<?php selected('1', $poll_ajax_style['fading']); ?>><?php _e('Yes', 'wp-polls'); ?></option>
210
- </select>
211
- </td>
212
- </tr>
213
- </table>
214
-
215
- <!-- Sorting Of Poll Answers -->
216
- <h3><?php _e('Sorting Of Poll Answers', 'wp-polls'); ?></h3>
217
- <table class="form-table">
218
- <tr>
219
- <th scope="row" valign="top"><?php _e('Sort Poll Answers By:', 'wp-polls'); ?></th>
220
- <td>
221
- <select name="poll_ans_sortby" size="1">
222
- <option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>
223
- <option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>
224
- <option value="RAND()"<?php selected('RAND()', get_option('poll_ans_sortby')); ?>><?php _e('Random Order', 'wp-polls'); ?></option>
225
- </select>
226
- </td>
227
- </tr>
228
- <tr>
229
- <th scope="row" valign="top"><?php _e('Sort Order Of Poll Answers:', 'wp-polls'); ?></th>
230
- <td>
231
- <select name="poll_ans_sortorder" size="1">
232
- <option value="asc"<?php selected('asc', get_option('poll_ans_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>
233
- <option value="desc"<?php selected('desc', get_option('poll_ans_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>
234
- </select>
235
- </td>
236
- </tr>
237
- </table>
238
-
239
- <!-- Sorting Of Poll Results -->
240
- <h3><?php _e('Sorting Of Poll Results', 'wp-polls'); ?></h3>
241
- <table class="form-table">
242
- <tr>
243
- <th scope="row" valign="top"><?php _e('Sort Poll Results By:', 'wp-polls'); ?></th>
244
- <td>
245
- <select name="poll_ans_result_sortby" size="1">
246
- <option value="polla_votes"<?php selected('polla_votes', get_option('poll_ans_result_sortby')); ?>><?php _e('Votes Cast', 'wp-polls'); ?></option>
247
- <option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_result_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>
248
- <option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_result_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>
249
- <option value="RAND()"<?php selected('RAND()', get_option('poll_ans_result_sortby')); ?>><?php _e('Random Order', 'wp-polls'); ?></option>
250
- </select>
251
- </td>
252
- </tr>
253
- <tr>
254
- <th scope="row" valign="top"><?php _e('Sort Order Of Poll Results:', 'wp-polls'); ?></th>
255
- <td>
256
- <select name="poll_ans_result_sortorder" size="1">
257
- <option value="asc"<?php selected('asc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>
258
- <option value="desc"<?php selected('desc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>
259
- </select>
260
- </td>
261
- </tr>
262
- </table>
263
-
264
- <!-- Allow To Vote -->
265
- <h3><?php _e('Allow To Vote', 'wp-polls'); ?></h3>
266
- <table class="form-table">
267
- <tr>
268
- <th scope="row" valign="top"><?php _e('Who Is Allowed To Vote?', 'wp-polls'); ?></th>
269
- <td>
270
- <select name="poll_allowtovote" size="1">
271
- <option value="0"<?php selected('0', get_option('poll_allowtovote')); ?>><?php _e('Guests Only', 'wp-polls'); ?></option>
272
- <option value="1"<?php selected('1', get_option('poll_allowtovote')); ?>><?php _e('Registered Users Only', 'wp-polls'); ?></option>
273
- <option value="2"<?php selected('2', get_option('poll_allowtovote')); ?>><?php _e('Registered Users And Guests', 'wp-polls'); ?></option>
274
- </select>
275
- </td>
276
- </tr>
277
- </table>
278
-
279
- <!-- Logging Method -->
280
- <h3><?php _e('Logging Method', 'wp-polls'); ?></h3>
281
- <table class="form-table">
282
- <tr valign="top">
283
- <th scope="row" valign="top"><?php _e('Poll Logging Method:', 'wp-polls'); ?></th>
284
- <td>
285
- <select name="poll_logging_method" size="1">
286
- <option value="0"<?php selected('0', get_option('poll_logging_method')); ?>><?php _e('Do Not Log', 'wp-polls'); ?></option>
287
- <option value="1"<?php selected('1', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie', 'wp-polls'); ?></option>
288
- <option value="2"<?php selected('2', get_option('poll_logging_method')); ?>><?php _e('Logged By IP', 'wp-polls'); ?></option>
289
- <option value="3"<?php selected('3', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie And IP', 'wp-polls'); ?></option>
290
- <option value="4"<?php selected('4', get_option('poll_logging_method')); ?>><?php _e('Logged By Username', 'wp-polls'); ?></option>
291
- </select>
292
- </td>
293
- </tr>
294
- <tr>
295
- <th scope="row" valign="top"><?php _e('Expiry Time For Cookie And Log:', 'wp-polls'); ?></th>
296
- <td><input type="text" name="poll_cookielog_expiry" value="<?php echo intval(get_option('poll_cookielog_expiry')); ?>" size="10" /> <?php _e('seconds (0 to disable)', 'wp-polls'); ?></td>
297
- </tr>
298
- </table>
299
-
300
- <!-- Poll Archive -->
301
- <h3><?php _e('Poll Archive', 'wp-polls'); ?></h3>
302
- <table class="form-table">
303
- <tr>
304
- <th scope="row" valign="top"><?php _e('Number Of Polls Per Page:', 'wp-polls'); ?></th>
305
- <td><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_option('poll_archive_perpage')); ?>" size="2" /></td>
306
- </tr>
307
- <tr>
308
- <th scope="row" valign="top"><?php _e('Type Of Polls To Display In Poll Archive:', 'wp-polls'); ?></th>
309
- <td>
310
- <select name="poll_archive_displaypoll" size="1">
311
- <option value="1"<?php selected('1', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed Polls Only', 'wp-polls'); ?></option>
312
- <option value="2"<?php selected('2', get_option('poll_archive_displaypoll')); ?>><?php _e('Opened Polls Only', 'wp-polls'); ?></option>
313
- <option value="3"<?php selected('3', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed And Opened Polls', 'wp-polls'); ?></option>
314
- </select>
315
- </td>
316
- </tr>
317
- <tr>
318
- <th scope="row" valign="top"><?php _e('Poll Archive URL:', 'wp-polls'); ?></th>
319
- <td><input type="text" name="poll_archive_url" value="<?php echo get_option('poll_archive_url'); ?>" size="50" dir="ltr" /></td>
320
- </tr>
321
- <tr>
322
- <th scope="row" valign="top"><?php _e('Display Poll Archive Link Below Poll?', 'wp-polls'); ?></th>
323
- <td>
324
- <select name="poll_archive_show" size="1">
325
- <option value="0"<?php selected('0', get_option('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option>
326
- <option value="1"<?php selected('1', get_option('poll_archive_show')); ?>><?php _e('Yes', 'wp-polls'); ?></option>
327
- </select>
328
- </td>
329
- </tr>
330
- <tr>
331
- <th scope="row" valign="top"><?php _e('Note', 'wp-polls'); ?></th>
332
- <td><em><?php _e('Only polls\' results will be shown in the Poll Archive regardless of whether the poll is closed or opened.', 'wp-polls'); ?></em></td>
333
- </tr>
334
- </table>
335
-
336
- <!-- Current Active Poll -->
337
- <h3><?php _e('Current Active Poll', 'wp-polls'); ?></h3>
338
- <table class="form-table">
339
- <tr>
340
- <th scope="row" valign="top"><?php _e('Current Active Poll', 'wp-polls'); ?>:</th>
341
- <td>
342
- <select name="poll_currentpoll" size="1">
343
- <option value="-1"<?php selected(-1, get_option('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
344
- <option value="-2"<?php selected(-2, get_option('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
345
- <option value="0"<?php selected(0, get_option('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
346
- <optgroup>&nbsp;</optgroup>
347
- <?php
348
- $polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
349
- if($polls) {
350
- foreach($polls as $poll) {
351
- $poll_question = stripslashes($poll->pollq_question);
352
- $poll_id = intval($poll->pollq_id);
353
- if($poll_id == intval(get_option('poll_currentpoll'))) {
354
- echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n";
355
- } else {
356
- echo "<option value=\"$poll_id\">$poll_question</option>\n";
357
- }
358
- }
359
- }
360
- ?>
361
- </select>
362
- </td>
363
- </tr>
364
- <?php if(function_exists('dynamic_sidebar')) { ?>
365
- <tr>
366
- <th scope="row"valign="top"><?php _e('Note', 'wp-polls'); ?></th>
367
- <td><em><?php _e('If you chose \'Display Multiple Polls\' for the above option, you need to configure it in Presentation -> Widgets -> Poll.', 'wp-polls'); ?></em></td>
368
- </tr>
369
- <?php } ?>
370
- <tr>
371
- <th scope="row" valign="top"><?php _e('When Poll Is Closed', 'wp-polls'); ?>:</th>
372
- <td>
373
- <select name="poll_close" size="1">
374
- <option value="1"<?php selected(1, get_option('poll_close')); ?>><?php _e('Display Poll\'s Results', 'wp-polls'); ?></option>
375
- <option value="3"<?php selected(3, get_option('poll_close')); ?>><?php _e('Display Disabled Poll\'s Voting Form', 'wp-polls'); ?></option>
376
- <option value="2"<?php selected(2, get_option('poll_close')); ?>><?php _e('Do Not Display Poll In Post/Sidebar', 'wp-polls'); ?></option>
377
- </select>
378
- </td>
379
- </tr>
380
- </table>
381
-
382
- <!-- Submit Button -->
383
- <p class="submit">
384
- <input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-polls'); ?>" />
385
- </p>
386
- </div>
387
- </form>
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress Plugin: WP-Polls |
6
+ | Copyright (c) 2012 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Configure Poll Options |
14
+ | - wp-content/plugins/wp-polls/polls-options.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Polls
21
+ if(!current_user_can('manage_polls')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+
26
+ ### Variables Variables Variables
27
+ $base_name = plugin_basename('wp-polls/polls-options.php');
28
+ $base_page = 'admin.php?page='.$base_name;
29
+ $id = (isset($_GET['id']) ? intval($_GET['id']) : 0);
30
+
31
+ ### If Form Is Submitted
32
+ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
33
+ check_admin_referer('wp-polls_options');
34
+ $poll_bar_style = strip_tags(trim($_POST['poll_bar_style']));
35
+ $poll_bar_background = strip_tags(trim($_POST['poll_bar_bg']));
36
+ $poll_bar_border = strip_tags(trim($_POST['poll_bar_border']));
37
+ $poll_bar_height = intval($_POST['poll_bar_height']);
38
+ $poll_bar = array('style' => $poll_bar_style, 'background' => $poll_bar_background, 'border' => $poll_bar_border, 'height' => $poll_bar_height);
39
+ $poll_ajax_style = array('loading' => intval($_POST['poll_ajax_style_loading']), 'fading' => intval($_POST['poll_ajax_style_fading']));
40
+ $poll_ans_sortby = strip_tags(trim($_POST['poll_ans_sortby']));
41
+ $poll_ans_sortorder = strip_tags(trim($_POST['poll_ans_sortorder']));
42
+ $poll_ans_result_sortby = strip_tags(trim($_POST['poll_ans_result_sortby']));
43
+ $poll_ans_result_sortorder = strip_tags(trim($_POST['poll_ans_result_sortorder']));
44
+ $poll_archive_perpage = intval($_POST['poll_archive_perpage']);
45
+ $poll_archive_displaypoll = intval($_POST['poll_archive_displaypoll']);
46
+ $poll_archive_url = strip_tags(trim($_POST['poll_archive_url']));
47
+ $poll_archive_show = intval($_POST['poll_archive_show']);
48
+ $poll_currentpoll = intval($_POST['poll_currentpoll']);
49
+ $poll_close = intval($_POST['poll_close']);
50
+ $poll_logging_method = intval($_POST['poll_logging_method']);
51
+ $poll_cookielog_expiry = intval($_POST['poll_cookielog_expiry']);
52
+ $poll_allowtovote = intval($_POST['poll_allowtovote']);
53
+ $update_poll_queries = array();
54
+ $update_poll_text = array();
55
+ $update_poll_queries[] = update_option('poll_bar', $poll_bar);
56
+ $update_poll_queries[] = update_option('poll_ajax_style', $poll_ajax_style);
57
+ $update_poll_queries[] = update_option('poll_ans_sortby', $poll_ans_sortby);
58
+ $update_poll_queries[] = update_option('poll_ans_sortorder', $poll_ans_sortorder);
59
+ $update_poll_queries[] = update_option('poll_ans_result_sortby', $poll_ans_result_sortby);
60
+ $update_poll_queries[] = update_option('poll_ans_result_sortorder', $poll_ans_result_sortorder);
61
+ $update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage);
62
+ $update_poll_queries[] = update_option('poll_archive_displaypoll', $poll_archive_displaypoll);
63
+ $update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url);
64
+ $update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show);
65
+ $update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll);
66
+ $update_poll_queries[] = update_option('poll_close', $poll_close);
67
+ $update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method);
68
+ $update_poll_queries[] = update_option('poll_cookielog_expiry', $poll_cookielog_expiry);
69
+ $update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote);
70
+ $update_poll_text[] = __('Poll Bar Style', 'wp-polls');
71
+ $update_poll_text[] = __('Poll AJAX Style', 'wp-polls');
72
+ $update_poll_text[] = __('Sort Poll Answers By Option', 'wp-polls');
73
+ $update_poll_text[] = __('Sort Order Of Poll Answers Option', 'wp-polls');
74
+ $update_poll_text[] = __('Sort Poll Results By Option', 'wp-polls');
75
+ $update_poll_text[] = __('Sort Order Of Poll Results Option', 'wp-polls');
76
+ $update_poll_text[] = __('Number Of Polls Per Page To Display In Poll Archive Option', 'wp-polls');
77
+ $update_poll_text[] = __('Type Of Polls To Display In Poll Archive Option', 'wp-polls');
78
+ $update_poll_text[] = __('Poll Archive URL Option', 'wp-polls');
79
+ $update_poll_text[] = __('Show Poll Achive Link Option', 'wp-polls');
80
+ $update_poll_text[] = __('Current Active Poll Option', 'wp-polls');
81
+ $update_poll_text[] = __('Poll Close Option', 'wp-polls');
82
+ $update_poll_text[] = __('Logging Method', 'wp-polls');
83
+ $update_poll_text[] = __('Cookie And Log Expiry Option', 'wp-polls');
84
+ $update_poll_text[] = __('Allow To Vote Option', 'wp-polls');
85
+ $i=0;
86
+ $text = '';
87
+ foreach($update_poll_queries as $update_poll_query) {
88
+ if($update_poll_query) {
89
+ $text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />';
90
+ }
91
+ $i++;
92
+ }
93
+ if(empty($text)) {
94
+ $text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>';
95
+ }
96
+ cron_polls_place();
97
+ }
98
+ ?>
99
+ <script type="text/javascript">
100
+ /* <![CDATA[*/
101
+ function set_pollbar_height(height) {
102
+ jQuery("#poll_bar_height").val(height);
103
+ }
104
+ function update_pollbar(where) {
105
+ pollbar_background = "#" + jQuery("#poll_bar_bg").val();
106
+ pollbar_border = "#" + jQuery("#poll_bar_border").val();
107
+ pollbar_height = jQuery("#poll_bar_height").val() + "px";
108
+ if(where == "background") {
109
+ jQuery("#wp-polls-pollbar-bg").css("background-color", pollbar_background);
110
+ } else if(where == "border") {
111
+ jQuery("#wp-polls-pollbar-border").css("background-color", pollbar_border);
112
+ } else if(where == "style") {
113
+ pollbar_style = jQuery("input[name='poll_bar_style']:checked").val();
114
+ if(pollbar_style == "use_css") {
115
+ jQuery("#wp-polls-pollbar").css("background-image", "none");
116
+ } else {
117
+ jQuery("#wp-polls-pollbar").css("background-image", "url('<?php echo plugins_url('wp-polls/images/'); ?>" + pollbar_style + "/pollbg.gif')");
118
+ }
119
+ }
120
+ jQuery("#wp-polls-pollbar").css({"background-color":pollbar_background, "border":"1px solid " + pollbar_border, "height":pollbar_height});
121
+ }
122
+ /* ]]> */
123
+ </script>
124
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
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>
132
+ <table class="form-table">
133
+ <tr>
134
+ <th scope="row" valign="top"><?php _e('Poll Bar Style', 'wp-polls'); ?></th>
135
+ <td colspan="2">
136
+ <?php
137
+ $pollbar = get_option('poll_bar');
138
+ $pollbar_url = plugins_url('wp-polls/images');
139
+ $pollbar_path = WP_PLUGIN_DIR.'/wp-polls/images';
140
+ if($handle = @opendir($pollbar_path)) {
141
+ while (false !== ($filename = readdir($handle))) {
142
+ if (substr($filename, 0, 1) != '.' && substr($filename, 0, 2) != '..') {
143
+ if(is_dir($pollbar_path.'/'.$filename)) {
144
+ echo '<p>'."\n";
145
+ $pollbar_info = getimagesize($pollbar_path.'/'.$filename.'/pollbg.gif');
146
+ if($pollbar['style'] == $filename) {
147
+ echo '<input type="radio" id="poll_bar_style-'.$filename.'" name="poll_bar_style" value="'.$filename.'" checked="checked" onclick="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />';
148
+ } else {
149
+ echo '<input type="radio" id="poll_bar_style-'.$filename.'" name="poll_bar_style" value="'.$filename.'" onclick="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />';
150
+ }
151
+ echo '<label for="poll_bar_style-'.$filename.'">&nbsp;&nbsp;&nbsp;';
152
+ echo '<img src="'.$pollbar_url.'/'.$filename.'/pollbg.gif" height="'.$pollbar_info[1].'" width="100" alt="pollbg.gif" />';
153
+ echo '&nbsp;&nbsp;&nbsp;('.$filename.')</label>';
154
+ echo '</p>'."\n";
155
+ }
156
+ }
157
+ }
158
+ closedir($handle);
159
+ }
160
+ ?>
161
+ <input type="radio" id="poll_bar_style-use_css" name="poll_bar_style" value="use_css"<?php checked('use_css', $pollbar['style']); ?> onclick="update_pollbar('style');" /><label for="poll_bar_style-use_css"> <?php _e('Use CSS Style', 'wp-polls'); ?></label>
162
+ </td>
163
+ </tr>
164
+ <tr>
165
+ <th scope="row" valign="top"><?php _e('Poll Bar Background', 'wp-polls'); ?></th>
166
+ <td width="10%" dir="ltr">#<input type="text" id="poll_bar_bg" name="poll_bar_bg" value="<?php echo $pollbar['background']; ?>" size="6" maxlength="6" onblur="update_pollbar('background');" /></td>
167
+ <td><div id="wp-polls-pollbar-bg" style="background-color: #<?php echo $pollbar['background']; ?>;"></div></td>
168
+ </tr>
169
+ <tr>
170
+ <th scope="row" valign="top"><?php _e('Poll Bar Border', 'wp-polls'); ?></th>
171
+ <td width="10%" dir="ltr">#<input type="text" id="poll_bar_border" name="poll_bar_border" value="<?php echo $pollbar['border']; ?>" size="6" maxlength="6" onblur="update_pollbar('border');" /></td>
172
+ <td><div id="wp-polls-pollbar-border" style="background-color: #<?php echo $pollbar['border']; ?>;"></div></td>
173
+ </tr>
174
+ <tr>
175
+ <th scope="row" valign="top"><?php _e('Poll Bar Height', 'wp-polls'); ?></th>
176
+ <td colspan="2" dir="ltr"><input type="text" id="poll_bar_height" name="poll_bar_height" value="<?php echo $pollbar['height']; ?>" size="2" maxlength="2" onblur="update_pollbar('height');" />px</td>
177
+ </tr>
178
+ <tr>
179
+ <th scope="row" valign="top"><?php _e('Your poll bar will look like this', 'wp-polls'); ?></th>
180
+ <td colspan="2">
181
+ <?php
182
+ if($pollbar['style'] == 'use_css') {
183
+ echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'"></div>'."\n";
184
+ } else {
185
+ echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'; background-image: url(\''.plugins_url('wp-polls/images/'.$pollbar['style'].'/pollbg.gif').'\');"></div>'."\n";
186
+ }
187
+ ?>
188
+ </td>
189
+ </tr>
190
+ </table>
191
+
192
+ <!-- Polls AJAX Style -->
193
+ <?php $poll_ajax_style = get_option('poll_ajax_style'); ?>
194
+ <h3><?php _e('Polls AJAX Style', 'wp-polls'); ?></h3>
195
+ <table class="form-table">
196
+ <tr>
197
+ <th scope="row" valign="top"><?php _e('Show Loading Image With Text', 'wp-polls'); ?></th>
198
+ <td>
199
+ <select name="poll_ajax_style_loading" size="1">
200
+ <option value="0"<?php selected('0', $poll_ajax_style['loading']); ?>><?php _e('No', 'wp-polls'); ?></option>
201
+ <option value="1"<?php selected('1', $poll_ajax_style['loading']); ?>><?php _e('Yes', 'wp-polls'); ?></option>
202
+ </select>
203
+ </td>
204
+ </tr>
205
+ <tr>
206
+ <th scope="row" valign="top"><?php _e('Show Fading In And Fading Out Of Poll', 'wp-polls'); ?></th>
207
+ <td>
208
+ <select name="poll_ajax_style_fading" size="1">
209
+ <option value="0"<?php selected('0', $poll_ajax_style['fading']); ?>><?php _e('No', 'wp-polls'); ?></option>
210
+ <option value="1"<?php selected('1', $poll_ajax_style['fading']); ?>><?php _e('Yes', 'wp-polls'); ?></option>
211
+ </select>
212
+ </td>
213
+ </tr>
214
+ </table>
215
+
216
+ <!-- Sorting Of Poll Answers -->
217
+ <h3><?php _e('Sorting Of Poll Answers', 'wp-polls'); ?></h3>
218
+ <table class="form-table">
219
+ <tr>
220
+ <th scope="row" valign="top"><?php _e('Sort Poll Answers By:', 'wp-polls'); ?></th>
221
+ <td>
222
+ <select name="poll_ans_sortby" size="1">
223
+ <option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>
224
+ <option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>
225
+ <option value="RAND()"<?php selected('RAND()', get_option('poll_ans_sortby')); ?>><?php _e('Random Order', 'wp-polls'); ?></option>
226
+ </select>
227
+ </td>
228
+ </tr>
229
+ <tr>
230
+ <th scope="row" valign="top"><?php _e('Sort Order Of Poll Answers:', 'wp-polls'); ?></th>
231
+ <td>
232
+ <select name="poll_ans_sortorder" size="1">
233
+ <option value="asc"<?php selected('asc', get_option('poll_ans_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>
234
+ <option value="desc"<?php selected('desc', get_option('poll_ans_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>
235
+ </select>
236
+ </td>
237
+ </tr>
238
+ </table>
239
+
240
+ <!-- Sorting Of Poll Results -->
241
+ <h3><?php _e('Sorting Of Poll Results', 'wp-polls'); ?></h3>
242
+ <table class="form-table">
243
+ <tr>
244
+ <th scope="row" valign="top"><?php _e('Sort Poll Results By:', 'wp-polls'); ?></th>
245
+ <td>
246
+ <select name="poll_ans_result_sortby" size="1">
247
+ <option value="polla_votes"<?php selected('polla_votes', get_option('poll_ans_result_sortby')); ?>><?php _e('Votes Cast', 'wp-polls'); ?></option>
248
+ <option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_result_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>
249
+ <option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_result_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>
250
+ <option value="RAND()"<?php selected('RAND()', get_option('poll_ans_result_sortby')); ?>><?php _e('Random Order', 'wp-polls'); ?></option>
251
+ </select>
252
+ </td>
253
+ </tr>
254
+ <tr>
255
+ <th scope="row" valign="top"><?php _e('Sort Order Of Poll Results:', 'wp-polls'); ?></th>
256
+ <td>
257
+ <select name="poll_ans_result_sortorder" size="1">
258
+ <option value="asc"<?php selected('asc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>
259
+ <option value="desc"<?php selected('desc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>
260
+ </select>
261
+ </td>
262
+ </tr>
263
+ </table>
264
+
265
+ <!-- Allow To Vote -->
266
+ <h3><?php _e('Allow To Vote', 'wp-polls'); ?></h3>
267
+ <table class="form-table">
268
+ <tr>
269
+ <th scope="row" valign="top"><?php _e('Who Is Allowed To Vote?', 'wp-polls'); ?></th>
270
+ <td>
271
+ <select name="poll_allowtovote" size="1">
272
+ <option value="0"<?php selected('0', get_option('poll_allowtovote')); ?>><?php _e('Guests Only', 'wp-polls'); ?></option>
273
+ <option value="1"<?php selected('1', get_option('poll_allowtovote')); ?>><?php _e('Registered Users Only', 'wp-polls'); ?></option>
274
+ <option value="2"<?php selected('2', get_option('poll_allowtovote')); ?>><?php _e('Registered Users And Guests', 'wp-polls'); ?></option>
275
+ </select>
276
+ </td>
277
+ </tr>
278
+ </table>
279
+
280
+ <!-- Logging Method -->
281
+ <h3><?php _e('Logging Method', 'wp-polls'); ?></h3>
282
+ <table class="form-table">
283
+ <tr valign="top">
284
+ <th scope="row" valign="top"><?php _e('Poll Logging Method:', 'wp-polls'); ?></th>
285
+ <td>
286
+ <select name="poll_logging_method" size="1">
287
+ <option value="0"<?php selected('0', get_option('poll_logging_method')); ?>><?php _e('Do Not Log', 'wp-polls'); ?></option>
288
+ <option value="1"<?php selected('1', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie', 'wp-polls'); ?></option>
289
+ <option value="2"<?php selected('2', get_option('poll_logging_method')); ?>><?php _e('Logged By IP', 'wp-polls'); ?></option>
290
+ <option value="3"<?php selected('3', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie And IP', 'wp-polls'); ?></option>
291
+ <option value="4"<?php selected('4', get_option('poll_logging_method')); ?>><?php _e('Logged By Username', 'wp-polls'); ?></option>
292
+ </select>
293
+ </td>
294
+ </tr>
295
+ <tr>
296
+ <th scope="row" valign="top"><?php _e('Expiry Time For Cookie And Log:', 'wp-polls'); ?></th>
297
+ <td><input type="text" name="poll_cookielog_expiry" value="<?php echo intval(get_option('poll_cookielog_expiry')); ?>" size="10" /> <?php _e('seconds (0 to disable)', 'wp-polls'); ?></td>
298
+ </tr>
299
+ </table>
300
+
301
+ <!-- Poll Archive -->
302
+ <h3><?php _e('Poll Archive', 'wp-polls'); ?></h3>
303
+ <table class="form-table">
304
+ <tr>
305
+ <th scope="row" valign="top"><?php _e('Number Of Polls Per Page:', 'wp-polls'); ?></th>
306
+ <td><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_option('poll_archive_perpage')); ?>" size="2" /></td>
307
+ </tr>
308
+ <tr>
309
+ <th scope="row" valign="top"><?php _e('Type Of Polls To Display In Poll Archive:', 'wp-polls'); ?></th>
310
+ <td>
311
+ <select name="poll_archive_displaypoll" size="1">
312
+ <option value="1"<?php selected('1', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed Polls Only', 'wp-polls'); ?></option>
313
+ <option value="2"<?php selected('2', get_option('poll_archive_displaypoll')); ?>><?php _e('Opened Polls Only', 'wp-polls'); ?></option>
314
+ <option value="3"<?php selected('3', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed And Opened Polls', 'wp-polls'); ?></option>
315
+ </select>
316
+ </td>
317
+ </tr>
318
+ <tr>
319
+ <th scope="row" valign="top"><?php _e('Poll Archive URL:', 'wp-polls'); ?></th>
320
+ <td><input type="text" name="poll_archive_url" value="<?php echo get_option('poll_archive_url'); ?>" size="50" dir="ltr" /></td>
321
+ </tr>
322
+ <tr>
323
+ <th scope="row" valign="top"><?php _e('Display Poll Archive Link Below Poll?', 'wp-polls'); ?></th>
324
+ <td>
325
+ <select name="poll_archive_show" size="1">
326
+ <option value="0"<?php selected('0', get_option('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option>
327
+ <option value="1"<?php selected('1', get_option('poll_archive_show')); ?>><?php _e('Yes', 'wp-polls'); ?></option>
328
+ </select>
329
+ </td>
330
+ </tr>
331
+ <tr>
332
+ <th scope="row" valign="top"><?php _e('Note', 'wp-polls'); ?></th>
333
+ <td><em><?php _e('Only polls\' results will be shown in the Poll Archive regardless of whether the poll is closed or opened.', 'wp-polls'); ?></em></td>
334
+ </tr>
335
+ </table>
336
+
337
+ <!-- Current Active Poll -->
338
+ <h3><?php _e('Current Active Poll', 'wp-polls'); ?></h3>
339
+ <table class="form-table">
340
+ <tr>
341
+ <th scope="row" valign="top"><?php _e('Current Active Poll', 'wp-polls'); ?>:</th>
342
+ <td>
343
+ <select name="poll_currentpoll" size="1">
344
+ <option value="-1"<?php selected(-1, get_option('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
345
+ <option value="-2"<?php selected(-2, get_option('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
346
+ <option value="0"<?php selected(0, get_option('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
347
+ <optgroup>&nbsp;</optgroup>
348
+ <?php
349
+ $polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
350
+ if($polls) {
351
+ foreach($polls as $poll) {
352
+ $poll_question = stripslashes($poll->pollq_question);
353
+ $poll_id = intval($poll->pollq_id);
354
+ if($poll_id == intval(get_option('poll_currentpoll'))) {
355
+ echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n";
356
+ } else {
357
+ echo "<option value=\"$poll_id\">$poll_question</option>\n";
358
+ }
359
+ }
360
+ }
361
+ ?>
362
+ </select>
363
+ </td>
364
+ </tr>
365
+ <tr>
366
+ <th scope="row" valign="top"><?php _e('When Poll Is Closed', 'wp-polls'); ?>:</th>
367
+ <td>
368
+ <select name="poll_close" size="1">
369
+ <option value="1"<?php selected(1, get_option('poll_close')); ?>><?php _e('Display Poll\'s Results', 'wp-polls'); ?></option>
370
+ <option value="3"<?php selected(3, get_option('poll_close')); ?>><?php _e('Display Disabled Poll\'s Voting Form', 'wp-polls'); ?></option>
371
+ <option value="2"<?php selected(2, get_option('poll_close')); ?>><?php _e('Do Not Display Poll In Post/Sidebar', 'wp-polls'); ?></option>
372
+ </select>
373
+ </td>
374
+ </tr>
375
+ </table>
376
+
377
+ <!-- Submit Button -->
378
+ <p class="submit">
379
+ <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'wp-polls'); ?>" />
380
+ </p>
381
+ </div>
382
+ </form>
 
 
 
 
 
polls-templates.php CHANGED
@@ -1,496 +1,498 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Configure Poll Templates |
14
- | - wp-content/plugins/wp-polls/polls-templates.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Polls
21
- if(!current_user_can('manage_polls')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables Variables Variables
27
- $base_name = plugin_basename('wp-polls/polls-templates.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
- $id = intval($_GET['id']);
30
-
31
-
32
- ### If Form Is Submitted
33
- if($_POST['Submit']) {
34
- $poll_template_voteheader =trim($_POST['poll_template_voteheader']);
35
- $poll_template_votebody = trim($_POST['poll_template_votebody']);
36
- $poll_template_votefooter = trim($_POST['poll_template_votefooter']);
37
- $poll_template_resultheader = trim($_POST['poll_template_resultheader']);
38
- $poll_template_resultbody = trim($_POST['poll_template_resultbody']);
39
- $poll_template_resultbody2 = trim($_POST['poll_template_resultbody2']);
40
- $poll_template_resultfooter = trim($_POST['poll_template_resultfooter']);
41
- $poll_template_resultfooter2 = trim($_POST['poll_template_resultfooter2']);
42
- $poll_template_pollarchivelink = trim($_POST['poll_template_pollarchivelink']);
43
- $poll_template_pollarchiveheader = trim($_POST['poll_template_pollarchiveheader']);
44
- $poll_template_pollarchivefooter = trim($_POST['poll_template_pollarchivefooter']);
45
- $poll_template_pollarchivepagingheader = trim($_POST['poll_template_pollarchivepagingheader']);
46
- $poll_template_pollarchivepagingfooter = trim($_POST['poll_template_pollarchivepagingfooter']);
47
- $poll_template_disable = trim($_POST['poll_template_disable']);
48
- $poll_template_error = trim($_POST['poll_template_error']);
49
- $update_poll_queries = array();
50
- $update_poll_text = array();
51
- $update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
52
- $update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
53
- $update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
54
- $update_poll_queries[] = update_option('poll_template_resultheader', $poll_template_resultheader);
55
- $update_poll_queries[] = update_option('poll_template_resultbody', $poll_template_resultbody);
56
- $update_poll_queries[] = update_option('poll_template_resultbody2', $poll_template_resultbody2);
57
- $update_poll_queries[] = update_option('poll_template_resultfooter', $poll_template_resultfooter);
58
- $update_poll_queries[] = update_option('poll_template_resultfooter2', $poll_template_resultfooter2);
59
- $update_poll_queries[] = update_option('poll_template_pollarchivelink', $poll_template_pollarchivelink);
60
- $update_poll_queries[] = update_option('poll_template_pollarchiveheader', $poll_template_pollarchiveheader);
61
- $update_poll_queries[] = update_option('poll_template_pollarchivefooter', $poll_template_pollarchivefooter);
62
- $update_poll_queries[] = update_option('poll_template_pollarchivepagingheader', $poll_template_pollarchivepagingheader);
63
- $update_poll_queries[] = update_option('poll_template_pollarchivepagingfooter', $poll_template_pollarchivepagingfooter);
64
- $update_poll_queries[] = update_option('poll_template_disable', $poll_template_disable);
65
- $update_poll_queries[] = update_option('poll_template_error', $poll_template_error);
66
- $update_poll_text[] = __('Voting Form Header Template', 'wp-polls');
67
- $update_poll_text[] = __('Voting Form Body Template', 'wp-polls');
68
- $update_poll_text[] = __('Voting Form Footer Template', 'wp-polls');
69
- $update_poll_text[] = __('Result Header Template', 'wp-polls');
70
- $update_poll_text[] = __('Result Body Template', 'wp-polls');
71
- $update_poll_text[] = __('Result Body2 Template', 'wp-polls');
72
- $update_poll_text[] = __('Result Footer Template', 'wp-polls');
73
- $update_poll_text[] = __('Result Footer2 Template', 'wp-polls');
74
- $update_poll_text[] = __('Poll Archive Link Template', 'wp-polls');
75
- $update_poll_text[] = __('Poll Archive Poll Header Template', 'wp-polls');
76
- $update_poll_text[] = __('Poll Archive Poll Footer Template', 'wp-polls');
77
- $update_poll_text[] = __('Poll Archive Paging Header Template', 'wp-polls');
78
- $update_poll_text[] = __('Poll Archive Paging Footer Template', 'wp-polls');
79
- $update_poll_text[] = __('Poll Disabled Template', 'wp-polls');
80
- $update_poll_text[] = __('Poll Error Template', 'wp-polls');
81
- $i=0;
82
- $text = '';
83
- foreach($update_poll_queries as $update_poll_query) {
84
- if($update_poll_query) {
85
- $text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />';
86
- }
87
- $i++;
88
- }
89
- if(empty($text)) {
90
- $text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>';
91
- }
92
- wp_clear_scheduled_hook('polls_cron');
93
- if (!wp_next_scheduled('polls_cron')) {
94
- wp_schedule_event(time(), 'daily', 'polls_cron');
95
- }
96
- }
97
- ?>
98
- <script type="text/javascript">
99
- /* <![CDATA[*/
100
- function poll_default_templates(template) {
101
- var default_template;
102
- switch(template) {
103
- case "voteheader":
104
- default_template = "<p style=\"text-align: center;\"><strong>%POLL_QUESTION%</strong></p>\n<div id=\"polls-%POLL_ID%-ans\" class=\"wp-polls-ans\">\n<ul class=\"wp-polls-ul\">";
105
- break;
106
- case "votebody":
107
- default_template = "<li><input type=\"%POLL_CHECKBOX_RADIO%\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" /> <label for=\"poll-answer-%POLL_ANSWER_ID%\">%POLL_ANSWER%</label></li>";
108
- break;
109
- case "votefooter":
110
- default_template = "</ul>\n<p style=\"text-align: center;\"><input type=\"button\" name=\"vote\" value=\" <?php _e('Vote', 'wp-polls'); ?> \" class=\"Buttons\" onclick=\"poll_vote(%POLL_ID%);\" /></p>\n<p style=\"text-align: center;\"><a href=\"#ViewPollResults\" onclick=\"poll_result(%POLL_ID%); return false;\" title=\"<?php _e('View Results Of This Poll', 'wp-polls'); ?>\"><?php _e('View Results', 'wp-polls'); ?></a></p>\n</div>";
111
- break;
112
- case "resultheader":
113
- default_template = "<p style=\"text-align: center;\"><strong>%POLL_QUESTION%</strong></p>\n<div id=\"polls-%POLL_ID%-ans\" class=\"wp-polls-ans\">\n<ul class=\"wp-polls-ul\">";
114
- break;
115
- case "resultbody":
116
- default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'wp-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
117
- break;
118
- case "resultbody2":
119
- default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'wp-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'wp-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
120
- break;
121
- case "resultfooter":
122
- default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n</div>";
123
- break;
124
- case "resultfooter2":
125
- default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n<p style=\"text-align: center;\"><a href=\"#VotePoll\" onclick=\"poll_booth(%POLL_ID%); return false;\" title=\"<?php _e('Vote For This Poll', 'wp-polls'); ?>\"><?php _e('Vote', 'wp-polls'); ?></a></p>\n</div>";
126
- break;
127
- case "pollarchivelink":
128
- default_template = "<ul>\n<li><a href=\"%POLL_ARCHIVE_URL%\"><?php _e('Polls Archive', 'wp-polls'); ?></a></li>\n</ul>";
129
- break;
130
- case "pollarchiveheader":
131
- default_template = "";
132
- break;
133
- case "pollarchivefooter":
134
- default_template = "<p><?php _e('Start Date:', 'wp-polls'); ?> %POLL_START_DATE%<br /><?php _e('End Date:', 'wp-polls'); ?> %POLL_END_DATE%</p>";
135
- break;
136
- case "pollarchivepagingheader":
137
- default_template = "";
138
- break;
139
- case "pollarchivepagingfooter":
140
- default_template = "";
141
- break;
142
- case "disable":
143
- default_template = "<?php _e('Sorry, there are no polls available at the moment.', 'wp-polls'); ?>";
144
- break;
145
- case "error":
146
- default_template = "<?php _e('An error has occurred when processing your poll.', 'wp-polls'); ?>";
147
- break;
148
- }
149
- jQuery("#poll_template_" + template).val(default_template);
150
- }
151
- /* ]]> */
152
- </script>
153
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
154
- <form id="poll_template_form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
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">
161
- <tr>
162
- <td>
163
- <strong>%POLL_ID%</strong><br />
164
- <?php _e('Display the poll\'s ID', 'wp-polls'); ?>
165
- </td>
166
- <td>
167
- <strong>%POLL_ANSWER_ID%</strong><br />
168
- <?php _e('Display the poll\'s answer ID', 'wp-polls'); ?>
169
- </td>
170
- </tr>
171
- <tr class="alternate">
172
- <td>
173
- <strong>%POLL_QUESTION%</strong><br />
174
- <?php _e('Display the poll\'s question', 'wp-polls'); ?>
175
- </td>
176
- <td>
177
- <strong>%POLL_ANSWER%</strong><br />
178
- <?php _e('Display the poll\'s answer', 'wp-polls'); ?>
179
- </td>
180
- </tr>
181
- <tr>
182
- <td>
183
- <strong>%POLL_TOTALVOTES%</strong><br />
184
- <?php _e('Display the poll\'s total votes NOT the number of people who voted for the poll', 'wp-polls'); ?>
185
- </td>
186
- <td>
187
- <strong>%POLL_ANSWER_TEXT%</strong><br />
188
- <?php _e('Display the poll\'s answer without HTML formatting.', 'wp-polls'); ?>
189
- </td>
190
- </tr>
191
- <tr class="alternate">
192
- <td>
193
- <strong>%POLL_RESULT_URL%</strong><br />
194
- <?php _e('Displays URL to poll\'s result', 'wp-polls'); ?>
195
- </td>
196
- <td>
197
- <strong>%POLL_ANSWER_VOTES%</strong><br />
198
- <?php _e('Display the poll\'s answer votes', 'wp-polls'); ?>
199
- </td>
200
- </tr>
201
- <tr>
202
- <td>
203
- <strong>%POLL_MOST_ANSWER%</strong><br />
204
- <?php _e('Display the poll\'s most voted answer', 'wp-polls'); ?>
205
- </td>
206
- <td>
207
- <strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
208
- <?php _e('Display the poll\'s answer percentage', 'wp-polls'); ?>
209
- </td>
210
- </tr>
211
- <tr class="alternate">
212
- <td>
213
- <strong>%POLL_MOST_VOTES%</strong><br />
214
- <?php _e('Display the poll\'s answer votes for the most voted answer', 'wp-polls'); ?>
215
- </td>
216
- <td>
217
- <strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
218
- <?php _e('Display the poll\'s answer image width', 'wp-polls'); ?>
219
- </td>
220
- </tr>
221
- <tr>
222
- <td>
223
- <strong>%POLL_MOST_PERCENTAGE%</strong><br />
224
- <?php _e('Display the poll\'s answer percentage for the most voted answer', 'wp-polls'); ?>
225
- </td>
226
- <td>
227
- <strong>%POLL_LEAST_ANSWER%</strong><br />
228
- <?php _e('Display the poll\'s least voted answer', 'wp-polls'); ?>
229
- </td>
230
- </tr>
231
- <tr class="alternate">
232
- <td>
233
- <strong>%POLL_START_DATE%</strong><br />
234
- <?php _e('Display the poll\'s start date/time', 'wp-polls'); ?>
235
- </td>
236
- <td>
237
- <strong>%POLL_LEAST_VOTES%</strong><br />
238
- <?php _e('Display the poll\'s answer votes for the least voted answer', 'wp-polls'); ?>
239
- </td>
240
- </tr>
241
- <tr>
242
- <td>
243
- <strong>%POLL_END_DATE%</strong><br />
244
- <?php _e('Display the poll\'s end date/time', 'wp-polls'); ?>
245
- </td>
246
- <td>
247
- <strong>%POLL_LEAST_PERCENTAGE%</strong><br />
248
- <?php _e('Display the poll\'s answer percentage for the least voted answer', 'wp-polls'); ?>
249
- </td>
250
- </tr>
251
- <tr class="alternate">
252
- <td>
253
- <strong>%POLL_MULTIPLE_ANS_MAX%</strong><br />
254
- <?php _e('Display the the maximum number of answers the user can choose if the poll supports multiple answers', 'wp-polls'); ?>
255
- </td>
256
- <td>
257
- <strong>%POLL_CHECKBOX_RADIO%</strong><br />
258
- <?php _e('Display "checkbox" or "radio" input types depending on the poll type', 'wp-polls'); ?>
259
- </td>
260
- </tr>
261
- <tr>
262
- <td>
263
- <strong>%POLL_TOTALVOTERS%</strong><br />
264
- <?php _e('Display the number of people who voted for the poll NOT the total votes of the poll', 'wp-polls'); ?>
265
- </td>
266
- <td>
267
- <strong>%POLL_ARCHIVE_URL%</strong><br />
268
- <?php _e('Display the poll archive URL', 'wp-polls'); ?>
269
- </td>
270
- </tr>
271
- <tr class="alternate">
272
- <td colspan="2">
273
- <?php _e('Note: <strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</strong> will be different if your poll supports multiple answers. If your poll allows only single answer, both value will be the same.', 'wp-polls'); ?>
274
- </td>
275
- </tr>
276
- </table>
277
-
278
- <!-- Poll Voting Form Templates -->
279
- <h3><?php _e('Poll Voting Form Templates', 'wp-polls'); ?></h3>
280
- <table class="form-table">
281
- <tr>
282
- <td width="30%" valign="top">
283
- <strong><?php _e('Voting Form Header:', 'wp-polls'); ?></strong><br /><br /><br />
284
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
285
- <p style="margin: 2px 0">- %POLL_ID%</p>
286
- <p style="margin: 2px 0">- %POLL_QUESTION%</p>
287
- <p style="margin: 2px 0">- %POLL_START_DATE%</p>
288
- <p style="margin: 2px 0">- %POLL_END_DATE%</p>
289
- <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
290
- <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
291
- <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
292
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('voteheader');" class="button" />
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 />
300
- <p style="margin: 2px 0">- %POLL_ID%</p>
301
- <p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
302
- <p style="margin: 2px 0">- %POLL_ANSWER%</p>
303
- <p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
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 />
313
- <p style="margin: 2px 0">- %POLL_ID%</p>
314
- <p style="margin: 2px 0">- %POLL_RESULT_URL%</p>
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 />
328
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
329
- <p style="margin: 2px 0">- %POLL_ID%</p>
330
- <p style="margin: 2px 0">- %POLL_QUESTION%</p>
331
- <p style="margin: 2px 0">- %POLL_START_DATE%</p>
332
- <p style="margin: 2px 0">- %POLL_END_DATE%</p>
333
- <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
334
- <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
335
- <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
336
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultheader');" class="button" />
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 />
344
- <p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
345
- <p style="margin: 2px 0">- %POLL_ANSWER%</p>
346
- <p style="margin: 2px 0">- %POLL_ANSWER_TEXT%</p>
347
- <p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
348
- <p style="margin: 2px 0">- %POLL_ANSWER_PERCENTAGE%</p>
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 />
358
- <p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
359
- <p style="margin: 2px 0">- %POLL_ANSWER%</p>
360
- <p style="margin: 2px 0">- %POLL_ANSWER_TEXT%</p>
361
- <p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
362
- - %POLL_ANSWER_PERCENTAGE%</p>
363
- <p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
364
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody2');" class="button" />
365
- </td>
366
- <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>
367
- </tr>
368
- <tr>
369
- <td width="30%" valign="top">
370
- <strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
371
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
372
- <p style="margin: 2px 0">- %POLL_ID%</p>
373
- <p style="margin: 2px 0">- %POLL_START_DATE%</p>
374
- <p style="margin: 2px 0">- %POLL_END_DATE%</p>
375
- <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
376
- <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
377
- <p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
378
- <p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
379
- <p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
380
- <p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
381
- <p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
382
- <p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
383
- <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
384
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter');" class="button" />
385
- </td>
386
- <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>
387
- </tr>
388
- <tr>
389
- <td width="30%" valign="top">
390
- <strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
391
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
392
- <p style="margin: 2px 0">- %POLL_ID%</p>
393
- <p style="margin: 2px 0">- %POLL_START_DATE%</p>
394
- <p style="margin: 2px 0">- %POLL_END_DATE%</p>
395
- <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
396
- <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
397
- <p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
398
- <p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
399
- <p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
400
- <p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
401
- <p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
402
- <p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
403
- <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
404
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter2');" class="button" />
405
- </td>
406
- <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>
407
- </tr>
408
- </table>
409
-
410
- <!-- Poll Archive Templates -->
411
- <h3><?php _e('Poll Archive Templates', 'wp-polls'); ?></h3>
412
- <table class="form-table">
413
- <tr>
414
- <td width="30%" valign="top">
415
- <strong><?php _e('Poll Archive Link', 'wp-polls'); ?></strong><br /><?php _e('Template For Displaying Poll Archive Link', 'wp-polls'); ?><br /><br />
416
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
417
- <p style="margin: 2px 0">- %POLL_ARCHIVE_URL%</p><br />
418
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivelink');" class="button" />
419
- </td>
420
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivelink" name="poll_template_pollarchivelink"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivelink'))); ?></textarea></td>
421
- </tr>
422
- <tr>
423
- <td width="30%" valign="top">
424
- <strong><?php _e('Individual Poll Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
425
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
426
- <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
427
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchiveheader');" class="button" />
428
- </td>
429
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchiveheader" name="poll_template_pollarchiveheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchiveheader'))); ?></textarea></td>
430
- </tr>
431
- <tr>
432
- <td width="30%" valign="top">
433
- <strong><?php _e('Individual Poll Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
434
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
435
- <p style="margin: 2px 0">- %POLL_START_DATE%</p>
436
- <p style="margin: 2px 0">- %POLL_END_DATE%</p>
437
- <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
438
- <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
439
- <p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
440
- <p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
441
- <p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
442
- <p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
443
- <p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
444
- <p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
445
- <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
446
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivefooter');" class="button" />
447
- </td>
448
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivefooter" name="poll_template_pollarchivefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivefooter'))); ?></textarea></td>
449
- </tr>
450
- <tr>
451
- <td width="30%" valign="top">
452
- <strong><?php _e('Paging Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Paging In The Poll Archive', 'wp-polls'); ?><br /><br />
453
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
454
- <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
455
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivepagingheader');" class="button" />
456
- </td>
457
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivepagingheader" name="poll_template_pollarchivepagingheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivepagingheader'))); ?></textarea></td>
458
- </tr>
459
- <tr>
460
- <td width="30%" valign="top">
461
- <strong><?php _e('Paging Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Paging In The Poll Archive', 'wp-polls'); ?><br /><br />
462
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
463
- <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
464
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivepagingfooter');" class="button" />
465
- </td>
466
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivepagingfooter" name="poll_template_pollarchivepagingfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivepagingfooter'))); ?></textarea></td>
467
- </tr>
468
- </table>
469
-
470
- <!-- Poll Misc Templates -->
471
- <h3><?php _e('Poll Misc Templates', 'wp-polls'); ?></h3>
472
- <table class="form-table">
473
- <tr>
474
- <td width="30%" valign="top">
475
- <strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The Poll Is Disabled', 'wp-polls'); ?><br /><br />
476
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
477
- <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
478
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('disable');" class="button" />
479
- </td>
480
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_disable" name="poll_template_disable"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_disable'))); ?></textarea></td>
481
- </tr>
482
- <tr>
483
- <td width="30%" valign="top">
484
- <strong><?php _e('Poll Error', 'wp-polls'); ?></strong><br /><?php _e('Displayed When An Error Has Occured While Processing The Poll', 'wp-polls'); ?><br /><br />
485
- <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
486
- <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?><br /><br />
487
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('error');" class="button" />
488
- </td>
489
- <td valign="top"><textarea cols="80" rows="15" id="poll_template_error" name="poll_template_error"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_error'))); ?></textarea></td>
490
- </tr>
491
- </table>
492
- <p class="submit">
493
- <input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-polls'); ?>" />
494
- </p>
495
- </div>
 
 
496
  </form>
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress Plugin: WP-Polls |
6
+ | Copyright (c) 2012 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Configure Poll Templates |
14
+ | - wp-content/plugins/wp-polls/polls-templates.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Polls
21
+ if(!current_user_can('manage_polls')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+ ### Variables Variables Variables
26
+ $base_name = plugin_basename('wp-polls/polls-templates.php');
27
+ $base_page = 'admin.php?page='.$base_name;
28
+ $id = (isset($_GET['id']) ? intval($_GET['id']) : 0);
29
+
30
+ ### If Form Is Submitted
31
+ if( isset($_POST['Submit']) && $_POST['Submit'] ) {
32
+ check_admin_referer('wp-polls_templates');
33
+ $poll_template_voteheader = trim($_POST['poll_template_voteheader']);
34
+ $poll_template_votebody = trim($_POST['poll_template_votebody']);
35
+ $poll_template_votefooter = trim($_POST['poll_template_votefooter']);
36
+ $poll_template_resultheader = trim($_POST['poll_template_resultheader']);
37
+ $poll_template_resultbody = trim($_POST['poll_template_resultbody']);
38
+ $poll_template_resultbody2 = trim($_POST['poll_template_resultbody2']);
39
+ $poll_template_resultfooter = trim($_POST['poll_template_resultfooter']);
40
+ $poll_template_resultfooter2 = trim($_POST['poll_template_resultfooter2']);
41
+ $poll_template_pollarchivelink = trim($_POST['poll_template_pollarchivelink']);
42
+ $poll_template_pollarchiveheader = trim($_POST['poll_template_pollarchiveheader']);
43
+ $poll_template_pollarchivefooter = trim($_POST['poll_template_pollarchivefooter']);
44
+ $poll_template_pollarchivepagingheader = trim($_POST['poll_template_pollarchivepagingheader']);
45
+ $poll_template_pollarchivepagingfooter = trim($_POST['poll_template_pollarchivepagingfooter']);
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);
53
+ $update_poll_queries[] = update_option('poll_template_resultheader', $poll_template_resultheader);
54
+ $update_poll_queries[] = update_option('poll_template_resultbody', $poll_template_resultbody);
55
+ $update_poll_queries[] = update_option('poll_template_resultbody2', $poll_template_resultbody2);
56
+ $update_poll_queries[] = update_option('poll_template_resultfooter', $poll_template_resultfooter);
57
+ $update_poll_queries[] = update_option('poll_template_resultfooter2', $poll_template_resultfooter2);
58
+ $update_poll_queries[] = update_option('poll_template_pollarchivelink', $poll_template_pollarchivelink);
59
+ $update_poll_queries[] = update_option('poll_template_pollarchiveheader', $poll_template_pollarchiveheader);
60
+ $update_poll_queries[] = update_option('poll_template_pollarchivefooter', $poll_template_pollarchivefooter);
61
+ $update_poll_queries[] = update_option('poll_template_pollarchivepagingheader', $poll_template_pollarchivepagingheader);
62
+ $update_poll_queries[] = update_option('poll_template_pollarchivepagingfooter', $poll_template_pollarchivepagingfooter);
63
+ $update_poll_queries[] = update_option('poll_template_disable', $poll_template_disable);
64
+ $update_poll_queries[] = update_option('poll_template_error', $poll_template_error);
65
+ $update_poll_text[] = __('Voting Form Header Template', 'wp-polls');
66
+ $update_poll_text[] = __('Voting Form Body Template', 'wp-polls');
67
+ $update_poll_text[] = __('Voting Form Footer Template', 'wp-polls');
68
+ $update_poll_text[] = __('Result Header Template', 'wp-polls');
69
+ $update_poll_text[] = __('Result Body Template', 'wp-polls');
70
+ $update_poll_text[] = __('Result Body2 Template', 'wp-polls');
71
+ $update_poll_text[] = __('Result Footer Template', 'wp-polls');
72
+ $update_poll_text[] = __('Result Footer2 Template', 'wp-polls');
73
+ $update_poll_text[] = __('Poll Archive Link Template', 'wp-polls');
74
+ $update_poll_text[] = __('Poll Archive Poll Header Template', 'wp-polls');
75
+ $update_poll_text[] = __('Poll Archive Poll Footer Template', 'wp-polls');
76
+ $update_poll_text[] = __('Poll Archive Paging Header Template', 'wp-polls');
77
+ $update_poll_text[] = __('Poll Archive Paging Footer Template', 'wp-polls');
78
+ $update_poll_text[] = __('Poll Disabled Template', 'wp-polls');
79
+ $update_poll_text[] = __('Poll Error Template', 'wp-polls');
80
+ $i=0;
81
+ $text = '';
82
+ foreach($update_poll_queries as $update_poll_query) {
83
+ if($update_poll_query) {
84
+ $text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />';
85
+ }
86
+ $i++;
87
+ }
88
+ if(empty($text)) {
89
+ $text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>';
90
+ }
91
+ wp_clear_scheduled_hook('polls_cron');
92
+ if (!wp_next_scheduled('polls_cron')) {
93
+ wp_schedule_event(time(), 'daily', 'polls_cron');
94
+ }
95
+ }
96
+ ?>
97
+ <script type="text/javascript">
98
+ /* <![CDATA[*/
99
+ function poll_default_templates(template) {
100
+ var default_template;
101
+ switch(template) {
102
+ case "voteheader":
103
+ default_template = "<p style=\"text-align: center;\"><strong>%POLL_QUESTION%</strong></p>\n<div id=\"polls-%POLL_ID%-ans\" class=\"wp-polls-ans\">\n<ul class=\"wp-polls-ul\">";
104
+ break;
105
+ case "votebody":
106
+ default_template = "<li><input type=\"%POLL_CHECKBOX_RADIO%\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" /> <label for=\"poll-answer-%POLL_ANSWER_ID%\">%POLL_ANSWER%</label></li>";
107
+ break;
108
+ case "votefooter":
109
+ default_template = "</ul>\n<p style=\"text-align: center;\"><input type=\"button\" name=\"vote\" value=\" <?php _e('Vote', 'wp-polls'); ?> \" class=\"Buttons\" onclick=\"poll_vote(%POLL_ID%);\" /></p>\n<p style=\"text-align: center;\"><a href=\"#ViewPollResults\" onclick=\"poll_result(%POLL_ID%); return false;\" title=\"<?php _e('View Results Of This Poll', 'wp-polls'); ?>\"><?php _e('View Results', 'wp-polls'); ?></a></p>\n</div>";
110
+ break;
111
+ case "resultheader":
112
+ default_template = "<p style=\"text-align: center;\"><strong>%POLL_QUESTION%</strong></p>\n<div id=\"polls-%POLL_ID%-ans\" class=\"wp-polls-ans\">\n<ul class=\"wp-polls-ul\">";
113
+ break;
114
+ case "resultbody":
115
+ default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'wp-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
116
+ break;
117
+ case "resultbody2":
118
+ default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'wp-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'wp-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
119
+ break;
120
+ case "resultfooter":
121
+ default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n</div>";
122
+ break;
123
+ case "resultfooter2":
124
+ default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n<p style=\"text-align: center;\"><a href=\"#VotePoll\" onclick=\"poll_booth(%POLL_ID%); return false;\" title=\"<?php _e('Vote For This Poll', 'wp-polls'); ?>\"><?php _e('Vote', 'wp-polls'); ?></a></p>\n</div>";
125
+ break;
126
+ case "pollarchivelink":
127
+ default_template = "<ul>\n<li><a href=\"%POLL_ARCHIVE_URL%\"><?php _e('Polls Archive', 'wp-polls'); ?></a></li>\n</ul>";
128
+ break;
129
+ case "pollarchiveheader":
130
+ default_template = "";
131
+ break;
132
+ case "pollarchivefooter":
133
+ default_template = "<p><?php _e('Start Date:', 'wp-polls'); ?> %POLL_START_DATE%<br /><?php _e('End Date:', 'wp-polls'); ?> %POLL_END_DATE%</p>";
134
+ break;
135
+ case "pollarchivepagingheader":
136
+ default_template = "";
137
+ break;
138
+ case "pollarchivepagingfooter":
139
+ default_template = "";
140
+ break;
141
+ case "disable":
142
+ default_template = "<?php _e('Sorry, there are no polls available at the moment.', 'wp-polls'); ?>";
143
+ break;
144
+ case "error":
145
+ default_template = "<?php _e('An error has occurred when processing your poll.', 'wp-polls'); ?>";
146
+ break;
147
+ }
148
+ jQuery("#poll_template_" + template).val(default_template);
149
+ }
150
+ /* ]]> */
151
+ </script>
152
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
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">
161
+ <tr>
162
+ <td>
163
+ <strong>%POLL_ID%</strong><br />
164
+ <?php _e('Display the poll\'s ID', 'wp-polls'); ?>
165
+ </td>
166
+ <td>
167
+ <strong>%POLL_ANSWER_ID%</strong><br />
168
+ <?php _e('Display the poll\'s answer ID', 'wp-polls'); ?>
169
+ </td>
170
+ </tr>
171
+ <tr class="alternate">
172
+ <td>
173
+ <strong>%POLL_QUESTION%</strong><br />
174
+ <?php _e('Display the poll\'s question', 'wp-polls'); ?>
175
+ </td>
176
+ <td>
177
+ <strong>%POLL_ANSWER%</strong><br />
178
+ <?php _e('Display the poll\'s answer', 'wp-polls'); ?>
179
+ </td>
180
+ </tr>
181
+ <tr>
182
+ <td>
183
+ <strong>%POLL_TOTALVOTES%</strong><br />
184
+ <?php _e('Display the poll\'s total votes NOT the number of people who voted for the poll', 'wp-polls'); ?>
185
+ </td>
186
+ <td>
187
+ <strong>%POLL_ANSWER_TEXT%</strong><br />
188
+ <?php _e('Display the poll\'s answer without HTML formatting.', 'wp-polls'); ?>
189
+ </td>
190
+ </tr>
191
+ <tr class="alternate">
192
+ <td>
193
+ <strong>%POLL_RESULT_URL%</strong><br />
194
+ <?php _e('Displays URL to poll\'s result', 'wp-polls'); ?>
195
+ </td>
196
+ <td>
197
+ <strong>%POLL_ANSWER_VOTES%</strong><br />
198
+ <?php _e('Display the poll\'s answer votes', 'wp-polls'); ?>
199
+ </td>
200
+ </tr>
201
+ <tr>
202
+ <td>
203
+ <strong>%POLL_MOST_ANSWER%</strong><br />
204
+ <?php _e('Display the poll\'s most voted answer', 'wp-polls'); ?>
205
+ </td>
206
+ <td>
207
+ <strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
208
+ <?php _e('Display the poll\'s answer percentage', 'wp-polls'); ?>
209
+ </td>
210
+ </tr>
211
+ <tr class="alternate">
212
+ <td>
213
+ <strong>%POLL_MOST_VOTES%</strong><br />
214
+ <?php _e('Display the poll\'s answer votes for the most voted answer', 'wp-polls'); ?>
215
+ </td>
216
+ <td>
217
+ <strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
218
+ <?php _e('Display the poll\'s answer image width', 'wp-polls'); ?>
219
+ </td>
220
+ </tr>
221
+ <tr>
222
+ <td>
223
+ <strong>%POLL_MOST_PERCENTAGE%</strong><br />
224
+ <?php _e('Display the poll\'s answer percentage for the most voted answer', 'wp-polls'); ?>
225
+ </td>
226
+ <td>
227
+ <strong>%POLL_LEAST_ANSWER%</strong><br />
228
+ <?php _e('Display the poll\'s least voted answer', 'wp-polls'); ?>
229
+ </td>
230
+ </tr>
231
+ <tr class="alternate">
232
+ <td>
233
+ <strong>%POLL_START_DATE%</strong><br />
234
+ <?php _e('Display the poll\'s start date/time', 'wp-polls'); ?>
235
+ </td>
236
+ <td>
237
+ <strong>%POLL_LEAST_VOTES%</strong><br />
238
+ <?php _e('Display the poll\'s answer votes for the least voted answer', 'wp-polls'); ?>
239
+ </td>
240
+ </tr>
241
+ <tr>
242
+ <td>
243
+ <strong>%POLL_END_DATE%</strong><br />
244
+ <?php _e('Display the poll\'s end date/time', 'wp-polls'); ?>
245
+ </td>
246
+ <td>
247
+ <strong>%POLL_LEAST_PERCENTAGE%</strong><br />
248
+ <?php _e('Display the poll\'s answer percentage for the least voted answer', 'wp-polls'); ?>
249
+ </td>
250
+ </tr>
251
+ <tr class="alternate">
252
+ <td>
253
+ <strong>%POLL_MULTIPLE_ANS_MAX%</strong><br />
254
+ <?php _e('Display the the maximum number of answers the user can choose if the poll supports multiple answers', 'wp-polls'); ?>
255
+ </td>
256
+ <td>
257
+ <strong>%POLL_CHECKBOX_RADIO%</strong><br />
258
+ <?php _e('Display "checkbox" or "radio" input types depending on the poll type', 'wp-polls'); ?>
259
+ </td>
260
+ </tr>
261
+ <tr>
262
+ <td>
263
+ <strong>%POLL_TOTALVOTERS%</strong><br />
264
+ <?php _e('Display the number of people who voted for the poll NOT the total votes of the poll', 'wp-polls'); ?>
265
+ </td>
266
+ <td>
267
+ <strong>%POLL_ARCHIVE_URL%</strong><br />
268
+ <?php _e('Display the poll archive URL', 'wp-polls'); ?>
269
+ </td>
270
+ </tr>
271
+ <tr class="alternate">
272
+ <td colspan="2">
273
+ <?php _e('Note: <strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</strong> will be different if your poll supports multiple answers. If your poll allows only single answer, both value will be the same.', 'wp-polls'); ?>
274
+ </td>
275
+ </tr>
276
+ </table>
277
+
278
+ <!-- Poll Voting Form Templates -->
279
+ <h3><?php _e('Poll Voting Form Templates', 'wp-polls'); ?></h3>
280
+ <table class="form-table">
281
+ <tr>
282
+ <td width="30%" valign="top">
283
+ <strong><?php _e('Voting Form Header:', 'wp-polls'); ?></strong><br /><br /><br />
284
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
285
+ <p style="margin: 2px 0">- %POLL_ID%</p>
286
+ <p style="margin: 2px 0">- %POLL_QUESTION%</p>
287
+ <p style="margin: 2px 0">- %POLL_START_DATE%</p>
288
+ <p style="margin: 2px 0">- %POLL_END_DATE%</p>
289
+ <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
290
+ <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
291
+ <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
292
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('voteheader');" class="button" />
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 />
300
+ <p style="margin: 2px 0">- %POLL_ID%</p>
301
+ <p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
302
+ <p style="margin: 2px 0">- %POLL_ANSWER%</p>
303
+ <p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
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 />
313
+ <p style="margin: 2px 0">- %POLL_ID%</p>
314
+ <p style="margin: 2px 0">- %POLL_RESULT_URL%</p>
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 />
328
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
329
+ <p style="margin: 2px 0">- %POLL_ID%</p>
330
+ <p style="margin: 2px 0">- %POLL_QUESTION%</p>
331
+ <p style="margin: 2px 0">- %POLL_START_DATE%</p>
332
+ <p style="margin: 2px 0">- %POLL_END_DATE%</p>
333
+ <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
334
+ <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
335
+ <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
336
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultheader');" class="button" />
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 />
344
+ <p style="margin: 2px 0">- %POLL_ID%</p>
345
+ <p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
346
+ <p style="margin: 2px 0">- %POLL_ANSWER%</p>
347
+ <p style="margin: 2px 0">- %POLL_ANSWER_TEXT%</p>
348
+ <p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
349
+ <p style="margin: 2px 0">- %POLL_ANSWER_PERCENTAGE%</p>
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 />
359
+ <p style="margin: 2px 0">- %POLL_ID%</p>
360
+ <p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
361
+ <p style="margin: 2px 0">- %POLL_ANSWER%</p>
362
+ <p style="margin: 2px 0">- %POLL_ANSWER_TEXT%</p>
363
+ <p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
364
+ - %POLL_ANSWER_PERCENTAGE%</p>
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 />
374
+ <p style="margin: 2px 0">- %POLL_ID%</p>
375
+ <p style="margin: 2px 0">- %POLL_START_DATE%</p>
376
+ <p style="margin: 2px 0">- %POLL_END_DATE%</p>
377
+ <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
378
+ <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
379
+ <p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
380
+ <p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
381
+ <p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
382
+ <p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
383
+ <p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
384
+ <p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
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 />
394
+ <p style="margin: 2px 0">- %POLL_ID%</p>
395
+ <p style="margin: 2px 0">- %POLL_START_DATE%</p>
396
+ <p style="margin: 2px 0">- %POLL_END_DATE%</p>
397
+ <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
398
+ <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
399
+ <p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
400
+ <p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
401
+ <p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
402
+ <p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
403
+ <p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
404
+ <p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
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 />
418
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
419
+ <p style="margin: 2px 0">- %POLL_ARCHIVE_URL%</p><br />
420
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivelink');" class="button" />
421
+ </td>
422
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivelink" name="poll_template_pollarchivelink"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivelink'))); ?></textarea></td>
423
+ </tr>
424
+ <tr>
425
+ <td width="30%" valign="top">
426
+ <strong><?php _e('Individual Poll Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
427
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
428
+ <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
429
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchiveheader');" class="button" />
430
+ </td>
431
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchiveheader" name="poll_template_pollarchiveheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchiveheader'))); ?></textarea></td>
432
+ </tr>
433
+ <tr>
434
+ <td width="30%" valign="top">
435
+ <strong><?php _e('Individual Poll Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
436
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
437
+ <p style="margin: 2px 0">- %POLL_START_DATE%</p>
438
+ <p style="margin: 2px 0">- %POLL_END_DATE%</p>
439
+ <p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
440
+ <p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
441
+ <p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
442
+ <p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
443
+ <p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
444
+ <p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
445
+ <p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
446
+ <p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
447
+ <p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
448
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivefooter');" class="button" />
449
+ </td>
450
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivefooter" name="poll_template_pollarchivefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivefooter'))); ?></textarea></td>
451
+ </tr>
452
+ <tr>
453
+ <td width="30%" valign="top">
454
+ <strong><?php _e('Paging Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Paging In The Poll Archive', 'wp-polls'); ?><br /><br />
455
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
456
+ <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
457
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivepagingheader');" class="button" />
458
+ </td>
459
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivepagingheader" name="poll_template_pollarchivepagingheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivepagingheader'))); ?></textarea></td>
460
+ </tr>
461
+ <tr>
462
+ <td width="30%" valign="top">
463
+ <strong><?php _e('Paging Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Paging In The Poll Archive', 'wp-polls'); ?><br /><br />
464
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
465
+ <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
466
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivepagingfooter');" class="button" />
467
+ </td>
468
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivepagingfooter" name="poll_template_pollarchivepagingfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivepagingfooter'))); ?></textarea></td>
469
+ </tr>
470
+ </table>
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 />
478
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
479
+ <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
480
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('disable');" class="button" />
481
+ </td>
482
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_disable" name="poll_template_disable"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_disable'))); ?></textarea></td>
483
+ </tr>
484
+ <tr>
485
+ <td width="30%" valign="top">
486
+ <strong><?php _e('Poll Error', 'wp-polls'); ?></strong><br /><?php _e('Displayed When An Error Has Occured While Processing The Poll', 'wp-polls'); ?><br /><br />
487
+ <?php _e('Allowed Variables:', 'wp-polls'); ?><br />
488
+ <p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?><br /><br />
489
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('error');" class="button" />
490
+ </td>
491
+ <td valign="top"><textarea cols="80" rows="15" id="poll_template_error" name="poll_template_error"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_error'))); ?></textarea></td>
492
+ </tr>
493
+ </table>
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>
polls-uninstall.php CHANGED
@@ -1,141 +1,135 @@
1
- <?php
2
- /*
3
- +----------------------------------------------------------------+
4
- | |
5
- | WordPress 2.8 Plugin: WP-Polls 2.50 |
6
- | Copyright (c) 2009 Lester "GaMerZ" Chan |
7
- | |
8
- | File Written By: |
9
- | - Lester "GaMerZ" Chan |
10
- | - http://lesterchan.net |
11
- | |
12
- | File Information: |
13
- | - Uninstall WP-Polls |
14
- | - wp-content/plugins/wp-polls/polls-uninstall.php |
15
- | |
16
- +----------------------------------------------------------------+
17
- */
18
-
19
-
20
- ### Check Whether User Can Manage Polls
21
- if(!current_user_can('manage_polls')) {
22
- die('Access Denied');
23
- }
24
-
25
-
26
- ### Variables Variables Variables
27
- $base_name = plugin_basename('wp-polls/polls-manager.php');
28
- $base_page = 'admin.php?page='.$base_name;
29
- $mode = trim($_GET['mode']);
30
- $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']) {
38
- // Uninstall WP-Polls (By: Philippe Corbes)
39
- case __('UNINSTALL WP-Polls', 'wp-polls') :
40
- if(trim($_POST['uninstall_poll_yes']) == 'yes') {
41
- echo '<div id="message" class="updated fade">';
42
- echo '<p>';
43
- foreach($polls_tables as $table) {
44
- $wpdb->query("DROP TABLE {$table}");
45
- echo '<font style="color: green;">';
46
- printf(__('Table \'%s\' has been deleted.', 'wp-polls'), "<strong><em>{$table}</em></strong>");
47
- echo '</font><br />';
48
- }
49
- echo '</p>';
50
- echo '<p>';
51
- foreach($polls_settings as $setting) {
52
- $delete_setting = delete_option($setting);
53
- if($delete_setting) {
54
- echo '<font color="green">';
55
- printf(__('Setting Key \'%s\' has been deleted.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
56
- echo '</font><br />';
57
- } else {
58
- echo '<font color="red">';
59
- printf(__('Error deleting Setting Key \'%s\' or Setting Key \'%s\' does not exist.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
60
- echo '</font><br />';
61
- }
62
- }
63
- echo '</p>';
64
- echo '</div>';
65
- $mode = 'end-UNINSTALL';
66
- }
67
- break;
68
- }
69
- }
70
-
71
-
72
- ### Determines Which Mode It Is
73
- switch($mode) {
74
- // Deactivating WP-Polls (By: Philippe Corbes)
75
- case 'end-UNINSTALL':
76
- $deactivate_url = 'plugins.php?action=deactivate&amp;plugin=wp-polls/wp-polls.php';
77
- if(function_exists('wp_nonce_url')) {
78
- $deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_wp-polls/wp-polls.php');
79
- }
80
- echo '<div class="wrap">';
81
- echo '<div id="icon-wp-polls" class="icon32"><br /></div>';
82
- echo '<h2>'.__('Uninstall WP-Polls', 'wp-polls').'</h2>';
83
- 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>';
84
- echo '</div>';
85
- break;
86
- // Main Page
87
- default:
88
- ?>
89
- <!-- Uninstall WP-Polls (By: Philippe Corbes) -->
90
- <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
91
- <div class="wrap">
92
- <div id="icon-wp-polls" class="icon32"><br /></div>
93
- <h2><?php _e('Uninstall WP-Polls', 'wp-polls'); ?></h2>
94
- <p>
95
- <?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'); ?>
96
- </p>
97
- <p style="color: red">
98
- <strong><?php _e('WARNING:', 'wp-polls'); ?></strong><br />
99
- <?php _e('Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.', 'wp-polls'); ?>
100
- </p>
101
- <p style="color: red">
102
- <strong><?php _e('The following WordPress Options/Tables will be DELETED:', 'wp-polls'); ?></strong><br />
103
- </p>
104
- <table class="widefat">
105
- <thead>
106
- <tr>
107
- <th><?php _e('WordPress Options', 'wp-polls'); ?></th>
108
- <th><?php _e('WordPress Tables', 'wp-polls'); ?></th>
109
- </tr>
110
- </thead>
111
- <tr>
112
- <td valign="top">
113
- <ol>
114
- <?php
115
- foreach($polls_settings as $settings) {
116
- echo '<li>'.$settings.'</li>'."\n";
117
- }
118
- ?>
119
- </ol>
120
- </td>
121
- <td valign="top" class="alternate">
122
- <ol>
123
- <?php
124
- foreach($polls_tables as $tables) {
125
- echo '<li>'.$tables.'</li>'."\n";
126
- }
127
- ?>
128
- </ol>
129
- </td>
130
- </tr>
131
- </table>
132
- <p style="text-align: center;">
133
- <?php _e('Do you really want to uninstall WP-Polls?', 'wp-polls'); ?><br /><br />
134
- <input type="checkbox" name="uninstall_poll_yes" value="yes" />&nbsp;<?php _e('Yes', 'wp-polls'); ?><br /><br />
135
- <input type="submit" name="do" value="<?php _e('UNINSTALL WP-Polls', 'wp-polls'); ?>" class="button" onclick="return confirm('<?php _e('You Are About To Uninstall WP-Polls From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.', 'wp-polls'); ?>')" />
136
- </p>
137
- </div>
138
- </form>
139
- <?php
140
- } // End switch($mode)
141
- ?>
1
+ <?php
2
+ /*
3
+ +----------------------------------------------------------------+
4
+ | |
5
+ | WordPress Plugin: WP-Polls |
6
+ | Copyright (c) 2012 Lester "GaMerZ" Chan |
7
+ | |
8
+ | File Written By: |
9
+ | - Lester "GaMerZ" Chan |
10
+ | - http://lesterchan.net |
11
+ | |
12
+ | File Information: |
13
+ | - Uninstall WP-Polls |
14
+ | - wp-content/plugins/wp-polls/polls-uninstall.php |
15
+ | |
16
+ +----------------------------------------------------------------+
17
+ */
18
+
19
+
20
+ ### Check Whether User Can Manage Polls
21
+ if(!current_user_can('manage_polls')) {
22
+ die('Access Denied');
23
+ }
24
+
25
+
26
+ ### Variables Variables Variables
27
+ $base_name = plugin_basename('wp-polls/polls-manager.php');
28
+ $base_page = 'admin.php?page='.$base_name;
29
+ $mode = (isset($_GET['mode']) ? trim($_GET['mode']) : '');
30
+ $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']) {
38
+ // Uninstall WP-Polls (By: Philippe Corbes)
39
+ case __('UNINSTALL WP-Polls', 'wp-polls') :
40
+ check_admin_referer('wp-polls_uninstall');
41
+ if(trim($_POST['uninstall_poll_yes']) == 'yes') {
42
+ echo '<div id="message" class="updated fade">';
43
+ echo '<p>';
44
+ foreach($polls_tables as $table) {
45
+ $wpdb->query("DROP TABLE {$table}");
46
+ echo '<font style="color: green;">';
47
+ printf(__('Table \'%s\' has been deleted.', 'wp-polls'), "<strong><em>{$table}</em></strong>");
48
+ echo '</font><br />';
49
+ }
50
+ echo '</p>';
51
+ echo '<p>';
52
+ foreach($polls_settings as $setting) {
53
+ $delete_setting = delete_option($setting);
54
+ if($delete_setting) {
55
+ echo '<font color="green">';
56
+ printf(__('Setting Key \'%s\' has been deleted.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
57
+ echo '</font><br />';
58
+ }
59
+ }
60
+ echo '</p>';
61
+ echo '</div>';
62
+ $mode = 'end-UNINSTALL';
63
+ }
64
+ break;
65
+ }
66
+ }
67
+
68
+
69
+ ### Determines Which Mode It Is
70
+ switch($mode) {
71
+ // Deactivating WP-Polls (By: Philippe Corbes)
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>';
79
+ break;
80
+ // Main Page
81
+ default:
82
+ ?>
83
+ <!-- Uninstall WP-Polls (By: Philippe Corbes) -->
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'); ?>
91
+ </p>
92
+ <p style="color: red">
93
+ <strong><?php _e('WARNING:', 'wp-polls'); ?></strong><br />
94
+ <?php _e('Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.', 'wp-polls'); ?>
95
+ </p>
96
+ <p style="color: red">
97
+ <strong><?php _e('The following WordPress Options/Tables will be DELETED:', 'wp-polls'); ?></strong><br />
98
+ </p>
99
+ <table class="widefat">
100
+ <thead>
101
+ <tr>
102
+ <th><?php _e('WordPress Options', 'wp-polls'); ?></th>
103
+ <th><?php _e('WordPress Tables', 'wp-polls'); ?></th>
104
+ </tr>
105
+ </thead>
106
+ <tr>
107
+ <td valign="top">
108
+ <ol>
109
+ <?php
110
+ foreach($polls_settings as $settings) {
111
+ echo '<li>'.$settings.'</li>'."\n";
112
+ }
113
+ ?>
114
+ </ol>
115
+ </td>
116
+ <td valign="top" class="alternate">
117
+ <ol>
118
+ <?php
119
+ foreach($polls_tables as $tables) {
120
+ echo '<li>'.$tables.'</li>'."\n";
121
+ }
122
+ ?>
123
+ </ol>
124
+ </td>
125
+ </tr>
126
+ </table>
127
+ <p style="text-align: center;">
128
+ <?php _e('Do you really want to uninstall WP-Polls?', 'wp-polls'); ?><br /><br />
129
+ <input type="checkbox" name="uninstall_poll_yes" value="yes" />&nbsp;<?php _e('Yes', 'wp-polls'); ?><br /><br />
130
+ <input type="submit" name="do" value="<?php _e('UNINSTALL WP-Polls', 'wp-polls'); ?>" class="button-primary" onclick="return confirm('<?php _e('You Are About To Uninstall WP-Polls From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.', 'wp-polls'); ?>')" />
131
+ </p>
132
+ </div>
133
+ </form>
134
+ <?php
135
+ } // End switch($mode)
 
 
 
 
 
 
readme.html DELETED
@@ -1,771 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
- <head>
4
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
- <title>WP-Polls 2.50 Readme</title>
6
- <style type="text/css" media="screen">
7
- /* Default Style */
8
- BODY {
9
- font-family: Verdana, Arial;
10
- font-size: 12px;
11
- color: #000000;
12
- background: #FFFFFF;
13
- }
14
- P {
15
- padding-left: 10px;
16
- }
17
- BLOCKQUOTE {
18
- margin: 10px 20px 0px 20px;
19
- padding: 10px;
20
- border: 1px solid #8d8d8d;
21
- background-color: #f5f5f5;
22
- overflow: auto;
23
- }
24
- LI {
25
- margin-top: 20px;
26
- }
27
- UL LI UL LI {
28
- margin-top: 10px;
29
- }
30
- A, A:active, A:link, A:visited {
31
- color: #2d3a4c;
32
- text-decoration: none;
33
- }
34
- A:hover {
35
- color: #5577a5;
36
- text-decoration: underline;
37
- }
38
- /* Place Holder Style */
39
- #Container {
40
- width: 780px;
41
- margin-left: auto;
42
- margin-right: auto;
43
- }
44
- #Content {
45
- background-color: #fafafa;
46
- border: 1px solid #a2b6cb;
47
- padding: 10px;
48
- margin-top: -13px;
49
- }
50
- /* Title Style */
51
- #Title {
52
- font-family: Verdana, Arial;
53
- font-size: 22px;
54
- font-weight: bold;
55
- color: #389aff;
56
- border-bottom: 1px solid #389aff;
57
- margin-bottom: 10px;
58
- }
59
- .SubTitle {
60
- font-family: Verdana, Arial;
61
- font-size: 18px;
62
- font-weight: bold;
63
- color: #5b87b4;
64
- }
65
- .SubSubTitle {
66
- font-family: Verdana, Arial;
67
- font-size: 14px;
68
- font-weight: bold;
69
- color: #73a4d6;
70
- }
71
- /* Tabs */
72
- UL#Tabs {
73
- font-family: Verdana, Arial;
74
- font-size: 12px;
75
- font-weight: bold;
76
- list-style-type: none;
77
- padding-bottom: 28px;
78
- border-bottom: 1px solid #a2b6cb;
79
- margin-bottom: 12px;
80
- z-index: 1;
81
- }
82
- #Tabs LI.Tab {
83
- float: right;
84
- height: 25px;
85
- background-color: #deedfb;
86
- margin: 2px 0px 0px 5px;
87
- border: 1px solid #a2b6cb;
88
- }
89
- #Tabs LI.Tab A {
90
- float: left;
91
- display: block;
92
- color: #666666;
93
- text-decoration: none;
94
- padding: 5px;
95
- }
96
- #Tabs LI.Tab A:hover {
97
- background-color: #bfe0fe;
98
- border-bottom: 1px solid #bfe0fe;
99
- }
100
- /* Selected Tab */
101
- #Tabs LI.SelectedTab {
102
- float: right;
103
- height: 25px;
104
- background-color: #fafafa;
105
- margin: 2px 0px 0px 5px;
106
- border-top: 1px solid #a2b6cb;
107
- border-right: 1px solid #a2b6cb;
108
- border-bottom: 1px solid #fafafa;
109
- border-left: 1px solid #a2b6cb;
110
- }
111
- #Tabs LI.SelectedTab A {
112
- float: left;
113
- display: block;
114
- color: #666666;
115
- text-decoration: none;
116
- padding: 5px;
117
- cursor: default;
118
- }
119
- /* Copyright */
120
- #Copyright {
121
- text-align: center;
122
- }
123
- </style>
124
- <script type="text/javascript">
125
- /* <![CDATA[*/
126
- // Index Page
127
- function index() {
128
- // Tab
129
- document.getElementById('IndexTab').className = 'SelectedTab';
130
- document.getElementById('ChangelogTab').className = 'Tab';
131
- document.getElementById('InstallTab').className = 'Tab';
132
- document.getElementById('UpgradeTab').className = 'Tab';
133
- document.getElementById('UsageTab').className = 'Tab';
134
- // Page
135
- document.getElementById('Index').style.display= 'block';
136
- document.getElementById('Changelog').style.display = 'none';
137
- document.getElementById('Install').style.display = 'none';
138
- document.getElementById('Upgrade').style.display = 'none';
139
- document.getElementById('Usage').style.display = 'none';
140
- }
141
- // Changelog Page
142
- function changelog() {
143
- // Tab
144
- document.getElementById('IndexTab').className = 'Tab';
145
- document.getElementById('ChangelogTab').className = 'SelectedTab';
146
- document.getElementById('InstallTab').className = 'Tab';
147
- document.getElementById('UpgradeTab').className = 'Tab';
148
- document.getElementById('UsageTab').className = 'Tab';
149
- // Page
150
- document.getElementById('Index').style.display = 'none';
151
- document.getElementById('Changelog').style.display = 'block';
152
- document.getElementById('Install').style.display = 'none';
153
- document.getElementById('Upgrade').style.display = 'none';
154
- document.getElementById('Usage').style.display = 'none';
155
- }
156
- // Installation Page
157
- function install() {
158
- // Tab
159
- document.getElementById('IndexTab').className = 'Tab';
160
- document.getElementById('ChangelogTab').className = 'Tab';
161
- document.getElementById('InstallTab').className = 'SelectedTab';
162
- document.getElementById('UpgradeTab').className = 'Tab';
163
- document.getElementById('UsageTab').className = 'Tab';
164
- // Page
165
- document.getElementById('Index').style.display= 'none';
166
- document.getElementById('Changelog').style.display = 'none';
167
- document.getElementById('Install').style.display = 'block';
168
- document.getElementById('Upgrade').style.display = 'none';
169
- document.getElementById('Usage').style.display = 'none';
170
- }
171
- // Upgrade Page
172
- function upgrade() {
173
- // Tab
174
- document.getElementById('IndexTab').className = 'Tab';
175
- document.getElementById('ChangelogTab').className = 'Tab';
176
- document.getElementById('InstallTab').className = 'Tab';
177
- document.getElementById('UpgradeTab').className = 'SelectedTab';
178
- document.getElementById('UsageTab').className = 'Tab';
179
- // Page
180
- document.getElementById('Index').style.display= 'none';
181
- document.getElementById('Changelog').style.display = 'none';
182
- document.getElementById('Install').style.display = 'none';
183
- document.getElementById('Upgrade').style.display = 'block';
184
- document.getElementById('Usage').style.display = 'none';
185
- }
186
- // Usage Page
187
- function usage() {
188
- // Tab
189
- document.getElementById('IndexTab').className = 'Tab';
190
- document.getElementById('ChangelogTab').className = 'Tab';
191
- document.getElementById('InstallTab').className = 'Tab';
192
- document.getElementById('UpgradeTab').className = 'Tab';
193
- document.getElementById('UsageTab').className = 'SelectedTab';
194
- // Page
195
- document.getElementById('Index').style.display= 'none';
196
- document.getElementById('Changelog').style.display = 'none';
197
- document.getElementById('Install').style.display = 'none';
198
- document.getElementById('Upgrade').style.display = 'none';
199
- document.getElementById('Usage').style.display = 'block';
200
- }
201
- /* ]]> */
202
- </script>
203
- </head>
204
- <body>
205
- <div id="Container">
206
- <!-- Title -->
207
- <div id="Title">WP-Polls 2.50&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
208
-
209
- <!-- Tabs -->
210
- <ul id="Tabs">
211
- <li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
212
- <li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
213
- <li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
214
- <li id="ChangelogTab" class="Tab"><a href="#Changelog" onclick="changelog(); return false;" title="Changelog">Changelog</a></li>
215
- <li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
216
- </ul>
217
-
218
- <!-- Content -->
219
- <div id="Content">
220
- <!-- Index -->
221
- <div id="Index">
222
- <div class="SubTitle">&raquo; Index</div>
223
- <div class="SubSubTitle">Plugin Information</div>
224
- <p>
225
- <strong>Author:</strong><br />
226
- <strong>&raquo;</strong> Lester 'GaMerZ' Chan
227
- </p>
228
- <p>
229
- <strong>Website:</strong><br />
230
- <strong>&raquo;</strong> <a href="http://lesterchan.net/" title="http://lesterchan.net/">http://lesterchan.net/</a>
231
- </p>
232
- <p>
233
- <strong>Features:</strong><br />
234
- <strong>&raquo;</strong> 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.
235
- </p>
236
- <p>
237
- <strong>Download:</strong><br />
238
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-polls.2.50.zip" title="http://downloads.wordpress.org/plugin/wp-polls.2.50.zip">WP-Polls 2.50 For WordPress 2.8.x</a><br />
239
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-polls.2.40.zip" title="http://downloads.wordpress.org/plugin/wp-polls.2.40.zip">WP-Polls 2.40 For WordPress 2.7.x</a><br />
240
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-polls.2.31.zip" title="http://downloads.wordpress.org/plugin/wp-polls.2.31.zip">WP-Polls 2.31 For WordPress 2.5.x And 2.6.x</a><br />
241
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-polls.2.20.zip" title="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</a><br />
242
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-polls.2.13.zip" title="http://downloads.wordpress.org/plugin/wp-polls.2.13.zip">WP-Polls 2.13 For WordPress 2.0.x</a><br />
243
- <strong>&raquo;</strong> <a href="http://downloads.wordpress.org/plugin/wp-polls.2.02a.zip" title="http://downloads.wordpress.org/plugin/wp-polls.2.02a.zip">WP-Polls 2.02a For WordPress 1.5.2</a>
244
- </p>
245
- <p>
246
- <strong>Screenshots:</strong><br />
247
- <strong>&raquo;</strong> <a href="http://lesterchan.net/wordpress/screenshots/browse/wp-polls/" title="http://lesterchan.net/wordpress/screenshots/browse/wp-polls/">http://lesterchan.net/wordpress/screenshots/browse/wp-polls/</a>
248
- </p>
249
- <p>
250
- <strong>Demo:</strong><br />
251
- <strong>&raquo;</strong> <a href="http://lesterchan.net/wordpress/" title="http://lesterchan.net/wordpress/">http://lesterchan.net/wordpress/</a>
252
- </p>
253
- <p>
254
- <strong>Development:</strong><br />
255
- <strong>&raquo;</strong> <a href="http://dev.wp-plugins.org/browser/wp-polls/" title="http://dev.wp-plugins.org/browser/wp-polls/">http://dev.wp-plugins.org/browser/wp-polls/</a>
256
- </p>
257
- <p>
258
- <strong>Translations:</strong><br />
259
- <strong>&raquo;</strong> <a href="http://dev.wp-plugins.org/browser/wp-polls/i18n/" title="http://dev.wp-plugins.org/browser/wp-polls/i18n/">http://dev.wp-plugins.org/browser/wp-polls/i18n/</a>
260
- </p>
261
- <p>
262
- <strong>Support Forums:</strong><br />
263
- <strong>&raquo;</strong> <a href="http://forums.lesterchan.net/index.php?board=15.0" title="http://forums.lesterchan.net/index.php?board=15.0">http://forums.lesterchan.net/index.php?board=15.0</a>
264
- </p>
265
- <p>
266
- <strong>Credits:</strong><br />
267
- <strong>&raquo;</strong> __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a>.<br />
268
- <strong>&raquo;</strong> Right To Left Language Support by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a>.
269
- </p>
270
- <p>
271
- <strong>Note:</strong><br />
272
- <strong>&raquo;</strong> The <strong>Changelog</strong>, <strong>Installation</strong>, <strong>Upgrade</strong>, <strong>Usage</strong> Tab at the top of the page.<br />
273
- </p>
274
- <p>
275
- <strong>Donations:</strong><br />
276
- <strong>&raquo;</strong> I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appericiate it. If not feel free to use it without any obligations. Thank You. My Paypal account is
277
- <script type="text/javascript">
278
- /* <![CDATA[*/
279
- document.write(' <strong>lesterchan@gmail.com</strong>.');
280
- /* ]]> */
281
- </script>
282
- </p>
283
- </div>
284
-
285
- <!-- Changelog -->
286
- <div id="Changelog" style="display: none;">
287
- <div class="SubTitle">&raquo; Changelog</div>
288
- <ul>
289
- <li>
290
- <strong>Version 2.50 (01-06-2009)</strong>
291
- <ul>
292
- <li>NEW: Works For WordPress 2.8 Only</li>
293
- <li>NEW: Javascript Now Placed At The Footer</li>
294
- <li>NEW: Uses jQuery Instead Of tw-sack</li>
295
- <li>NEW: Minified Javascript Instead Of Packed Javascript</li>
296
- <li>NEW: Renamed polls-admin-js-packed.js To polls-admin-js.js</li>
297
- <li>NEW: Renamed polls-admin-js.js To polls-admin-js.dev.js</li>
298
- <li>NEW: Renamed polls-js-packed.js To polls-js.js</li>
299
- <li>NEW: Renamed polls-js.js To polls-js.dev.js</li>
300
- <li>NEW: Translate Javascript Variables Using wp_localize_script()</li>
301
- <li>NEW: Add "Add Poll" To WordPress Favourite Actions</li>
302
- <li>NEW: Minified editor_plugin.js And Added Non-Minified editor_plugin.dev.js</li>
303
- <li>NEW: Able To Remove Individual Answers When Adding Or Editing A Poll</li>
304
- <li>NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()</li>
305
- <li>NEW: Uses New Widget Class From WordPress</li>
306
- <li>NEW: Merge Widget Code To wp-polls.php And Remove wp-polls-widget.php</li>
307
- <li>FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']</li>
308
- <li>FIXED: Ensure That Percentage Always Add Up To 100%</li>
309
- <li>FIXED: More Efficient WP-Polls Archive</li>
310
- <li>FIXED: Logged By Username Now Shows Poll Results To Users Who Did Not Login</li>
311
- </ul>
312
- </li>
313
- <li>
314
- <strong>Version 2.40 (12-12-2008)</strong>
315
- <ul>
316
- <li>NEW: Works For WordPress 2.7 Only</li>
317
- <li>NEW: Load Admin JS And CSS Only In WP-Polls Admin Pages</li>
318
- <li>NEW: Added polls-admin-css.css For WP-Polls Admin CSS Styles</li>
319
- <li>NEW: Right To Left Language Support by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
320
- <li>NEW: Added "polls-css-rtl.css" by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
321
- <li>NEW: Applied Output Of polls_archive() To "polls_archive" Filter by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
322
- <li>NEW: Added Call To polls_textdomain() In create_poll_table() and vote_poll() functions by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
323
- <li>NEW: Uses wp_register_style(), wp_print_styles(), plugins_url() And site_url()</li>
324
- <li>NEW: [poll id="-2"] or <?php get_poll(-2); ?> Will Randomize The Poll</li>
325
- <li>FIXED: SSL Support</li>
326
- <li>FIXED Moved Call To update_pollbar() From onblur To onclick Event. It Was Showing The Last Selection Instead Of Current One by <a href="http://persian-programming.com/" title="http://persian-programming.com/">Kambiz R. Khojasteh</a></li>
327
- </ul>
328
- </li>
329
- <li>
330
- <strong>Version 2.31 (16-07-2008)</strong>
331
- <ul>
332
- <li>NEW: Works For WordPress 2.6</li>
333
- <li>NEW: Better Translation Using __ngetext() by <a href="http://hweia.ru/" title="http://hweia.ru/">Anna Ozeritskaya</a></li>
334
- <li>FIXED: MYSQL Charset Issue Should Be Solved</li>
335
- </ul>
336
- </li>
337
- <li>
338
- <strong>Version 2.30 (01-06-2008)</strong>
339
- <ul>
340
- <li>NEW: Works For WordPress 2.5 Only</li>
341
- <li>NEW: Added Paging Header And Footer Template For Polls Archive Page</li>
342
- <li>NEW: Uses WP-PageNavi Style Paging For Polls Archive Page</li>
343
- <li>NEW: WP-Polls Will Load 'polls-css.css' Inside Your Theme Directory If It Exists. If Not, It Will Just Load The Default 'polls-css.css' By WP-Polls</li>
344
- <li>NEW: Uses Shortcode API</li>
345
- <li>NEW: When Inserting Poll Into Post, It is Now [poll id="1"], Where 1 Is Your Poll ID</li>
346
- <li>NEW: When User Does Not Have Permission To Vote, The Voting Form Is Now Disabled Instead Of Showing Poll's Result</li>
347
- <li>NEW: Added A New Action Called "Display Disabled Poll's Voting Form" To Action Taken When A Poll Is Closed</li>
348
- <li>NEW: Updated WP-Polls TinyMCE Plugin To Work With TinyMCE 3.0</li>
349
- <li>NEW: Add Time Expiry For Cookie/Log</li>
350
- <li>NEW: Removed polls-usage.php</li>
351
- <li>NEW: Removed "Fade Anything Technique" In Polls Admin</li>
352
- <li>NEW: Uses /wp-polls/ Folder Instead Of /polls/</li>
353
- <li>NEW: Uses wp-polls.php Instead Of polls.php</li>
354
- <li>NEW: Uses wp-polls-widget.php Instead Of polls-widget.php</li>
355
- <li>NEW: Use number_format_i18n() Instead</li>
356
- <li>NEW: Renamed polls-admin-js.php To polls-admin-js.js and Move The Dynamic Javascript Variables To The PHP Pages</li>
357
- <li>NEW: Renamed polls-js.php To polls-js.js and Move The Dynamic Javascript Variables To The PHP Pages</li>
358
- <li>NEW: Uses polls-js-packed.js And polls-admin-js-packed.js</li>
359
- <li>FIXED: Unable To Delete Poll Or Poll Answers If There Is Quotes Within The Poll Or Poll Answer</li>
360
- <li>FIXED: number_format() Not Used In Polls Archive</li>
361
- <li>FIXED: Unable To Schedule Future Poll If The Year Is Different From Current Year</li>
362
- <li>FIXED: TinyMCE Tool Tip For Insert Poll Not Translated</li>
363
- <li>FIXED: Content-Type Not Being Sent Back When AJAX Return Results</li>
364
- </ul>
365
- </li>
366
- <li>
367
- <strong>Version 2.21 (01-10-2007)</strong>
368
- <ul>
369
- <li>NEW: Works For WordPress 2.3 Only</li>
370
- <li>NEW: Added Quick Tag For Poll To Visual (TinyMCE) / Code Editor</li>
371
- <li>NEW: New CSS Style For WP-Polls Archive (.wp-polls-archive)</li>
372
- <li>NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page</li>
373
- <li>NEW: Ability To Add Polls To Excerpt</li>
374
- <li>NEW: Added "Random Order" For Sorting Poll's Answers And Poll's Result Answers</li>
375
- <li>FIXED: Language Problem By Setting Database Table To UTF8</li>
376
- <li>FIXED: Some Text Not Translated In Polls Widget</li>
377
- <li>FIXED: 2 Wrong Options Name In Polls Uninstall</li>
378
- <li>FIXED: Some Translation Bug in polls-usage.php</li>
379
- </ul>
380
- </li>
381
- <li>
382
- <strong>Version 2.20 (01-06-2007)</strong>
383
- <ul>
384
- <li>NEW: Poll Archive Link, Individual Poll Header And Footer In Poll Archive Template</li>
385
- <li>NEW: Poll Templates Has Now Its Own Page 'WP-Admin -> Polls -> Poll Templates'</li>
386
- <li>NEW: Poll Widget Can Now Display Multiple Polls</li>
387
- <li>NEW: Ability To Allow User To Select More Than 1 Poll Answer</li>
388
- <li>NEW: Added AJAX Style Option: "Show Loading Image With Text"</li>
389
- <li>NEW: Added AJAX Style Option: "Show Fading In And Fading Out Of Polls"</li>
390
- <li>NEW: Major Changes To The Administration Panel For WP-Polls</li>
391
- <li>NEW: AJAX Added To The Administration Panel For WP-Polls</li>
392
- <li>NEW: Default Poll's Result Template Will Now Show Number Of Votes Beside The Percentage</li>
393
- <li>NEW: Term "Total Votes" Changed To "Total Voters". <a href="http://lesterchan.net/wordpress/2007/02/09/total-voters-and-total-votes/">Refer To Here</a></li>
394
- <li>NEW: Removed Polls From Feed If The Poll Is Embedded Into The Post Using [poll=ID]</li>
395
- <li>NEW: Filtering Of Individual Poll Logs</li>
396
- <li>FIXED: Poll Archive Will Now Show Only Polls Results</li>
397
- </ul>
398
- </li>
399
- <li>
400
- <strong>Version 2.14 (01-02-2007)</strong>
401
- <ul>
402
- <li>NEW: Works For WordPress 2.1 Only</li>
403
- <li>NEW: Renamed polls-js.js to polls-js.php To Enable PHP Parsing</li>
404
- <li>NEW: Ability To Make A Poll Expire</li>
405
- <li>NEW: Ability To Make A Future Poll</li>
406
- <li>NEW: Future Poll Will Automatically Open When The Poll's Date Is Reached</li>
407
- <li>NEW: Expired Poll Will Automatically Closed When The Poll's Date Is Reached</li>
408
- <li>NEW: Ablity To Choose What To Do When The Poll Is Closed (Display Result, Remove Poll From Sidebar)</li>
409
- <li>FIXED: Future Dated Polls Will Not Appear In The Post/Sidebar/Polls Archive</li>
410
- </ul>
411
- </li>
412
- <li>
413
- <strong>Version 2.13 (02-01-2007)</strong>
414
- <ul>
415
- <li>NEW: polls.php Now Handles The AJAX Processing Instead Of index.php</li>
416
- <li>NEW: Able To Modify The Style Of Poll Results Bar in 'Polls -> Poll Option'</li>
417
- <li>NEW: Usage Instructions Is Also Included Within The Plugin Itself</li>
418
- <li>NEW: Uninstaller Done By Philippe Corbes</li>
419
- <li>NEW: Localization Done By <a href="http://4visions.nl/" title="http://4visions.nl/">Ravan</a></li>
420
- <li>NEW: Ability To Add HTML Into Poll Question and Answers</li>
421
- <li>FIXED: AJAX Not Working On Servers Running On PHP CGI</li>
422
- <li>FIXED: Added Some Default Styles To polls-css.css To Ensure That WP-Polls Does Not Break</li>
423
- <li>FIXED: Other Languages Not Appearing Properly</li>
424
- <li>FIXED: Poll IP Logs Of Deleted Poll's Answer Did Not Get Deleted</li>
425
- <li>FIXED: There Is An Error In Voting If There Is Only 1 Poll's Answer</li>
426
- </ul>
427
- </li>
428
- <li>
429
- <strong>Version 2.12 (01-10-2006)</strong>
430
- <ul>
431
-
432
- <li>NEW: Polls Archive Is Now Embedded Into A Page, And Hence No More Integrating Of Polls Archive</li>
433
- <li>NEW: WP-Polls Is Now Using DIV To Display The Poll's Results Instead Of The Image Bar</li>
434
- <li>NEW: Added Widget Title Option To WP-Polls Widget</li>
435
- <li>NEW: Ability To Logged By UserName</li>
436
- <li>NEW: Added CSS Class 'wp-polls-image' To All IMG Tags</li>
437
- <li>FIXED: If Site URL Doesn't Match WP Option's Site URL, WP-Polls Will Not Work</li>
438
- </ul>
439
- </li>
440
- <li>
441
- <strong>Version 2.11 (08-06-2006)</strong>
442
- <ul>
443
- <li>NEW: You Can Now Place The Poll On The Sidebar As A Widget</li>
444
- <li>NEW: Moved wp-polls.php To wp-content/plugins/polls/ Folder</li>
445
- <li>FIXED: AJAX Not Working In Opera Browser</li>
446
- <li>FIXED: Poll Not Working On Physical Pages That Is Integrated Into WordPress</li>
447
- </ul>
448
- </li>
449
- <li>
450
- <strong>Version 2.1 (01-06-2006)</strong>
451
- <ul>
452
- <li>NEW: Poll Is Now Using AJAX</li>
453
- <li>NEW: Ability To Close/Open Poll</li>
454
- <li>NEW: Added Poll Option For Logging Method</li>
455
- <li>NEW: Added Poll Option For Who Can Vote</li>
456
- <li>NEW: Added Poll Results Footer Template Variable (Used When User Click "View Results")</li>
457
- <li>NEW: Added The Ability To Delete All Poll Logs Or Logs From A Specific Poll</li>
458
- <li>NEW: Poll Administration Panel And The Code That WP-Polls Generated Is XHTML 1.0 Transitional</li>
459
- </ul>
460
- </li>
461
- <li>
462
- <strong>Version 2.06b (26-04-2006)</strong>
463
- <ul>
464
- <li>FIXED: Bug In vote_poll();</li>
465
- </ul>
466
- </li>
467
- <li>
468
- <strong>Version 2.06a (02-04-2006)</strong>
469
- <ul>
470
- <li>FIXED: Random Poll Not Working Correctly</li>
471
- </ul>
472
- </li>
473
- <li>
474
- <strong>Version 2.06 (01-04-2006)</strong>
475
- <ul>
476
- <li>NEW: Poll Bar Is Slightly Nicer</li>
477
- <li>NEW: Got Rid Of Tables, Now Using List</li>
478
- <li>NEW: Added In Most Voted And Least Voted Answer/Votes/Percentage For Individual Poll As Template Variables</li>
479
- <li>NEW: Display Random Poll Option Under Poll -> Poll Options -> Current Poll</li>
480
- <li>FIXED: Totally Removed Tables In wp-polls.php</li>
481
- </ul>
482
- </li>
483
- <li>
484
- <strong>Version 2.05 (01-03-2006)</strong>
485
- <ul>
486
- <li>NEW: Improved On 'manage_polls' Capabilities</li>
487
- <li>NEW: Neater Structure</li>
488
- <li>NEW: No More Install/Upgrade File, It Will Install/Upgrade When You Activate The Plugin</li>
489
- <li>NEW: Added Poll Stats Function</li>
490
- </ul>
491
- </li>
492
- <li>
493
- <strong>Version 2.04 (01-02-2006)</strong>
494
- <ul>
495
- <li>NEW: Added 'manage_polls' Capabilities To Administrator Role</li>
496
- <li>NEW: [poll=POLL_ID] Tag To Insert Poll Into A Post</li>
497
- <li>NEW: Ability To Edit Poll's Timestamp</li>
498
- <li>NEW: Ability To Edit Individual Poll's Answer Votes</li>
499
- <li>NEW: %POLL_RESULT_URL% To Display Poll's Result URL</li>
500
- <li>FIXED: Cannot Sent Header Error</li>
501
- </ul>
502
- </li>
503
- <li>
504
- <strong>Version 2.03 (01-01-2006)</strong>
505
- <ul>
506
- <li>NEW: Compatible With WordPress 2.0 Only</li>
507
- <li>NEW: Poll Administration Menu Added Automatically Upon Activating The Plugin</li>
508
- <li>NEW: Removed Add Poll Link From The Administration Menu</li>
509
- <li>NEW: GPL License Added</li>
510
- <li>NEW: Page Title Added To wp-polls.php</li>
511
- </ul>
512
- </li>
513
- <li>
514
- <strong>Version 2.02a (17-11-2005)</strong>
515
- <ul>
516
- <li>FIXED: poll-install.php And poll-upgrade.php will Now Be Installed/Upgraded To 2.02 Instead Of 2.01</li>
517
- </ul>
518
- </li>
519
- <li>
520
- <strong>Version 2.02 (05-11-2005)</strong>
521
- <ul>
522
- <li>FIXED: Showing 0 Vote On Poll Edit Page</li>
523
- <li>FIXED: Null Vote Being Counted As A Vote</li>
524
- <li>FIXED: Auto Loading Of Poll Option: Polls Per Page In Poll Archive Page Is Now "No"</li>
525
- <li>NEW: Host Column In Poll IP Table To Prevent Network Lagging When Resolving IP</li>
526
- <li>NEW: New Poll Error Template</li>
527
- </ul>
528
- </li>
529
- <li>
530
- <strong>Version 2.01 (25-10-2005)</strong>
531
- <ul>
532
- <li>FIXED: Upgrade Script To Insert Lastest Poll ID Of User's Current Polls, Instead Of Poll ID 1</li>
533
- <li>FIXED: Replace All &lt;?= With &lt;?php</li>
534
- <li>FIXED: Added addalshes() To $pollip_user</li>
535
- <li>FIXED: Better Localization Support (80% Done, Will Leave It In The Mean Time)</li>
536
- </ul>
537
- </li>
538
- <li>
539
- <strong>Version 2.0 (20-10-2005)</strong>
540
- <ul>
541
- <li>NEW: IP Logging</li>
542
- <li>NEW: Poll Options: Sorting Of Answers In Voting Form</li>
543
- <li>NEW: Poll Options: Sorting Of Answers In Results View</li>
544
- <li>NEW: Poll Options: Number Of Polls Per Page In Poll Archive</li>
545
- <li>NEW: Poll Options: Choose Poll To Display On Index Page</li>
546
- <li>NEW: Poll Options: Able To Disable Poll With Custom Message</li>
547
- <li>NEW: Poll Options: Poll Templates</li>
548
- <li>NEW: Display User's Voted Choice</li>
549
- <li>FIXED: Better Install/Upgrade Script</li>
550
- </ul>
551
- </li>
552
- </ul>
553
- </div>
554
-
555
- <!-- Installation Instructions -->
556
- <div id="Install" style="display: none;">
557
- <div class="SubTitle">&raquo; Installation Instructions</div>
558
- <ol>
559
- <li>
560
- Open <strong>wp-content/plugins</strong> Folder
561
- </li>
562
- <li>
563
- Put:
564
- <blockquote>Folder: wp-polls</blockquote>
565
- </li>
566
- <li>
567
- <strong>Activate</strong> WP-Polls Plugin
568
- </li>
569
- <li>
570
- Refer To <strong>Usage</strong> For Further Instructions
571
- </li>
572
- </ol>
573
- </div>
574
-
575
- <!-- Upgrade Instructions -->
576
- <div id="Upgrade" style="display: none;">
577
- <div class="SubTitle">&raquo; Upgrade Instructions</div>
578
- <div class="SubSubTitle">From v2.xx To v2.50</div>
579
- <ol>
580
- <li>
581
- <strong>Deactivate</strong> WP-Polls Plugin
582
- </li>
583
- <li>
584
- <strong>Deactivate</strong> WP-Polls Widget Plugin
585
- </li>
586
- <li>
587
- Open <strong>wp-content/plugins</strong> Folder
588
- </li>
589
- <li>
590
- Put/Overwrite:
591
- <blockquote>Folder: wp-polls</blockquote>
592
- </li>
593
- <li>
594
- Delete this folder/file if exists:
595
- <blockquote>
596
- Folder: polls<br />
597
- File: wp-polls-widget.php
598
- </blockquote>
599
- </li>
600
- <li>
601
- <strong>Activate</strong> WP-Polls Plugin
602
- </li>
603
- <li>
604
- Go to '<strong>WP-Admin -> Polls -> Polls Templates</strong>' and restore all the template variables to <strong>Default</strong>
605
- </li>
606
- <li>
607
- Go to '<strong>WP-Admin -> Appearance -> Widgets</strong>' and re-add the Poll Widget
608
- </li>
609
- <li>
610
- Refer To <strong>Usage</strong> For Further Instructions
611
- </li>
612
- </ol>
613
- </div>
614
-
615
- <!-- Usage Instructions -->
616
- <div id="Usage" style="display: none;">
617
- <div class="SubTitle">&raquo; Usage Instructions</div>
618
- <div class="SubSubTitle">General Usage (Without Widget)</div>
619
- <ol>
620
- <li>
621
- Open <strong>wp-content/themes/&lt;YOUR THEME NAME&gt;/sidebar.php</strong>
622
- </li>
623
- <li>
624
- Add:
625
- <blockquote>
626
- &lt;?php if (function_exists('vote_poll') &amp;&amp; !in_pollarchive()): ?&gt;<br />
627
- &lt;li&gt;<br />
628
- &nbsp;&nbsp;&nbsp;&lt;h2&gt;Polls&lt;/h2&gt;<br />
629
- &nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
630
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;?php get_poll();?&gt;&lt;/li&gt;<br />
631
- &nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
632
- &nbsp;&nbsp;&nbsp;&lt;?php display_polls_archive_link(); ?&gt;<br />
633
- &lt;/li&gt;<br />
634
- &lt;?php endif; ?&gt;
635
- </blockquote>
636
- <p>To show specific poll, use &lt;?php get_poll(<strong>2</strong>); ?&gt; where <strong>2</strong> is your poll id.</p>
637
- <p>To show random poll, use &lt;?php get_poll(<strong>-2</strong>); ?&gt;</p>
638
- <p>To embed a specific poll in your post, use [poll id="<strong>2</strong>"] where <strong>2</strong> is your poll id.</p>
639
- <p>To embed a random poll in your post, use [poll id="<strong>-2</strong>"]</p>
640
- <p>To embed a specific poll's result in your post, use [poll id="<strong>2</strong>" type="result"] where <strong>2</strong> is your poll id.</p>
641
- </li>
642
- <li>
643
- Scroll down for instructions on how to create a <strong>Polls Archive</strong>.
644
- </li>
645
- </ol>
646
- <div class="SubSubTitle">General Usage (With Widget)</div>
647
- <ol>
648
- <li>
649
- Go to '<strong>WP-Admin -> Appearance -> Widgets</strong>'.
650
- </li>
651
- <li>
652
- You can <strong>add</strong> the Polls Widget by clicking on the 'Add' link besides it.
653
- </li>
654
- <li>
655
- After adding, you can <strong>configure</strong> the Polls Widget by clicking on the 'Edit' link besides it.
656
- </li>
657
- <li>
658
- Click 'Save Changes'.
659
- </li>
660
- <li>
661
- Scroll down for instructions on how to create a <strong>Polls Archive</strong>.
662
- </li>
663
- </ol>
664
- <div class="SubSubTitle">Polls Archive</div>
665
- <ol>
666
- <li>
667
- Go to '<strong>WP-Admin -> Pages -> Add New</strong>'.
668
- </li>
669
- <li>
670
- Type any title you like in the post's title area.
671
- </li>
672
- <li>
673
- If you <strong>ARE </strong> using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an 'Edit' link just beside the permalink.
674
- </li>
675
- <li>
676
- Click 'Edit' and type in '<strong>pollsarchive</strong>' in the text field (without the quotes) and click 'Save'.
677
- </li>
678
- <li>
679
- Type '<strong>[page_polls]</strong>' in the post's content area (without the quotes).
680
- </li>
681
- <li>
682
- Click 'Publish'.
683
- </li>
684
- <li>
685
- If you <strong>ARE NOT</strong> using nice permalinks, you need to go to 'WP-Admin -> Polls -> Poll Options' and under '<strong>Poll Archive -> Polls Archive URL</strong>', you need to fill in the URL to the Polls Archive Page you created above.
686
- </li>
687
- </ol>
688
- <div class="SubSubTitle">Note</div>
689
- <ul>
690
- <li>
691
- WP-Polls will load '<strong>polls-css.css</strong>' from your theme's directory if it exists.
692
- <ul>
693
- <li>If it doesn't exists, it will just load the default 'polls-css.css' that comes with WP-Polls.</li>
694
- <li>This will allow you to upgrade WP-Polls without worrying about overwriting your polls styles that you have created.</li>
695
- </ul>
696
- </li>
697
- <li>
698
- In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,
699
- <ol>
700
- <li>
701
- Open <strong>poll-css.css</strong>
702
- </li>
703
- <li>
704
- Find:
705
- <blockquote>
706
- /* background-color: #ffffff; */
707
- </blockquote>
708
- </li>
709
- <li>
710
- Replace:
711
- <blockquote>
712
- background-color: #ffffff;
713
- </blockquote>
714
- <p>Where <strong>#ffffff</strong> should be your background color for the poll.</p>
715
- </li>
716
- </ol>
717
- </li>
718
- </ul>
719
- <div class="SubSubTitle">Polls Stats (Outside WP Loop)</div>
720
- <ul>
721
- <li>
722
- To Display <strong>Total Polls</strong>
723
- </li>
724
- <li>
725
- Use:
726
- <blockquote>
727
- &lt;?php if (function_exists('get_pollquestions')): ?&gt;<br />
728
- &nbsp;&nbsp;&nbsp;&lt;?php get_pollquestions(); ?&gt;<br />
729
- &lt;?php endif; ?&gt;
730
- </blockquote>
731
- </li>
732
- <li>
733
- To Display <strong>Total Poll Answers</strong>
734
- </li>
735
- <li>
736
- Use:
737
- <blockquote>
738
- &lt;?php if (function_exists('get_pollanswers')): ?&gt;<br />
739
- &nbsp;&nbsp;&nbsp;&lt;?php get_pollanswers(); ?&gt;<br />
740
- &lt;?php endif; ?&gt;
741
- </blockquote>
742
- </li>
743
- <li>
744
- To Display <strong>Total Poll Votes</strong>
745
- </li>
746
- <li>
747
- Use:
748
- <blockquote>
749
- &lt;?php if (function_exists('get_pollvotes')): ?&gt;<br />
750
- &nbsp;&nbsp;&nbsp;&lt;?php get_pollvotes(); ?&gt;<br />
751
- &lt;?php endif; ?&gt;
752
- </blockquote>
753
- </li>
754
- <li>
755
- To Display <strong>Total Poll Voters</strong>
756
- </li>
757
- <li>
758
- Use:
759
- <blockquote>
760
- &lt;?php if (function_exists('get_pollvoters')): ?&gt;<br />
761
- &nbsp;&nbsp;&nbsp;&lt;?php get_pollvoters(); ?&gt;<br />
762
- &lt;?php endif; ?&gt;
763
- </blockquote>
764
- </li>
765
- </ul>
766
- </div>
767
- </div>
768
- </div>
769
- <p id="Copyright">WP-Polls 2.50<br />Copyright &copy; 2009 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
770
- </body>
771
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,30 +1,395 @@
1
- === WP-Polls ===
2
- Contributors: GamerZ
3
- Donate link: http://lesterchan.net/wordpress
4
- Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
- Requires at least: 2.8
6
- Stable tag: 2.50
7
-
8
- Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
9
-
10
- == Description ==
11
- 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.
12
-
13
- All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-Polls Readme](http://lesterchan.net/wordpress/readme/wp-polls.html "WP-Polls Readme").
14
- It is the exact same readme.html is included in the zip package.
15
-
16
- == Development Blog ==
17
-
18
- [GaMerZ WordPress Plugins Development Blog](http://lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
19
-
20
- == Installation ==
21
-
22
- [WP-Polls Readme](http://lesterchan.net/wordpress/readme/wp-polls.html "WP-Polls Readme") (Installation Tab)
23
-
24
- == Screenshots ==
25
-
26
- [WP-Polls Screenshots](http://lesterchan.net/wordpress/screenshots/browse/wp-polls/ "WP-Polls Screenshots")
27
-
28
- == Frequently Asked Questions ==
29
-
30
- [WP-Polls Support Forums](http://forums.lesterchan.net/index.php?board=15.0 "WP-Polls Support Forums")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP-Polls ===
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")
34
+
35
+ = Donations =
36
+ * I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appericiate it. If not feel free to use it without any obligations.
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.
43
+
44
+ = Version 2.63 (21-05-2012) =
45
+ * Move AJAX Request to wp-admin/admin-ajax.php
46
+ * Added nonce To AJAX Calls
47
+ * FIXED: PHP Notices/add_options() Deprecated Arguments ([Dewey Bushaw](http://www.parapxl.com/ "Dewey Bushaw"))
48
+
49
+ = Version 2.62 (31-08-2011) =
50
+ * FIXED: Escaped Hostname. Thanks to Renaud Feil ([Renaud Feil](http://www.stratsec.net "Renaud Feil"))
51
+ * FIXED: Ensure Poll ID In Shortcode Is An Integer. Thanks to Renaud Feil ([Renaud Feil](http://www.stratsec.net "Renaud Feil"))
52
+
53
+ = Version 2.61 (14-02-2011) =
54
+ * FIXED: XSS Vulnerability. Thanks to Dweeks, Leon Juranic and Chad Lavoie of the Swiftwill Security Team Inc ([www.swiftwill.com](http://www.swiftwill.com "www.swiftwill.com"))
55
+
56
+ = Version 2.60 (01-12-2009) =
57
+ * NEW: Uses WordPress nonce Throughout
58
+ * NEW: Display 2,000 Records In Poll Logs Instead Of 100
59
+
60
+ = Version 2.50 (01-06-2009) =
61
+ * NEW: Works For WordPress 2.8 Only
62
+ * NEW: Javascript Now Placed At The Footer
63
+ * NEW: Uses jQuery Instead Of tw-sack
64
+ * NEW: Minified Javascript Instead Of Packed Javascript
65
+ * NEW: Renamed polls-admin-js-packed.js To polls-admin-js.js
66
+ * NEW: Renamed polls-admin-js.js To polls-admin-js.dev.js
67
+ * NEW: Renamed polls-js-packed.js To polls-js.js
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
75
+ * NEW: Merge Widget Code To wp-polls.php And Remove wp-polls-widget.php
76
+ * FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']
77
+ * FIXED: Ensure That Percentage Always Add Up To 100%
78
+ * FIXED: More Efficient WP-Polls Archive
79
+ * FIXED: Logged By Username Now Shows Poll Results To Users Who Did Not Login
80
+
81
+ = Version 2.40 (12-12-2008) =
82
+ * NEW: Works For WordPress 2.7 Only
83
+ * NEW: Load Admin JS And CSS Only In WP-Polls Admin Pages
84
+ * NEW: Added polls-admin-css.css For WP-Polls Admin CSS Styles
85
+ * NEW: Right To Left Language Support by Kambiz R. Khojasteh
86
+ * NEW: Added "polls-css-rtl.css" by Kambiz R. Khojasteh
87
+ * NEW: Applied Output Of polls_archive() To "polls_archive" Filter by Kambiz R. Khojasteh
88
+ * NEW: Added Call To polls_textdomain() In create_poll_table() and vote_poll() functions by Kambiz R. Khojasteh
89
+ * NEW: Uses wp_register_style(), wp_print_styles(), plugins_url() And site_url()
90
+ * NEW: [poll id="-2"] or <?php get_poll(-2); ?> Will Randomize The Poll
91
+ * FIXED: SSL Support
92
+ * FIXED: Moved Call To update_pollbar() From onblur To onclick Event. It Was Showing The Last Selection Instead Of Current One by Kambiz R. Khojasteh
93
+
94
+ = Version 2.31 (16-07-2008) =
95
+ * NEW: Works For WordPress 2.6
96
+ * NEW: Better Translation Using __ngetext() by Anna Ozeritskaya
97
+ * FIXED: MYSQL Charset Issue Should Be Solved
98
+
99
+ = Version 2.30 (01-06-2008) =
100
+ * NEW: Works For WordPress 2.5 Only
101
+ * NEW: Added Paging Header And Footer Template For Polls Archive Page
102
+ * NEW: Uses WP-PageNavi Style Paging For Polls Archive Page
103
+ * NEW: WP-Polls Will Load 'polls-css.css' Inside Your Theme Directory If It Exists. If Not, It Will Just Load The Default 'polls-css.css' By WP-Polls
104
+ * NEW: Uses Shortcode API
105
+ * NEW: When Inserting Poll Into Post, It is Now [poll id="1"], Where 1 Is Your Poll ID
106
+ * NEW: When User Does Not Have Permission To Vote, The Voting Form Is Now Disabled Instead Of Showing Poll's Result
107
+ * NEW: Added A New Action Called "Display Disabled Poll's Voting Form" To Action Taken When A Poll Is Closed
108
+ * NEW: Updated WP-Polls TinyMCE Plugin To Work With TinyMCE 3.0
109
+ * NEW: Add Time Expiry For Cookie/Log
110
+ * NEW: Removed polls-usage.php
111
+ * NEW: Removed "Fade Anything Technique" In Polls Admin
112
+ * NEW: Uses /wp-polls/ Folder Instead Of /polls/
113
+ * NEW: Uses wp-polls.php Instead Of polls.php
114
+ * NEW: Uses wp-polls-widget.php Instead Of polls-widget.php
115
+ * NEW: Use number_format_i18n() Instead
116
+ * NEW: Renamed polls-admin-js.php To polls-admin-js.js and Move The Dynamic Javascript Variables To The PHP Pages
117
+ * NEW: Renamed polls-js.php To polls-js.js and Move The Dynamic Javascript Variables To The PHP Pages
118
+ * NEW: Uses polls-js-packed.js And polls-admin-js-packed.js
119
+ * FIXED: Unable To Delete Poll Or Poll Answers If There Is Quotes Within The Poll Or Poll Answer
120
+ * FIXED: number_format() Not Used In Polls Archive
121
+ * FIXED: Unable To Schedule Future Poll If The Year Is Different From Current Year
122
+ * FIXED: TinyMCE Tool Tip For Insert Poll Not Translated
123
+ * FIXED: Content-Type Not Being Sent Back When AJAX Return Results
124
+
125
+ = Version 2.21 (01-10-2007) =
126
+ * NEW: Works For WordPress 2.3 Only
127
+ * NEW: Added Quick Tag For Poll To Visual (TinyMCE) / Code Editor
128
+ * NEW: New CSS Style For WP-Polls Archive (.wp-polls-archive)
129
+ * NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page
130
+ * NEW: Ability To Add Polls To Excerpt
131
+ * NEW: Added "Random Order" For Sorting Poll's Answers And Poll's Result Answers
132
+ * FIXED: Language Problem By Setting Database Table To UTF8
133
+ * FIXED: Some Text Not Translated In Polls Widget
134
+ * FIXED: 2 Wrong Options Name In Polls Uninstall
135
+ * FIXED: Some Translation Bug in polls-usage.php
136
+
137
+ = Version 2.20 (01-06-2007) =
138
+ * NEW: Poll Archive Link, Individual Poll Header And Footer In Poll Archive Template
139
+ * NEW: Poll Templates Has Now Its Own Page 'WP-Admin -> Polls -> Poll Templates'
140
+ * NEW: Poll Widget Can Now Display Multiple Polls
141
+ * NEW: Ability To Allow User To Select More Than 1 Poll Answer
142
+ * NEW: Added AJAX Style Option: "Show Loading Image With Text"
143
+ * NEW: Added AJAX Style Option: "Show Fading In And Fading Out Of Polls"
144
+ * NEW: Major Changes To The Administration Panel For WP-Polls
145
+ * NEW: AJAX Added To The Administration Panel For WP-Polls
146
+ * NEW: Default Poll's Result Template Will Now Show Number Of Votes Beside The Percentage
147
+ * NEW: Term "Total Votes" Changed To "Total Voters"
148
+ * NEW: Removed Polls From Feed If The Poll Is Embedded Into The Post Using [poll=ID]
149
+ * NEW: Filtering Of Individual Poll Logs
150
+ * FIXED: Poll Archive Will Now Show Only Polls Results
151
+
152
+ = Version 2.14 (01-02-2007) =
153
+ * NEW: Works For WordPress 2.1 Only
154
+ * NEW: Renamed polls-js.js to polls-js.php To Enable PHP Parsing
155
+ * NEW: Ability To Make A Poll Expire
156
+ * NEW: Ability To Make A Future Poll
157
+ * NEW: Future Poll Will Automatically Open When The Poll's Date Is Reached
158
+ * NEW: Expired Poll Will Automatically Closed When The Poll's Date Is Reached
159
+ * NEW: Ablity To Choose What To Do When The Poll Is Closed (Display Result, Remove Poll From Sidebar)
160
+ * FIXED: Future Dated Polls Will Not Appear In The Post/Sidebar/Polls Archive
161
+
162
+ = Version 2.13 (02-01-2007) =
163
+ * NEW: polls.php Now Handles The AJAX Processing Instead Of index.php
164
+ * NEW: Able To Modify The Style Of Poll Results Bar in 'Polls -> Poll Option'
165
+ * NEW: Usage Instructions Is Also Included Within The Plugin Itself
166
+ * NEW: Uninstaller Done By Philippe Corbes
167
+ * NEW: Localization Done By Ravan
168
+ * NEW: Ability To Add HTML Into Poll Question and Answers
169
+ * FIXED: AJAX Not Working On Servers Running On PHP CGI
170
+ * FIXED: Added Some Default Styles To polls-css.css To Ensure That WP-Polls Does Not Break
171
+ * FIXED: Other Languages Not Appearing Properly
172
+ * FIXED: Poll IP Logs Of Deleted Poll's Answer Did Not Get Deleted
173
+ * FIXED: There Is An Error In Voting If There Is Only 1 Poll's Answer
174
+
175
+ = Version 2.12 (01-10-2006) =
176
+ * NEW: Polls Archive Is Now Embedded Into A Page, And Hence No More Integrating Of Polls Archive
177
+ * NEW: WP-Polls Is Now Using DIV To Display The Poll's Results Instead Of The Image Bar
178
+ * NEW: Added Widget Title Option To WP-Polls Widget
179
+ * NEW: Ability To Logged By UserName
180
+ * NEW: Added CSS Class 'wp-polls-image' To All IMG Tags
181
+ * FIXED: If Site URL Doesn't Match WP Option's Site URL, WP-Polls Will Not Work
182
+
183
+ = Version 2.11 (08-06-2006) =
184
+ * NEW: You Can Now Place The Poll On The Sidebar As A Widget
185
+ * NEW: Moved wp-polls.php To wp-content/plugins/polls/ Folder
186
+ * FIXED: AJAX Not Working In Opera Browser
187
+ * FIXED: Poll Not Working On Physical Pages That Is Integrated Into WordPress
188
+
189
+ = Version 2.1 (01-06-2006) =
190
+ * NEW: Poll Is Now Using AJAX
191
+ * NEW: Ability To Close/Open Poll
192
+ * NEW: Added Poll Option For Logging Method
193
+ * NEW: Added Poll Option For Who Can Vote
194
+ * NEW: Added Poll Results Footer Template Variable (Used When User Click "View Results")
195
+ * NEW: Added The Ability To Delete All Poll Logs Or Logs From A Specific Poll
196
+ * NEW: Poll Administration Panel And The Code That WP-Polls Generated Is XHTML 1.0 Transitional
197
+
198
+ = Version 2.06b (26-04-2006) =
199
+ * FIXED: Bug In vote_poll();
200
+
201
+ = Version 2.06a (02-04-2006) =
202
+ * FIXED: Random Poll Not Working Correctly
203
+
204
+ = Version 2.06 (01-04-2006) =
205
+ * NEW: Poll Bar Is Slightly Nicer
206
+ * NEW: Got Rid Of Tables, Now Using List
207
+ * NEW: Added In Most Voted And Least Voted Answer/Votes/Percentage For Individual Poll As Template Variables
208
+ * NEW: Display Random Poll Option Under Poll -> Poll Options -> Current Poll
209
+ * FIXED: Totally Removed Tables In wp-polls.php
210
+
211
+ = Version 2.05 (01-03-2006) =
212
+ * NEW: Improved On 'manage_polls' Capabilities
213
+ * NEW: Neater Structure
214
+ * NEW: No More Install/Upgrade File, It Will Install/Upgrade When You Activate The Plugin
215
+ * NEW: Added Poll Stats Function
216
+
217
+ = Version 2.04 (01-02-2006) =
218
+ * NEW: Added 'manage_polls' Capabilities To Administrator Role
219
+ * NEW: [poll=POLL_ID] Tag To Insert Poll Into A Post
220
+ * NEW: Ability To Edit Poll's Timestamp
221
+ * NEW: Ability To Edit Individual Poll's Answer Votes
222
+ * NEW: %POLL_RESULT_URL% To Display Poll's Result URL
223
+ * FIXED: Cannot Sent Header Error
224
+
225
+ = Version 2.03 (01-01-2006) =
226
+ * NEW: Compatible With WordPress 2.0 Only
227
+ * NEW: Poll Administration Menu Added Automatically Upon Activating The Plugin
228
+ * NEW: Removed Add Poll Link From The Administration Menu
229
+ * NEW: GPL License Added
230
+ * NEW: Page Title Added To wp-polls.php
231
+
232
+ = Version 2.02a (17-11-2005) =
233
+ * FIXED: poll-install.php And poll-upgrade.php will Now Be Installed/Upgraded To 2.02 Instead Of 2.01
234
+
235
+ = Version 2.02 (05-11-2005) =
236
+ * FIXED: Showing 0 Vote On Poll Edit Page
237
+ * FIXED: Null Vote Being Counted As A Vote
238
+ * FIXED: Auto Loading Of Poll Option: Polls Per Page In Poll Archive Page Is Now "No"
239
+ * NEW: Host Column In Poll IP Table To Prevent Network Lagging When Resolving IP
240
+ * NEW: New Poll Error Template
241
+
242
+ = Version 2.01 (25-10-2005) =
243
+ * FIXED: Upgrade Script To Insert Lastest Poll ID Of User's Current Polls, Instead Of Poll ID 1
244
+ * FIXED: Replace All <?### With <?php
245
+ * FIXED: Added addalshes() To $pollip_user
246
+ * FIXED: Better Localization Support (80% Done, Will Leave It In The Mean Time)
247
+
248
+ = Version 2.0 (20-10-2005) =
249
+ * NEW: IP Logging
250
+ * NEW: Poll Options: Sorting Of Answers In Voting Form
251
+ * NEW: Poll Options: Sorting Of Answers In Results View
252
+ * NEW: Poll Options: Number Of Polls Per Page In Poll Archive
253
+ * NEW: Poll Options: Choose Poll To Display On Index Page
254
+ * NEW: Poll Options: Able To Disable Poll With Custom Message
255
+ * NEW: Poll Options: Poll Templates
256
+ * NEW: Display User's Voted Choice
257
+ * FIXED: Better Install/Upgrade Script
258
+
259
+ == Installation ==
260
+
261
+ 1. Open `wp-content/plugins` Folder
262
+ 2. Put: `Folder: wp-polls`
263
+ 3. Activate `WP-Polls` Plugin
264
+ 4. Go to `WP-Admin -> WP-Polls`
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.
282
+ * To show random poll, use `<?php get_poll(-2); ?>`
283
+ * To embed a specific poll in your post, use `[poll id="2"]` where 2 is your poll id.
284
+ * To embed a random poll in your post, use `[poll id="-2"]`
285
+ * To embed a specific poll's result in your post, use `[poll id="2" type="result"]` where 2 is your poll id.
286
+
287
+ = General Usage (With Widget) =
288
+ 1. Go to `WP-Admin -> Appearance -> Widgets`.
289
+ 2. You can add the Polls Widget by clicking on the 'Add' link besides it.
290
+ 3. After adding, you can configure the Polls Widget by clicking on the 'Edit' link besides it.
291
+ 4. Click 'Save Changes'.
292
+ 5. Scroll down for instructions on how to create a Polls Archive.
293
+
294
+ == Upgrading ==
295
+
296
+ 1. Deactivate `WP-Polls` Plugin
297
+ 2. Open `wp-content/plugins` Folder
298
+ 3. Put/Overwrite: `Folder: wp-polls`
299
+ 4. Activate `WP-Polls` Plugin
300
+ 5. Go to `WP-Admin -> Polls -> Polls Templates` and restore all the template variables to `Default`
301
+ 6. Go to `WP-Admin -> Appearance -> Widgets` and re-add the Poll Widget
302
+
303
+ == Upgrade Notice ==
304
+
305
+ N/A
306
+
307
+ == Screenshots ==
308
+
309
+ 1. Admin - All Poll
310
+ 2. Admin - Manage Polls
311
+ 3. Admin - Poll Options
312
+ 4. Admin - Poll Templates
313
+ 5. Admin - Poll Widget
314
+ 6. Admin - Uninstall Poll
315
+ 7. Poll - Single Poll Answer
316
+ 8. Poll - Mutiple Poll Answers
317
+ 9. Poll - Results
318
+ 10. Poll - Archive
319
+
320
+ == Frequently Asked Questions ==
321
+
322
+
323
+ = How To Add A Polls Archive? =
324
+ 1. Go to `WP-Admin -> Pages -> Add New`.
325
+ 2. Type any title you like in the post's title area.
326
+ 3. If you ARE using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an 'Edit' link just beside the permalink.
327
+ 4. Click 'Edit' and type in `pollsarchive` in the text field and click 'Save'.
328
+ 5. Type `[page_polls]` in the post's content area.
329
+ 6. Click 'Publish'.
330
+
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? =
339
+ * To solve this issue, Open poll-css.css
340
+ * Find: `/* background-color: #ffffff; */`
341
+ * Replace: `background-color: #ffffff;` (where #ffffff should be your background color for the poll.)
342
+
343
+ = How Do I Have Individual Colors For Each Poll's Bar? =
344
+ * Courtesy Of [TreedBox.com](http://treedbox.com "TreedBox.com")
345
+ * Open poll-css.css
346
+ * Add to the end of the file:
347
+
348
+ <code>
349
+ .wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5}
350
+ .wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8}
351
+ .wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b}
352
+ .wp-polls-ul li:nth-child(04) .pollbar{ background:#a61e2a}
353
+ .wp-polls-ul li:nth-child(05) .pollbar{ background:#4ebbff}
354
+ .wp-polls-ul li:nth-child(06) .pollbar{ background:#fbca54}
355
+ .wp-polls-ul li:nth-child(07) .pollbar{ background:#aad34f}
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>
screenshot-1.png ADDED
Binary file
screenshot-10.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
screenshot-6.png ADDED
Binary file
screenshot-7.png ADDED
Binary file
screenshot-8.png ADDED
Binary file
screenshot-9.png ADDED
Binary file
tinymce/plugins/polls/editor_plugin.dev.js CHANGED
@@ -24,7 +24,7 @@
24
  author : 'Lester Chan',
25
  authorurl : 'http://lesterchan.net',
26
  infourl : 'http://lesterchan.net/portfolio/programming/php/',
27
- version : '2.50'
28
  };
29
  }
30
  });
24
  author : 'Lester Chan',
25
  authorurl : 'http://lesterchan.net',
26
  infourl : 'http://lesterchan.net/portfolio/programming/php/',
27
+ version : '2.62'
28
  };
29
  }
30
  });
tinymce/plugins/polls/editor_plugin.js CHANGED
@@ -1 +1 @@
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.50"}}});tinymce.PluginManager.add("polls",tinymce.plugins.PollsPlugin)})();
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)})();
wp-polls.mo DELETED
Binary file
wp-polls.php CHANGED
@@ -1,1597 +1,1766 @@
1
- <?php
2
- /*
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.50
7
- Author: Lester 'GaMerZ' Chan
8
- Author URI: http://lesterchan.net
9
- */
10
-
11
-
12
- /*
13
- Copyright 2009 Lester Chan (email : lesterchan@gmail.com)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
- */
29
-
30
-
31
- ### Load WP-Config File If This File Is Called Directly
32
- if (!function_exists('add_action')) {
33
- $wp_root = '../../..';
34
- if (file_exists($wp_root.'/wp-load.php')) {
35
- require_once($wp_root.'/wp-load.php');
36
- } else {
37
- require_once($wp_root.'/wp-config.php');
38
- }
39
- }
40
-
41
-
42
- ### Create Text Domain For Translations
43
- add_action('init', 'polls_textdomain');
44
- function polls_textdomain() {
45
- load_plugin_textdomain('wp-polls', false, 'wp-polls');
46
- }
47
-
48
-
49
- ### Polls Table Name
50
- global $wpdb;
51
- $wpdb->pollsq = $wpdb->prefix.'pollsq';
52
- $wpdb->pollsa = $wpdb->prefix.'pollsa';
53
- $wpdb->pollsip = $wpdb->prefix.'pollsip';
54
-
55
-
56
- ### Function: Poll Administration Menu
57
- add_action('admin_menu', 'poll_menu');
58
- function poll_menu() {
59
- if (function_exists('add_menu_page')) {
60
- add_menu_page(__('Polls', 'wp-polls'), __('Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-manager.php', '', plugins_url('wp-polls/images/poll.png'));
61
- }
62
- if (function_exists('add_submenu_page')) {
63
- add_submenu_page('wp-polls/polls-manager.php', __('Manage Polls', 'wp-polls'), __('Manage Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-manager.php');
64
- add_submenu_page('wp-polls/polls-manager.php', __('Add Poll', 'wp-polls'), __('Add Poll', 'wp-polls'), 'manage_polls', 'wp-polls/polls-add.php');
65
- add_submenu_page('wp-polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'wp-polls/polls-options.php');
66
- add_submenu_page('wp-polls/polls-manager.php', __('Poll Templates', 'wp-polls'), __('Poll Templates', 'wp-polls'), 'manage_polls', 'wp-polls/polls-templates.php');
67
- 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');
68
- }
69
- }
70
-
71
-
72
- ### Function: Get Poll
73
- function get_poll($temp_poll_id = 0, $display = true) {
74
- global $wpdb, $polls_loaded;
75
- // Poll Result Link
76
- $pollresult_id = intval($_GET['pollresult']);
77
- $temp_poll_id = intval($temp_poll_id);
78
- // Check Whether Poll Is Disabled
79
- if(intval(get_option('poll_currentpoll')) == -1) {
80
- if($display) {
81
- echo stripslashes(get_option('poll_template_disable'));
82
- return;
83
- } else {
84
- return stripslashes(get_option('poll_template_disable'));
85
- }
86
- // Poll Is Enabled
87
- } else {
88
- // Hardcoded Poll ID Is Not Specified
89
- switch($temp_poll_id) {
90
- // Random Poll
91
- case -2:
92
- $poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1");
93
- break;
94
- // Latest Poll
95
- case 0:
96
- // Random Poll
97
- if(intval(get_option('poll_currentpoll')) == -2) {
98
- $random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1");
99
- $poll_id = intval($random_poll_id);
100
- if($pollresult_id > 0) {
101
- $poll_id = $pollresult_id;
102
- } elseif(intval($_POST['poll_id']) > 0) {
103
- $poll_id = intval($_POST['poll_id']);
104
- }
105
- // Current Poll ID Is Not Specified
106
- } elseif(intval(get_option('poll_currentpoll')) == 0) {
107
- // Get Lastest Poll ID
108
- $poll_id = intval(get_option('poll_latestpoll'));
109
- } else {
110
- // Get Current Poll ID
111
- $poll_id = intval(get_option('poll_currentpoll'));
112
- }
113
- break;
114
- // Take Poll ID From Arguments
115
- default:
116
- $poll_id = $temp_poll_id;
117
- }
118
- }
119
-
120
- // Assign All Loaded Poll To $polls_loaded
121
- if(empty($polls_loaded)) {
122
- $polls_loaded = array();
123
- }
124
- if(!in_array($poll_id, $polls_loaded)) {
125
- $polls_loaded[] = $poll_id;
126
- }
127
-
128
- // User Click on View Results Link
129
- if($pollresult_id == $poll_id) {
130
- if($display) {
131
- echo display_pollresult($poll_id);
132
- return;
133
- } else {
134
- return display_pollresult($poll_id);
135
- }
136
- // Check Whether User Has Voted
137
- } else {
138
- $poll_active = $wpdb->get_var("SELECT pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
139
- $poll_active = intval($poll_active);
140
- $check_voted = check_voted($poll_id);
141
- if($poll_active == 0) {
142
- $poll_close = intval(get_option('poll_close'));
143
- } else {
144
- $poll_close = 0;
145
- }
146
- if(intval($check_voted) > 0 || (is_array($check_voted) && sizeof($check_voted) > 0) || ($poll_active == 0 && $poll_close == 1)) {
147
- if($display) {
148
- echo display_pollresult($poll_id, $check_voted);
149
- return;
150
- } else {
151
- return display_pollresult($poll_id, $check_voted);
152
- }
153
- } elseif(!check_allowtovote() || ($poll_active == 0 && $poll_close == 3)) {
154
- $disable_poll_js = '<script type="text/javascript">jQuery("#polls_form_'.$poll_id.' :input").each(function (i){jQuery(this).attr("disabled","disabled")});</script>';
155
- if($display) {
156
- echo display_pollvote($poll_id).$disable_poll_js;
157
- return;
158
- } else {
159
- return display_pollvote($poll_id).$disable_poll_js;
160
- }
161
- } elseif($poll_active == 1) {
162
- if($display) {
163
- echo display_pollvote($poll_id);
164
- return;
165
- } else {
166
- return display_pollvote($poll_id);
167
- }
168
- }
169
- }
170
- }
171
-
172
-
173
- ### Function: Print Polls Stylesheets That Are Dynamic And jQuery At The Top
174
- add_action('wp_head', 'poll_head_scripts');
175
- function poll_head_scripts() {
176
- $pollbar = get_option('poll_bar');
177
- echo '<style type="text/css">'."\n";
178
- if($pollbar['style'] == 'use_css') {
179
- echo '.wp-polls .pollbar {'."\n";
180
- echo "\t".'margin: 1px;'."\n";
181
- echo "\t".'font-size: '.($pollbar['height']-2).'px;'."\n";
182
- echo "\t".'line-height: '.$pollbar['height'].'px;'."\n";
183
- echo "\t".'height: '.$pollbar['height'].'px;'."\n";
184
- echo "\t".'background: #'.$pollbar['background'].';'."\n";
185
- echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n";
186
- echo '}'."\n";
187
- } else {
188
- echo '.wp-polls .pollbar {'."\n";
189
- echo "\t".'margin: 1px;'."\n";
190
- echo "\t".'font-size: '.($pollbar['height']-2).'px;'."\n";
191
- echo "\t".'line-height: '.$pollbar['height'].'px;'."\n";
192
- echo "\t".'height: '.$pollbar['height'].'px;'."\n";
193
- echo "\t".'background-image: url(\''.plugins_url('wp-polls/images/'.$pollbar['style'].'/pollbg.gif').'\');'."\n";
194
- echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n";
195
- echo '}'."\n";
196
- }
197
- echo '</style>'."\n";
198
- wp_print_scripts('jquery');
199
- }
200
-
201
-
202
- ### Function: Enqueue Polls JavaScripts/CSS
203
- add_action('wp_enqueue_scripts', 'poll_scripts');
204
- function poll_scripts() {
205
- global $text_direction;
206
- if(@file_exists(TEMPLATEPATH.'/polls-css.css')) {
207
- wp_enqueue_style('wp-polls', get_stylesheet_directory_uri().'/polls-css.css', false, '2.50', 'all');
208
- } else {
209
- wp_enqueue_style('wp-polls', plugins_url('wp-polls/polls-css.css'), false, '2.50', 'all');
210
- }
211
- if('rtl' == $text_direction) {
212
- if(@file_exists(TEMPLATEPATH.'/polls-css-rtl.css')) {
213
- wp_enqueue_style('wp-polls-rtl', get_stylesheet_directory_uri().'/polls-css-rtl.css', false, '2.50', 'all');
214
- } else {
215
- wp_enqueue_style('wp-polls-rtl', plugins_url('wp-polls/polls-css-rtl.css'), false, '2.50', 'all');
216
- }
217
- }
218
- $poll_ajax_style = get_option('poll_ajax_style');
219
- $pollbar = get_option('poll_bar');
220
- wp_enqueue_script('wp-polls', plugins_url('wp-polls/polls-js.js'), array('jquery'), '2.50', true);
221
- wp_localize_script('wp-polls', 'pollsL10n', array(
222
- 'ajax_url' => plugins_url('wp-polls/wp-polls.php'),
223
- 'text_wait' => __('Your last request is still being processed. Please wait a while ...', 'wp-polls'),
224
- 'text_valid' => __('Please choose a valid poll answer.', 'wp-polls'),
225
- 'text_multiple' => __('Maximum number of choices allowed: ', 'wp-polls'),
226
- 'show_loading' => intval($poll_ajax_style['loading']),
227
- 'show_fading' => intval($poll_ajax_style['fading'])
228
- ));
229
- }
230
-
231
-
232
- ### Function: Enqueue Polls Stylesheets/JavaScripts In WP-Admin
233
- add_action('admin_enqueue_scripts', 'poll_scripts_admin');
234
- function poll_scripts_admin($hook_suffix) {
235
- global $text_direction;
236
- $poll_admin_pages = array('wp-polls/polls-manager.php', 'wp-polls/polls-add.php', 'wp-polls/polls-options.php', 'wp-polls/polls-templates.php', 'wp-polls/polls-uninstall.php');
237
- if(in_array($hook_suffix, $poll_admin_pages)) {
238
- wp_enqueue_style('wp-polls-admin', plugins_url('wp-polls/polls-admin-css.css'), false, '2.50', 'all');
239
- wp_enqueue_script('wp-polls-admin', plugins_url('wp-polls/polls-admin-js.js'), array('jquery'), '2.50', true);
240
- wp_localize_script('wp-polls-admin', 'pollsAdminL10n', array(
241
- 'admin_ajax_url' => plugins_url('wp-polls/polls-admin-ajax.php'),
242
- 'text_direction' => ('rtl' == $text_direction) ? 'left' : 'right',
243
- 'text_delete_poll' => __('Delete Poll', 'wp-polls'),
244
- 'text_no_poll_logs' => __('No poll logs available.', 'wp-polls'),
245
- 'text_delete_all_logs' => __('Delete All Logs', 'wp-polls'),
246
- 'text_checkbox_delete_all_logs' => __('Please check the \\\'Yes\\\' checkbox if you want to delete all logs.', 'wp-polls'),
247
- 'text_delete_poll_logs' => __('Delete Logs For This Poll Only', 'wp-polls'),
248
- 'text_checkbox_delete_poll_logs' => __('Please check the \\\'Yes\\\' checkbox if you want to delete all logs for this poll ONLY.', 'wp-polls'),
249
- 'text_delete_poll_ans' => __('Delete Poll Answer', 'wp-polls'),
250
- 'text_open_poll' => __('Open Poll', 'wp-polls'),
251
- 'text_close_poll' => __('Close Poll', 'wp-polls'),
252
- 'text_answer' => __('Answer', 'wp-polls'),
253
- 'text_remove_poll_answer' => __('Remove', 'wp-polls')
254
- ));
255
- }
256
- }
257
-
258
-
259
- ### Function: Displays Polls Footer In WP-Admin
260
- add_action('admin_footer-post-new.php', 'poll_footer_admin');
261
- add_action('admin_footer-post.php', 'poll_footer_admin');
262
- add_action('admin_footer-page-new.php', 'poll_footer_admin');
263
- add_action('admin_footer-page.php', 'poll_footer_admin');
264
- function poll_footer_admin() {
265
- // Javascript Code Courtesy Of WP-AddQuicktag (http://bueltge.de/wp-addquicktags-de-plugin/120/)
266
- echo '<script type="text/javascript">'."\n";
267
- echo '/* <![CDATA[ */'."\n";
268
- echo "\t".'var pollsEdL10n = {'."\n";
269
- echo "\t\t".'enter_poll_id: "'.js_escape(__('Enter Poll ID', 'wp-polls')).'",'."\n";
270
- echo "\t\t".'enter_poll_id_again: "'.js_escape(__('Error: Poll ID must be numeric', 'wp-polls')).'\n\n'.js_escape(__('Please enter Poll ID again', 'wp-polls')).'",'."\n";
271
- echo "\t\t".'poll: "'.js_escape(__('Poll', 'wp-polls')).'",'."\n";
272
- echo "\t\t".'insert_poll: "'.js_escape(__('Insert_Poll', 'wp-polls')).'",'."\n";
273
- echo "\t".'};'."\n";
274
- echo "\t".'function insertPoll(where, myField) {'."\n";
275
- echo "\t\t".'var poll_id = jQuery.trim(prompt(pollsEdL10n.enter_poll_id));'."\n";
276
- echo "\t\t".'while(isNaN(poll_id)) {'."\n";
277
- echo "\t\t\t".'poll_id = jQuery.trim(prompt(pollsEdL10n.enter_poll_id_again));'."\n";
278
- echo "\t\t".'}'."\n";
279
- echo "\t\t".'if (poll_id >= -1 && poll_id != null && poll_id != "") {'."\n";
280
- echo "\t\t\t".'if(where == \'code\') {'."\n";
281
- echo "\t\t\t\t".'edInsertContent(myField, \'[poll id="\' + poll_id + \'"]\');'."\n";
282
- echo "\t\t\t".'} else {'."\n";
283
- echo "\t\t\t\t".'return \'[poll id="\' + poll_id + \'"]\';'."\n";
284
- echo "\t\t\t".'}'."\n";
285
- echo "\t\t".'}'."\n";
286
- echo "\t".'}'."\n";
287
- echo "\t".'if(document.getElementById("ed_toolbar")){'."\n";
288
- echo "\t\t".'qt_toolbar = document.getElementById("ed_toolbar");'."\n";
289
- echo "\t\t".'edButtons[edButtons.length] = new edButton("ed_poll",pollsEdL10n.poll, "", "","");'."\n";
290
- echo "\t\t".'var qt_button = qt_toolbar.lastChild;'."\n";
291
- echo "\t\t".'while (qt_button.nodeType != 1){'."\n";
292
- echo "\t\t\t".'qt_button = qt_button.previousSibling;'."\n";
293
- echo "\t\t".'}'."\n";
294
- echo "\t\t".'qt_button = qt_button.cloneNode(true);'."\n";
295
- echo "\t\t".'qt_button.value = pollsEdL10n.poll;'."\n";
296
- echo "\t\t".'qt_button.title = pollsEdL10n.insert_poll;'."\n";
297
- echo "\t\t".'qt_button.onclick = function () { insertPoll(\'code\', edCanvas);}'."\n";
298
- echo "\t\t".'qt_button.id = "ed_poll";'."\n";
299
- echo "\t\t".'qt_toolbar.appendChild(qt_button);'."\n";
300
- echo "\t".'}'."\n";
301
- echo '/* ]]> */'."\n";
302
- echo '</script>'."\n";
303
- }
304
-
305
-
306
- ### Function: Add Favourite Actions >= WordPress 2.7
307
- add_filter('favorite_actions', 'poll_favorite_actions');
308
- function poll_favorite_actions($favorite_actions) {
309
- $favorite_actions['admin.php?page=wp-polls/polls-add.php'] = array(__('Add Poll', 'wp-polls'), 'manage_polls');
310
- return $favorite_actions;
311
- }
312
-
313
-
314
- ### Function: Add Quick Tag For Poll In TinyMCE >= WordPress 2.5
315
- add_action('init', 'poll_tinymce_addbuttons');
316
- function poll_tinymce_addbuttons() {
317
- if(!current_user_can('edit_posts') && ! current_user_can('edit_pages')) {
318
- return;
319
- }
320
- if(get_user_option('rich_editing') == 'true') {
321
- add_filter("mce_external_plugins", "poll_tinymce_addplugin");
322
- add_filter('mce_buttons', 'poll_tinymce_registerbutton');
323
- }
324
- }
325
- function poll_tinymce_registerbutton($buttons) {
326
- array_push($buttons, 'separator', 'polls');
327
- return $buttons;
328
- }
329
- function poll_tinymce_addplugin($plugin_array) {
330
- $plugin_array['polls'] = plugins_url('wp-polls/tinymce/plugins/polls/editor_plugin.js');
331
- return $plugin_array;
332
- }
333
-
334
-
335
- ### Function: Check Who Is Allow To Vote
336
- function check_allowtovote() {
337
- global $user_ID;
338
- $user_ID = intval($user_ID);
339
- $allow_to_vote = intval(get_option('poll_allowtovote'));
340
- switch($allow_to_vote) {
341
- // Guests Only
342
- case 0:
343
- if($user_ID > 0) {
344
- return false;
345
- }
346
- return true;
347
- break;
348
- // Registered Users Only
349
- case 1:
350
- if($user_ID == 0) {
351
- return false;
352
- }
353
- return true;
354
- break;
355
- // Registered Users And Guests
356
- case 2:
357
- default:
358
- return true;
359
- }
360
- }
361
-
362
-
363
- ### Funcrion: Check Voted By Cookie Or IP
364
- function check_voted($poll_id) {
365
- $poll_logging_method = intval(get_option('poll_logging_method'));
366
- switch($poll_logging_method) {
367
- // Do Not Log
368
- case 0:
369
- return 0;
370
- break;
371
- // Logged By Cookie
372
- case 1:
373
- return check_voted_cookie($poll_id);
374
- break;
375
- // Logged By IP
376
- case 2:
377
- return check_voted_ip($poll_id);
378
- break;
379
- // Logged By Cookie And IP
380
- case 3:
381
- $check_voted_cookie = check_voted_cookie($poll_id);
382
- if(!empty($check_voted_cookie)) {
383
- return $check_voted_cookie;
384
- } else {
385
- return check_voted_ip($poll_id);
386
- }
387
- break;
388
- // Logged By Username
389
- case 4:
390
- return check_voted_username($poll_id);
391
- break;
392
- }
393
- }
394
-
395
-
396
- ### Function: Check Voted By Cookie
397
- function check_voted_cookie($poll_id) {
398
- if(!empty($_COOKIE["voted_$poll_id"])) {
399
- $get_voted_aids = explode(',', $_COOKIE["voted_$poll_id"]);
400
- } else {
401
- $get_voted_aids = 0;
402
- }
403
- return $get_voted_aids;
404
- }
405
-
406
-
407
- ### Function: Check Voted By IP
408
- function check_voted_ip($poll_id) {
409
- global $wpdb;
410
- $log_expiry = intval(get_option('poll_cookielog_expiry'));
411
- $log_expiry_sql = '';
412
- if($log_expiry > 0) {
413
- $log_expiry_sql = 'AND ('.current_time('timestamp').'-(pollip_timestamp+0)) < '.$log_expiry;
414
- }
415
- // Check IP From IP Logging Database
416
- $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."' $log_expiry_sql");
417
- if($get_voted_aids) {
418
- return $get_voted_aids;
419
- } else {
420
- return 0;
421
- }
422
- }
423
-
424
-
425
- ### Function: Check Voted By Username
426
- function check_voted_username($poll_id) {
427
- global $wpdb, $user_ID;
428
- // Check IP If User Is Guest
429
- if (!is_user_logged_in()) {
430
- return 1;
431
- }
432
- $pollsip_userid = intval($user_ID);
433
- $log_expiry = intval(get_option('poll_cookielog_expiry'));
434
- $log_expiry_sql = '';
435
- if($log_expiry > 0) {
436
- $log_expiry_sql = 'AND ('.current_time('timestamp').'-(pollip_timestamp+0)) < '.$log_expiry;
437
- }
438
- // Check User ID From IP Logging Database
439
- $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid = $pollsip_userid $log_expiry_sql");
440
- if($get_voted_aids) {
441
- return $get_voted_aids;
442
- } else {
443
- return 0;
444
- }
445
- }
446
-
447
-
448
- ### Function: Display Voting Form
449
- function display_pollvote($poll_id, $display_loading = true) {
450
- global $wpdb;
451
- // Temp Poll Result
452
- $temp_pollvote = '';
453
- // Get Poll Question Data
454
- $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_timestamp, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
455
- // Poll Question Variables
456
- $poll_question_text = stripslashes($poll_question->pollq_question);
457
- $poll_question_id = intval($poll_question->pollq_id);
458
- $poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
459
- $poll_question_totalvoters = intval($poll_question->pollq_totalvoters);
460
- $poll_start_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
461
- $poll_expiry = trim($poll_question->pollq_expiry);
462
- if(empty($poll_expiry)) {
463
- $poll_end_date = __('No Expiry', 'wp-polls');
464
- } else {
465
- $poll_end_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
466
- }
467
- $poll_multiple_ans = intval($poll_question->pollq_multiple);
468
- $template_question = stripslashes(get_option('poll_template_voteheader'));
469
- $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
470
- $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
471
- $template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
472
- $template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question);
473
- $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
474
- $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
475
- if($poll_multiple_ans > 0) {
476
- $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question);
477
- } else {
478
- $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
479
- }
480
- // Get Poll Answers Data
481
- $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_sortby').' '.get_option('poll_ans_sortorder'));
482
- // If There Is Poll Question With Answers
483
- if($poll_question && $poll_answers) {
484
- // Display Poll Voting Form
485
- $temp_pollvote .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
486
- $temp_pollvote .= "\t<form id=\"polls_form_$poll_question_id\" class=\"wp-polls-form\" action=\"".htmlspecialchars($_SERVER['REQUEST_URI'])."\" method=\"post\">\n";
487
- $temp_pollvote .= "\t\t<p style=\"display: none;\"><input type=\"hidden\" name=\"poll_id\" value=\"$poll_question_id\" /></p>\n";
488
- if($poll_multiple_ans > 0) {
489
- $temp_pollvote .= "\t\t<p style=\"display: none;\"><input type=\"hidden\" id=\"poll_multiple_ans_$poll_question_id\" name=\"poll_multiple_ans_$poll_question_id\" value=\"$poll_multiple_ans\" /></p>\n";
490
- }
491
- // Print Out Voting Form Header Template
492
- $temp_pollvote .= "\t\t$template_question\n";
493
- foreach($poll_answers as $poll_answer) {
494
- // Poll Answer Variables
495
- $poll_answer_id = intval($poll_answer->polla_aid);
496
- $poll_answer_text = stripslashes($poll_answer->polla_answers);
497
- $poll_answer_votes = intval($poll_answer->polla_votes);
498
- $template_answer = stripslashes(get_option('poll_template_votebody'));
499
- $template_answer = str_replace("%POLL_ID%", $poll_question_id, $template_answer);
500
- $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
501
- $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
502
- $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($poll_answer_votes), $template_answer);
503
- if($poll_multiple_ans > 0) {
504
- $template_answer = str_replace("%POLL_CHECKBOX_RADIO%", 'checkbox', $template_answer);
505
- } else {
506
- $template_answer = str_replace("%POLL_CHECKBOX_RADIO%", 'radio', $template_answer);
507
- }
508
- // Print Out Voting Form Body Template
509
- $temp_pollvote .= "\t\t$template_answer\n";
510
- }
511
- // Determine Poll Result URL
512
- $poll_result_url = $_SERVER['REQUEST_URI'];
513
- $poll_result_url = preg_replace('/pollresult=(\d+)/i', 'pollresult='.$poll_question_id, $poll_result_url);
514
- if(intval($_GET['pollresult']) == 0) {
515
- if(strpos($poll_result_url, '?') !== false) {
516
- $poll_result_url = "$poll_result_url&amp;pollresult=$poll_question_id";
517
- } else {
518
- $poll_result_url = "$poll_result_url?pollresult=$poll_question_id";
519
- }
520
- }
521
- // Voting Form Footer Variables
522
- $template_footer = stripslashes(get_option('poll_template_votefooter'));
523
- $template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
524
- $template_footer = str_replace("%POLL_RESULT_URL%", $poll_result_url, $template_footer);
525
- $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
526
- $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
527
- if($poll_multiple_ans > 0) {
528
- $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer);
529
- } else {
530
- $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
531
- }
532
- // Print Out Voting Form Footer Template
533
- $temp_pollvote .= "\t\t$template_footer\n";
534
- $temp_pollvote .= "\t</form>\n";
535
- $temp_pollvote .= "</div>\n";
536
- if($display_loading) {
537
- $poll_ajax_style = get_option('poll_ajax_style');
538
- if(intval($poll_ajax_style['loading']) == 1) {
539
- $temp_pollvote .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".plugins_url('wp-polls/images/loading.gif')."\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" />&nbsp;".__('Loading', 'wp-polls')." ...</div>\n";
540
- }
541
- }
542
- } else {
543
- $temp_pollvote .= stripslashes(get_option('poll_template_disable'));
544
- }
545
- // Return Poll Vote Template
546
- return $temp_pollvote;
547
- }
548
-
549
-
550
- ### Function: Display Results Form
551
- function display_pollresult($poll_id, $user_voted = '', $display_loading = true) {
552
- global $wpdb;
553
- // User Voted
554
- if(!is_array($user_voted)) {
555
- $user_voted = array();
556
- }
557
- // Temp Poll Result
558
- $temp_pollresult = '';
559
- // Most/Least Variables
560
- $poll_most_answer = '';
561
- $poll_most_votes = 0;
562
- $poll_most_percentage = 0;
563
- $poll_least_answer = '';
564
- $poll_least_votes = 0;
565
- $poll_least_percentage = 0;
566
- // Get Poll Question Data
567
- $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_active, pollq_timestamp, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
568
- // Poll Question Variables
569
- $poll_question_text = stripslashes($poll_question->pollq_question);
570
- $poll_question_id = intval($poll_question->pollq_id);
571
- $poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
572
- $poll_question_totalvoters = intval($poll_question->pollq_totalvoters);
573
- $poll_question_active = intval($poll_question->pollq_active);
574
- $poll_start_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
575
- $poll_expiry = trim($poll_question->pollq_expiry);
576
- if(empty($poll_expiry)) {
577
- $poll_end_date = __('No Expiry', 'wp-polls');
578
- } else {
579
- $poll_end_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
580
- }
581
- $poll_multiple_ans = intval($poll_question->pollq_multiple);
582
- $template_question = stripslashes(get_option('poll_template_resultheader'));
583
- $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
584
- $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
585
- $template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
586
- $template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question);
587
- $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
588
- $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
589
- if($poll_multiple_ans > 0) {
590
- $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question);
591
- } else {
592
- $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
593
- }
594
- // Get Poll Answers Data
595
- $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder'));
596
- // If There Is Poll Question With Answers
597
- if($poll_question && $poll_answers) {
598
- // Store The Percentage Of The Poll
599
- $poll_answer_percentage_array = array();
600
- // Is The Poll Total Votes 0?
601
- $poll_totalvotes_zero = true;
602
- if($poll_question_totalvotes > 0) {
603
- $poll_totalvotes_zero = false;
604
- }
605
- // Print Out Result Header Template
606
- $temp_pollresult .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
607
- $temp_pollresult .= "\t\t$template_question\n";
608
- foreach($poll_answers as $poll_answer) {
609
- // Poll Answer Variables
610
- $poll_answer_id = intval($poll_answer->polla_aid);
611
- $poll_answer_text = stripslashes($poll_answer->polla_answers);
612
- $poll_answer_votes = intval($poll_answer->polla_votes);
613
- $poll_answer_percentage = 0;
614
- $poll_answer_imagewidth = 0;
615
- // Calculate Percentage And Image Bar Width
616
- if(!$poll_totalvotes_zero) {
617
- if($poll_answer_votes > 0) {
618
- $poll_answer_percentage = round((($poll_answer_votes/$poll_question_totalvoters)*100));
619
- $poll_answer_imagewidth = round($poll_answer_percentage);
620
- if($poll_answer_imagewidth == 100) {
621
- $poll_answer_imagewidth = 99;
622
- }
623
- } else {
624
- $poll_answer_percentage = 0;
625
- $poll_answer_imagewidth = 1;
626
- }
627
- } else {
628
- $poll_answer_percentage = 0;
629
- $poll_answer_imagewidth = 1;
630
- }
631
- // Make Sure That Total Percentage Is 100% By Adding A Buffer To The Last Poll Answer
632
- if($poll_multiple_ans == 0) {
633
- $poll_answer_percentage_array[] = $poll_answer_percentage;
634
- if(sizeof($poll_answer_percentage_array) == sizeof($poll_answers)) {
635
- $percentage_error_buffer = 100 - array_sum($poll_answer_percentage_array);
636
- $poll_answer_percentage = $poll_answer_percentage + $percentage_error_buffer;
637
- }
638
- }
639
- // Let User See What Options They Voted
640
- if(in_array($poll_answer_id, $user_voted)) {
641
- // Results Body Variables
642
- $template_answer = stripslashes(get_option('poll_template_resultbody2'));
643
- $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
644
- $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
645
- $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($poll_answer_text)), $template_answer);
646
- $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($poll_answer_votes), $template_answer);
647
- $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
648
- $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
649
- // Print Out Results Body Template
650
- $temp_pollresult .= "\t\t$template_answer\n";
651
- } else {
652
- // Results Body Variables
653
- $template_answer = stripslashes(get_option('poll_template_resultbody'));
654
- $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
655
- $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
656
- $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($poll_answer_text)), $template_answer);
657
- $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($poll_answer_votes), $template_answer);
658
- $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
659
- $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
660
- // Print Out Results Body Template
661
- $temp_pollresult .= "\t\t$template_answer\n";
662
- }
663
- // Get Most Voted Data
664
- if($poll_answer_votes > $poll_most_votes) {
665
- $poll_most_answer = $poll_answer_text;
666
- $poll_most_votes = $poll_answer_votes;
667
- $poll_most_percentage = $poll_answer_percentage;
668
- }
669
- // Get Least Voted Data
670
- if($poll_least_votes == 0) {
671
- $poll_least_votes = $poll_answer_votes;
672
- }
673
- if($poll_answer_votes <= $poll_least_votes) {
674
- $poll_least_answer = $poll_answer_text;
675
- $poll_least_votes = $poll_answer_votes;
676
- $poll_least_percentage = $poll_answer_percentage;
677
- }
678
- }
679
- // Results Footer Variables
680
- if(!empty($user_voted) || $poll_question_active == 0 || !check_allowtovote()) {
681
- $template_footer = stripslashes(get_option('poll_template_resultfooter'));
682
- } else {
683
- $template_footer = stripslashes(get_option('poll_template_resultfooter2'));
684
- }
685
- $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
686
- $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
687
- $template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
688
- $template_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($poll_question_totalvotes), $template_footer);
689
- $template_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($poll_question_totalvoters), $template_footer);
690
- $template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
691
- $template_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_footer);
692
- $template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
693
- $template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
694
- $template_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_footer);
695
- $template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
696
- if($poll_multiple_ans > 0) {
697
- $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer);
698
- } else {
699
- $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
700
- }
701
- // Print Out Results Footer Template
702
- $temp_pollresult .= "\t\t$template_footer\n";
703
- $temp_pollresult .= "</div>\n";
704
- if($display_loading) {
705
- $poll_ajax_style = get_option('poll_ajax_style');
706
- if(intval($poll_ajax_style['loading']) == 1) {
707
- $temp_pollresult .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".plugins_url('wp-polls/images/loading.gif')."\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" />&nbsp;".__('Loading', 'wp-polls')." ...</div>\n";
708
- }
709
- }
710
- } else {
711
- $temp_pollresult .= stripslashes(get_option('poll_template_disable'));
712
- }
713
- // Return Poll Result
714
- return $temp_pollresult;
715
- }
716
-
717
-
718
- ### Function: Get IP Address
719
- if(!function_exists('get_ipaddress')) {
720
- function get_ipaddress() {
721
- if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
722
- $ip_address = $_SERVER["REMOTE_ADDR"];
723
- } else {
724
- $ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
725
- }
726
- if(strpos($ip_address, ',') !== false) {
727
- $ip_address = explode(',', $ip_address);
728
- $ip_address = $ip_address[0];
729
- }
730
- return esc_attr($ip_address);
731
- }
732
- }
733
-
734
-
735
- ### Function: Short Code For Inserting Polls Archive Into Page
736
- add_shortcode('page_polls', 'poll_page_shortcode');
737
- function poll_page_shortcode($atts) {
738
- return polls_archive();
739
- }
740
-
741
-
742
- ### Function: Short Code For Inserting Polls Into Posts
743
- add_shortcode('poll', 'poll_shortcode');
744
- function poll_shortcode($atts) {
745
- extract(shortcode_atts(array('id' => 0, 'type' => 'vote'), $atts));
746
- if(!is_feed()) {
747
- if($type == 'vote') {
748
- return get_poll($id, false);
749
- } elseif($type == 'result') {
750
- return display_pollresult($id);
751
- }
752
- } else {
753
- return __('Note: There is a poll embedded within this post, please visit the site to participate in this post\'s poll.', 'wp-polls');
754
- }
755
- }
756
-
757
-
758
- ### Function: Get Poll Total Questions
759
- if(!function_exists('get_pollquestions')) {
760
- function get_pollquestions($display = true) {
761
- global $wpdb;
762
- $totalpollq = intval($wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq"));
763
- if($display) {
764
- echo $totalpollq;
765
- } else {
766
- return $totalpollq;
767
- }
768
- }
769
- }
770
-
771
-
772
- ### Function: Get Poll Total Answers
773
- if(!function_exists('get_pollanswers')) {
774
- function get_pollanswers($display = true) {
775
- global $wpdb;
776
- $totalpolla = intval($wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa"));
777
- if($display) {
778
- echo $totalpolla;
779
- } else {
780
- return $totalpolla;
781
- }
782
- }
783
- }
784
-
785
-
786
- ### Function: Get Poll Total Votes
787
- if(!function_exists('get_pollvotes')) {
788
- function get_pollvotes($display = true) {
789
- global $wpdb;
790
- $totalvotes = intval($wpdb->get_var("SELECT SUM(pollq_totalvotes) FROM $wpdb->pollsq"));
791
- if($display) {
792
- echo $totalvotes;
793
- } else {
794
- return $totalvotes;
795
- }
796
- }
797
- }
798
-
799
-
800
- ### Function: Get Poll Total Voters
801
- if(!function_exists('get_pollvoters')) {
802
- function get_pollvoters($display = true) {
803
- global $wpdb;
804
- $totalvoters = intval($wpdb->get_var("SELECT SUM(pollq_totalvoters) FROM $wpdb->pollsq"));
805
- if($display) {
806
- echo $totalvoters;
807
- } else {
808
- return $totalvoters;
809
- }
810
- }
811
- }
812
-
813
-
814
- ### Function: Check Voted To Get Voted Answer
815
- function check_voted_multiple($poll_id, $polls_ips) {
816
- if(!empty($_COOKIE["voted_$poll_id"])) {
817
- return explode(',', $_COOKIE["voted_$poll_id"]);
818
- } else {
819
- if($polls_ips) {
820
- return $polls_ips;
821
- } else {
822
- return array();
823
- }
824
- }
825
- }
826
-
827
-
828
- ### Function: Polls Archive Link
829
- function polls_archive_link($page) {
830
- $polls_archive_url = get_option('poll_archive_url');
831
- if($page > 0) {
832
- if(strpos($polls_archive_url, '?') !== false) {
833
- $polls_archive_url = "$polls_archive_url&amp;poll_page=$page";
834
- } else {
835
- $polls_archive_url = "$polls_archive_url?poll_page=$page";
836
- }
837
- }
838
- return $polls_archive_url;
839
- }
840
-
841
-
842
- ### Function: Displays Polls Archive Link
843
- function display_polls_archive_link($display = true) {
844
- $template_pollarchivelink = stripslashes(get_option('poll_template_pollarchivelink'));
845
- $template_pollarchivelink = str_replace("%POLL_ARCHIVE_URL%", get_option('poll_archive_url'), $template_pollarchivelink);
846
- if($display) {
847
- echo $template_pollarchivelink;
848
- } else{
849
- return $template_pollarchivelink;
850
- }
851
- }
852
-
853
-
854
- ### Function: Display Polls Archive
855
- function polls_archive() {
856
- global $wpdb, $in_pollsarchive;
857
- // Polls Variables
858
- $in_pollsarchive = true;
859
- $page = intval($_GET['poll_page']);
860
- $polls_questions = array();
861
- $polls_answers = array();
862
- $polls_ip = array();
863
- $polls_perpage = intval(get_option('poll_archive_perpage'));
864
- $poll_questions_ids = '0';
865
- $poll_voted = false;
866
- $poll_voted_aid = 0;
867
- $poll_id = 0;
868
- $pollsarchive_output_archive = '';
869
- $polls_type = intval(get_option('poll_archive_displaypoll'));
870
- $polls_type_sql = '';
871
- // Determine What Type Of Polls To Show
872
- switch($polls_type) {
873
- case 1:
874
- $polls_type_sql = 'pollq_active = 0';
875
- break;
876
- case 2:
877
- $polls_type_sql = 'pollq_active = 1';
878
- break;
879
- case 3:
880
- $polls_type_sql = 'pollq_active IN (0,1)';
881
- break;
882
- }
883
- // Get Total Polls
884
- $total_polls = $wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq WHERE $polls_type_sql AND pollq_active != -1");
885
-
886
- // Calculate Paging
887
- $numposts = $total_polls;
888
- $perpage = $polls_perpage;
889
- $max_page = ceil($numposts/$perpage);
890
- if(empty($page) || $page == 0) {
891
- $page = 1;
892
- }
893
- $offset = ($page-1) * $perpage;
894
- $pages_to_show = 10;
895
- $pages_to_show_minus_1 = $pages_to_show-1;
896
- $half_page_start = floor($pages_to_show_minus_1/2);
897
- $half_page_end = ceil($pages_to_show_minus_1/2);
898
- $start_page = $page - $half_page_start;
899
- if($start_page <= 0) {
900
- $start_page = 1;
901
- }
902
- $end_page = $page + $half_page_end;
903
- if(($end_page - $start_page) != $pages_to_show_minus_1) {
904
- $end_page = $start_page + $pages_to_show_minus_1;
905
- }
906
- if($end_page > $max_page) {
907
- $start_page = $max_page - $pages_to_show_minus_1;
908
- $end_page = $max_page;
909
- }
910
- if($start_page <= 0) {
911
- $start_page = 1;
912
- }
913
- if(($offset + $perpage) > $numposts) {
914
- $max_on_page = $numposts;
915
- } else {
916
- $max_on_page = ($offset + $perpage);
917
- }
918
- if (($offset + 1) > ($numposts)) {
919
- $display_on_page = $numposts;
920
- } else {
921
- $display_on_page = ($offset + 1);
922
- }
923
-
924
- // Get Poll Questions
925
- $questions = $wpdb->get_results("SELECT * FROM $wpdb->pollsq WHERE $polls_type_sql ORDER BY pollq_id DESC LIMIT $offset, $polls_perpage");
926
- if($questions) {
927
- foreach($questions as $question) {
928
- $polls_questions[] = array('id' => intval($question->pollq_id), 'question' => stripslashes($question->pollq_question), 'timestamp' => $question->pollq_timestamp, 'totalvotes' => intval($question->pollq_totalvotes), 'start' => $question->pollq_timestamp, 'end' => trim($question->pollq_expiry), 'multiple' => intval($question->pollq_multiple), 'totalvoters' => intval($question->pollq_totalvoters));
929
- $poll_questions_ids .= intval($question->pollq_id).', ';
930
- }
931
- $poll_questions_ids = substr($poll_questions_ids, 0, -2);
932
- }
933
-
934
- // Get Poll Answers
935
- $answers = $wpdb->get_results("SELECT polla_aid, polla_qid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid IN ($poll_questions_ids) ORDER BY ".get_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder'));
936
- if($answers) {
937
- foreach($answers as $answer) {
938
- $polls_answers[intval($answer->polla_qid)][] = array('aid' => intval($answer->polla_aid), 'qid' => intval($answer->polla_qid), 'answers' => stripslashes($answer->polla_answers), 'votes' => intval($answer->polla_votes));
939
- }
940
- }
941
-
942
- // Get Poll IPs
943
- $ips = $wpdb->get_results("SELECT pollip_qid, pollip_aid FROM $wpdb->pollsip WHERE pollip_qid IN ($poll_questions_ids) AND pollip_ip = '".get_ipaddress()."' ORDER BY pollip_qid ASC");
944
- if($ips) {
945
- foreach($ips as $ip) {
946
- $polls_ips[intval($ip->pollip_qid)][] = intval($ip->pollip_aid);
947
- }
948
- }
949
- // Poll Archives
950
- $pollsarchive_output_archive .= "<div class=\"wp-polls wp-polls-archive\">\n";
951
- foreach($polls_questions as $polls_question) {
952
- // Most/Least Variables
953
- $poll_most_answer = '';
954
- $poll_most_votes = 0;
955
- $poll_most_percentage = 0;
956
- $poll_least_answer = '';
957
- $poll_least_votes = 0;
958
- $poll_least_percentage = 0;
959
- // Is The Poll Total Votes 0?
960
- $poll_totalvotes_zero = true;
961
- if($polls_question['totalvotes'] > 0) {
962
- $poll_totalvotes_zero = false;
963
- }
964
- $poll_start_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $polls_question['start']));
965
- if(empty($polls_question['end'])) {
966
- $poll_end_date = __('No Expiry', 'wp-polls');
967
- } else {
968
- $poll_end_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $polls_question['end']));
969
- }
970
- // Archive Poll Header
971
- $template_archive_header = stripslashes(get_option('poll_template_pollarchiveheader'));
972
- // Poll Question Variables
973
- $template_question = stripslashes(get_option('poll_template_resultheader'));
974
- $template_question = str_replace("%POLL_QUESTION%", $polls_question['question'], $template_question);
975
- $template_question = str_replace("%POLL_ID%", $polls_question['id'], $template_question);
976
- $template_question = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_question);
977
- $template_question = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_question);
978
- $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
979
- $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
980
- if($polls_question['multiple'] > 0) {
981
- $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_question);
982
- } else {
983
- $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
984
- }
985
- // Print Out Result Header Template
986
- $pollsarchive_output_archive .= $template_archive_header;
987
- $pollsarchive_output_archive .= $template_question;
988
- // Store The Percentage Of The Poll
989
- $poll_answer_percentage_array = array();
990
- foreach($polls_answers[$polls_question['id']] as $polls_answer) {
991
- // Calculate Percentage And Image Bar Width
992
- if(!$poll_totalvotes_zero) {
993
- if($polls_answer['votes'] > 0) {
994
- $poll_answer_percentage = round((($polls_answer['votes']/$polls_question['totalvoters'])*100));
995
- $poll_answer_imagewidth = round($poll_answer_percentage*0.9);
996
- } else {
997
- $poll_answer_percentage = 0;
998
- $poll_answer_imagewidth = 1;
999
- }
1000
- } else {
1001
- $poll_answer_percentage = 0;
1002
- $poll_answer_imagewidth = 1;
1003
- }
1004
- // Make Sure That Total Percentage Is 100% By Adding A Buffer To The Last Poll Answer
1005
- if($polls_question['multiple'] == 0) {
1006
- $poll_answer_percentage_array[] = $poll_answer_percentage;
1007
- if(sizeof($poll_answer_percentage_array) == sizeof($polls_answers[$polls_question['id']])) {
1008
- $percentage_error_buffer = 100 - array_sum($poll_answer_percentage_array);
1009
- $poll_answer_percentage = $poll_answer_percentage + $percentage_error_buffer;
1010
- }
1011
- }
1012
- // Let User See What Options They Voted
1013
- if(in_array($polls_answer['aid'], check_voted_multiple($polls_question['id'], $polls_ips[$polls_question['id']]))) {
1014
- // Results Body Variables
1015
- $template_answer = stripslashes(get_option('poll_template_resultbody2'));
1016
- $template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
1017
- $template_answer = str_replace("%POLL_ANSWER%", $polls_answer['answers'], $template_answer);
1018
- $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($polls_answer['answers'])), $template_answer);
1019
- $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($polls_answer['votes']), $template_answer);
1020
- $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
1021
- $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
1022
- // Print Out Results Body Template
1023
- $pollsarchive_output_archive .= $template_answer;
1024
- } else {
1025
- // Results Body Variables
1026
- $template_answer = stripslashes(get_option('poll_template_resultbody'));
1027
- $template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
1028
- $template_answer = str_replace("%POLL_ANSWER%", $polls_answer['answers'], $template_answer);
1029
- $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($polls_answer['answers'])), $template_answer);
1030
- $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($polls_answer['votes']), $template_answer);
1031
- $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
1032
- $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
1033
- // Print Out Results Body Template
1034
- $pollsarchive_output_archive .= $template_answer;
1035
- }
1036
- // Get Most Voted Data
1037
- if($polls_answer['votes'] > $poll_most_votes) {
1038
- $poll_most_answer = $polls_answer['answers'];
1039
- $poll_most_votes = $polls_answer['votes'];
1040
- $poll_most_percentage = $poll_answer_percentage;
1041
- }
1042
- // Get Least Voted Data
1043
- if($poll_least_votes == 0) {
1044
- $poll_least_votes = $polls_answer['votes'];
1045
- }
1046
- if($polls_answer['votes'] <= $poll_least_votes) {
1047
- $poll_least_answer = $polls_answer['answers'];
1048
- $poll_least_votes = $polls_answer['votes'];
1049
- $poll_least_percentage = $poll_answer_percentage;
1050
- }
1051
- }
1052
- // Results Footer Variables
1053
- $template_footer = stripslashes(get_option('poll_template_resultfooter'));
1054
- $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
1055
- $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
1056
- $template_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_footer);
1057
- $template_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_footer);
1058
- $template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
1059
- $template_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_footer);
1060
- $template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
1061
- $template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
1062
- $template_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_footer);
1063
- $template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
1064
- if($polls_question['multiple'] > 0) {
1065
- $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_footer);
1066
- } else {
1067
- $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
1068
- }
1069
- // Archive Poll Footer
1070
- $template_archive_footer = stripslashes(get_option('poll_template_pollarchivefooter'));
1071
- $template_archive_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_archive_footer);
1072
- $template_archive_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_archive_footer);
1073
- $template_archive_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_archive_footer);
1074
- $template_archive_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_archive_footer);
1075
- $template_archive_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_archive_footer);
1076
- $template_archive_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_archive_footer);
1077
- $template_archive_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_archive_footer);
1078
- $template_archive_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_archive_footer);
1079
- $template_archive_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_archive_footer);
1080
- $template_archive_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_archive_footer);
1081
- if($polls_question['multiple'] > 0) {
1082
- $template_archive_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_archive_footer);
1083
- } else {
1084
- $template_archive_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_archive_footer);
1085
- }
1086
- // Print Out Results Footer Template
1087
- $pollsarchive_output_archive .= $template_footer;
1088
- // Print Out Archive Poll Footer Template
1089
- $pollsarchive_output_archive .= $template_archive_footer;
1090
- }
1091
- $pollsarchive_output_archive .= "</div>\n";
1092
-
1093
- // Polls Archive Paging
1094
- if($max_page > 1) {
1095
- $pollsarchive_output_archive .= stripslashes(get_option('poll_template_pollarchivepagingheader'));
1096
- if(function_exists('wp_pagenavi')) {
1097
- $pollsarchive_output_archive .= '<div class="wp-pagenavi">'."\n";
1098
- } else {
1099
- $pollsarchive_output_archive .= '<div class="wp-polls-paging">'."\n";
1100
- }
1101
- $pollsarchive_output_archive .= '<span class="pages">&#8201;'.sprintf(__('Page %s of %s', 'wp-polls'), number_format_i18n($page), number_format_i18n($max_page)).'&#8201;</span>';
1102
- if ($start_page >= 2 && $pages_to_show < $max_page) {
1103
- $pollsarchive_output_archive .= '<a href="'.polls_archive_link(1).'" title="'.__('&laquo; First', 'wp-polls').'">&#8201;'.__('&laquo; First', 'wp-polls').'&#8201;</a>';
1104
- $pollsarchive_output_archive .= '<span class="extend">...</span>';
1105
- }
1106
- if($page > 1) {
1107
- $pollsarchive_output_archive .= '<a href="'.polls_archive_link(($page-1)).'" title="'.__('&laquo;', 'wp-polls').'">&#8201;'.__('&laquo;', 'wp-polls').'&#8201;</a>';
1108
- }
1109
- for($i = $start_page; $i <= $end_page; $i++) {
1110
- if($i == $page) {
1111
- $pollsarchive_output_archive .= '<span class="current">&#8201;'.number_format_i18n($i).'&#8201;</span>';
1112
- } else {
1113
- $pollsarchive_output_archive .= '<a href="'.polls_archive_link($i).'" title="'.number_format_i18n($i).'">&#8201;'.number_format_i18n($i).'&#8201;</a>';
1114
- }
1115
- }
1116
- if(empty($page) || ($page+1) <= $max_page) {
1117
- $pollsarchive_output_archive .= '<a href="'.polls_archive_link(($page+1)).'" title="'.__('&raquo;', 'wp-polls').'">&#8201;'.__('&raquo;', 'wp-polls').'&#8201;</a>';
1118
- }
1119
- if ($end_page < $max_page) {
1120
- $pollsarchive_output_archive .= '<span class="extend">...</span>';
1121
- $pollsarchive_output_archive .= '<a href="'.polls_archive_link($max_page).'" title="'.__('Last &raquo;', 'wp-polls').'">&#8201;'.__('Last &raquo;', 'wp-polls').'&#8201;</a>';
1122
- }
1123
- $pollsarchive_output_archive .= '</div>';
1124
- $pollsarchive_output_archive .= stripslashes(get_option('poll_template_pollarchivepagingfooter'));
1125
- }
1126
-
1127
- // Output Polls Archive Page
1128
- return apply_filters('polls_archive', $pollsarchive_output_archive);
1129
- }
1130
-
1131
-
1132
- // Edit Timestamp Options
1133
- function poll_timestamp($poll_timestamp, $fieldname = 'pollq_timestamp', $display = 'block') {
1134
- global $month;
1135
- echo '<div id="'.$fieldname.'" style="display: '.$display.'">'."\n";
1136
- $day = gmdate('j', $poll_timestamp);
1137
- echo '<select name="'.$fieldname.'_day" size="1">'."\n";
1138
- for($i = 1; $i <=31; $i++) {
1139
- if($day == $i) {
1140
- echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1141
- } else {
1142
- echo "<option value=\"$i\">$i</option>\n";
1143
- }
1144
- }
1145
- echo '</select>&nbsp;&nbsp;'."\n";
1146
- $month2 = gmdate('n', $poll_timestamp);
1147
- echo '<select name="'.$fieldname.'_month" size="1">'."\n";
1148
- for($i = 1; $i <= 12; $i++) {
1149
- if ($i < 10) {
1150
- $ii = '0'.$i;
1151
- } else {
1152
- $ii = $i;
1153
- }
1154
- if($month2 == $i) {
1155
- echo "<option value=\"$i\" selected=\"selected\">$month[$ii]</option>\n";
1156
- } else {
1157
- echo "<option value=\"$i\">$month[$ii]</option>\n";
1158
- }
1159
- }
1160
- echo '</select>&nbsp;&nbsp;'."\n";
1161
- $year = gmdate('Y', $poll_timestamp);
1162
- echo '<select name="'.$fieldname.'_year" size="1">'."\n";
1163
- for($i = 2000; $i <= ($year+10); $i++) {
1164
- if($year == $i) {
1165
- echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1166
- } else {
1167
- echo "<option value=\"$i\">$i</option>\n";
1168
- }
1169
- }
1170
- echo '</select>&nbsp;@'."\n";
1171
- echo '<span dir="ltr">'."\n";
1172
- $hour = gmdate('H', $poll_timestamp);
1173
- echo '<select name="'.$fieldname.'_hour" size="1">'."\n";
1174
- for($i = 0; $i < 24; $i++) {
1175
- if($hour == $i) {
1176
- echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1177
- } else {
1178
- echo "<option value=\"$i\">$i</option>\n";
1179
- }
1180
- }
1181
- echo '</select>&nbsp;:'."\n";
1182
- $minute = gmdate('i', $poll_timestamp);
1183
- echo '<select name="'.$fieldname.'_minute" size="1">'."\n";
1184
- for($i = 0; $i < 60; $i++) {
1185
- if($minute == $i) {
1186
- echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1187
- } else {
1188
- echo "<option value=\"$i\">$i</option>\n";
1189
- }
1190
- }
1191
-
1192
- echo '</select>&nbsp;:'."\n";
1193
- $second = gmdate('s', $poll_timestamp);
1194
- echo '<select name="'.$fieldname.'_second" size="1">'."\n";
1195
- for($i = 0; $i <= 60; $i++) {
1196
- if($second == $i) {
1197
- echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1198
- } else {
1199
- echo "<option value=\"$i\">$i</option>\n";
1200
- }
1201
- }
1202
- echo '</span>'."\n";
1203
- echo '</select>'."\n";
1204
- echo '</div>'."\n";
1205
- }
1206
-
1207
-
1208
- ### Function: Place Cron
1209
- function cron_polls_place() {
1210
- wp_clear_scheduled_hook('polls_cron');
1211
- if (!wp_next_scheduled('polls_cron')) {
1212
- wp_schedule_event(time(), 'twicedaily', 'polls_cron');
1213
- }
1214
- }
1215
-
1216
-
1217
- ### Funcion: Check All Polls Status To Check If It Expires
1218
- add_action('polls_cron', 'cron_polls_status');
1219
- function cron_polls_status() {
1220
- global $wpdb;
1221
- // Close Poll
1222
- $close_polls = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_expiry < '".current_time('timestamp')."' AND pollq_expiry != '' AND pollq_active != 0");
1223
- // Open Future Polls
1224
- $active_polls = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_timestamp <= '".current_time('timestamp')."' AND pollq_active = -1");
1225
- // Update Latest Poll If Future Poll Is Opened
1226
- if($active_polls) {
1227
- $update_latestpoll = update_option('poll_latestpoll', polls_latest_id());
1228
- }
1229
- return;
1230
- }
1231
-
1232
-
1233
- ### Funcion: Get Latest Poll ID
1234
- function polls_latest_id() {
1235
- global $wpdb;
1236
- $poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY pollq_timestamp DESC LIMIT 1");
1237
- return intval($poll_id);
1238
- }
1239
-
1240
-
1241
- ### Check If In Poll Archive Page
1242
- function in_pollarchive() {
1243
- $poll_archive_url = get_option('poll_archive_url');
1244
- $poll_archive_url_array = explode('/', $poll_archive_url);
1245
- $poll_archive_url = $poll_archive_url_array[sizeof($poll_archive_url_array)-1];
1246
- if(empty($poll_archive_url)) {
1247
- $poll_archive_url = $poll_archive_url_array[sizeof($poll_archive_url_array)-2];
1248
- }
1249
- $current_url = $_SERVER['REQUEST_URI'];
1250
- if(strpos($current_url, $poll_archive_url) === false) {
1251
- return false;
1252
- } else {
1253
- return true;
1254
- }
1255
- }
1256
-
1257
-
1258
- ### Function: Vote Poll
1259
- vote_poll();
1260
- function vote_poll() {
1261
- global $wpdb, $user_identity, $user_ID;
1262
- if(!empty($_POST['vote'])) {
1263
- polls_textdomain();
1264
- header('Content-Type: text/html; charset='.get_option('blog_charset').'');
1265
- $poll_id = intval($_POST['poll_id']);
1266
- $poll_aid = $_POST["poll_$poll_id"];
1267
- $poll_aid_array = array_unique(array_map('intval', explode(',', $poll_aid)));
1268
- if($poll_id > 0 && !empty($poll_aid_array) && check_allowtovote()) {
1269
- $check_voted = check_voted($poll_id);
1270
- if($check_voted == 0) {
1271
- if(!empty($user_identity)) {
1272
- $pollip_user = htmlspecialchars(addslashes($user_identity));
1273
- } elseif(!empty($_COOKIE['comment_author_'.COOKIEHASH])) {
1274
- $pollip_user = htmlspecialchars(addslashes($_COOKIE['comment_author_'.COOKIEHASH]));
1275
- } else {
1276
- $pollip_user = __('Guest', 'wp-polls');
1277
- }
1278
- $pollip_userid = intval($user_ID);
1279
- $pollip_ip = get_ipaddress();
1280
- $pollip_host = @gethostbyaddr($pollip_ip);
1281
- $pollip_timestamp = current_time('timestamp');
1282
- // Only Create Cookie If User Choose Logging Method 1 Or 2
1283
- $poll_logging_method = intval(get_option('poll_logging_method'));
1284
- if($poll_logging_method == 1 || $poll_logging_method == 3) {
1285
- $cookie_expiry = intval(get_option('poll_cookielog_expiry'));
1286
- if($cookie_expiry == 0) {
1287
- $cookie_expiry = 30000000;
1288
- }
1289
- $vote_cookie = setcookie('voted_'.$poll_id, $poll_aid, ($pollip_timestamp + $cookie_expiry), COOKIEPATH);
1290
- }
1291
- $i = 0;
1292
- foreach($poll_aid_array as $polla_aid) {
1293
- $update_polla_votes = $wpdb->query("UPDATE $wpdb->pollsa SET polla_votes = (polla_votes+1) WHERE polla_qid = $poll_id AND polla_aid = $polla_aid");
1294
- if(!$update_polla_votes) {
1295
- unset($poll_aid_array[$i]);
1296
- }
1297
- $i++;
1298
- }
1299
- $vote_q = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes+".sizeof($poll_aid_array)."), pollq_totalvoters = (pollq_totalvoters+1) WHERE pollq_id = $poll_id AND pollq_active = 1");
1300
- if($vote_q) {
1301
- foreach($poll_aid_array as $polla_aid) {
1302
- $wpdb->query("INSERT INTO $wpdb->pollsip VALUES (0, $poll_id, $polla_aid, '$pollip_ip', '$pollip_host', '$pollip_timestamp', '$pollip_user', $pollip_userid)");
1303
- }
1304
- echo display_pollresult($poll_id,$poll_aid_array, false);
1305
- exit();
1306
- } else {
1307
- printf(__('Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s', 'wp-polls'), $poll_id);
1308
- exit();
1309
- } // End if($vote_a)
1310
- } else {
1311
- printf(__('You Had Already Voted For This Poll. Poll ID #%s', 'wp-polls'), $poll_id);
1312
- exit();
1313
- }// End if($check_voted)
1314
- } else {
1315
- printf(__('Invalid Poll ID. Poll ID #%s', 'wp-polls'), $poll_id);
1316
- exit();
1317
- } // End if($poll_id > 0 && $poll_aid > 0)
1318
- } elseif (intval($_GET['pollresult']) > 0) {
1319
- header('Content-Type: text/html; charset='.get_option('blog_charset').'');
1320
- $poll_id = intval($_GET['pollresult']);
1321
- echo display_pollresult($poll_id, 0, false);
1322
- exit();
1323
- } elseif (intval($_GET['pollbooth']) > 0) {
1324
- header('Content-Type: text/html; charset='.get_option('blog_charset').'');
1325
- $poll_id = intval($_GET['pollbooth']);
1326
- echo display_pollvote($poll_id, false);
1327
- exit();
1328
- } // End if(!empty($_POST['vote']))
1329
- }
1330
-
1331
-
1332
- ### Function: Plug Into WP-Stats
1333
- if(strpos(get_option('stats_url'), $_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], 'stats-options.php') || strpos($_SERVER['REQUEST_URI'], 'wp-stats/wp-stats.php')) {
1334
- add_filter('wp_stats_page_admin_plugins', 'polls_page_admin_general_stats');
1335
- add_filter('wp_stats_page_plugins', 'polls_page_general_stats');
1336
- }
1337
-
1338
-
1339
- ### Function: Add WP-Polls General Stats To WP-Stats Page Options
1340
- function polls_page_admin_general_stats($content) {
1341
- $stats_display = get_option('stats_display');
1342
- if($stats_display['polls'] == 1) {
1343
- $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_polls" value="polls" checked="checked" />&nbsp;&nbsp;<label for="wpstats_polls">'.__('WP-Polls', 'wp-polls').'</label><br />'."\n";
1344
- } else {
1345
- $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_polls" value="polls" />&nbsp;&nbsp;<label for="wpstats_polls">'.__('WP-Polls', 'wp-polls').'</label><br />'."\n";
1346
- }
1347
- return $content;
1348
- }
1349
-
1350
-
1351
- ### Function: Add WP-Polls General Stats To WP-Stats Page
1352
- function polls_page_general_stats($content) {
1353
- $stats_display = get_option('stats_display');
1354
- if($stats_display['polls'] == 1) {
1355
- $content .= '<p><strong>'.__('WP-Polls', 'wp-polls').'</strong></p>'."\n";
1356
- $content .= '<ul>'."\n";
1357
- $content .= '<li>'.sprintf(_n('<strong>%s</strong> poll was created.', '<strong>%s</strong> polls were created.', get_pollquestions(false), 'wp-polls'), number_format_i18n(get_pollquestions(false))).'</li>'."\n";
1358
- $content .= '<li>'.sprintf(_n('<strong>%s</strong> polls\' answer was given.', '<strong>%s</strong> polls\' answers were given.', get_pollanswers(false), 'wp-polls'), number_format_i18n(get_pollanswers(false))).'</li>'."\n";
1359
- $content .= '<li>'.sprintf(_n('<strong>%s</strong> vote was casted.', '<strong>%s</strong> votes were casted.', get_pollvotes(false), 'wp-polls'), number_format_i18n(get_pollvotes(false))).'</li>'."\n";
1360
- $content .= '</ul>'."\n";
1361
- }
1362
- return $content;
1363
- }
1364
-
1365
-
1366
- ### Class: WP-Polls Widget
1367
- class WP_Widget_Polls extends WP_Widget {
1368
- // Constructor
1369
- function WP_Widget_Polls() {
1370
- $widget_ops = array('description' => __('WP-Polls polls', 'wp-polls'));
1371
- $this->WP_Widget('polls-widget', __('Polls', 'wp-polls'), $widget_ops);
1372
- }
1373
-
1374
- // Display Widget
1375
- function widget($args, $instance) {
1376
- extract($args);
1377
- $title = apply_filters('widget_title', esc_attr($instance['title']));
1378
- $poll_id = intval($instance['poll_id']);
1379
- $display_pollarchive = intval($instance['display_pollarchive']);
1380
- echo $before_widget;
1381
- if(!empty($title)) {
1382
- echo $before_title.$title.$after_title;
1383
- }
1384
- get_poll($poll_id);
1385
- if($display_pollarchive) {
1386
- display_polls_archive_link();
1387
- }
1388
- echo $after_widget;
1389
- }
1390
-
1391
- // When Widget Control Form Is Posted
1392
- function update($new_instance, $old_instance) {
1393
- if (!isset($new_instance['submit'])) {
1394
- return false;
1395
- }
1396
- $instance = $old_instance;
1397
- $instance['title'] = strip_tags($new_instance['title']);
1398
- $instance['poll_id'] = intval($new_instance['poll_id']);
1399
- $instance['display_pollarchive'] = intval($new_instance['display_pollarchive']);
1400
- return $instance;
1401
- }
1402
-
1403
- // DIsplay Widget Control Form
1404
- function form($instance) {
1405
- global $wpdb;
1406
- $instance = wp_parse_args((array) $instance, array('title' => __('Polls', 'wp-polls'), 'poll_id' => 0, 'display_pollarchive' => 1));
1407
- $title = esc_attr($instance['title']);
1408
- $poll_id = intval($instance['poll_id']);
1409
- $display_pollarchive = intval($instance['display_pollarchive']);
1410
- ?>
1411
- <p>
1412
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'wp-polls'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label>
1413
- </p>
1414
- <p>
1415
- <label for="<?php echo $this->get_field_id('display_pollarchive'); ?>"><?php _e('Display Polls Archive Link Below Poll?', 'wp-polls'); ?>
1416
- <select name="<?php echo $this->get_field_name('display_pollarchive'); ?>" id="<?php echo $this->get_field_id('display_pollarchive'); ?>" class="widefat">
1417
- <option value="0"<?php selected(0, $display_pollarchive); ?>><?php _e('No', 'wp-polls'); ?></option>
1418
- <option value="1"<?php selected(1, $display_pollarchive); ?>><?php _e('Yes', 'wp-polls'); ?></option>
1419
- </select>
1420
- </label>
1421
- </p>
1422
- <p>
1423
- <label for="<?php echo $this->get_field_id('poll_id'); ?>"><?php _e('Poll To Display:', 'wp-polls'); ?>
1424
- <select name="<?php echo $this->get_field_name('poll_id'); ?>" id="<?php echo $this->get_field_id('poll_id'); ?>" class="widefat">
1425
- <option value="-1"<?php selected(-1, $poll_id); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
1426
- <option value="-2"<?php selected(-2, $poll_id); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
1427
- <option value="0"<?php selected(0, $poll_id); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
1428
- <optgroup>&nbsp;</optgroup>
1429
- <?php
1430
- $polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
1431
- if($polls) {
1432
- foreach($polls as $poll) {
1433
- $pollq_question = stripslashes($poll->pollq_question);
1434
- $pollq_id = intval($poll->pollq_id);
1435
- if($pollq_id == $poll_id) {
1436
- echo "<option value=\"$pollq_id\" selected=\"selected\">$pollq_question</option>\n";
1437
- } else {
1438
- echo "<option value=\"$pollq_id\">$pollq_question</option>\n";
1439
- }
1440
- }
1441
- }
1442
- ?>
1443
- </select>
1444
- </label>
1445
- </p>
1446
- <input type="hidden" id="<?php echo $this->get_field_id('submit'); ?>" name="<?php echo $this->get_field_name('submit'); ?>" value="1" />
1447
- <?php
1448
- }
1449
- }
1450
-
1451
-
1452
- ### Function: Init WP-Polls Widget
1453
- add_action('widgets_init', 'widget_polls_init');
1454
- function widget_polls_init() {
1455
- register_widget('WP_Widget_Polls');
1456
- }
1457
-
1458
-
1459
- ### Function: Create Poll Tables
1460
- add_action('activate_wp-polls/wp-polls.php', 'create_poll_table');
1461
- function create_poll_table() {
1462
- global $wpdb;
1463
- polls_textdomain();
1464
- if(@is_file(ABSPATH.'/wp-admin/upgrade-functions.php')) {
1465
- include_once(ABSPATH.'/wp-admin/upgrade-functions.php');
1466
- } elseif(@is_file(ABSPATH.'/wp-admin/includes/upgrade.php')) {
1467
- include_once(ABSPATH.'/wp-admin/includes/upgrade.php');
1468
- } else {
1469
- die('We have problem finding your \'/wp-admin/upgrade-functions.php\' and \'/wp-admin/includes/upgrade.php\'');
1470
- }
1471
- // Create Poll Tables (3 Tables)
1472
- $charset_collate = '';
1473
- if($wpdb->supports_collation()) {
1474
- if(!empty($wpdb->charset)) {
1475
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
1476
- }
1477
- if(!empty($wpdb->collate)) {
1478
- $charset_collate .= " COLLATE $wpdb->collate";
1479
- }
1480
- }
1481
- $create_table = array();
1482
- $create_table['pollsq'] = "CREATE TABLE $wpdb->pollsq (".
1483
- "pollq_id int(10) NOT NULL auto_increment,".
1484
- "pollq_question varchar(200) character set utf8 NOT NULL default '',".
1485
- "pollq_timestamp varchar(20) NOT NULL default '',".
1486
- "pollq_totalvotes int(10) NOT NULL default '0',".
1487
- "pollq_active tinyint(1) NOT NULL default '1',".
1488
- "pollq_expiry varchar(20) NOT NULL default '',".
1489
- "pollq_multiple tinyint(3) NOT NULL default '0',".
1490
- "pollq_totalvoters int(10) NOT NULL default '0',".
1491
- "PRIMARY KEY (pollq_id)) $charset_collate;";
1492
- $create_table['pollsa'] = "CREATE TABLE $wpdb->pollsa (".
1493
- "polla_aid int(10) NOT NULL auto_increment,".
1494
- "polla_qid int(10) NOT NULL default '0',".
1495
- "polla_answers varchar(200) character set utf8 NOT NULL default '',".
1496
- "polla_votes int(10) NOT NULL default '0',".
1497
- "PRIMARY KEY (polla_aid)) $charset_collate;";
1498
- $create_table['pollsip'] = "CREATE TABLE $wpdb->pollsip (".
1499
- "pollip_id int(10) NOT NULL auto_increment,".
1500
- "pollip_qid varchar(10) NOT NULL default '',".
1501
- "pollip_aid varchar(10) NOT NULL default '',".
1502
- "pollip_ip varchar(100) NOT NULL default '',".
1503
- "pollip_host VARCHAR(200) NOT NULL default '',".
1504
- "pollip_timestamp varchar(20) NOT NULL default '0000-00-00 00:00:00',".
1505
- "pollip_user tinytext NOT NULL,".
1506
- "pollip_userid int(10) NOT NULL default '0',".
1507
- "PRIMARY KEY (pollip_id)) $charset_collate;";
1508
- maybe_create_table($wpdb->pollsq, $create_table['pollsq']);
1509
- maybe_create_table($wpdb->pollsa, $create_table['pollsa']);
1510
- maybe_create_table($wpdb->pollsip, $create_table['pollsip']);
1511
- // Check Whether It is Install Or Upgrade
1512
- $first_poll = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq LIMIT 1");
1513
- // If Install, Insert 1st Poll Question With 5 Poll Answers
1514
- if(empty($first_poll)) {
1515
- // Insert Poll Question (1 Record)
1516
- $insert_pollq = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (1, '".__('How Is My Site?', 'wp-polls')."', '".current_time('timestamp')."', 0, 1, '', 0, 0);");
1517
- if($insert_pollq) {
1518
- // Insert Poll Answers (5 Records)
1519
- $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (1, 1, '".__('Good', 'wp-polls')."', 0);");
1520
- $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (2, 1, '".__('Excellent', 'wp-polls')."', 0);");
1521
- $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (3, 1, '".__('Bad', 'wp-polls')."', 0);");
1522
- $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (4, 1, '".__('Can Be Improved', 'wp-polls')."', 0);");
1523
- $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (5, 1, '".__('No Comments', 'wp-polls')."', 0);");
1524
- }
1525
- }
1526
- // Add In Options (16 Records)
1527
- add_option('poll_template_voteheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
1528
- '<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
1529
- '<ul class="wp-polls-ul">', 'Template For Poll\'s Question');
1530
- add_option('poll_template_votebody', '<li><input type="%POLL_CHECKBOX_RADIO%" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value="%POLL_ANSWER_ID%" /> <label for="poll-answer-%POLL_ANSWER_ID%">%POLL_ANSWER%</label></li>', 'Template For Poll\'s Answers');
1531
- add_option('poll_template_votefooter', '</ul>'.
1532
- '<p style="text-align: center;"><input type="button" name="vote" value=" '.__('Vote', 'wp-polls').' " class="Buttons" onclick="poll_vote(%POLL_ID%);" /></p>'.
1533
- '<p style="text-align: center;"><a href="#ViewPollResults" onclick="poll_result(%POLL_ID%); return false;" title="'.__('View Results Of This Poll', 'wp-polls').'">'.__('View Results', 'wp-polls').'</a></p>'.
1534
- '</div>', 'Template For Poll\'s Voting Footer');
1535
- add_option('poll_template_resultheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
1536
- '<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
1537
- '<ul class="wp-polls-ul">', 'Template For Poll Header');
1538
- add_option('poll_template_resultbody', '<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%'.__(',', 'wp-polls').' %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')</small><div class="pollbar" style="width: %POLL_ANSWER_IMAGEWIDTH%%;" title="%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')"></div></li>', 'Template For Poll Results');
1539
- add_option('poll_template_resultbody2', '<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%'.__(',', 'wp-polls').' %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')</small></i></strong><div class="pollbar" style="width: %POLL_ANSWER_IMAGEWIDTH%%;" title="'.__('You Have Voted For This Choice', 'wp-polls').' - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')"></div></li>', 'Template For Poll Results (User Voted)');
1540
- add_option('poll_template_resultfooter', '</ul>'.
1541
- '<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'.
1542
- '</div>', 'Template For Poll Result Footer');
1543
- add_option('poll_template_resultfooter2', '</ul>'.
1544
- '<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'.
1545
- '<p style="text-align: center;"><a href="#VotePoll" onclick="poll_booth(%POLL_ID%); return false;" title="'.__('Vote For This Poll', 'wp-polls').'">'.__('Vote', 'wp-polls').'</a></p>'.
1546
- '</div>', 'Template For Poll Result Footer');
1547
- add_option('poll_template_disable', __('Sorry, there are no polls available at the moment.', 'wp-polls'), 'Template For Poll When It Is Disabled');
1548
- add_option('poll_template_error', __('An error has occurred when processing your poll.', 'wp-polls'), 'Template For Poll When An Error Has Occured');
1549
- add_option('poll_currentpoll', 0, 'Current Displayed Poll');
1550
- add_option('poll_latestpoll', 1, 'The Latest Poll');
1551
- add_option('poll_archive_perpage', 5, 'Number Of Polls To Display Per Page On The Poll\'s Archive', 'no');
1552
- add_option('poll_ans_sortby', 'polla_aid', 'Sorting Of Poll\'s Answers');
1553
- add_option('poll_ans_sortorder', 'asc', 'Sort Order Of Poll\'s Answers');
1554
- add_option('poll_ans_result_sortby', 'polla_votes', 'Sorting Of Poll\'s Answers Result');
1555
- add_option('poll_ans_result_sortorder', 'desc', 'Sorting Order Of Poll\'s Answers Result');
1556
- // Database Upgrade For WP-Polls 2.1
1557
- add_option('poll_logging_method', '3', 'Logging Method Of User Poll\'s Answer');
1558
- add_option('poll_allowtovote', '2', 'Who Is Allowed To Vote');
1559
- maybe_add_column($wpdb->pollsq, 'pollq_active', "ALTER TABLE $wpdb->pollsq ADD pollq_active TINYINT( 1 ) NOT NULL DEFAULT '1';");
1560
- // Database Upgrade For WP-Polls 2.12
1561
- maybe_add_column($wpdb->pollsip, 'pollip_userid', "ALTER TABLE $wpdb->pollsip ADD pollip_userid INT( 10 ) NOT NULL DEFAULT '0';");
1562
- add_option('poll_archive_url', site_url('pollsarchive'), 'Polls Archive URL');
1563
- // Database Upgrade For WP-Polls 2.13
1564
- add_option('poll_bar', array('style' => 'default', 'background' => 'd8e1eb', 'border' => 'c8c8c8', 'height' => 8), 'Poll Bar Style');
1565
- // Database Upgrade For WP-Polls 2.14
1566
- maybe_add_column($wpdb->pollsq, 'pollq_expiry', "ALTER TABLE $wpdb->pollsq ADD pollq_expiry varchar(20) NOT NULL default '';");
1567
- add_option('poll_close', 1, 'Poll Close');
1568
- // Database Upgrade For WP-Polls 2.20
1569
- add_option('poll_ajax_style', array('loading' => 1, 'fading' => 1), 'Poll AJAX Style');
1570
- add_option('poll_template_pollarchivelink', '<ul>'.
1571
- '<li><a href="%POLL_ARCHIVE_URL%">'.__('Polls Archive', 'wp-polls').'</a></li>'.
1572
- '</ul>', 'Template For Poll Archive Link');
1573
- add_option('poll_archive_displaypoll', 2, 'Type Of Polls To Display In Polls Archive');
1574
- add_option('poll_template_pollarchiveheader', '', 'Displayed Before Each Poll In The Poll Archive');
1575
- add_option('poll_template_pollarchivefooter', '<p>'.__('Start Date:', 'wp-polls').' %POLL_START_DATE%<br />'.__('End Date:', 'wp-polls').' %POLL_END_DATE%</p>', 'Displayed After Each Poll In The Poll Archive');
1576
- maybe_add_column($wpdb->pollsq, 'pollq_multiple', "ALTER TABLE $wpdb->pollsq ADD pollq_multiple TINYINT( 3 ) NOT NULL DEFAULT '0';");
1577
- $pollq_totalvoters = maybe_add_column($wpdb->pollsq, 'pollq_totalvoters', "ALTER TABLE $wpdb->pollsq ADD pollq_totalvoters INT( 10 ) NOT NULL DEFAULT '0';");
1578
- if($pollq_totalvoters) {
1579
- $pollq_totalvoters = intval($wpdb->get_var("SELECT SUM(pollq_totalvoters) FROM $wpdb->pollsq"));
1580
- if($pollq_totalvoters == 0) {
1581
- $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvoters = pollq_totalvotes");
1582
- }
1583
- }
1584
- // Database Upgrade For WP-Polls 2.30
1585
- add_option('poll_cookielog_expiry', 0, 'Cookie And Log Expiry Time');
1586
- add_option('poll_template_pollarchivepagingheader', '', 'Displayed Before Paging In The Poll Archive');
1587
- add_option('poll_template_pollarchivepagingfooter', '', 'Displayed After Paging In The Poll Archive');
1588
- // Database Upgrade For WP-Polls 2.50
1589
- delete_option('poll_archive_show');
1590
- // Set 'manage_polls' Capabilities To Administrator
1591
- $role = get_role('administrator');
1592
- if(!$role->has_cap('manage_polls')) {
1593
- $role->add_cap('manage_polls');
1594
- }
1595
- cron_polls_place();
1596
- }
1597
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
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
10
+ */
11
+
12
+
13
+ /*
14
+ Copyright 2013 Lester Chan (email : lesterchan@gmail.com)
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; either version 2 of the License, or
19
+ (at your option) any later version.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
+ */
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
+
39
+ ### Polls Table Name
40
+ global $wpdb;
41
+ $wpdb->pollsq = $wpdb->prefix.'pollsq';
42
+ $wpdb->pollsa = $wpdb->prefix.'pollsa';
43
+ $wpdb->pollsip = $wpdb->prefix.'pollsip';
44
+
45
+
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
+
62
+ ### Function: Get Poll
63
+ function get_poll($temp_poll_id = 0, $display = true) {
64
+ global $wpdb, $polls_loaded;
65
+ // Poll Result Link
66
+ if(isset($_GET['pollresult'])) {
67
+ $pollresult_id = intval($_GET['pollresult']);
68
+ } else {
69
+ $pollresult_id = 0;
70
+ }
71
+ $temp_poll_id = intval($temp_poll_id);
72
+ // Check Whether Poll Is Disabled
73
+ if(intval(get_option('poll_currentpoll')) == -1) {
74
+ if($display) {
75
+ echo stripslashes(get_option('poll_template_disable'));
76
+ return;
77
+ } else {
78
+ return stripslashes(get_option('poll_template_disable'));
79
+ }
80
+ // Poll Is Enabled
81
+ } else {
82
+ // Hardcoded Poll ID Is Not Specified
83
+ switch($temp_poll_id) {
84
+ // Random Poll
85
+ case -2:
86
+ $poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1");
87
+ break;
88
+ // Latest Poll
89
+ case 0:
90
+ // Random Poll
91
+ if(intval(get_option('poll_currentpoll')) == -2) {
92
+ $random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1");
93
+ $poll_id = intval($random_poll_id);
94
+ if($pollresult_id > 0) {
95
+ $poll_id = $pollresult_id;
96
+ } elseif(intval($_POST['poll_id']) > 0) {
97
+ $poll_id = intval($_POST['poll_id']);
98
+ }
99
+ // Current Poll ID Is Not Specified
100
+ } elseif(intval(get_option('poll_currentpoll')) == 0) {
101
+ // Get Lastest Poll ID
102
+ $poll_id = intval(get_option('poll_latestpoll'));
103
+ } else {
104
+ // Get Current Poll ID
105
+ $poll_id = intval(get_option('poll_currentpoll'));
106
+ }
107
+ break;
108
+ // Take Poll ID From Arguments
109
+ default:
110
+ $poll_id = $temp_poll_id;
111
+ }
112
+ }
113
+
114
+ // Assign All Loaded Poll To $polls_loaded
115
+ if(empty($polls_loaded)) {
116
+ $polls_loaded = array();
117
+ }
118
+ if(!in_array($poll_id, $polls_loaded)) {
119
+ $polls_loaded[] = $poll_id;
120
+ }
121
+
122
+ // User Click on View Results Link
123
+ if($pollresult_id == $poll_id) {
124
+ if($display) {
125
+ echo display_pollresult($poll_id);
126
+ return;
127
+ } else {
128
+ return display_pollresult($poll_id);
129
+ }
130
+ // Check Whether User Has Voted
131
+ } else {
132
+ $poll_active = $wpdb->get_var("SELECT pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
133
+ $poll_active = intval($poll_active);
134
+ $check_voted = check_voted($poll_id);
135
+ if($poll_active == 0) {
136
+ $poll_close = intval(get_option('poll_close'));
137
+ } else {
138
+ $poll_close = 0;
139
+ }
140
+ if(intval($check_voted) > 0 || (is_array($check_voted) && sizeof($check_voted) > 0) || ($poll_active == 0 && $poll_close == 1)) {
141
+ if($display) {
142
+ echo display_pollresult($poll_id, $check_voted);
143
+ return;
144
+ } else {
145
+ return display_pollresult($poll_id, $check_voted);
146
+ }
147
+ } elseif(!check_allowtovote() || ($poll_active == 0 && $poll_close == 3)) {
148
+ $disable_poll_js = '<script type="text/javascript">jQuery("#polls_form_'.$poll_id.' :input").each(function (i){jQuery(this).attr("disabled","disabled")});</script>';
149
+ if($display) {
150
+ echo display_pollvote($poll_id).$disable_poll_js;
151
+ return;
152
+ } else {
153
+ return display_pollvote($poll_id).$disable_poll_js;
154
+ }
155
+ } elseif($poll_active == 1) {
156
+ if($display) {
157
+ echo display_pollvote($poll_id);
158
+ return;
159
+ } else {
160
+ return display_pollvote($poll_id);
161
+ }
162
+ }
163
+ }
164
+ }
165
+
166
+
167
+ ### Function: Print Polls Stylesheets That Are Dynamic And jQuery At The Top
168
+ add_action('wp_head', 'poll_head_scripts');
169
+ function poll_head_scripts() {
170
+ $pollbar = get_option('poll_bar');
171
+ echo '<style type="text/css">'."\n";
172
+ if($pollbar['style'] == 'use_css') {
173
+ echo '.wp-polls .pollbar {'."\n";
174
+ echo "\t".'margin: 1px;'."\n";
175
+ echo "\t".'font-size: '.($pollbar['height']-2).'px;'."\n";
176
+ echo "\t".'line-height: '.$pollbar['height'].'px;'."\n";
177
+ echo "\t".'height: '.$pollbar['height'].'px;'."\n";
178
+ echo "\t".'background: #'.$pollbar['background'].';'."\n";
179
+ echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n";
180
+ echo '}'."\n";
181
+ } else {
182
+ echo '.wp-polls .pollbar {'."\n";
183
+ echo "\t".'margin: 1px;'."\n";
184
+ echo "\t".'font-size: '.($pollbar['height']-2).'px;'."\n";
185
+ echo "\t".'line-height: '.$pollbar['height'].'px;'."\n";
186
+ echo "\t".'height: '.$pollbar['height'].'px;'."\n";
187
+ echo "\t".'background-image: url(\''.plugins_url('wp-polls/images/'.$pollbar['style'].'/pollbg.gif').'\');'."\n";
188
+ echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n";
189
+ echo '}'."\n";
190
+ }
191
+ echo '</style>'."\n";
192
+ wp_print_scripts('jquery');
193
+ }
194
+
195
+
196
+ ### Function: Enqueue Polls JavaScripts/CSS
197
+ add_action('wp_enqueue_scripts', 'poll_scripts');
198
+ function poll_scripts() {
199
+ global $text_direction;
200
+ if(@file_exists(get_stylesheet_directory().'/polls-css.css')) {
201
+ wp_enqueue_style('wp-polls', get_stylesheet_directory_uri().'/polls-css.css', false, '2.63', 'all');
202
+ } else {
203
+ wp_enqueue_style('wp-polls', plugins_url('wp-polls/polls-css.css'), false, '2.63', 'all');
204
+ }
205
+ if('rtl' == $text_direction) {
206
+ if(@file_exists(get_stylesheet_directory().'/polls-css-rtl.css')) {
207
+ wp_enqueue_style('wp-polls-rtl', get_stylesheet_directory_uri().'/polls-css-rtl.css', false, '2.63', 'all');
208
+ } else {
209
+ wp_enqueue_style('wp-polls-rtl', plugins_url('wp-polls/polls-css-rtl.css'), false, '2.63', 'all');
210
+ }
211
+ }
212
+ $poll_ajax_style = get_option('poll_ajax_style');
213
+ $pollbar = get_option('poll_bar');
214
+ wp_enqueue_script('wp-polls', plugins_url('wp-polls/polls-js.js'), array('jquery'), '2.63', true);
215
+ wp_localize_script('wp-polls', 'pollsL10n', array(
216
+ 'ajax_url' => admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')),
217
+ 'text_wait' => __('Your last request is still being processed. Please wait a while ...', 'wp-polls'),
218
+ 'text_valid' => __('Please choose a valid poll answer.', 'wp-polls'),
219
+ 'text_multiple' => __('Maximum number of choices allowed: ', 'wp-polls'),
220
+ 'show_loading' => intval($poll_ajax_style['loading']),
221
+ 'show_fading' => intval($poll_ajax_style['fading'])
222
+ ));
223
+ }
224
+
225
+
226
+ ### Function: Enqueue Polls Stylesheets/JavaScripts In WP-Admin
227
+ add_action('admin_enqueue_scripts', 'poll_scripts_admin');
228
+ function poll_scripts_admin($hook_suffix) {
229
+ global $text_direction;
230
+ $poll_admin_pages = array('wp-polls/polls-manager.php', 'wp-polls/polls-add.php', 'wp-polls/polls-options.php', 'wp-polls/polls-templates.php', 'wp-polls/polls-uninstall.php');
231
+ if(in_array($hook_suffix, $poll_admin_pages)) {
232
+ wp_enqueue_style('wp-polls-admin', plugins_url('wp-polls/polls-admin-css.css'), false, '2.63', 'all');
233
+ wp_enqueue_script('wp-polls-admin', plugins_url('wp-polls/polls-admin-js.js'), array('jquery'), '2.63', true);
234
+ wp_localize_script('wp-polls-admin', 'pollsAdminL10n', array(
235
+ 'admin_ajax_url' => admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')),
236
+ 'text_direction' => ('rtl' == $text_direction) ? 'left' : 'right',
237
+ 'text_delete_poll' => __('Delete Poll', 'wp-polls'),
238
+ 'text_no_poll_logs' => __('No poll logs available.', 'wp-polls'),
239
+ 'text_delete_all_logs' => __('Delete All Logs', 'wp-polls'),
240
+ 'text_checkbox_delete_all_logs' => __('Please check the \\\'Yes\\\' checkbox if you want to delete all logs.', 'wp-polls'),
241
+ 'text_delete_poll_logs' => __('Delete Logs For This Poll Only', 'wp-polls'),
242
+ 'text_checkbox_delete_poll_logs' => __('Please check the \\\'Yes\\\' checkbox if you want to delete all logs for this poll ONLY.', 'wp-polls'),
243
+ 'text_delete_poll_ans' => __('Delete Poll Answer', 'wp-polls'),
244
+ 'text_open_poll' => __('Open Poll', 'wp-polls'),
245
+ 'text_close_poll' => __('Close Poll', 'wp-polls'),
246
+ 'text_answer' => __('Answer', 'wp-polls'),
247
+ 'text_remove_poll_answer' => __('Remove', 'wp-polls')
248
+ ));
249
+ }
250
+ }
251
+
252
+
253
+ ### Function: Displays Polls Footer In WP-Admin
254
+ add_action('admin_footer-post-new.php', 'poll_footer_admin');
255
+ 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() {
303
+ if(!current_user_can('edit_posts') && ! current_user_can('edit_pages')) {
304
+ return;
305
+ }
306
+ if(get_user_option('rich_editing') == 'true') {
307
+ add_filter("mce_external_plugins", "poll_tinymce_addplugin");
308
+ add_filter('mce_buttons', 'poll_tinymce_registerbutton');
309
+ }
310
+ }
311
+ function poll_tinymce_registerbutton($buttons) {
312
+ array_push($buttons, 'separator', 'polls');
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
+
320
+
321
+ ### Function: Check Who Is Allow To Vote
322
+ function check_allowtovote() {
323
+ global $user_ID;
324
+ $user_ID = intval($user_ID);
325
+ $allow_to_vote = intval(get_option('poll_allowtovote'));
326
+ switch($allow_to_vote) {
327
+ // Guests Only
328
+ case 0:
329
+ if($user_ID > 0) {
330
+ return false;
331
+ }
332
+ return true;
333
+ break;
334
+ // Registered Users Only
335
+ case 1:
336
+ if($user_ID == 0) {
337
+ return false;
338
+ }
339
+ return true;
340
+ break;
341
+ // Registered Users And Guests
342
+ case 2:
343
+ default:
344
+ return true;
345
+ }
346
+ }
347
+
348
+
349
+ ### Funcrion: Check Voted By Cookie Or IP
350
+ function check_voted($poll_id) {
351
+ $poll_logging_method = intval(get_option('poll_logging_method'));
352
+ switch($poll_logging_method) {
353
+ // Do Not Log
354
+ case 0:
355
+ return 0;
356
+ break;
357
+ // Logged By Cookie
358
+ case 1:
359
+ return check_voted_cookie($poll_id);
360
+ break;
361
+ // Logged By IP
362
+ case 2:
363
+ return check_voted_ip($poll_id);
364
+ break;
365
+ // Logged By Cookie And IP
366
+ case 3:
367
+ $check_voted_cookie = check_voted_cookie($poll_id);
368
+ if(!empty($check_voted_cookie)) {
369
+ return $check_voted_cookie;
370
+ } else {
371
+ return check_voted_ip($poll_id);
372
+ }
373
+ break;
374
+ // Logged By Username
375
+ case 4:
376
+ return check_voted_username($poll_id);
377
+ break;
378
+ }
379
+ }
380
+
381
+
382
+ ### Function: Check Voted By Cookie
383
+ function check_voted_cookie($poll_id) {
384
+ if(!empty($_COOKIE["voted_$poll_id"])) {
385
+ $get_voted_aids = explode(',', $_COOKIE["voted_$poll_id"]);
386
+ } else {
387
+ $get_voted_aids = 0;
388
+ }
389
+ return $get_voted_aids;
390
+ }
391
+
392
+
393
+ ### Function: Check Voted By IP
394
+ function check_voted_ip($poll_id) {
395
+ global $wpdb;
396
+ $log_expiry = intval(get_option('poll_cookielog_expiry'));
397
+ $log_expiry_sql = '';
398
+ if($log_expiry > 0) {
399
+ $log_expiry_sql = 'AND ('.current_time('timestamp').'-(pollip_timestamp+0)) < '.$log_expiry;
400
+ }
401
+ // Check IP From IP Logging Database
402
+ $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."' $log_expiry_sql");
403
+ if($get_voted_aids) {
404
+ return $get_voted_aids;
405
+ } else {
406
+ return 0;
407
+ }
408
+ }
409
+
410
+
411
+ ### Function: Check Voted By Username
412
+ function check_voted_username($poll_id) {
413
+ global $wpdb, $user_ID;
414
+ // Check IP If User Is Guest
415
+ if (!is_user_logged_in()) {
416
+ return 1;
417
+ }
418
+ $pollsip_userid = intval($user_ID);
419
+ $log_expiry = intval(get_option('poll_cookielog_expiry'));
420
+ $log_expiry_sql = '';
421
+ if($log_expiry > 0) {
422
+ $log_expiry_sql = 'AND ('.current_time('timestamp').'-(pollip_timestamp+0)) < '.$log_expiry;
423
+ }
424
+ // Check User ID From IP Logging Database
425
+ $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid = $pollsip_userid $log_expiry_sql");
426
+ if($get_voted_aids) {
427
+ return $get_voted_aids;
428
+ } else {
429
+ return 0;
430
+ }
431
+ }
432
+
433
+ add_filter('poll_template_voteheader_markup', 'poll_template_vote_markup', 10, 3);
434
+ add_filter('poll_template_votebody_markup', 'poll_template_vote_markup', 10, 3);
435
+ add_filter('poll_template_votefooter_markup', 'poll_template_vote_markup', 10, 3);
436
+
437
+ function poll_template_vote_markup($template, $poll_db_object, $variables) {
438
+
439
+ foreach($variables as $placeholder => $value) {
440
+ $template = str_replace($placeholder, $value, $template);
441
+ }
442
+
443
+ return $template;
444
+ }
445
+
446
+
447
+ ### Function: Display Voting Form
448
+ function display_pollvote($poll_id, $display_loading = true) {
449
+ global $wpdb;
450
+ // Temp Poll Result
451
+ $temp_pollvote = '';
452
+ // Get Poll Question Data
453
+ $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_timestamp, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
454
+
455
+ // Poll Question Variables
456
+ $poll_question_text = stripslashes($poll_question->pollq_question);
457
+ $poll_question_id = intval($poll_question->pollq_id);
458
+ $poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
459
+ $poll_question_totalvoters = intval($poll_question->pollq_totalvoters);
460
+ $poll_start_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
461
+ $poll_expiry = trim($poll_question->pollq_expiry);
462
+ if(empty($poll_expiry)) {
463
+ $poll_end_date = __('No Expiry', 'wp-polls');
464
+ } else {
465
+ $poll_end_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
466
+ }
467
+ $poll_multiple_ans = intval($poll_question->pollq_multiple);
468
+
469
+ $template_question = stripslashes(get_option('poll_template_voteheader'));
470
+
471
+ $template_question = apply_filters('poll_template_voteheader_markup', $template_question, $poll_question, array(
472
+ '%POLL_QUESTION%' => $poll_question_text,
473
+ '%POLL_ID%' => $poll_question_id,
474
+ '%POLL_TOTALVOTES%' => $poll_question_totalvotes,
475
+ '%POLL_TOTALVOTERS%' => $poll_question_totalvoters,
476
+ '%POLL_START_DATE%' => $poll_start_date,
477
+ '%POLL_END_DATE%' => $poll_end_date,
478
+ '%POLL_MULTIPLE_ANS_MAX%' => $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
479
+ ));
480
+
481
+ // Get Poll Answers Data
482
+ $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_qid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_sortby').' '.get_option('poll_ans_sortorder'));
483
+ // If There Is Poll Question With Answers
484
+ if($poll_question && $poll_answers) {
485
+ // Display Poll Voting Form
486
+ $temp_pollvote .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
487
+ $temp_pollvote .= "\t<form id=\"polls_form_$poll_question_id\" class=\"wp-polls-form\" action=\"".esc_attr($_SERVER['SCRIPT_NAME'])."\" method=\"post\">\n";
488
+ $temp_pollvote .= "\t\t<p style=\"display: none;\"><input type=\"hidden\" id=\"poll_{$poll_question_id}_nonce\" name=\"wp-polls-nonce\" value=\"".wp_create_nonce('poll_'.$poll_question_id.'-nonce')."\" /></p>\n";
489
+ $temp_pollvote .= "\t\t<p style=\"display: none;\"><input type=\"hidden\" name=\"poll_id\" value=\"$poll_question_id\" /></p>\n";
490
+ if($poll_multiple_ans > 0) {
491
+ $temp_pollvote .= "\t\t<p style=\"display: none;\"><input type=\"hidden\" id=\"poll_multiple_ans_$poll_question_id\" name=\"poll_multiple_ans_$poll_question_id\" value=\"$poll_multiple_ans\" /></p>\n";
492
+ }
493
+ // Print Out Voting Form Header Template
494
+ $temp_pollvote .= "\t\t$template_question\n";
495
+ foreach($poll_answers as $poll_answer) {
496
+ // Poll Answer Variables
497
+ $poll_answer_id = intval($poll_answer->polla_aid);
498
+ $poll_answer_text = stripslashes($poll_answer->polla_answers);
499
+ $poll_answer_votes = intval($poll_answer->polla_votes);
500
+ $template_answer = stripslashes(get_option('poll_template_votebody'));
501
+
502
+ $template_answer = apply_filters('poll_template_votebody_markup', $template_answer, $poll_answer, array(
503
+ '%POLL_ID%' => $poll_question_id,
504
+ '%POLL_ANSWER_ID%' => $poll_answer_id,
505
+ '%POLL_ANSWER%' => $poll_answer_text,
506
+ '%POLL_ANSWER_VOTES%' => number_format_i18n($poll_answer_votes),
507
+ "%POLL_CHECKBOX_RADIO%" => $poll_multiple_ans > 0 ? 'checkbox' : 'radio'
508
+ ));
509
+
510
+ // Print Out Voting Form Body Template
511
+ $temp_pollvote .= "\t\t$template_answer\n";
512
+ }
513
+ // Determine Poll Result URL
514
+ $poll_result_url = $_SERVER['REQUEST_URI'];
515
+ $poll_result_url = preg_replace('/pollresult=(\d+)/i', 'pollresult='.$poll_question_id, $poll_result_url);
516
+ if(isset($_GET['pollresult']) && intval($_GET['pollresult']) == 0) {
517
+ if(strpos($poll_result_url, '?') !== false) {
518
+ $poll_result_url = "$poll_result_url&amp;pollresult=$poll_question_id";
519
+ } else {
520
+ $poll_result_url = "$poll_result_url?pollresult=$poll_question_id";
521
+ }
522
+ }
523
+ // Voting Form Footer Variables
524
+ $template_footer = stripslashes(get_option('poll_template_votefooter'));
525
+
526
+ $template_footer = apply_filters('poll_template_votefooter_markup', $template_footer, $poll_question, array(
527
+ '%POLL_ID%' => $poll_question_id,
528
+ '%POLL_RESULT_URL%' => $poll_result_url,
529
+ '%POLL_START_DATE%' => $poll_start_date,
530
+ '%POLL_END_DATE%' => $poll_end_date,
531
+ '%POLL_MULTIPLE_ANS_MAX%' => $poll_multiple_ans > 0 ? $poll_multiple_ans : 1
532
+ ));
533
+
534
+ // Print Out Voting Form Footer Template
535
+ $temp_pollvote .= "\t\t$template_footer\n";
536
+ $temp_pollvote .= "\t</form>\n";
537
+ $temp_pollvote .= "</div>\n";
538
+ if($display_loading) {
539
+ $poll_ajax_style = get_option('poll_ajax_style');
540
+ if(intval($poll_ajax_style['loading']) == 1) {
541
+ $temp_pollvote .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".plugins_url('wp-polls/images/loading.gif')."\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" />&nbsp;".__('Loading', 'wp-polls')." ...</div>\n";
542
+ }
543
+ }
544
+ } else {
545
+ $temp_pollvote .= stripslashes(get_option('poll_template_disable'));
546
+ }
547
+ // Return Poll Vote Template
548
+ return $temp_pollvote;
549
+ }
550
+
551
+
552
+ ### Function: Display Results Form
553
+ function display_pollresult($poll_id, $user_voted = '', $display_loading = true) {
554
+ global $wpdb;
555
+ $poll_id = intval($poll_id);
556
+ // User Voted
557
+ if(!is_array($user_voted)) {
558
+ $user_voted = array();
559
+ }
560
+ // Temp Poll Result
561
+ $temp_pollresult = '';
562
+ // Most/Least Variables
563
+ $poll_most_answer = '';
564
+ $poll_most_votes = 0;
565
+ $poll_most_percentage = 0;
566
+ $poll_least_answer = '';
567
+ $poll_least_votes = 0;
568
+ $poll_least_percentage = 0;
569
+ // Get Poll Question Data
570
+ $poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_active, pollq_timestamp, pollq_expiry, pollq_multiple, pollq_totalvoters FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
571
+ // Poll Question Variables
572
+ $poll_question_text = stripslashes($poll_question->pollq_question);
573
+ $poll_question_id = intval($poll_question->pollq_id);
574
+ $poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
575
+ $poll_question_totalvoters = intval($poll_question->pollq_totalvoters);
576
+ $poll_question_active = intval($poll_question->pollq_active);
577
+ $poll_start_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
578
+ $poll_expiry = trim($poll_question->pollq_expiry);
579
+ if(empty($poll_expiry)) {
580
+ $poll_end_date = __('No Expiry', 'wp-polls');
581
+ } else {
582
+ $poll_end_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $poll_expiry));
583
+ }
584
+ $poll_multiple_ans = intval($poll_question->pollq_multiple);
585
+ $template_question = stripslashes(get_option('poll_template_resultheader'));
586
+ $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
587
+ $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
588
+ $template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
589
+ $template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question);
590
+ $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
591
+ $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
592
+ if($poll_multiple_ans > 0) {
593
+ $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question);
594
+ } else {
595
+ $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
596
+ }
597
+ // Get Poll Answers Data
598
+ $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder'));
599
+ // If There Is Poll Question With Answers
600
+ if($poll_question && $poll_answers) {
601
+ // Store The Percentage Of The Poll
602
+ $poll_answer_percentage_array = array();
603
+ // Is The Poll Total Votes 0?
604
+ $poll_totalvotes_zero = true;
605
+ if($poll_question_totalvotes > 0) {
606
+ $poll_totalvotes_zero = false;
607
+ }
608
+ // Print Out Result Header Template
609
+ $temp_pollresult .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
610
+ $temp_pollresult .= "\t\t$template_question\n";
611
+ foreach($poll_answers as $poll_answer) {
612
+ // Poll Answer Variables
613
+ $poll_answer_id = intval($poll_answer->polla_aid);
614
+ $poll_answer_text = stripslashes($poll_answer->polla_answers);
615
+ $poll_answer_votes = intval($poll_answer->polla_votes);
616
+ $poll_answer_percentage = 0;
617
+ $poll_answer_imagewidth = 0;
618
+ // Calculate Percentage And Image Bar Width
619
+ if(!$poll_totalvotes_zero) {
620
+ if($poll_answer_votes > 0) {
621
+ $poll_answer_percentage = round((($poll_answer_votes/$poll_question_totalvoters)*100));
622
+ $poll_answer_imagewidth = round($poll_answer_percentage);
623
+ if($poll_answer_imagewidth == 100) {
624
+ $poll_answer_imagewidth = 99;
625
+ }
626
+ } else {
627
+ $poll_answer_percentage = 0;
628
+ $poll_answer_imagewidth = 1;
629
+ }
630
+ } else {
631
+ $poll_answer_percentage = 0;
632
+ $poll_answer_imagewidth = 1;
633
+ }
634
+ // Make Sure That Total Percentage Is 100% By Adding A Buffer To The Last Poll Answer
635
+ if($poll_multiple_ans == 0) {
636
+ $poll_answer_percentage_array[] = $poll_answer_percentage;
637
+ if(sizeof($poll_answer_percentage_array) == sizeof($poll_answers)) {
638
+ $percentage_error_buffer = 100 - array_sum($poll_answer_percentage_array);
639
+ $poll_answer_percentage = $poll_answer_percentage + $percentage_error_buffer;
640
+ if($poll_answer_percentage < 0) {
641
+ $poll_answer_percentage = 0;
642
+ }
643
+ }
644
+ }
645
+ // Let User See What Options They Voted
646
+ if(in_array($poll_answer_id, $user_voted)) {
647
+ // Results Body Variables
648
+ $template_answer = stripslashes(get_option('poll_template_resultbody2'));
649
+ $template_answer = str_replace("%POLL_ID%", $poll_question_id, $template_answer);
650
+ $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
651
+ $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
652
+ $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($poll_answer_text)), $template_answer);
653
+ $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($poll_answer_votes), $template_answer);
654
+ $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
655
+ $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
656
+ // Print Out Results Body Template
657
+ $temp_pollresult .= "\t\t$template_answer\n";
658
+ } else {
659
+ // Results Body Variables
660
+ $template_answer = stripslashes(get_option('poll_template_resultbody'));
661
+ $template_answer = str_replace("%POLL_ID%", $poll_question_id, $template_answer);
662
+ $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
663
+ $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
664
+ $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($poll_answer_text)), $template_answer);
665
+ $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($poll_answer_votes), $template_answer);
666
+ $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
667
+ $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
668
+ // Print Out Results Body Template
669
+ $temp_pollresult .= "\t\t$template_answer\n";
670
+ }
671
+ // Get Most Voted Data
672
+ if($poll_answer_votes > $poll_most_votes) {
673
+ $poll_most_answer = $poll_answer_text;
674
+ $poll_most_votes = $poll_answer_votes;
675
+ $poll_most_percentage = $poll_answer_percentage;
676
+ }
677
+ // Get Least Voted Data
678
+ if($poll_least_votes == 0) {
679
+ $poll_least_votes = $poll_answer_votes;
680
+ }
681
+ if($poll_answer_votes <= $poll_least_votes) {
682
+ $poll_least_answer = $poll_answer_text;
683
+ $poll_least_votes = $poll_answer_votes;
684
+ $poll_least_percentage = $poll_answer_percentage;
685
+ }
686
+ }
687
+ // Results Footer Variables
688
+ if(!empty($user_voted) || $poll_question_active == 0 || !check_allowtovote()) {
689
+ $template_footer = stripslashes(get_option('poll_template_resultfooter'));
690
+ } else {
691
+ $template_footer = stripslashes(get_option('poll_template_resultfooter2'));
692
+ }
693
+ $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
694
+ $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
695
+ $template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
696
+ $template_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($poll_question_totalvotes), $template_footer);
697
+ $template_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($poll_question_totalvoters), $template_footer);
698
+ $template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
699
+ $template_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_footer);
700
+ $template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
701
+ $template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
702
+ $template_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_footer);
703
+ $template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
704
+ if($poll_multiple_ans > 0) {
705
+ $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer);
706
+ } else {
707
+ $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
708
+ }
709
+ // Print Out Results Footer Template
710
+ $temp_pollresult .= "\t\t$template_footer\n";
711
+ $temp_pollresult .= "\t\t<input type=\"hidden\" id=\"poll_{$poll_question_id}_nonce\" name=\"wp-polls-nonce\" value=\"".wp_create_nonce('poll_'.$poll_question_id.'-nonce')."\" />\n";
712
+ $temp_pollresult .= "</div>\n";
713
+ if($display_loading) {
714
+ $poll_ajax_style = get_option('poll_ajax_style');
715
+ if(intval($poll_ajax_style['loading']) == 1) {
716
+ $temp_pollresult .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".plugins_url('wp-polls/images/loading.gif')."\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" />&nbsp;".__('Loading', 'wp-polls')." ...</div>\n";
717
+ }
718
+ }
719
+ } else {
720
+ $temp_pollresult .= stripslashes(get_option('poll_template_disable'));
721
+ }
722
+ // Return Poll Result
723
+ return $temp_pollresult;
724
+ }
725
+
726
+
727
+ ### Function: Get IP Address
728
+ if(!function_exists('get_ipaddress')) {
729
+ function get_ipaddress() {
730
+ if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
731
+ $ip_address = $_SERVER["REMOTE_ADDR"];
732
+ } else {
733
+ $ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
734
+ }
735
+ if(strpos($ip_address, ',') !== false) {
736
+ $ip_address = explode(',', $ip_address);
737
+ $ip_address = $ip_address[0];
738
+ }
739
+ return esc_attr($ip_address);
740
+ }
741
+ }
742
+
743
+
744
+ ### Function: Short Code For Inserting Polls Archive Into Page
745
+ add_shortcode('page_polls', 'poll_page_shortcode');
746
+ function poll_page_shortcode($atts) {
747
+ return polls_archive();
748
+ }
749
+
750
+
751
+ ### Function: Short Code For Inserting Polls Into Posts
752
+ add_shortcode('poll', 'poll_shortcode');
753
+ function poll_shortcode($atts) {
754
+ extract(shortcode_atts(array('id' => 0, 'type' => 'vote'), $atts));
755
+ if(!is_feed()) {
756
+ $id = intval($id);
757
+ if($type == 'vote') {
758
+ return get_poll($id, false);
759
+ } elseif($type == 'result') {
760
+ return display_pollresult($id);
761
+ }
762
+ } else {
763
+ return __('Note: There is a poll embedded within this post, please visit the site to participate in this post\'s poll.', 'wp-polls');
764
+ }
765
+ }
766
+
767
+
768
+ ### Function: Get Poll Question Based On Poll ID
769
+ if(!function_exists('get_poll_question')) {
770
+ function get_poll_question($poll_id) {
771
+ global $wpdb;
772
+ $poll_id = intval($poll_id);
773
+ $poll_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
774
+ return stripslashes($poll_question);
775
+ }
776
+ }
777
+
778
+
779
+ ### Function: Get Poll Total Questions
780
+ if(!function_exists('get_pollquestions')) {
781
+ function get_pollquestions($display = true) {
782
+ global $wpdb;
783
+ $totalpollq = intval($wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq"));
784
+ if($display) {
785
+ echo $totalpollq;
786
+ } else {
787
+ return $totalpollq;
788
+ }
789
+ }
790
+ }
791
+
792
+
793
+ ### Function: Get Poll Total Answers
794
+ if(!function_exists('get_pollanswers')) {
795
+ function get_pollanswers($display = true) {
796
+ global $wpdb;
797
+ $totalpolla = intval($wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa"));
798
+ if($display) {
799
+ echo $totalpolla;
800
+ } else {
801
+ return $totalpolla;
802
+ }
803
+ }
804
+ }
805
+
806
+
807
+ ### Function: Get Poll Total Votes
808
+ if(!function_exists('get_pollvotes')) {
809
+ function get_pollvotes($display = true) {
810
+ global $wpdb;
811
+ $totalvotes = intval($wpdb->get_var("SELECT SUM(pollq_totalvotes) FROM $wpdb->pollsq"));
812
+ if($display) {
813
+ echo $totalvotes;
814
+ } else {
815
+ return $totalvotes;
816
+ }
817
+ }
818
+ }
819
+
820
+
821
+ ### Function: Get Poll Total Voters
822
+ if(!function_exists('get_pollvoters')) {
823
+ function get_pollvoters($display = true) {
824
+ global $wpdb;
825
+ $totalvoters = intval($wpdb->get_var("SELECT SUM(pollq_totalvoters) FROM $wpdb->pollsq"));
826
+ if($display) {
827
+ echo $totalvoters;
828
+ } else {
829
+ return $totalvoters;
830
+ }
831
+ }
832
+ }
833
+
834
+
835
+ ### Function: Check Voted To Get Voted Answer
836
+ function check_voted_multiple($poll_id, $polls_ips) {
837
+ if(!empty($_COOKIE["voted_$poll_id"])) {
838
+ return explode(',', $_COOKIE["voted_$poll_id"]);
839
+ } else {
840
+ if($polls_ips) {
841
+ return $polls_ips;
842
+ } else {
843
+ return array();
844
+ }
845
+ }
846
+ }
847
+
848
+
849
+ ### Function: Polls Archive Link
850
+ function polls_archive_link($page) {
851
+ $polls_archive_url = get_option('poll_archive_url');
852
+ if($page > 0) {
853
+ if(strpos($polls_archive_url, '?') !== false) {
854
+ $polls_archive_url = "$polls_archive_url&amp;poll_page=$page";
855
+ } else {
856
+ $polls_archive_url = "$polls_archive_url?poll_page=$page";
857
+ }
858
+ }
859
+ return $polls_archive_url;
860
+ }
861
+
862
+
863
+ ### Function: Displays Polls Archive Link
864
+ function display_polls_archive_link($display = true) {
865
+ $template_pollarchivelink = stripslashes(get_option('poll_template_pollarchivelink'));
866
+ $template_pollarchivelink = str_replace("%POLL_ARCHIVE_URL%", get_option('poll_archive_url'), $template_pollarchivelink);
867
+ if($display) {
868
+ echo $template_pollarchivelink;
869
+ } else{
870
+ return $template_pollarchivelink;
871
+ }
872
+ }
873
+
874
+
875
+ ### Function: Display Polls Archive
876
+ function polls_archive() {
877
+ global $wpdb, $in_pollsarchive;
878
+ // Polls Variables
879
+ $in_pollsarchive = true;
880
+ $page = intval($_GET['poll_page']);
881
+ $polls_questions = array();
882
+ $polls_answers = array();
883
+ $polls_ip = array();
884
+ $polls_perpage = intval(get_option('poll_archive_perpage'));
885
+ $poll_questions_ids = '0';
886
+ $poll_voted = false;
887
+ $poll_voted_aid = 0;
888
+ $poll_id = 0;
889
+ $pollsarchive_output_archive = '';
890
+ $polls_type = intval(get_option('poll_archive_displaypoll'));
891
+ $polls_type_sql = '';
892
+ // Determine What Type Of Polls To Show
893
+ switch($polls_type) {
894
+ case 1:
895
+ $polls_type_sql = 'pollq_active = 0';
896
+ break;
897
+ case 2:
898
+ $polls_type_sql = 'pollq_active = 1';
899
+ break;
900
+ case 3:
901
+ $polls_type_sql = 'pollq_active IN (0,1)';
902
+ break;
903
+ }
904
+ // Get Total Polls
905
+ $total_polls = $wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq WHERE $polls_type_sql AND pollq_active != -1");
906
+
907
+ // Calculate Paging
908
+ $numposts = $total_polls;
909
+ $perpage = $polls_perpage;
910
+ $max_page = ceil($numposts/$perpage);
911
+ if(empty($page) || $page == 0) {
912
+ $page = 1;
913
+ }
914
+ $offset = ($page-1) * $perpage;
915
+ $pages_to_show = 10;
916
+ $pages_to_show_minus_1 = $pages_to_show-1;
917
+ $half_page_start = floor($pages_to_show_minus_1/2);
918
+ $half_page_end = ceil($pages_to_show_minus_1/2);
919
+ $start_page = $page - $half_page_start;
920
+ if($start_page <= 0) {
921
+ $start_page = 1;
922
+ }
923
+ $end_page = $page + $half_page_end;
924
+ if(($end_page - $start_page) != $pages_to_show_minus_1) {
925
+ $end_page = $start_page + $pages_to_show_minus_1;
926
+ }
927
+ if($end_page > $max_page) {
928
+ $start_page = $max_page - $pages_to_show_minus_1;
929
+ $end_page = $max_page;
930
+ }
931
+ if($start_page <= 0) {
932
+ $start_page = 1;
933
+ }
934
+ if(($offset + $perpage) > $numposts) {
935
+ $max_on_page = $numposts;
936
+ } else {
937
+ $max_on_page = ($offset + $perpage);
938
+ }
939
+ if (($offset + 1) > ($numposts)) {
940
+ $display_on_page = $numposts;
941
+ } else {
942
+ $display_on_page = ($offset + 1);
943
+ }
944
+
945
+ // Get Poll Questions
946
+ $questions = $wpdb->get_results("SELECT * FROM $wpdb->pollsq WHERE $polls_type_sql ORDER BY pollq_id DESC LIMIT $offset, $polls_perpage");
947
+ if($questions) {
948
+ foreach($questions as $question) {
949
+ $polls_questions[] = array('id' => intval($question->pollq_id), 'question' => stripslashes($question->pollq_question), 'timestamp' => $question->pollq_timestamp, 'totalvotes' => intval($question->pollq_totalvotes), 'start' => $question->pollq_timestamp, 'end' => trim($question->pollq_expiry), 'multiple' => intval($question->pollq_multiple), 'totalvoters' => intval($question->pollq_totalvoters));
950
+ $poll_questions_ids .= intval($question->pollq_id).', ';
951
+ }
952
+ $poll_questions_ids = substr($poll_questions_ids, 0, -2);
953
+ }
954
+
955
+ // Get Poll Answers
956
+ $answers = $wpdb->get_results("SELECT polla_aid, polla_qid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid IN ($poll_questions_ids) ORDER BY ".get_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder'));
957
+ if($answers) {
958
+ foreach($answers as $answer) {
959
+ $polls_answers[intval($answer->polla_qid)][] = array('aid' => intval($answer->polla_aid), 'qid' => intval($answer->polla_qid), 'answers' => stripslashes($answer->polla_answers), 'votes' => intval($answer->polla_votes));
960
+ }
961
+ }
962
+
963
+ // Get Poll IPs
964
+ $ips = $wpdb->get_results("SELECT pollip_qid, pollip_aid FROM $wpdb->pollsip WHERE pollip_qid IN ($poll_questions_ids) AND pollip_ip = '".get_ipaddress()."' ORDER BY pollip_qid ASC");
965
+ if($ips) {
966
+ foreach($ips as $ip) {
967
+ $polls_ips[intval($ip->pollip_qid)][] = intval($ip->pollip_aid);
968
+ }
969
+ }
970
+ // Poll Archives
971
+ $pollsarchive_output_archive .= "<div class=\"wp-polls wp-polls-archive\">\n";
972
+ foreach($polls_questions as $polls_question) {
973
+ // Most/Least Variables
974
+ $poll_most_answer = '';
975
+ $poll_most_votes = 0;
976
+ $poll_most_percentage = 0;
977
+ $poll_least_answer = '';
978
+ $poll_least_votes = 0;
979
+ $poll_least_percentage = 0;
980
+ // Is The Poll Total Votes 0?
981
+ $poll_totalvotes_zero = true;
982
+ if($polls_question['totalvotes'] > 0) {
983
+ $poll_totalvotes_zero = false;
984
+ }
985
+ $poll_start_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $polls_question['start']));
986
+ if(empty($polls_question['end'])) {
987
+ $poll_end_date = __('No Expiry', 'wp-polls');
988
+ } else {
989
+ $poll_end_date = mysql2date(sprintf(__('%s @ %s', 'wp-polls'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $polls_question['end']));
990
+ }
991
+ // Archive Poll Header
992
+ $template_archive_header = stripslashes(get_option('poll_template_pollarchiveheader'));
993
+ // Poll Question Variables
994
+ $template_question = stripslashes(get_option('poll_template_resultheader'));
995
+ $template_question = str_replace("%POLL_QUESTION%", $polls_question['question'], $template_question);
996
+ $template_question = str_replace("%POLL_ID%", $polls_question['id'], $template_question);
997
+ $template_question = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_question);
998
+ $template_question = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_question);
999
+ $template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
1000
+ $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
1001
+ if($polls_question['multiple'] > 0) {
1002
+ $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_question);
1003
+ } else {
1004
+ $template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
1005
+ }
1006
+ // Print Out Result Header Template
1007
+ $pollsarchive_output_archive .= $template_archive_header;
1008
+ $pollsarchive_output_archive .= $template_question;
1009
+ // Store The Percentage Of The Poll
1010
+ $poll_answer_percentage_array = array();
1011
+ foreach($polls_answers[$polls_question['id']] as $polls_answer) {
1012
+ // Calculate Percentage And Image Bar Width
1013
+ if(!$poll_totalvotes_zero) {
1014
+ if($polls_answer['votes'] > 0) {
1015
+ $poll_answer_percentage = round((($polls_answer['votes']/$polls_question['totalvoters'])*100));
1016
+ $poll_answer_imagewidth = round($poll_answer_percentage*0.9);
1017
+ } else {
1018
+ $poll_answer_percentage = 0;
1019
+ $poll_answer_imagewidth = 1;
1020
+ }
1021
+ } else {
1022
+ $poll_answer_percentage = 0;
1023
+ $poll_answer_imagewidth = 1;
1024
+ }
1025
+ // Make Sure That Total Percentage Is 100% By Adding A Buffer To The Last Poll Answer
1026
+ if($polls_question['multiple'] == 0) {
1027
+ $poll_answer_percentage_array[] = $poll_answer_percentage;
1028
+ if(sizeof($poll_answer_percentage_array) == sizeof($polls_answers[$polls_question['id']])) {
1029
+ $percentage_error_buffer = 100 - array_sum($poll_answer_percentage_array);
1030
+ $poll_answer_percentage = $poll_answer_percentage + $percentage_error_buffer;
1031
+ if($poll_answer_percentage < 0) {
1032
+ $poll_answer_percentage = 0;
1033
+ }
1034
+ }
1035
+ }
1036
+ // Let User See What Options They Voted
1037
+ if(in_array($polls_answer['aid'], check_voted_multiple($polls_question['id'], $polls_ips[$polls_question['id']]))) {
1038
+ // Results Body Variables
1039
+ $template_answer = stripslashes(get_option('poll_template_resultbody2'));
1040
+ $template_answer = str_replace("%POLL_ID%", $polls_question['id'], $template_answer);
1041
+ $template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
1042
+ $template_answer = str_replace("%POLL_ANSWER%", $polls_answer['answers'], $template_answer);
1043
+ $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($polls_answer['answers'])), $template_answer);
1044
+ $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($polls_answer['votes']), $template_answer);
1045
+ $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
1046
+ $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
1047
+ // Print Out Results Body Template
1048
+ $pollsarchive_output_archive .= $template_answer;
1049
+ } else {
1050
+ // Results Body Variables
1051
+ $template_answer = stripslashes(get_option('poll_template_resultbody'));
1052
+ $template_answer = str_replace("%POLL_ID%", $polls_question['id'], $template_answer);
1053
+ $template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
1054
+ $template_answer = str_replace("%POLL_ANSWER%", $polls_answer['answers'], $template_answer);
1055
+ $template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($polls_answer['answers'])), $template_answer);
1056
+ $template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format_i18n($polls_answer['votes']), $template_answer);
1057
+ $template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
1058
+ $template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
1059
+ // Print Out Results Body Template
1060
+ $pollsarchive_output_archive .= $template_answer;
1061
+ }
1062
+ // Get Most Voted Data
1063
+ if($polls_answer['votes'] > $poll_most_votes) {
1064
+ $poll_most_answer = $polls_answer['answers'];
1065
+ $poll_most_votes = $polls_answer['votes'];
1066
+ $poll_most_percentage = $poll_answer_percentage;
1067
+ }
1068
+ // Get Least Voted Data
1069
+ if($poll_least_votes == 0) {
1070
+ $poll_least_votes = $polls_answer['votes'];
1071
+ }
1072
+ if($polls_answer['votes'] <= $poll_least_votes) {
1073
+ $poll_least_answer = $polls_answer['answers'];
1074
+ $poll_least_votes = $polls_answer['votes'];
1075
+ $poll_least_percentage = $poll_answer_percentage;
1076
+ }
1077
+ }
1078
+ // Results Footer Variables
1079
+ $template_footer = stripslashes(get_option('poll_template_resultfooter'));
1080
+ $template_footer = str_replace("%POLL_ID%", $polls_question['id'], $template_footer);
1081
+ $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
1082
+ $template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
1083
+ $template_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_footer);
1084
+ $template_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_footer);
1085
+ $template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
1086
+ $template_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_footer);
1087
+ $template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
1088
+ $template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
1089
+ $template_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_footer);
1090
+ $template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
1091
+ if($polls_question['multiple'] > 0) {
1092
+ $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_footer);
1093
+ } else {
1094
+ $template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
1095
+ }
1096
+ // Archive Poll Footer
1097
+ $template_archive_footer = stripslashes(get_option('poll_template_pollarchivefooter'));
1098
+ $template_archive_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_archive_footer);
1099
+ $template_archive_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_archive_footer);
1100
+ $template_archive_footer = str_replace("%POLL_TOTALVOTES%", number_format_i18n($polls_question['totalvotes']), $template_archive_footer);
1101
+ $template_archive_footer = str_replace("%POLL_TOTALVOTERS%", number_format_i18n($polls_question['totalvoters']), $template_archive_footer);
1102
+ $template_archive_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_archive_footer);
1103
+ $template_archive_footer = str_replace("%POLL_MOST_VOTES%", number_format_i18n($poll_most_votes), $template_archive_footer);
1104
+ $template_archive_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_archive_footer);
1105
+ $template_archive_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_archive_footer);
1106
+ $template_archive_footer = str_replace("%POLL_LEAST_VOTES%", number_format_i18n($poll_least_votes), $template_archive_footer);
1107
+ $template_archive_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_archive_footer);
1108
+ if($polls_question['multiple'] > 0) {
1109
+ $template_archive_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_archive_footer);
1110
+ } else {
1111
+ $template_archive_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_archive_footer);
1112
+ }
1113
+ // Print Out Results Footer Template
1114
+ $pollsarchive_output_archive .= $template_footer;
1115
+ // Print Out Archive Poll Footer Template
1116
+ $pollsarchive_output_archive .= $template_archive_footer;
1117
+ }
1118
+ $pollsarchive_output_archive .= "</div>\n";
1119
+
1120
+ // Polls Archive Paging
1121
+ if($max_page > 1) {
1122
+ $pollsarchive_output_archive .= stripslashes(get_option('poll_template_pollarchivepagingheader'));
1123
+ if(function_exists('wp_pagenavi')) {
1124
+ $pollsarchive_output_archive .= '<div class="wp-pagenavi">'."\n";
1125
+ } else {
1126
+ $pollsarchive_output_archive .= '<div class="wp-polls-paging">'."\n";
1127
+ }
1128
+ $pollsarchive_output_archive .= '<span class="pages">&#8201;'.sprintf(__('Page %s of %s', 'wp-polls'), number_format_i18n($page), number_format_i18n($max_page)).'&#8201;</span>';
1129
+ if ($start_page >= 2 && $pages_to_show < $max_page) {
1130
+ $pollsarchive_output_archive .= '<a href="'.polls_archive_link(1).'" title="'.__('&laquo; First', 'wp-polls').'">&#8201;'.__('&laquo; First', 'wp-polls').'&#8201;</a>';
1131
+ $pollsarchive_output_archive .= '<span class="extend">...</span>';
1132
+ }
1133
+ if($page > 1) {
1134
+ $pollsarchive_output_archive .= '<a href="'.polls_archive_link(($page-1)).'" title="'.__('&laquo;', 'wp-polls').'">&#8201;'.__('&laquo;', 'wp-polls').'&#8201;</a>';
1135
+ }
1136
+ for($i = $start_page; $i <= $end_page; $i++) {
1137
+ if($i == $page) {
1138
+ $pollsarchive_output_archive .= '<span class="current">&#8201;'.number_format_i18n($i).'&#8201;</span>';
1139
+ } else {
1140
+ $pollsarchive_output_archive .= '<a href="'.polls_archive_link($i).'" title="'.number_format_i18n($i).'">&#8201;'.number_format_i18n($i).'&#8201;</a>';
1141
+ }
1142
+ }
1143
+ if(empty($page) || ($page+1) <= $max_page) {
1144
+ $pollsarchive_output_archive .= '<a href="'.polls_archive_link(($page+1)).'" title="'.__('&raquo;', 'wp-polls').'">&#8201;'.__('&raquo;', 'wp-polls').'&#8201;</a>';
1145
+ }
1146
+ if ($end_page < $max_page) {
1147
+ $pollsarchive_output_archive .= '<span class="extend">...</span>';
1148
+ $pollsarchive_output_archive .= '<a href="'.polls_archive_link($max_page).'" title="'.__('Last &raquo;', 'wp-polls').'">&#8201;'.__('Last &raquo;', 'wp-polls').'&#8201;</a>';
1149
+ }
1150
+ $pollsarchive_output_archive .= '</div>';
1151
+ $pollsarchive_output_archive .= stripslashes(get_option('poll_template_pollarchivepagingfooter'));
1152
+ }
1153
+
1154
+ // Output Polls Archive Page
1155
+ return apply_filters('polls_archive', $pollsarchive_output_archive);
1156
+ }
1157
+
1158
+
1159
+ // Edit Timestamp Options
1160
+ function poll_timestamp($poll_timestamp, $fieldname = 'pollq_timestamp', $display = 'block') {
1161
+ global $month;
1162
+ echo '<div id="'.$fieldname.'" style="display: '.$display.'">'."\n";
1163
+ $day = gmdate('j', $poll_timestamp);
1164
+ echo '<select name="'.$fieldname.'_day" size="1">'."\n";
1165
+ for($i = 1; $i <=31; $i++) {
1166
+ if($day == $i) {
1167
+ echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1168
+ } else {
1169
+ echo "<option value=\"$i\">$i</option>\n";
1170
+ }
1171
+ }
1172
+ echo '</select>&nbsp;&nbsp;'."\n";
1173
+ $month2 = gmdate('n', $poll_timestamp);
1174
+ echo '<select name="'.$fieldname.'_month" size="1">'."\n";
1175
+ for($i = 1; $i <= 12; $i++) {
1176
+ if ($i < 10) {
1177
+ $ii = '0'.$i;
1178
+ } else {
1179
+ $ii = $i;
1180
+ }
1181
+ if($month2 == $i) {
1182
+ echo "<option value=\"$i\" selected=\"selected\">$month[$ii]</option>\n";
1183
+ } else {
1184
+ echo "<option value=\"$i\">$month[$ii]</option>\n";
1185
+ }
1186
+ }
1187
+ echo '</select>&nbsp;&nbsp;'."\n";
1188
+ $year = gmdate('Y', $poll_timestamp);
1189
+ echo '<select name="'.$fieldname.'_year" size="1">'."\n";
1190
+ for($i = 2000; $i <= ($year+10); $i++) {
1191
+ if($year == $i) {
1192
+ echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1193
+ } else {
1194
+ echo "<option value=\"$i\">$i</option>\n";
1195
+ }
1196
+ }
1197
+ echo '</select>&nbsp;@'."\n";
1198
+ echo '<span dir="ltr">'."\n";
1199
+ $hour = gmdate('H', $poll_timestamp);
1200
+ echo '<select name="'.$fieldname.'_hour" size="1">'."\n";
1201
+ for($i = 0; $i < 24; $i++) {
1202
+ if($hour == $i) {
1203
+ echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1204
+ } else {
1205
+ echo "<option value=\"$i\">$i</option>\n";
1206
+ }
1207
+ }
1208
+ echo '</select>&nbsp;:'."\n";
1209
+ $minute = gmdate('i', $poll_timestamp);
1210
+ echo '<select name="'.$fieldname.'_minute" size="1">'."\n";
1211
+ for($i = 0; $i < 60; $i++) {
1212
+ if($minute == $i) {
1213
+ echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1214
+ } else {
1215
+ echo "<option value=\"$i\">$i</option>\n";
1216
+ }
1217
+ }
1218
+
1219
+ echo '</select>&nbsp;:'."\n";
1220
+ $second = gmdate('s', $poll_timestamp);
1221
+ echo '<select name="'.$fieldname.'_second" size="1">'."\n";
1222
+ for($i = 0; $i <= 60; $i++) {
1223
+ if($second == $i) {
1224
+ echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
1225
+ } else {
1226
+ echo "<option value=\"$i\">$i</option>\n";
1227
+ }
1228
+ }
1229
+ echo '</select>'."\n";
1230
+ echo '</span>'."\n";
1231
+ echo '</div>'."\n";
1232
+ }
1233
+
1234
+
1235
+ ### Function: Place Cron
1236
+ function cron_polls_place() {
1237
+ wp_clear_scheduled_hook('polls_cron');
1238
+ if (!wp_next_scheduled('polls_cron')) {
1239
+ wp_schedule_event(time(), 'twicedaily', 'polls_cron');
1240
+ }
1241
+ }
1242
+
1243
+
1244
+ ### Funcion: Check All Polls Status To Check If It Expires
1245
+ add_action('polls_cron', 'cron_polls_status');
1246
+ function cron_polls_status() {
1247
+ global $wpdb;
1248
+ // Close Poll
1249
+ $close_polls = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_expiry < '".current_time('timestamp')."' AND pollq_expiry != '' AND pollq_active != 0");
1250
+ // Open Future Polls
1251
+ $active_polls = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_timestamp <= '".current_time('timestamp')."' AND pollq_active = -1");
1252
+ // Update Latest Poll If Future Poll Is Opened
1253
+ if($active_polls) {
1254
+ $update_latestpoll = update_option('poll_latestpoll', polls_latest_id());
1255
+ }
1256
+ return;
1257
+ }
1258
+
1259
+
1260
+ ### Funcion: Get Latest Poll ID
1261
+ function polls_latest_id() {
1262
+ global $wpdb;
1263
+ $poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY pollq_timestamp DESC LIMIT 1");
1264
+ return intval($poll_id);
1265
+ }
1266
+
1267
+
1268
+ ### Check If In Poll Archive Page
1269
+ function in_pollarchive() {
1270
+ $poll_archive_url = get_option('poll_archive_url');
1271
+ $poll_archive_url_array = explode('/', $poll_archive_url);
1272
+ $poll_archive_url = $poll_archive_url_array[sizeof($poll_archive_url_array)-1];
1273
+ if(empty($poll_archive_url)) {
1274
+ $poll_archive_url = $poll_archive_url_array[sizeof($poll_archive_url_array)-2];
1275
+ }
1276
+ $current_url = $_SERVER['REQUEST_URI'];
1277
+ if(strpos($current_url, $poll_archive_url) === false) {
1278
+ return false;
1279
+ } else {
1280
+ return true;
1281
+ }
1282
+ }
1283
+
1284
+
1285
+ ### Function: Vote Poll
1286
+ add_action('wp_ajax_polls', 'vote_poll');
1287
+ add_action('wp_ajax_nopriv_polls', 'vote_poll');
1288
+ function vote_poll() {
1289
+ global $wpdb, $user_identity, $user_ID;
1290
+
1291
+ if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'polls')
1292
+ {
1293
+ // Load Headers
1294
+ polls_textdomain();
1295
+ header('Content-Type: text/html; charset='.get_option('blog_charset').'');
1296
+
1297
+ // Get Poll ID
1298
+ $poll_id = (isset($_REQUEST['poll_id']) ? intval($_REQUEST['poll_id']) : 0);
1299
+
1300
+ // Ensure Poll ID Is Valid
1301
+ if($poll_id == 0)
1302
+ {
1303
+ _e('Invalid Poll ID', 'wp-polls');
1304
+ exit();
1305
+ }
1306
+
1307
+ // Verify Referer
1308
+ if(!check_ajax_referer('poll_'.$poll_id.'-nonce', 'poll_'.$poll_id.'_nonce', false))
1309
+ {
1310
+ _e('Failed To Verify Referrer', 'wp-polls');
1311
+ exit();
1312
+ }
1313
+
1314
+ // Which View
1315
+ switch($_REQUEST['view'])
1316
+ {
1317
+ // Poll Vote
1318
+ case 'process':
1319
+ $poll_aid = $_POST["poll_$poll_id"];
1320
+ $poll_aid_array = array_unique(array_map('intval', explode(',', $poll_aid)));
1321
+ if($poll_id > 0 && !empty($poll_aid_array) && check_allowtovote()) {
1322
+ $check_voted = check_voted($poll_id);
1323
+ if($check_voted == 0) {
1324
+ if(!empty($user_identity)) {
1325
+ $pollip_user = htmlspecialchars(addslashes($user_identity));
1326
+ } elseif(!empty($_COOKIE['comment_author_'.COOKIEHASH])) {
1327
+ $pollip_user = htmlspecialchars(addslashes($_COOKIE['comment_author_'.COOKIEHASH]));
1328
+ } else {
1329
+ $pollip_user = __('Guest', 'wp-polls');
1330
+ }
1331
+ $pollip_userid = intval($user_ID);
1332
+ $pollip_ip = get_ipaddress();
1333
+ $pollip_host = esc_attr(@gethostbyaddr($pollip_ip));
1334
+ $pollip_timestamp = current_time('timestamp');
1335
+ // Only Create Cookie If User Choose Logging Method 1 Or 2
1336
+ $poll_logging_method = intval(get_option('poll_logging_method'));
1337
+ if($poll_logging_method == 1 || $poll_logging_method == 3) {
1338
+ $cookie_expiry = intval(get_option('poll_cookielog_expiry'));
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) {
1346
+ $update_polla_votes = $wpdb->query("UPDATE $wpdb->pollsa SET polla_votes = (polla_votes+1) WHERE polla_qid = $poll_id AND polla_aid = $polla_aid");
1347
+ if(!$update_polla_votes) {
1348
+ unset($poll_aid_array[$i]);
1349
+ }
1350
+ $i++;
1351
+ }
1352
+ $vote_q = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes+".sizeof($poll_aid_array)."), pollq_totalvoters = (pollq_totalvoters+1) WHERE pollq_id = $poll_id AND pollq_active = 1");
1353
+ if($vote_q) {
1354
+ foreach($poll_aid_array as $polla_aid) {
1355
+ $wpdb->query("INSERT INTO $wpdb->pollsip VALUES (0, $poll_id, $polla_aid, '$pollip_ip', '$pollip_host', '$pollip_timestamp', '$pollip_user', $pollip_userid)");
1356
+ }
1357
+ echo display_pollresult($poll_id,$poll_aid_array, false);
1358
+ } else {
1359
+ printf(__('Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s', 'wp-polls'), $poll_id);
1360
+ } // End if($vote_a)
1361
+ } else {
1362
+ printf(__('You Had Already Voted For This Poll. Poll ID #%s', 'wp-polls'), $poll_id);
1363
+ }// End if($check_voted)
1364
+ } else {
1365
+ printf(__('Invalid Poll ID. Poll ID #%s', 'wp-polls'), $poll_id);
1366
+ } // End if($poll_id > 0 && !empty($poll_aid_array) && check_allowtovote())
1367
+ break;
1368
+ // Poll Result
1369
+ case 'result':
1370
+ echo display_pollresult($poll_id, 0, false);
1371
+ break;
1372
+ // Poll Booth Aka Poll Voting Form
1373
+ case 'booth':
1374
+ echo display_pollvote($poll_id, false);
1375
+ break;
1376
+ } // End switch($_REQUEST['view'])
1377
+ } // End if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'polls')
1378
+ exit();
1379
+ }
1380
+
1381
+
1382
+ ### Function: Manage Polls
1383
+ add_action('wp_ajax_polls-admin', 'manage_poll');
1384
+ function manage_poll() {
1385
+ global $wpdb;
1386
+ ### Form Processing
1387
+ if(isset($_POST['action']) && $_POST['action'] == 'polls-admin')
1388
+ {
1389
+ if(!empty($_POST['do'])) {
1390
+ // Set Header
1391
+ header('Content-Type: text/html; charset='.get_option('blog_charset').'');
1392
+
1393
+ // Decide What To Do
1394
+ switch($_POST['do']) {
1395
+ // Delete Polls Logs
1396
+ case __('Delete All Logs', 'wp-polls'):
1397
+ check_ajax_referer('wp-polls_delete-polls-logs');
1398
+ if(trim($_POST['delete_logs_yes']) == 'yes') {
1399
+ $delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip");
1400
+ if($delete_logs) {
1401
+ echo '<p style="color: green;">'.__('All Polls Logs Have Been Deleted.', 'wp-polls').'</p>';
1402
+ } else {
1403
+ echo '<p style="color: red;">'.__('An Error Has Occurred While Deleting All Polls Logs.', 'wp-polls').'</p>';
1404
+ }
1405
+ }
1406
+ break;
1407
+ // Delete Poll Logs For Individual Poll
1408
+ case __('Delete Logs For This Poll Only', 'wp-polls'):
1409
+ check_ajax_referer('wp-polls_delete-poll-logs');
1410
+ $pollq_id = intval($_POST['pollq_id']);
1411
+ $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
1412
+ if(trim($_POST['delete_logs_yes']) == 'yes') {
1413
+ $delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
1414
+ if($delete_logs) {
1415
+ echo '<p style="color: green;">'.sprintf(__('All Logs For \'%s\' Has Been Deleted.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1416
+ } else {
1417
+ echo '<p style="color: red;">'.sprintf(__('An Error Has Occurred While Deleting All Logs For \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1418
+ }
1419
+ }
1420
+ break;
1421
+ // Delete Poll's Answer
1422
+ case __('Delete Poll Answer', 'wp-polls'):
1423
+ check_ajax_referer('wp-polls_delete-poll-answer');
1424
+ $pollq_id = intval($_POST['pollq_id']);
1425
+ $polla_aid = intval($_POST['polla_aid']);
1426
+ $poll_answers = $wpdb->get_row("SELECT polla_votes, polla_answers FROM $wpdb->pollsa WHERE polla_aid = $polla_aid AND polla_qid = $pollq_id");
1427
+ $polla_votes = intval($poll_answers->polla_votes);
1428
+ $polla_answers = stripslashes(trim($poll_answers->polla_answers));
1429
+ $delete_polla_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_aid = $polla_aid AND polla_qid = $pollq_id");
1430
+ $delete_pollip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id AND pollip_aid = $polla_aid");
1431
+ $update_pollq_totalvotes = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes-$polla_votes) WHERE pollq_id = $pollq_id");
1432
+ if($delete_polla_answers) {
1433
+ echo '<p style="color: green;">'.sprintf(__('Poll Answer \'%s\' Deleted Successfully.', 'wp-polls'), $polla_answers).'</p>';
1434
+ } else {
1435
+ echo '<p style="color: red;">'.sprintf(__('Error In Deleting Poll Answer \'%s\'.', 'wp-polls'), $polla_answers).'</p>';
1436
+ }
1437
+ break;
1438
+ // Open Poll
1439
+ case __('Open Poll', 'wp-polls'):
1440
+ check_ajax_referer('wp-polls_open-poll');
1441
+ $pollq_id = intval($_POST['pollq_id']);
1442
+ $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
1443
+ $open_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_id = $pollq_id;");
1444
+ if($open_poll) {
1445
+ echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Is Now Opened', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1446
+ } else {
1447
+ echo '<p style="color: red;">'.sprintf(__('Error Opening Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1448
+ }
1449
+ break;
1450
+ // Close Poll
1451
+ case __('Close Poll', 'wp-polls'):
1452
+ check_ajax_referer('wp-polls_close-poll');
1453
+ $pollq_id = intval($_POST['pollq_id']);
1454
+ $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
1455
+ $close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_id = $pollq_id;");
1456
+ if($close_poll) {
1457
+ echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Is Now Closed', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1458
+ } else {
1459
+ echo '<p style="color: red;">'.sprintf(__('Error Closing Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1460
+ }
1461
+ break;
1462
+ // Delete Poll
1463
+ case __('Delete Poll', 'wp-polls'):
1464
+ check_ajax_referer('wp-polls_delete-poll');
1465
+ $pollq_id = intval($_POST['pollq_id']);
1466
+ $pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
1467
+ $delete_poll_question = $wpdb->query("DELETE FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
1468
+ $delete_poll_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_qid = $pollq_id");
1469
+ $delete_poll_ip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
1470
+ $poll_option_lastestpoll = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'poll_latestpoll'");
1471
+ if(!$delete_poll_question) {
1472
+ echo '<p style="color: red;">'.sprintf(__('Error In Deleting Poll \'%s\' Question', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1473
+ }
1474
+ if(empty($text)) {
1475
+ echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Deleted Successfully', 'wp-polls'), stripslashes($pollq_question)).'</p>';
1476
+ }
1477
+ // Update Lastest Poll ID To Poll Options
1478
+ $latest_pollid = polls_latest_id();
1479
+ $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
1480
+ break;
1481
+ }
1482
+ exit();
1483
+ }
1484
+ }
1485
+ }
1486
+
1487
+
1488
+ ### Function: Plug Into WP-Stats
1489
+ add_action('wp','polls_wp_stats');
1490
+ function polls_wp_stats() {
1491
+ if(function_exists('stats_page')) {
1492
+ if(strpos(get_option('stats_url'), $_SERVER['REQUEST_URI']) || strpos($_SERVER['REQUEST_URI'], 'stats-options.php') || strpos($_SERVER['REQUEST_URI'], 'wp-stats/wp-stats.php')) {
1493
+ add_filter('wp_stats_page_admin_plugins', 'polls_page_admin_general_stats');
1494
+ add_filter('wp_stats_page_plugins', 'polls_page_general_stats');
1495
+ }
1496
+ }
1497
+ }
1498
+
1499
+
1500
+ ### Function: Add WP-Polls General Stats To WP-Stats Page Options
1501
+ function polls_page_admin_general_stats($content) {
1502
+ $stats_display = get_option('stats_display');
1503
+ if($stats_display['polls'] == 1) {
1504
+ $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_polls" value="polls" checked="checked" />&nbsp;&nbsp;<label for="wpstats_polls">'.__('WP-Polls', 'wp-polls').'</label><br />'."\n";
1505
+ } else {
1506
+ $content .= '<input type="checkbox" name="stats_display[]" id="wpstats_polls" value="polls" />&nbsp;&nbsp;<label for="wpstats_polls">'.__('WP-Polls', 'wp-polls').'</label><br />'."\n";
1507
+ }
1508
+ return $content;
1509
+ }
1510
+
1511
+
1512
+ ### Function: Add WP-Polls General Stats To WP-Stats Page
1513
+ function polls_page_general_stats($content) {
1514
+ $stats_display = get_option('stats_display');
1515
+ if($stats_display['polls'] == 1) {
1516
+ $content .= '<p><strong>'.__('WP-Polls', 'wp-polls').'</strong></p>'."\n";
1517
+ $content .= '<ul>'."\n";
1518
+ $content .= '<li>'.sprintf(_n('<strong>%s</strong> poll was created.', '<strong>%s</strong> polls were created.', get_pollquestions(false), 'wp-polls'), number_format_i18n(get_pollquestions(false))).'</li>'."\n";
1519
+ $content .= '<li>'.sprintf(_n('<strong>%s</strong> polls\' answer was given.', '<strong>%s</strong> polls\' answers were given.', get_pollanswers(false), 'wp-polls'), number_format_i18n(get_pollanswers(false))).'</li>'."\n";
1520
+ $content .= '<li>'.sprintf(_n('<strong>%s</strong> vote was casted.', '<strong>%s</strong> votes were casted.', get_pollvotes(false), 'wp-polls'), number_format_i18n(get_pollvotes(false))).'</li>'."\n";
1521
+ $content .= '</ul>'."\n";
1522
+ }
1523
+ return $content;
1524
+ }
1525
+
1526
+
1527
+ ### Class: WP-Polls Widget
1528
+ class WP_Widget_Polls extends WP_Widget {
1529
+ // Constructor
1530
+ function WP_Widget_Polls() {
1531
+ $widget_ops = array('description' => __('WP-Polls polls', 'wp-polls'));
1532
+ $this->WP_Widget('polls-widget', __('Polls', 'wp-polls'), $widget_ops);
1533
+ }
1534
+
1535
+ // Display Widget
1536
+ function widget($args, $instance) {
1537
+ extract($args);
1538
+ $title = apply_filters('widget_title', esc_attr($instance['title']));
1539
+ $poll_id = intval($instance['poll_id']);
1540
+ $display_pollarchive = intval($instance['display_pollarchive']);
1541
+ echo $before_widget;
1542
+ if(!empty($title)) {
1543
+ echo $before_title.$title.$after_title;
1544
+ }
1545
+ get_poll($poll_id);
1546
+ if($display_pollarchive) {
1547
+ display_polls_archive_link();
1548
+ }
1549
+ echo $after_widget;
1550
+ }
1551
+
1552
+ // When Widget Control Form Is Posted
1553
+ function update($new_instance, $old_instance) {
1554
+ if (!isset($new_instance['submit'])) {
1555
+ return false;
1556
+ }
1557
+ $instance = $old_instance;
1558
+ $instance['title'] = strip_tags($new_instance['title']);
1559
+ $instance['poll_id'] = intval($new_instance['poll_id']);
1560
+ $instance['display_pollarchive'] = intval($new_instance['display_pollarchive']);
1561
+ return $instance;
1562
+ }
1563
+
1564
+ // DIsplay Widget Control Form
1565
+ function form($instance) {
1566
+ global $wpdb;
1567
+ $instance = wp_parse_args((array) $instance, array('title' => __('Polls', 'wp-polls'), 'poll_id' => 0, 'display_pollarchive' => 1));
1568
+ $title = esc_attr($instance['title']);
1569
+ $poll_id = intval($instance['poll_id']);
1570
+ $display_pollarchive = intval($instance['display_pollarchive']);
1571
+ ?>
1572
+ <p>
1573
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'wp-polls'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label>
1574
+ </p>
1575
+ <p>
1576
+ <label for="<?php echo $this->get_field_id('display_pollarchive'); ?>"><?php _e('Display Polls Archive Link Below Poll?', 'wp-polls'); ?>
1577
+ <select name="<?php echo $this->get_field_name('display_pollarchive'); ?>" id="<?php echo $this->get_field_id('display_pollarchive'); ?>" class="widefat">
1578
+ <option value="0"<?php selected(0, $display_pollarchive); ?>><?php _e('No', 'wp-polls'); ?></option>
1579
+ <option value="1"<?php selected(1, $display_pollarchive); ?>><?php _e('Yes', 'wp-polls'); ?></option>
1580
+ </select>
1581
+ </label>
1582
+ </p>
1583
+ <p>
1584
+ <label for="<?php echo $this->get_field_id('poll_id'); ?>"><?php _e('Poll To Display:', 'wp-polls'); ?>
1585
+ <select name="<?php echo $this->get_field_name('poll_id'); ?>" id="<?php echo $this->get_field_id('poll_id'); ?>" class="widefat">
1586
+ <option value="-1"<?php selected(-1, $poll_id); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
1587
+ <option value="-2"<?php selected(-2, $poll_id); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
1588
+ <option value="0"<?php selected(0, $poll_id); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
1589
+ <optgroup>&nbsp;</optgroup>
1590
+ <?php
1591
+ $polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
1592
+ if($polls) {
1593
+ foreach($polls as $poll) {
1594
+ $pollq_question = stripslashes($poll->pollq_question);
1595
+ $pollq_id = intval($poll->pollq_id);
1596
+ if($pollq_id == $poll_id) {
1597
+ echo "<option value=\"$pollq_id\" selected=\"selected\">$pollq_question</option>\n";
1598
+ } else {
1599
+ echo "<option value=\"$pollq_id\">$pollq_question</option>\n";
1600
+ }
1601
+ }
1602
+ }
1603
+ ?>
1604
+ </select>
1605
+ </label>
1606
+ </p>
1607
+ <input type="hidden" id="<?php echo $this->get_field_id('submit'); ?>" name="<?php echo $this->get_field_name('submit'); ?>" value="1" />
1608
+ <?php
1609
+ }
1610
+ }
1611
+
1612
+
1613
+ ### Function: Init WP-Polls Widget
1614
+ add_action('widgets_init', 'widget_polls_init');
1615
+ function widget_polls_init() {
1616
+ polls_textdomain();
1617
+ register_widget('WP_Widget_Polls');
1618
+ }
1619
+
1620
+
1621
+ ### Function: Create Poll Tables
1622
+ add_action('activate_wp-polls/wp-polls.php', 'create_poll_table');
1623
+ function create_poll_table() {
1624
+ global $wpdb;
1625
+ polls_textdomain();
1626
+ if(@is_file(ABSPATH.'/wp-admin/includes/upgrade.php')) {
1627
+ include_once(ABSPATH.'/wp-admin/includes/upgrade.php');
1628
+ }elseif(@is_file(ABSPATH.'/wp-admin/upgrade-functions.php')) {
1629
+ include_once(ABSPATH.'/wp-admin/upgrade-functions.php');
1630
+ } elseif(@is_file(ABSPATH.'/wp-admin/includes/upgrade.php')) {
1631
+ include_once(ABSPATH.'/wp-admin/includes/upgrade.php');
1632
+ } else {
1633
+ die('We have problem finding your \'/wp-admin/upgrade-functions.php\' and \'/wp-admin/includes/upgrade.php\'');
1634
+ }
1635
+ // Create Poll Tables (3 Tables)
1636
+ $charset_collate = '';
1637
+ if($wpdb->supports_collation()) {
1638
+ if(!empty($wpdb->charset)) {
1639
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
1640
+ }
1641
+ if(!empty($wpdb->collate)) {
1642
+ $charset_collate .= " COLLATE $wpdb->collate";
1643
+ }
1644
+ }
1645
+ $create_table = array();
1646
+ $create_table['pollsq'] = "CREATE TABLE $wpdb->pollsq (".
1647
+ "pollq_id int(10) NOT NULL auto_increment,".
1648
+ "pollq_question varchar(200) character set utf8 NOT NULL default '',".
1649
+ "pollq_timestamp varchar(20) NOT NULL default '',".
1650
+ "pollq_totalvotes int(10) NOT NULL default '0',".
1651
+ "pollq_active tinyint(1) NOT NULL default '1',".
1652
+ "pollq_expiry varchar(20) NOT NULL default '',".
1653
+ "pollq_multiple tinyint(3) NOT NULL default '0',".
1654
+ "pollq_totalvoters int(10) NOT NULL default '0',".
1655
+ "PRIMARY KEY (pollq_id)) $charset_collate;";
1656
+ $create_table['pollsa'] = "CREATE TABLE $wpdb->pollsa (".
1657
+ "polla_aid int(10) NOT NULL auto_increment,".
1658
+ "polla_qid int(10) NOT NULL default '0',".
1659
+ "polla_answers varchar(200) character set utf8 NOT NULL default '',".
1660
+ "polla_votes int(10) NOT NULL default '0',".
1661
+ "PRIMARY KEY (polla_aid)) $charset_collate;";
1662
+ $create_table['pollsip'] = "CREATE TABLE $wpdb->pollsip (".
1663
+ "pollip_id int(10) NOT NULL auto_increment,".
1664
+ "pollip_qid varchar(10) NOT NULL default '',".
1665
+ "pollip_aid varchar(10) NOT NULL default '',".
1666
+ "pollip_ip varchar(100) NOT NULL default '',".
1667
+ "pollip_host VARCHAR(200) NOT NULL default '',".
1668
+ "pollip_timestamp varchar(20) NOT NULL default '0000-00-00 00:00:00',".
1669
+ "pollip_user tinytext NOT NULL,".
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']);
1677
+ maybe_create_table($wpdb->pollsip, $create_table['pollsip']);
1678
+ // Check Whether It is Install Or Upgrade
1679
+ $first_poll = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq LIMIT 1");
1680
+ // If Install, Insert 1st Poll Question With 5 Poll Answers
1681
+ if(empty($first_poll)) {
1682
+ // Insert Poll Question (1 Record)
1683
+ $insert_pollq = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (1, '".__('How Is My Site?', 'wp-polls')."', '".current_time('timestamp')."', 0, 1, '', 0, 0);");
1684
+ if($insert_pollq) {
1685
+ // Insert Poll Answers (5 Records)
1686
+ $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (1, 1, '".__('Good', 'wp-polls')."', 0);");
1687
+ $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (2, 1, '".__('Excellent', 'wp-polls')."', 0);");
1688
+ $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (3, 1, '".__('Bad', 'wp-polls')."', 0);");
1689
+ $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (4, 1, '".__('Can Be Improved', 'wp-polls')."', 0);");
1690
+ $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (5, 1, '".__('No Comments', 'wp-polls')."', 0);");
1691
+ }
1692
+ }
1693
+ // Add In Options (16 Records)
1694
+ add_option('poll_template_voteheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
1695
+ '<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
1696
+ '<ul class="wp-polls-ul">');
1697
+ add_option('poll_template_votebody', '<li><input type="%POLL_CHECKBOX_RADIO%" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value="%POLL_ANSWER_ID%" /> <label for="poll-answer-%POLL_ANSWER_ID%">%POLL_ANSWER%</label></li>');
1698
+ add_option('poll_template_votefooter', '</ul>'.
1699
+ '<p style="text-align: center;"><input type="button" name="vote" value=" '.__('Vote', 'wp-polls').' " class="Buttons" onclick="poll_vote(%POLL_ID%);" /></p>'.
1700
+ '<p style="text-align: center;"><a href="#ViewPollResults" onclick="poll_result(%POLL_ID%); return false;" title="'.__('View Results Of This Poll', 'wp-polls').'">'.__('View Results', 'wp-polls').'</a></p>'.
1701
+ '</div>');
1702
+ add_option('poll_template_resultheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
1703
+ '<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
1704
+ '<ul class="wp-polls-ul">');
1705
+ add_option('poll_template_resultbody', '<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%'.__(',', 'wp-polls').' %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')</small><div class="pollbar" style="width: %POLL_ANSWER_IMAGEWIDTH%%;" title="%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')"></div></li>');
1706
+ add_option('poll_template_resultbody2', '<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%'.__(',', 'wp-polls').' %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')</small></i></strong><div class="pollbar" style="width: %POLL_ANSWER_IMAGEWIDTH%%;" title="'.__('You Have Voted For This Choice', 'wp-polls').' - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')"></div></li>');
1707
+ add_option('poll_template_resultfooter', '</ul>'.
1708
+ '<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'.
1709
+ '</div>');
1710
+ add_option('poll_template_resultfooter2', '</ul>'.
1711
+ '<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'.
1712
+ '<p style="text-align: center;"><a href="#VotePoll" onclick="poll_booth(%POLL_ID%); return false;" title="'.__('Vote For This Poll', 'wp-polls').'">'.__('Vote', 'wp-polls').'</a></p>'.
1713
+ '</div>');
1714
+ add_option('poll_template_disable', __('Sorry, there are no polls available at the moment.', 'wp-polls'));
1715
+ add_option('poll_template_error', __('An error has occurred when processing your poll.', 'wp-polls'));
1716
+ add_option('poll_currentpoll', 0);
1717
+ add_option('poll_latestpoll', 1);
1718
+ add_option('poll_archive_perpage', 5);
1719
+ add_option('poll_ans_sortby', 'polla_aid');
1720
+ add_option('poll_ans_sortorder', 'asc');
1721
+ add_option('poll_ans_result_sortby', 'polla_votes');
1722
+ add_option('poll_ans_result_sortorder', 'desc');
1723
+ // Database Upgrade For WP-Polls 2.1
1724
+ add_option('poll_logging_method', '3');
1725
+ add_option('poll_allowtovote', '2');
1726
+ maybe_add_column($wpdb->pollsq, 'pollq_active', "ALTER TABLE $wpdb->pollsq ADD pollq_active TINYINT( 1 ) NOT NULL DEFAULT '1';");
1727
+ // Database Upgrade For WP-Polls 2.12
1728
+ maybe_add_column($wpdb->pollsip, 'pollip_userid', "ALTER TABLE $wpdb->pollsip ADD pollip_userid INT( 10 ) NOT NULL DEFAULT '0';");
1729
+ add_option('poll_archive_url', site_url('pollsarchive'));
1730
+ // Database Upgrade For WP-Polls 2.13
1731
+ add_option('poll_bar', array('style' => 'default', 'background' => 'd8e1eb', 'border' => 'c8c8c8', 'height' => 8));
1732
+ // Database Upgrade For WP-Polls 2.14
1733
+ maybe_add_column($wpdb->pollsq, 'pollq_expiry', "ALTER TABLE $wpdb->pollsq ADD pollq_expiry varchar(20) NOT NULL default '';");
1734
+ add_option('poll_close', 1);
1735
+ // Database Upgrade For WP-Polls 2.20
1736
+ add_option('poll_ajax_style', array('loading' => 1, 'fading' => 1));
1737
+ add_option('poll_template_pollarchivelink', '<ul>'.
1738
+ '<li><a href="%POLL_ARCHIVE_URL%">'.__('Polls Archive', 'wp-polls').'</a></li>'.
1739
+ '</ul>');
1740
+ add_option('poll_archive_displaypoll', 2);
1741
+ add_option('poll_template_pollarchiveheader', '');
1742
+ add_option('poll_template_pollarchivefooter', '<p>'.__('Start Date:', 'wp-polls').' %POLL_START_DATE%<br />'.__('End Date:', 'wp-polls').' %POLL_END_DATE%</p>');
1743
+ maybe_add_column($wpdb->pollsq, 'pollq_multiple', "ALTER TABLE $wpdb->pollsq ADD pollq_multiple TINYINT( 3 ) NOT NULL DEFAULT '0';");
1744
+ $pollq_totalvoters = maybe_add_column($wpdb->pollsq, 'pollq_totalvoters', "ALTER TABLE $wpdb->pollsq ADD pollq_totalvoters INT( 10 ) NOT NULL DEFAULT '0';");
1745
+ if($pollq_totalvoters) {
1746
+ $pollq_totalvoters = intval($wpdb->get_var("SELECT SUM(pollq_totalvoters) FROM $wpdb->pollsq"));
1747
+ if($pollq_totalvoters == 0) {
1748
+ $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvoters = pollq_totalvotes");
1749
+ }
1750
+ }
1751
+ // Database Upgrade For WP-Polls 2.30
1752
+ add_option('poll_cookielog_expiry', 0);
1753
+ add_option('poll_template_pollarchivepagingheader', '');
1754
+ add_option('poll_template_pollarchivepagingfooter', '');
1755
+ // Database Upgrade For WP-Polls 2.50
1756
+ delete_option('poll_archive_show');
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')) {
1763
+ $role->add_cap('manage_polls');
1764
+ }
1765
+ cron_polls_place();
1766
+ }
wp-polls.pot CHANGED
@@ -1,543 +1,388 @@
 
 
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP-Polls 2.50\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2009-06-17 21:50+0800\n"
6
- "PO-Revision-Date: 2009-06-17 21:50+0800\n"
7
- "Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
8
- "Language-Team: Lester Chan <lesterchan@gmail.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-Country: SINGAPORE\n"
13
- "X-Poedit-KeywordsList: __;_e;_n:1,2;__ngettext_noop:1,2\n"
14
- "X-Poedit-Basepath: .\n"
15
- "X-Poedit-Language: English\n"
16
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
- "X-Poedit-SearchPath-0: .\n"
18
-
19
- #: polls-add.php:36
20
- #: polls-add.php:111
21
- #: polls-add.php:178
22
- #: wp-polls.php:64
23
- #: wp-polls.php:309
24
  msgid "Add Poll"
25
  msgstr ""
26
 
27
- #: polls-add.php:80
28
- #, php-format
29
  msgid "Error In Adding Poll '%s'."
30
  msgstr ""
31
 
32
- #: polls-add.php:89
33
- #: polls-manager.php:131
34
- #, php-format
35
  msgid "Error In Adding Poll's Answer '%s'."
36
  msgstr ""
37
 
38
- #: polls-add.php:96
39
- #, php-format
40
  msgid "Poll '%s' Added Successfully."
41
  msgstr ""
42
 
43
- #: polls-add.php:96
44
- #: polls-manager.php:334
45
- #: wp-polls.php:63
46
  msgid "Manage Polls"
47
  msgstr ""
48
 
49
- #: polls-add.php:113
50
- #: polls-manager.php:184
51
  msgid "Poll Question"
52
  msgstr ""
53
 
54
- #: polls-add.php:116
55
- #: polls-manager.php:187
56
- #: polls-manager.php:341
57
  msgid "Question"
58
  msgstr ""
59
 
60
- #: polls-add.php:121
61
- #: polls-manager.php:192
62
  msgid "Poll Answers"
63
  msgstr ""
64
 
65
- #: polls-add.php:126
66
- #: polls-manager.php:227
67
  msgid "Add Answer"
68
  msgstr ""
69
 
70
- #: polls-add.php:133
71
- #: polls-manager.php:214
72
- #, php-format
73
  msgid "Answer %s"
74
  msgstr ""
75
 
76
- #: polls-add.php:134
77
- #: wp-polls.php:253
78
  msgid "Remove"
79
  msgstr ""
80
 
81
- #: polls-add.php:142
82
- #: polls-manager.php:238
83
  msgid "Poll Multiple Answers"
84
  msgstr ""
85
 
86
- #: polls-add.php:145
87
- #: polls-manager.php:241
88
  msgid "Allows Users To Select More Than One Answer?"
89
  msgstr ""
90
 
91
- #: polls-add.php:148
92
- #: polls-manager.php:244
93
- #: polls-options.php:199
94
- #: polls-options.php:208
95
- #: polls-options.php:325
96
- #: wp-polls.php:1415
97
  msgid "No"
98
  msgstr ""
99
 
100
- #: polls-add.php:149
101
- #: polls-logs.php:373
102
- #: polls-manager.php:245
103
- #: polls-manager.php:470
104
- #: polls-options.php:200
105
- #: polls-options.php:209
106
- #: polls-options.php:326
107
- #: polls-uninstall.php:134
108
- #: wp-polls.php:1416
109
  msgid "Yes"
110
  msgstr ""
111
 
112
- #: polls-add.php:154
113
- #: polls-manager.php:250
114
  msgid "Maximum Number Of Selected Answers Allowed?"
115
  msgstr ""
116
 
117
- #: polls-add.php:167
118
- #: polls-manager.php:267
119
  msgid "Poll Start/End Date"
120
  msgstr ""
121
 
122
- #: polls-add.php:170
123
- #: polls-manager.php:270
124
- #: polls-manager.php:343
125
  msgid "Start Date/Time"
126
  msgstr ""
127
 
128
- #: polls-add.php:174
129
- #: polls-manager.php:278
130
- #: polls-manager.php:344
131
  msgid "End Date/Time"
132
  msgstr ""
133
 
134
- #: polls-add.php:175
135
- #: polls-manager.php:289
136
  msgid "Do NOT Expire This Poll"
137
  msgstr ""
138
 
139
- #: polls-add.php:178
140
- #: polls-manager.php:315
141
  msgid "Cancel"
142
  msgstr ""
143
 
144
- #: polls-admin-ajax.php:43
145
- #: polls-manager.php:471
146
- #: wp-polls.php:245
147
- msgid "Delete All Logs"
148
- msgstr ""
149
-
150
- #: polls-admin-ajax.php:47
151
- msgid "All Polls Logs Have Been Deleted."
152
- msgstr ""
153
-
154
- #: polls-admin-ajax.php:49
155
- msgid "An Error Has Occured While Deleting All Polls Logs."
156
- msgstr ""
157
-
158
- #: polls-admin-ajax.php:54
159
- #: polls-logs.php:374
160
- #: wp-polls.php:247
161
- msgid "Delete Logs For This Poll Only"
162
- msgstr ""
163
-
164
- #: polls-admin-ajax.php:60
165
- #, php-format
166
- msgid "All Logs For '%s' Has Been Deleted."
167
- msgstr ""
168
-
169
- #: polls-admin-ajax.php:62
170
- #, php-format
171
- msgid "An Error Has Occured While Deleting All Logs For '%s'"
172
- msgstr ""
173
-
174
- #: polls-admin-ajax.php:67
175
- #: wp-polls.php:249
176
- msgid "Delete Poll Answer"
177
- msgstr ""
178
-
179
- #: polls-admin-ajax.php:77
180
- #, php-format
181
- msgid "Poll Answer '%s' Deleted Successfully."
182
- msgstr ""
183
-
184
- #: polls-admin-ajax.php:79
185
- #, php-format
186
- msgid "Error In Deleting Poll Answer '%s'."
187
- msgstr ""
188
-
189
- #: polls-admin-ajax.php:83
190
- #: polls-manager.php:314
191
- #: wp-polls.php:250
192
- msgid "Open Poll"
193
- msgstr ""
194
-
195
- #: polls-admin-ajax.php:88
196
- #, php-format
197
- msgid "Poll '%s' Is Now Opened"
198
- msgstr ""
199
-
200
- #: polls-admin-ajax.php:90
201
- #, php-format
202
- msgid "Error Opening Poll '%s'"
203
- msgstr ""
204
-
205
- #: polls-admin-ajax.php:94
206
- #: polls-manager.php:313
207
- #: wp-polls.php:251
208
- msgid "Close Poll"
209
- msgstr ""
210
-
211
- #: polls-admin-ajax.php:99
212
- #, php-format
213
- msgid "Poll '%s' Is Now Closed"
214
- msgstr ""
215
-
216
- #: polls-admin-ajax.php:101
217
- #, php-format
218
- msgid "Error Closing Poll '%s'"
219
- msgstr ""
220
-
221
- #: polls-admin-ajax.php:105
222
- #: wp-polls.php:243
223
- msgid "Delete Poll"
224
- msgstr ""
225
-
226
- #: polls-admin-ajax.php:113
227
- #, php-format
228
- msgid "Error In Deleting Poll '%s' Question"
229
- msgstr ""
230
-
231
- #: polls-admin-ajax.php:116
232
- #, php-format
233
- msgid "Poll '%s' Deleted Successfully"
234
- msgstr ""
235
-
236
- #: polls-logs.php:33
237
- #: polls-logs.php:34
238
- #: polls-logs.php:37
239
- #: polls-logs.php:65
240
- #: polls-logs.php:69
241
- #: polls-logs.php:102
242
- #: polls-logs.php:105
243
- #: wp-polls.php:1274
244
  msgid "Guest"
245
  msgstr ""
246
 
247
- #: polls-logs.php:124
248
  msgid "Poll's Logs"
249
  msgstr ""
250
 
251
- #: polls-logs.php:127
252
- #, php-format
253
  msgid "There are a total of <strong>%s</strong> recorded vote for this poll."
254
- msgid_plural "There are a total of <strong>%s</strong> recorded votes for this poll."
 
255
  msgstr[0] ""
256
  msgstr[1] ""
257
 
258
- #: polls-logs.php:128
259
- #, php-format
260
- msgid "<strong>&raquo;</strong> <strong>%s</strong> vote is casted by registered users"
261
- msgid_plural "<strong>&raquo;</strong> <strong>%s</strong> votes are casted by registered users"
 
 
 
262
  msgstr[0] ""
263
  msgstr[1] ""
264
 
265
- #: polls-logs.php:129
266
- #, php-format
267
- msgid "<strong>&raquo;</strong> <strong>%s</strong> vote is casted by comment authors"
268
- msgid_plural "<strong>&raquo;</strong> <strong>%s</strong> votes are casted by comment authors"
 
 
 
269
  msgstr[0] ""
270
  msgstr[1] ""
271
 
272
- #: polls-logs.php:130
273
- #, php-format
274
  msgid "<strong>&raquo;</strong> <strong>%s</strong> vote is casted by guests"
275
- msgid_plural "<strong>&raquo;</strong> <strong>%s</strong> votes are casted by guests"
 
276
  msgstr[0] ""
277
  msgstr[1] ""
278
 
279
- #: polls-logs.php:135
280
  msgid "Filter Poll's Logs"
281
  msgstr ""
282
 
283
- #: polls-logs.php:143
284
  msgid "Display All Users That Voted For"
285
  msgstr ""
286
 
287
- #: polls-logs.php:164
288
- #: polls-logs.php:211
289
  msgid "Voters To EXCLUDE"
290
  msgstr ""
291
 
292
- #: polls-logs.php:166
293
- #: polls-logs.php:213
294
  msgid "Registered Users"
295
  msgstr ""
296
 
297
- #: polls-logs.php:167
298
- #: polls-logs.php:214
299
  msgid "Comment Authors"
300
  msgstr ""
301
 
302
- #: polls-logs.php:168
303
  msgid "Guests"
304
  msgstr ""
305
 
306
- #: polls-logs.php:172
307
- #: polls-logs.php:219
308
- #: polls-logs.php:253
309
  msgid "Filter"
310
  msgstr ""
311
 
312
- #: polls-logs.php:183
313
  msgid "Display Users That Voted For"
314
  msgstr ""
315
 
316
- #: polls-logs.php:186
317
  msgid "More Than"
318
  msgstr ""
319
 
320
- #: polls-logs.php:187
321
  msgid "More Than Or Exactly"
322
  msgstr ""
323
 
324
- #: polls-logs.php:188
325
  msgid "Exactly"
326
  msgstr ""
327
 
328
- #: polls-logs.php:189
329
  msgid "Less Than Or Exactly"
330
  msgstr ""
331
 
332
- #: polls-logs.php:190
333
  msgid "Less Than"
334
  msgstr ""
335
 
336
- #: polls-logs.php:197
337
  msgid "1 Answer"
338
  msgstr ""
339
 
340
- #: polls-logs.php:200
341
- #: polls-logs.php:202
342
- #, php-format
343
  msgid "%s Answer"
344
  msgid_plural "%s Answers"
345
  msgstr[0] ""
346
  msgstr[1] ""
347
 
348
- #: polls-logs.php:215
349
  msgid "Guests will automatically be excluded"
350
  msgstr ""
351
 
352
- #: polls-logs.php:235
353
  msgid "Display What This User Has Voted"
354
  msgstr ""
355
 
356
- #: polls-logs.php:261
357
  msgid "Clear Filter"
358
  msgstr ""
359
 
360
- #: polls-logs.php:268
361
  msgid "Poll Logs"
362
  msgstr ""
363
 
364
- #: polls-logs.php:273
365
- msgid "This default filter is limited to display only <strong>100</strong> records."
 
366
  msgstr ""
367
 
368
- #: polls-logs.php:281
369
- #: polls-logs.php:324
370
- #: wp-polls.php:252
371
  msgid "Answer"
372
  msgstr ""
373
 
374
- #: polls-logs.php:282
375
  msgid "IP"
376
  msgstr ""
377
 
378
- #: polls-logs.php:283
379
  msgid "Host"
380
  msgstr ""
381
 
382
- #: polls-logs.php:284
383
- #: polls-logs.php:331
384
  msgid "Date"
385
  msgstr ""
386
 
387
- #: polls-logs.php:291
388
- #: polls-logs.php:319
389
- #: polls-manager.php:272
390
- #: polls-manager.php:284
391
- #: polls-manager.php:364
392
- #: polls-manager.php:372
393
- #: wp-polls.php:460
394
- #: wp-polls.php:465
395
- #: wp-polls.php:574
396
- #: wp-polls.php:579
397
- #: wp-polls.php:964
398
- #: wp-polls.php:968
399
- #, php-format
400
  msgid "%s @ %s"
401
  msgstr ""
402
 
403
- #: polls-logs.php:299
404
- #: polls-logs.php:329
405
  msgid "User"
406
  msgstr ""
407
 
408
- #: polls-logs.php:328
409
  msgid "No."
410
  msgstr ""
411
 
412
- #: polls-logs.php:330
413
  msgid "IP/Host"
414
  msgstr ""
415
 
416
- #: polls-logs.php:352
417
- #, php-format
418
  msgid "Total number of records that matches this filter: <strong>%s</strong>"
419
  msgstr ""
420
 
421
- #: polls-logs.php:359
422
  msgid "No poll logs matches the filter."
423
  msgstr ""
424
 
425
- #: polls-logs.php:361
426
- #: polls-logs.php:377
427
  msgid "No poll logs available for this poll."
428
  msgstr ""
429
 
430
- #: polls-logs.php:368
431
  msgid "Delete Poll Logs"
432
  msgstr ""
433
 
434
- #: polls-logs.php:372
435
  msgid "Are You Sure You Want To Delete Logs For This Poll Only?"
436
  msgstr ""
437
 
438
- #: polls-logs.php:374
439
- #, php-format
440
- msgid "You are about to delete poll logs for this poll '%s' ONLY. This action is not reversible."
 
 
 
 
 
441
  msgstr ""
442
 
443
- #: polls-logs.php:381
444
- #: polls-manager.php:478
445
- msgid "Note: If your logging method is by IP and Cookie or by Cookie, users may still be unable to vote if they have voted before as the cookie is still stored in their computer."
 
 
446
  msgstr ""
447
 
448
- #: polls-manager.php:39
449
- #: polls-manager.php:182
450
- #: polls-manager.php:303
451
  msgid "Edit Poll"
452
  msgstr ""
453
 
454
- #: polls-manager.php:98
455
- #, php-format
456
  msgid "No Changes Had Been Made To Poll's Question '%s'."
457
  msgstr ""
458
 
459
- #: polls-manager.php:112
460
- #, php-format
461
  msgid "No Changes Had Been Made To Poll's Answer '%s'."
462
  msgstr ""
463
 
464
- #: polls-manager.php:114
465
- #, php-format
466
  msgid "Poll's Answer '%s' Edited Successfully."
467
  msgstr ""
468
 
469
- #: polls-manager.php:118
470
- #, php-format
471
  msgid "Invalid Poll '%s'."
472
  msgstr ""
473
 
474
- #: polls-manager.php:133
475
- #, php-format
476
  msgid "Poll's Answer '%s' Added Successfully."
477
  msgstr ""
478
 
479
- #: polls-manager.php:140
480
- #, php-format
481
  msgid "Poll '%s' Edited Successfully."
482
  msgstr ""
483
 
484
- #: polls-manager.php:196
485
  msgid "Answer No."
486
  msgstr ""
487
 
488
- #: polls-manager.php:197
489
  msgid "Answer Text"
490
  msgstr ""
491
 
492
- #: polls-manager.php:198
493
  msgid "No. Of Votes"
494
  msgstr ""
495
 
496
- #: polls-manager.php:207
497
  msgid "Null Votes"
498
  msgstr ""
499
 
500
- #: polls-manager.php:216
501
- #: polls-manager.php:419
502
  msgid "Delete"
503
  msgstr ""
504
 
505
- #: polls-manager.php:216
506
- #, php-format
507
  msgid "You are about to delete this poll's answer '%s'."
508
  msgstr ""
509
 
510
- #: polls-manager.php:228
511
  msgid "Total Votes:"
512
  msgstr ""
513
 
514
- #: polls-manager.php:233
515
- #: polls-manager.php:453
516
  msgid "Total Voters:"
517
  msgstr ""
518
 
519
- #: polls-manager.php:273
520
  msgid "Edit Start Date/Time"
521
  msgstr ""
522
 
523
- #: polls-manager.php:282
524
  msgid "This Poll Will Not Expire"
525
  msgstr ""
526
 
 
 
 
 
527
  #: polls-manager.php:313
528
- #, php-format
529
  msgid "You are about to CLOSE this poll '%s'."
530
  msgstr ""
531
 
 
 
 
 
532
  #: polls-manager.php:314
533
- #, php-format
534
  msgid "You are about to OPEN this poll '%s'."
535
  msgstr ""
536
 
537
- #: polls-manager.php:335
538
- #: wp-polls.php:60
539
- #: wp-polls.php:1369
540
- #: wp-polls.php:1404
541
  msgid "Polls"
542
  msgstr ""
543
 
@@ -545,11 +390,8 @@ msgstr ""
545
  msgid "ID"
546
  msgstr ""
547
 
548
- #: polls-manager.php:342
549
- #: polls-templates.php:122
550
- #: polls-templates.php:125
551
- #: wp-polls.php:1539
552
- #: wp-polls.php:1542
553
  msgid "Total Voters"
554
  msgstr ""
555
 
@@ -561,16 +403,11 @@ msgstr ""
561
  msgid "Action"
562
  msgstr ""
563
 
564
- #: polls-manager.php:370
565
- #: wp-polls.php:463
566
- #: wp-polls.php:577
567
- #: wp-polls.php:966
568
  msgid "No Expiry"
569
  msgstr ""
570
 
571
- #: polls-manager.php:395
572
- #: polls-manager.php:399
573
- #: polls-manager.php:402
574
  msgid "Displayed:"
575
  msgstr ""
576
 
@@ -595,7 +432,6 @@ msgid "Edit"
595
  msgstr ""
596
 
597
  #: polls-manager.php:419
598
- #, php-format
599
  msgid "You are about to delete this poll, '%s'."
600
  msgstr ""
601
 
@@ -627,911 +463,942 @@ msgstr ""
627
  msgid "Are You Sure You Want To Delete All Polls Logs?"
628
  msgstr ""
629
 
 
 
 
 
630
  #: polls-manager.php:471
631
  msgid "You are about to delete all poll logs. This action is not reversible."
632
  msgstr ""
633
 
634
- #: polls-manager.php:474
635
- #: wp-polls.php:244
636
  msgid "No poll logs available."
637
  msgstr ""
638
 
639
- #: polls-options.php:70
640
- #: polls-options.php:130
641
- #: polls-options.php:133
642
  msgid "Poll Bar Style"
643
  msgstr ""
644
 
645
- #: polls-options.php:71
646
  msgid "Poll AJAX Style"
647
  msgstr ""
648
 
649
- #: polls-options.php:72
650
  msgid "Sort Poll Answers By Option"
651
  msgstr ""
652
 
653
- #: polls-options.php:73
654
  msgid "Sort Order Of Poll Answers Option"
655
  msgstr ""
656
 
657
- #: polls-options.php:74
658
  msgid "Sort Poll Results By Option"
659
  msgstr ""
660
 
661
- #: polls-options.php:75
662
  msgid "Sort Order Of Poll Results Option"
663
  msgstr ""
664
 
665
- #: polls-options.php:76
666
  msgid "Number Of Polls Per Page To Display In Poll Archive Option"
667
  msgstr ""
668
 
669
- #: polls-options.php:77
670
  msgid "Type Of Polls To Display In Poll Archive Option"
671
  msgstr ""
672
 
673
- #: polls-options.php:78
674
  msgid "Poll Archive URL Option"
675
  msgstr ""
676
 
677
- #: polls-options.php:79
678
  msgid "Show Poll Achive Link Option"
679
  msgstr ""
680
 
681
- #: polls-options.php:80
682
  msgid "Current Active Poll Option"
683
  msgstr ""
684
 
685
- #: polls-options.php:81
686
  msgid "Poll Close Option"
687
  msgstr ""
688
 
689
- #: polls-options.php:82
690
- #: polls-options.php:280
691
  msgid "Logging Method"
692
  msgstr ""
693
 
694
- #: polls-options.php:83
695
  msgid "Cookie And Log Expiry Option"
696
  msgstr ""
697
 
698
- #: polls-options.php:84
699
  msgid "Allow To Vote Option"
700
  msgstr ""
701
 
702
- #: polls-options.php:89
703
- #: polls-templates.php:85
704
  msgid "Updated"
705
  msgstr ""
706
 
707
- #: polls-options.php:94
708
- #: polls-templates.php:90
709
  msgid "No Poll Option Updated"
710
  msgstr ""
711
 
712
- #: polls-options.php:128
713
- #: wp-polls.php:65
714
  msgid "Poll Options"
715
  msgstr ""
716
 
717
- #: polls-options.php:160
718
  msgid "Use CSS Style"
719
  msgstr ""
720
 
721
- #: polls-options.php:164
722
  msgid "Poll Bar Background"
723
  msgstr ""
724
 
725
- #: polls-options.php:169
726
  msgid "Poll Bar Border"
727
  msgstr ""
728
 
729
- #: polls-options.php:174
730
  msgid "Poll Bar Height"
731
  msgstr ""
732
 
733
- #: polls-options.php:178
734
  msgid "Your poll bar will look like this"
735
  msgstr ""
736
 
737
- #: polls-options.php:193
738
  msgid "Polls AJAX Style"
739
  msgstr ""
740
 
741
- #: polls-options.php:196
742
  msgid "Show Loading Image With Text"
743
  msgstr ""
744
 
745
- #: polls-options.php:205
746
  msgid "Show Fading In And Fading Out Of Poll"
747
  msgstr ""
748
 
749
- #: polls-options.php:216
750
  msgid "Sorting Of Poll Answers"
751
  msgstr ""
752
 
753
- #: polls-options.php:219
754
  msgid "Sort Poll Answers By:"
755
  msgstr ""
756
 
757
- #: polls-options.php:222
758
- #: polls-options.php:247
759
  msgid "Exact Order"
760
  msgstr ""
761
 
762
- #: polls-options.php:223
763
- #: polls-options.php:248
764
  msgid "Alphabetical Order"
765
  msgstr ""
766
 
767
- #: polls-options.php:224
768
- #: polls-options.php:249
769
  msgid "Random Order"
770
  msgstr ""
771
 
772
- #: polls-options.php:229
773
  msgid "Sort Order Of Poll Answers:"
774
  msgstr ""
775
 
776
- #: polls-options.php:232
777
- #: polls-options.php:257
778
  msgid "Ascending"
779
  msgstr ""
780
 
781
- #: polls-options.php:233
782
- #: polls-options.php:258
783
  msgid "Descending"
784
  msgstr ""
785
 
786
- #: polls-options.php:240
787
  msgid "Sorting Of Poll Results"
788
  msgstr ""
789
 
790
- #: polls-options.php:243
791
  msgid "Sort Poll Results By:"
792
  msgstr ""
793
 
794
- #: polls-options.php:246
795
  msgid "Votes Cast"
796
  msgstr ""
797
 
798
- #: polls-options.php:254
799
  msgid "Sort Order Of Poll Results:"
800
  msgstr ""
801
 
802
- #: polls-options.php:265
803
  msgid "Allow To Vote"
804
  msgstr ""
805
 
806
- #: polls-options.php:268
807
  msgid "Who Is Allowed To Vote?"
808
  msgstr ""
809
 
810
- #: polls-options.php:271
811
  msgid "Guests Only"
812
  msgstr ""
813
 
814
- #: polls-options.php:272
815
  msgid "Registered Users Only"
816
  msgstr ""
817
 
818
- #: polls-options.php:273
819
  msgid "Registered Users And Guests"
820
  msgstr ""
821
 
822
- #: polls-options.php:283
823
  msgid "Poll Logging Method:"
824
  msgstr ""
825
 
826
- #: polls-options.php:286
827
  msgid "Do Not Log"
828
  msgstr ""
829
 
830
- #: polls-options.php:287
831
  msgid "Logged By Cookie"
832
  msgstr ""
833
 
834
- #: polls-options.php:288
835
  msgid "Logged By IP"
836
  msgstr ""
837
 
838
- #: polls-options.php:289
839
  msgid "Logged By Cookie And IP"
840
  msgstr ""
841
 
842
- #: polls-options.php:290
843
  msgid "Logged By Username"
844
  msgstr ""
845
 
846
- #: polls-options.php:295
847
  msgid "Expiry Time For Cookie And Log:"
848
  msgstr ""
849
 
850
- #: polls-options.php:296
851
  msgid "seconds (0 to disable)"
852
  msgstr ""
853
 
854
- #: polls-options.php:301
855
  msgid "Poll Archive"
856
  msgstr ""
857
 
858
- #: polls-options.php:304
859
  msgid "Number Of Polls Per Page:"
860
  msgstr ""
861
 
862
- #: polls-options.php:308
863
  msgid "Type Of Polls To Display In Poll Archive:"
864
  msgstr ""
865
 
866
- #: polls-options.php:311
867
  msgid "Closed Polls Only"
868
  msgstr ""
869
 
870
- #: polls-options.php:312
871
  msgid "Opened Polls Only"
872
  msgstr ""
873
 
874
- #: polls-options.php:313
875
  msgid "Closed And Opened Polls"
876
  msgstr ""
877
 
878
- #: polls-options.php:318
879
  msgid "Poll Archive URL:"
880
  msgstr ""
881
 
882
- #: polls-options.php:322
883
  msgid "Display Poll Archive Link Below Poll?"
884
  msgstr ""
885
 
886
- #: polls-options.php:331
887
- #: polls-options.php:366
888
  msgid "Note"
889
  msgstr ""
890
 
891
- #: polls-options.php:332
892
- msgid "Only polls' results will be shown in the Poll Archive regardless of whether the poll is closed or opened."
 
 
893
  msgstr ""
894
 
895
- #: polls-options.php:337
896
- #: polls-options.php:340
897
  msgid "Current Active Poll"
898
  msgstr ""
899
 
900
- #: polls-options.php:343
901
- #: wp-polls.php:1423
902
  msgid "Do NOT Display Poll (Disable)"
903
  msgstr ""
904
 
905
- #: polls-options.php:344
906
- #: wp-polls.php:1424
907
  msgid "Display Random Poll"
908
  msgstr ""
909
 
910
- #: polls-options.php:345
911
- #: wp-polls.php:1425
912
  msgid "Display Latest Poll"
913
  msgstr ""
914
 
915
- #: polls-options.php:367
916
- msgid "If you chose 'Display Multiple Polls' for the above option, you need to configure it in Presentation -> Widgets -> Poll."
 
 
917
  msgstr ""
918
 
919
- #: polls-options.php:371
920
  msgid "When Poll Is Closed"
921
  msgstr ""
922
 
923
- #: polls-options.php:374
924
  msgid "Display Poll's Results"
925
  msgstr ""
926
 
927
- #: polls-options.php:375
928
  msgid "Display Disabled Poll's Voting Form"
929
  msgstr ""
930
 
931
- #: polls-options.php:376
932
  msgid "Do Not Display Poll In Post/Sidebar"
933
  msgstr ""
934
 
935
- #: polls-options.php:384
936
- #: polls-templates.php:493
937
  msgid "Save Changes"
938
  msgstr ""
939
 
940
- #: polls-templates.php:66
941
  msgid "Voting Form Header Template"
942
  msgstr ""
943
 
944
- #: polls-templates.php:67
945
  msgid "Voting Form Body Template"
946
  msgstr ""
947
 
948
- #: polls-templates.php:68
949
  msgid "Voting Form Footer Template"
950
  msgstr ""
951
 
952
- #: polls-templates.php:69
953
  msgid "Result Header Template"
954
  msgstr ""
955
 
956
- #: polls-templates.php:70
957
  msgid "Result Body Template"
958
  msgstr ""
959
 
960
- #: polls-templates.php:71
961
  msgid "Result Body2 Template"
962
  msgstr ""
963
 
964
- #: polls-templates.php:72
965
  msgid "Result Footer Template"
966
  msgstr ""
967
 
968
- #: polls-templates.php:73
969
  msgid "Result Footer2 Template"
970
  msgstr ""
971
 
972
- #: polls-templates.php:74
973
  msgid "Poll Archive Link Template"
974
  msgstr ""
975
 
976
- #: polls-templates.php:75
977
  msgid "Poll Archive Poll Header Template"
978
  msgstr ""
979
 
980
- #: polls-templates.php:76
981
  msgid "Poll Archive Poll Footer Template"
982
  msgstr ""
983
 
984
- #: polls-templates.php:77
985
  msgid "Poll Archive Paging Header Template"
986
  msgstr ""
987
 
988
- #: polls-templates.php:78
989
  msgid "Poll Archive Paging Footer Template"
990
  msgstr ""
991
 
992
- #: polls-templates.php:79
993
  msgid "Poll Disabled Template"
994
  msgstr ""
995
 
996
- #: polls-templates.php:80
997
  msgid "Poll Error Template"
998
  msgstr ""
999
 
1000
- #: polls-templates.php:110
1001
- #: polls-templates.php:125
1002
- #: wp-polls.php:1530
1003
- #: wp-polls.php:1543
1004
  msgid "Vote"
1005
  msgstr ""
1006
 
1007
- #: polls-templates.php:110
1008
- #: wp-polls.php:1531
1009
  msgid "View Results Of This Poll"
1010
  msgstr ""
1011
 
1012
- #: polls-templates.php:110
1013
- #: wp-polls.php:1531
1014
  msgid "View Results"
1015
  msgstr ""
1016
 
1017
- #: polls-templates.php:116
1018
- #: polls-templates.php:119
1019
- #: wp-polls.php:1536
1020
- #: wp-polls.php:1537
1021
  msgid ","
1022
  msgstr ""
1023
 
1024
- #: polls-templates.php:116
1025
- #: polls-templates.php:119
1026
- #: wp-polls.php:1536
1027
- #: wp-polls.php:1537
1028
  msgid "Votes"
1029
  msgstr ""
1030
 
1031
- #: polls-templates.php:119
1032
- #: wp-polls.php:1537
1033
  msgid "You Have Voted For This Choice"
1034
  msgstr ""
1035
 
1036
- #: polls-templates.php:125
1037
- #: wp-polls.php:1543
1038
  msgid "Vote For This Poll"
1039
  msgstr ""
1040
 
1041
- #: polls-templates.php:128
1042
- #: wp-polls.php:1569
1043
  msgid "Polls Archive"
1044
  msgstr ""
1045
 
1046
- #: polls-templates.php:134
1047
- #: wp-polls.php:1573
1048
  msgid "Start Date:"
1049
  msgstr ""
1050
 
1051
- #: polls-templates.php:134
1052
- #: wp-polls.php:1573
1053
  msgid "End Date:"
1054
  msgstr ""
1055
 
1056
- #: polls-templates.php:143
1057
- #: wp-polls.php:1545
1058
  msgid "Sorry, there are no polls available at the moment."
1059
  msgstr ""
1060
 
1061
- #: polls-templates.php:146
1062
- #: wp-polls.php:1546
1063
  msgid "An error has occurred when processing your poll."
1064
  msgstr ""
1065
 
1066
- #: polls-templates.php:157
1067
- #: wp-polls.php:66
1068
  msgid "Poll Templates"
1069
  msgstr ""
1070
 
1071
- #: polls-templates.php:159
1072
  msgid "Template Variables"
1073
  msgstr ""
1074
 
1075
- #: polls-templates.php:164
1076
  msgid "Display the poll's ID"
1077
  msgstr ""
1078
 
1079
- #: polls-templates.php:168
1080
  msgid "Display the poll's answer ID"
1081
  msgstr ""
1082
 
1083
- #: polls-templates.php:174
1084
  msgid "Display the poll's question"
1085
  msgstr ""
1086
 
1087
- #: polls-templates.php:178
1088
  msgid "Display the poll's answer"
1089
  msgstr ""
1090
 
1091
- #: polls-templates.php:184
1092
- msgid "Display the poll's total votes NOT the number of people who voted for the poll"
 
 
1093
  msgstr ""
1094
 
1095
- #: polls-templates.php:188
1096
  msgid "Display the poll's answer without HTML formatting."
1097
  msgstr ""
1098
 
1099
- #: polls-templates.php:194
1100
  msgid "Displays URL to poll's result"
1101
  msgstr ""
1102
 
1103
- #: polls-templates.php:198
1104
  msgid "Display the poll's answer votes"
1105
  msgstr ""
1106
 
1107
- #: polls-templates.php:204
1108
  msgid "Display the poll's most voted answer"
1109
  msgstr ""
1110
 
1111
- #: polls-templates.php:208
1112
  msgid "Display the poll's answer percentage"
1113
  msgstr ""
1114
 
1115
- #: polls-templates.php:214
1116
  msgid "Display the poll's answer votes for the most voted answer"
1117
  msgstr ""
1118
 
1119
- #: polls-templates.php:218
1120
  msgid "Display the poll's answer image width"
1121
  msgstr ""
1122
 
1123
- #: polls-templates.php:224
1124
  msgid "Display the poll's answer percentage for the most voted answer"
1125
  msgstr ""
1126
 
1127
- #: polls-templates.php:228
1128
  msgid "Display the poll's least voted answer"
1129
  msgstr ""
1130
 
1131
- #: polls-templates.php:234
1132
  msgid "Display the poll's start date/time"
1133
  msgstr ""
1134
 
1135
- #: polls-templates.php:238
1136
  msgid "Display the poll's answer votes for the least voted answer"
1137
  msgstr ""
1138
 
1139
- #: polls-templates.php:244
1140
  msgid "Display the poll's end date/time"
1141
  msgstr ""
1142
 
1143
- #: polls-templates.php:248
1144
  msgid "Display the poll's answer percentage for the least voted answer"
1145
  msgstr ""
1146
 
1147
- #: polls-templates.php:254
1148
- msgid "Display the the maximum number of answers the user can choose if the poll supports multiple answers"
 
 
1149
  msgstr ""
1150
 
1151
- #: polls-templates.php:258
1152
- msgid "Display \"checkbox\" or \"radio\" input types depending on the poll type"
 
1153
  msgstr ""
1154
 
1155
- #: polls-templates.php:264
1156
- msgid "Display the number of people who voted for the poll NOT the total votes of the poll"
 
 
1157
  msgstr ""
1158
 
1159
- #: polls-templates.php:268
1160
  msgid "Display the poll archive URL"
1161
  msgstr ""
1162
 
1163
- #: polls-templates.php:273
1164
- msgid "Note: <strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</strong> will be different if your poll supports multiple answers. If your poll allows only single answer, both value will be the same."
 
 
 
1165
  msgstr ""
1166
 
1167
- #: polls-templates.php:279
1168
  msgid "Poll Voting Form Templates"
1169
  msgstr ""
1170
 
1171
- #: polls-templates.php:283
1172
  msgid "Voting Form Header:"
1173
  msgstr ""
1174
 
1175
- #: polls-templates.php:284
1176
- #: polls-templates.php:299
1177
- #: polls-templates.php:312
1178
- #: polls-templates.php:328
1179
- #: polls-templates.php:343
1180
- #: polls-templates.php:357
1181
- #: polls-templates.php:371
1182
- #: polls-templates.php:391
1183
- #: polls-templates.php:416
1184
- #: polls-templates.php:425
1185
- #: polls-templates.php:434
1186
- #: polls-templates.php:453
1187
- #: polls-templates.php:462
1188
- #: polls-templates.php:476
1189
- #: polls-templates.php:485
1190
  msgid "Allowed Variables:"
1191
  msgstr ""
1192
 
1193
- #: polls-templates.php:292
1194
- #: polls-templates.php:305
1195
- #: polls-templates.php:316
1196
- #: polls-templates.php:336
1197
- #: polls-templates.php:350
1198
- #: polls-templates.php:364
1199
- #: polls-templates.php:384
1200
- #: polls-templates.php:404
1201
- #: polls-templates.php:418
1202
- #: polls-templates.php:427
1203
- #: polls-templates.php:446
1204
- #: polls-templates.php:455
1205
- #: polls-templates.php:464
1206
- #: polls-templates.php:478
1207
- #: polls-templates.php:487
1208
  msgid "Restore Default Template"
1209
  msgstr ""
1210
 
1211
- #: polls-templates.php:298
1212
  msgid "Voting Form Body:"
1213
  msgstr ""
1214
 
1215
- #: polls-templates.php:311
1216
  msgid "Voting Form Footer:"
1217
  msgstr ""
1218
 
1219
- #: polls-templates.php:323
1220
  msgid "Poll Result Templates"
1221
  msgstr ""
1222
 
1223
- #: polls-templates.php:327
1224
  msgid "Result Header:"
1225
  msgstr ""
1226
 
1227
- #: polls-templates.php:342
1228
- #: polls-templates.php:356
1229
  msgid "Result Body:"
1230
  msgstr ""
1231
 
1232
- #: polls-templates.php:342
1233
- #: polls-templates.php:390
1234
  msgid "Displayed When The User HAS NOT Voted"
1235
  msgstr ""
1236
 
1237
- #: polls-templates.php:356
1238
- #: polls-templates.php:370
1239
  msgid "Displayed When The User HAS Voted"
1240
  msgstr ""
1241
 
1242
- #: polls-templates.php:370
1243
- #: polls-templates.php:390
1244
  msgid "Result Footer:"
1245
  msgstr ""
1246
 
1247
- #: polls-templates.php:411
1248
  msgid "Poll Archive Templates"
1249
  msgstr ""
1250
 
1251
- #: polls-templates.php:415
1252
  msgid "Poll Archive Link"
1253
  msgstr ""
1254
 
1255
- #: polls-templates.php:415
1256
  msgid "Template For Displaying Poll Archive Link"
1257
  msgstr ""
1258
 
1259
- #: polls-templates.php:424
1260
  msgid "Individual Poll Header"
1261
  msgstr ""
1262
 
1263
- #: polls-templates.php:424
1264
  msgid "Displayed Before Each Poll In The Poll Archive"
1265
  msgstr ""
1266
 
1267
- #: polls-templates.php:426
1268
- #: polls-templates.php:454
1269
- #: polls-templates.php:463
1270
- #: polls-templates.php:477
1271
- #: polls-templates.php:486
1272
  msgid "N/A"
1273
  msgstr ""
1274
 
1275
- #: polls-templates.php:433
1276
  msgid "Individual Poll Footer"
1277
  msgstr ""
1278
 
1279
- #: polls-templates.php:433
1280
  msgid "Displayed After Each Poll In The Poll Archive"
1281
  msgstr ""
1282
 
1283
- #: polls-templates.php:452
1284
  msgid "Paging Header"
1285
  msgstr ""
1286
 
1287
- #: polls-templates.php:452
1288
  msgid "Displayed Before Paging In The Poll Archive"
1289
  msgstr ""
1290
 
1291
- #: polls-templates.php:461
1292
  msgid "Paging Footer"
1293
  msgstr ""
1294
 
1295
- #: polls-templates.php:461
1296
  msgid "Displayed After Paging In The Poll Archive"
1297
  msgstr ""
1298
 
1299
- #: polls-templates.php:471
1300
  msgid "Poll Misc Templates"
1301
  msgstr ""
1302
 
1303
- #: polls-templates.php:475
1304
  msgid "Poll Disabled"
1305
  msgstr ""
1306
 
1307
- #: polls-templates.php:475
1308
  msgid "Displayed When The Poll Is Disabled"
1309
  msgstr ""
1310
 
1311
- #: polls-templates.php:484
1312
  msgid "Poll Error"
1313
  msgstr ""
1314
 
1315
- #: polls-templates.php:484
1316
  msgid "Displayed When An Error Has Occured While Processing The Poll"
1317
  msgstr ""
1318
 
1319
- #: polls-uninstall.php:39
1320
- #: polls-uninstall.php:135
1321
  msgid "UNINSTALL WP-Polls"
1322
  msgstr ""
1323
 
1324
- #: polls-uninstall.php:46
1325
- #, php-format
1326
  msgid "Table '%s' has been deleted."
1327
  msgstr ""
1328
 
1329
- #: polls-uninstall.php:55
1330
- #, php-format
1331
  msgid "Setting Key '%s' has been deleted."
1332
  msgstr ""
1333
 
1334
- #: polls-uninstall.php:59
1335
- #, php-format
1336
- msgid "Error deleting Setting Key '%s' or Setting Key '%s' does not exist."
1337
- msgstr ""
1338
-
1339
- #: polls-uninstall.php:82
1340
- #: polls-uninstall.php:93
1341
- #: wp-polls.php:67
1342
  msgid "Uninstall WP-Polls"
1343
  msgstr ""
1344
 
1345
- #: polls-uninstall.php:83
1346
- #, php-format
1347
- msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically."
 
1348
  msgstr ""
1349
 
1350
- #: polls-uninstall.php:95
1351
- msgid "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."
 
 
 
1352
  msgstr ""
1353
 
1354
- #: polls-uninstall.php:98
1355
  msgid "WARNING:"
1356
  msgstr ""
1357
 
1358
- #: polls-uninstall.php:99
1359
- msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
 
 
1360
  msgstr ""
1361
 
1362
- #: polls-uninstall.php:102
1363
  msgid "The following WordPress Options/Tables will be DELETED:"
1364
  msgstr ""
1365
 
1366
- #: polls-uninstall.php:107
1367
  msgid "WordPress Options"
1368
  msgstr ""
1369
 
1370
- #: polls-uninstall.php:108
1371
  msgid "WordPress Tables"
1372
  msgstr ""
1373
 
1374
- #: polls-uninstall.php:133
1375
  msgid "Do you really want to uninstall WP-Polls?"
1376
  msgstr ""
1377
 
1378
- #: polls-uninstall.php:135
1379
  msgid ""
1380
- "You Are About To Uninstall WP-Polls From WordPress.\\n"
1381
- "This Action Is Not Reversible.\\n"
1382
- "\\n"
1383
- " Choose [Cancel] To Stop, [OK] To Uninstall."
1384
  msgstr ""
1385
 
1386
- #: wp-polls.php:223
1387
  msgid "Your last request is still being processed. Please wait a while ..."
1388
  msgstr ""
1389
 
1390
- #: wp-polls.php:224
1391
  msgid "Please choose a valid poll answer."
1392
  msgstr ""
1393
 
1394
- #: wp-polls.php:225
1395
  msgid "Maximum number of choices allowed: "
1396
  msgstr ""
1397
 
1398
- #: wp-polls.php:246
 
 
 
 
1399
  msgid "Please check the \\'Yes\\' checkbox if you want to delete all logs."
1400
  msgstr ""
1401
 
1402
- #: wp-polls.php:248
1403
- msgid "Please check the \\'Yes\\' checkbox if you want to delete all logs for this poll ONLY."
 
 
1404
  msgstr ""
1405
 
1406
- #: wp-polls.php:269
 
 
 
 
1407
  msgid "Enter Poll ID"
1408
  msgstr ""
1409
 
1410
- #: wp-polls.php:270
1411
  msgid "Error: Poll ID must be numeric"
1412
  msgstr ""
1413
 
1414
- #: wp-polls.php:270
1415
  msgid "Please enter Poll ID again"
1416
  msgstr ""
1417
 
1418
- #: wp-polls.php:271
1419
  msgid "Poll"
1420
  msgstr ""
1421
 
1422
- #: wp-polls.php:272
1423
- msgid "Insert_Poll"
1424
  msgstr ""
1425
 
1426
- #: wp-polls.php:539
1427
- #: wp-polls.php:707
1428
  msgid "Loading"
1429
  msgstr ""
1430
 
1431
- #: wp-polls.php:753
1432
- msgid "Note: There is a poll embedded within this post, please visit the site to participate in this post's poll."
 
 
1433
  msgstr ""
1434
 
1435
- #: wp-polls.php:1099
1436
- #, php-format
1437
  msgid "Page %s of %s"
1438
  msgstr ""
1439
 
1440
- #: wp-polls.php:1101
1441
  msgid "&laquo; First"
1442
  msgstr ""
1443
 
1444
- #: wp-polls.php:1105
1445
  msgid "&laquo;"
1446
  msgstr ""
1447
 
1448
- #: wp-polls.php:1115
1449
  msgid "&raquo;"
1450
  msgstr ""
1451
 
1452
- #: wp-polls.php:1119
1453
  msgid "Last &raquo;"
1454
  msgstr ""
1455
 
1456
- #: wp-polls.php:1305
1457
- #, php-format
 
 
 
 
 
 
 
1458
  msgid "Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s"
1459
  msgstr ""
1460
 
1461
- #: wp-polls.php:1309
1462
- #, php-format
1463
  msgid "You Had Already Voted For This Poll. Poll ID #%s"
1464
  msgstr ""
1465
 
1466
- #: wp-polls.php:1313
1467
- #, php-format
1468
  msgid "Invalid Poll ID. Poll ID #%s"
1469
  msgstr ""
1470
 
1471
- #: wp-polls.php:1341
1472
- #: wp-polls.php:1343
1473
- #: wp-polls.php:1353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1474
  msgid "WP-Polls"
1475
  msgstr ""
1476
 
1477
- #: wp-polls.php:1355
1478
- #, php-format
1479
  msgid "<strong>%s</strong> poll was created."
1480
  msgid_plural "<strong>%s</strong> polls were created."
1481
  msgstr[0] ""
1482
  msgstr[1] ""
1483
 
1484
- #: wp-polls.php:1356
1485
- #, php-format
1486
  msgid "<strong>%s</strong> polls' answer was given."
1487
  msgid_plural "<strong>%s</strong> polls' answers were given."
1488
  msgstr[0] ""
1489
  msgstr[1] ""
1490
 
1491
- #: wp-polls.php:1357
1492
- #, php-format
1493
  msgid "<strong>%s</strong> vote was casted."
1494
  msgid_plural "<strong>%s</strong> votes were casted."
1495
  msgstr[0] ""
1496
  msgstr[1] ""
1497
 
1498
- #: wp-polls.php:1368
1499
  msgid "WP-Polls polls"
1500
  msgstr ""
1501
 
1502
- #: wp-polls.php:1410
1503
  msgid "Title:"
1504
  msgstr ""
1505
 
1506
- #: wp-polls.php:1413
1507
  msgid "Display Polls Archive Link Below Poll?"
1508
  msgstr ""
1509
 
1510
- #: wp-polls.php:1421
1511
  msgid "Poll To Display:"
1512
  msgstr ""
1513
 
1514
- #: wp-polls.php:1514
1515
  msgid "How Is My Site?"
1516
  msgstr ""
1517
 
1518
- #: wp-polls.php:1517
1519
  msgid "Good"
1520
  msgstr ""
1521
 
1522
- #: wp-polls.php:1518
1523
  msgid "Excellent"
1524
  msgstr ""
1525
 
1526
- #: wp-polls.php:1519
1527
  msgid "Bad"
1528
  msgstr ""
1529
 
1530
- #: wp-polls.php:1520
1531
  msgid "Can Be Improved"
1532
  msgstr ""
1533
 
1534
- #: wp-polls.php:1521
1535
  msgid "No Comments"
1536
  msgstr ""
1537
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2012 WP-Polls
2
+ # This file is distributed under the same license as the WP-Polls package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP-Polls 2.63\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-polls\n"
7
+ "POT-Creation-Date: 2012-05-22 00:47:36+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: polls-add.php:36 polls-add.php:113 polls-add.php:180 wp-polls.php:53
16
+ #: wp-polls.php:294
 
 
 
 
 
 
17
  msgid "Add Poll"
18
  msgstr ""
19
 
20
+ #: polls-add.php:81
 
21
  msgid "Error In Adding Poll '%s'."
22
  msgstr ""
23
 
24
+ #: polls-add.php:90 polls-manager.php:132
 
 
25
  msgid "Error In Adding Poll's Answer '%s'."
26
  msgstr ""
27
 
28
+ #: polls-add.php:97
 
29
  msgid "Poll '%s' Added Successfully."
30
  msgstr ""
31
 
32
+ #: polls-add.php:97 polls-manager.php:334 wp-polls.php:52
 
 
33
  msgid "Manage Polls"
34
  msgstr ""
35
 
36
+ #: polls-add.php:115 polls-manager.php:186
 
37
  msgid "Poll Question"
38
  msgstr ""
39
 
40
+ #: polls-add.php:118 polls-manager.php:189 polls-manager.php:341
 
 
41
  msgid "Question"
42
  msgstr ""
43
 
44
+ #: polls-add.php:123 polls-manager.php:194
 
45
  msgid "Poll Answers"
46
  msgstr ""
47
 
48
+ #: polls-add.php:128 polls-manager.php:229
 
49
  msgid "Add Answer"
50
  msgstr ""
51
 
52
+ #: polls-add.php:135 polls-manager.php:216
 
 
53
  msgid "Answer %s"
54
  msgstr ""
55
 
56
+ #: polls-add.php:136 wp-polls.php:246
 
57
  msgid "Remove"
58
  msgstr ""
59
 
60
+ #: polls-add.php:144 polls-manager.php:240
 
61
  msgid "Poll Multiple Answers"
62
  msgstr ""
63
 
64
+ #: polls-add.php:147 polls-manager.php:243
 
65
  msgid "Allows Users To Select More Than One Answer?"
66
  msgstr ""
67
 
68
+ #: polls-add.php:150 polls-manager.php:246 polls-options.php:201
69
+ #: polls-options.php:210 polls-options.php:327 wp-polls.php:1562
 
 
 
 
70
  msgid "No"
71
  msgstr ""
72
 
73
+ #: polls-add.php:151 polls-logs.php:378 polls-manager.php:247
74
+ #: polls-manager.php:470 polls-options.php:202 polls-options.php:211
75
+ #: polls-options.php:328 polls-uninstall.php:129 wp-polls.php:1563
 
 
 
 
 
 
76
  msgid "Yes"
77
  msgstr ""
78
 
79
+ #: polls-add.php:156 polls-manager.php:252
 
80
  msgid "Maximum Number Of Selected Answers Allowed?"
81
  msgstr ""
82
 
83
+ #: polls-add.php:169 polls-manager.php:269
 
84
  msgid "Poll Start/End Date"
85
  msgstr ""
86
 
87
+ #: polls-add.php:172 polls-manager.php:272 polls-manager.php:343
 
 
88
  msgid "Start Date/Time"
89
  msgstr ""
90
 
91
+ #: polls-add.php:176 polls-manager.php:280 polls-manager.php:344
 
 
92
  msgid "End Date/Time"
93
  msgstr ""
94
 
95
+ #: polls-add.php:177 polls-manager.php:291
 
96
  msgid "Do NOT Expire This Poll"
97
  msgstr ""
98
 
99
+ #: polls-add.php:180 polls-manager.php:315
 
100
  msgid "Cancel"
101
  msgstr ""
102
 
103
+ #: polls-logs.php:34 polls-logs.php:35 polls-logs.php:38 polls-logs.php:67
104
+ #: polls-logs.php:71 polls-logs.php:104 polls-logs.php:107 wp-polls.php:1313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  msgid "Guest"
106
  msgstr ""
107
 
108
+ #: polls-logs.php:126
109
  msgid "Poll's Logs"
110
  msgstr ""
111
 
112
+ #: polls-logs.php:129
 
113
  msgid "There are a total of <strong>%s</strong> recorded vote for this poll."
114
+ msgid_plural ""
115
+ "There are a total of <strong>%s</strong> recorded votes for this poll."
116
  msgstr[0] ""
117
  msgstr[1] ""
118
 
119
+ #: polls-logs.php:130
120
+ msgid ""
121
+ "<strong>&raquo;</strong> <strong>%s</strong> vote is casted by registered "
122
+ "users"
123
+ msgid_plural ""
124
+ "<strong>&raquo;</strong> <strong>%s</strong> votes are casted by registered "
125
+ "users"
126
  msgstr[0] ""
127
  msgstr[1] ""
128
 
129
+ #: polls-logs.php:131
130
+ msgid ""
131
+ "<strong>&raquo;</strong> <strong>%s</strong> vote is casted by comment "
132
+ "authors"
133
+ msgid_plural ""
134
+ "<strong>&raquo;</strong> <strong>%s</strong> votes are casted by comment "
135
+ "authors"
136
  msgstr[0] ""
137
  msgstr[1] ""
138
 
139
+ #: polls-logs.php:132
 
140
  msgid "<strong>&raquo;</strong> <strong>%s</strong> vote is casted by guests"
141
+ msgid_plural ""
142
+ "<strong>&raquo;</strong> <strong>%s</strong> votes are casted by guests"
143
  msgstr[0] ""
144
  msgstr[1] ""
145
 
146
+ #: polls-logs.php:137
147
  msgid "Filter Poll's Logs"
148
  msgstr ""
149
 
150
+ #: polls-logs.php:146
151
  msgid "Display All Users That Voted For"
152
  msgstr ""
153
 
154
+ #: polls-logs.php:167 polls-logs.php:215
 
155
  msgid "Voters To EXCLUDE"
156
  msgstr ""
157
 
158
+ #: polls-logs.php:169 polls-logs.php:217
 
159
  msgid "Registered Users"
160
  msgstr ""
161
 
162
+ #: polls-logs.php:170 polls-logs.php:218
 
163
  msgid "Comment Authors"
164
  msgstr ""
165
 
166
+ #: polls-logs.php:171
167
  msgid "Guests"
168
  msgstr ""
169
 
170
+ #: polls-logs.php:175 polls-logs.php:223 polls-logs.php:258
 
 
171
  msgid "Filter"
172
  msgstr ""
173
 
174
+ #: polls-logs.php:187
175
  msgid "Display Users That Voted For"
176
  msgstr ""
177
 
178
+ #: polls-logs.php:190
179
  msgid "More Than"
180
  msgstr ""
181
 
182
+ #: polls-logs.php:191
183
  msgid "More Than Or Exactly"
184
  msgstr ""
185
 
186
+ #: polls-logs.php:192
187
  msgid "Exactly"
188
  msgstr ""
189
 
190
+ #: polls-logs.php:193
191
  msgid "Less Than Or Exactly"
192
  msgstr ""
193
 
194
+ #: polls-logs.php:194
195
  msgid "Less Than"
196
  msgstr ""
197
 
198
+ #: polls-logs.php:201
199
  msgid "1 Answer"
200
  msgstr ""
201
 
202
+ #: polls-logs.php:204 polls-logs.php:206
 
 
203
  msgid "%s Answer"
204
  msgid_plural "%s Answers"
205
  msgstr[0] ""
206
  msgstr[1] ""
207
 
208
+ #: polls-logs.php:219
209
  msgid "Guests will automatically be excluded"
210
  msgstr ""
211
 
212
+ #: polls-logs.php:240
213
  msgid "Display What This User Has Voted"
214
  msgstr ""
215
 
216
+ #: polls-logs.php:266
217
  msgid "Clear Filter"
218
  msgstr ""
219
 
220
+ #: polls-logs.php:273
221
  msgid "Poll Logs"
222
  msgstr ""
223
 
224
+ #: polls-logs.php:278
225
+ msgid ""
226
+ "This default filter is limited to display only <strong>%s</strong> records."
227
  msgstr ""
228
 
229
+ #: polls-logs.php:286 polls-logs.php:329 wp-polls.php:245
 
 
230
  msgid "Answer"
231
  msgstr ""
232
 
233
+ #: polls-logs.php:287
234
  msgid "IP"
235
  msgstr ""
236
 
237
+ #: polls-logs.php:288
238
  msgid "Host"
239
  msgstr ""
240
 
241
+ #: polls-logs.php:289 polls-logs.php:336
 
242
  msgid "Date"
243
  msgstr ""
244
 
245
+ #: polls-logs.php:296 polls-logs.php:324 polls-manager.php:274
246
+ #: polls-manager.php:286 polls-manager.php:364 polls-manager.php:372
247
+ #: wp-polls.php:445 wp-polls.php:450 wp-polls.php:561 wp-polls.php:566
248
+ #: wp-polls.php:969 wp-polls.php:973
 
 
 
 
 
 
 
 
 
249
  msgid "%s @ %s"
250
  msgstr ""
251
 
252
+ #: polls-logs.php:304 polls-logs.php:334
 
253
  msgid "User"
254
  msgstr ""
255
 
256
+ #: polls-logs.php:333
257
  msgid "No."
258
  msgstr ""
259
 
260
+ #: polls-logs.php:335
261
  msgid "IP/Host"
262
  msgstr ""
263
 
264
+ #: polls-logs.php:357
 
265
  msgid "Total number of records that matches this filter: <strong>%s</strong>"
266
  msgstr ""
267
 
268
+ #: polls-logs.php:364
269
  msgid "No poll logs matches the filter."
270
  msgstr ""
271
 
272
+ #: polls-logs.php:366 polls-logs.php:382
 
273
  msgid "No poll logs available for this poll."
274
  msgstr ""
275
 
276
+ #: polls-logs.php:373
277
  msgid "Delete Poll Logs"
278
  msgstr ""
279
 
280
+ #: polls-logs.php:377
281
  msgid "Are You Sure You Want To Delete Logs For This Poll Only?"
282
  msgstr ""
283
 
284
+ #: polls-logs.php:379 wp-polls.php:240 wp-polls.php:1392
285
+ msgid "Delete Logs For This Poll Only"
286
+ msgstr ""
287
+
288
+ #: polls-logs.php:379
289
+ msgid ""
290
+ "You are about to delete poll logs for this poll '%s' ONLY. This action is "
291
+ "not reversible."
292
  msgstr ""
293
 
294
+ #: polls-logs.php:386 polls-manager.php:478
295
+ msgid ""
296
+ "Note: If your logging method is by IP and Cookie or by Cookie, users may "
297
+ "still be unable to vote if they have voted before as the cookie is still "
298
+ "stored in their computer."
299
  msgstr ""
300
 
301
+ #: polls-manager.php:39 polls-manager.php:184 polls-manager.php:303
 
 
302
  msgid "Edit Poll"
303
  msgstr ""
304
 
305
+ #: polls-manager.php:99
 
306
  msgid "No Changes Had Been Made To Poll's Question '%s'."
307
  msgstr ""
308
 
309
+ #: polls-manager.php:113
 
310
  msgid "No Changes Had Been Made To Poll's Answer '%s'."
311
  msgstr ""
312
 
313
+ #: polls-manager.php:115
 
314
  msgid "Poll's Answer '%s' Edited Successfully."
315
  msgstr ""
316
 
317
+ #: polls-manager.php:119
 
318
  msgid "Invalid Poll '%s'."
319
  msgstr ""
320
 
321
+ #: polls-manager.php:134
 
322
  msgid "Poll's Answer '%s' Added Successfully."
323
  msgstr ""
324
 
325
+ #: polls-manager.php:141
 
326
  msgid "Poll '%s' Edited Successfully."
327
  msgstr ""
328
 
329
+ #: polls-manager.php:198
330
  msgid "Answer No."
331
  msgstr ""
332
 
333
+ #: polls-manager.php:199
334
  msgid "Answer Text"
335
  msgstr ""
336
 
337
+ #: polls-manager.php:200
338
  msgid "No. Of Votes"
339
  msgstr ""
340
 
341
+ #: polls-manager.php:209
342
  msgid "Null Votes"
343
  msgstr ""
344
 
345
+ #: polls-manager.php:218 polls-manager.php:419
 
346
  msgid "Delete"
347
  msgstr ""
348
 
349
+ #: polls-manager.php:218
 
350
  msgid "You are about to delete this poll's answer '%s'."
351
  msgstr ""
352
 
353
+ #: polls-manager.php:230
354
  msgid "Total Votes:"
355
  msgstr ""
356
 
357
+ #: polls-manager.php:235 polls-manager.php:453
 
358
  msgid "Total Voters:"
359
  msgstr ""
360
 
361
+ #: polls-manager.php:275
362
  msgid "Edit Start Date/Time"
363
  msgstr ""
364
 
365
+ #: polls-manager.php:284
366
  msgid "This Poll Will Not Expire"
367
  msgstr ""
368
 
369
+ #: polls-manager.php:313 wp-polls.php:244 wp-polls.php:1435
370
+ msgid "Close Poll"
371
+ msgstr ""
372
+
373
  #: polls-manager.php:313
 
374
  msgid "You are about to CLOSE this poll '%s'."
375
  msgstr ""
376
 
377
+ #: polls-manager.php:314 wp-polls.php:243 wp-polls.php:1423
378
+ msgid "Open Poll"
379
+ msgstr ""
380
+
381
  #: polls-manager.php:314
 
382
  msgid "You are about to OPEN this poll '%s'."
383
  msgstr ""
384
 
385
+ #: polls-manager.php:335 wp-polls.php:49 wp-polls.php:1516 wp-polls.php:1551
 
 
 
386
  msgid "Polls"
387
  msgstr ""
388
 
390
  msgid "ID"
391
  msgstr ""
392
 
393
+ #: polls-manager.php:342 polls-templates.php:123 polls-templates.php:126
394
+ #: wp-polls.php:1689 wp-polls.php:1692
 
 
 
395
  msgid "Total Voters"
396
  msgstr ""
397
 
403
  msgid "Action"
404
  msgstr ""
405
 
406
+ #: polls-manager.php:370 wp-polls.php:448 wp-polls.php:564 wp-polls.php:971
 
 
 
407
  msgid "No Expiry"
408
  msgstr ""
409
 
410
+ #: polls-manager.php:395 polls-manager.php:399 polls-manager.php:402
 
 
411
  msgid "Displayed:"
412
  msgstr ""
413
 
432
  msgstr ""
433
 
434
  #: polls-manager.php:419
 
435
  msgid "You are about to delete this poll, '%s'."
436
  msgstr ""
437
 
463
  msgid "Are You Sure You Want To Delete All Polls Logs?"
464
  msgstr ""
465
 
466
+ #: polls-manager.php:471 wp-polls.php:238 wp-polls.php:1380
467
+ msgid "Delete All Logs"
468
+ msgstr ""
469
+
470
  #: polls-manager.php:471
471
  msgid "You are about to delete all poll logs. This action is not reversible."
472
  msgstr ""
473
 
474
+ #: polls-manager.php:474 wp-polls.php:237
 
475
  msgid "No poll logs available."
476
  msgstr ""
477
 
478
+ #: polls-options.php:71 polls-options.php:132 polls-options.php:135
 
 
479
  msgid "Poll Bar Style"
480
  msgstr ""
481
 
482
+ #: polls-options.php:72
483
  msgid "Poll AJAX Style"
484
  msgstr ""
485
 
486
+ #: polls-options.php:73
487
  msgid "Sort Poll Answers By Option"
488
  msgstr ""
489
 
490
+ #: polls-options.php:74
491
  msgid "Sort Order Of Poll Answers Option"
492
  msgstr ""
493
 
494
+ #: polls-options.php:75
495
  msgid "Sort Poll Results By Option"
496
  msgstr ""
497
 
498
+ #: polls-options.php:76
499
  msgid "Sort Order Of Poll Results Option"
500
  msgstr ""
501
 
502
+ #: polls-options.php:77
503
  msgid "Number Of Polls Per Page To Display In Poll Archive Option"
504
  msgstr ""
505
 
506
+ #: polls-options.php:78
507
  msgid "Type Of Polls To Display In Poll Archive Option"
508
  msgstr ""
509
 
510
+ #: polls-options.php:79
511
  msgid "Poll Archive URL Option"
512
  msgstr ""
513
 
514
+ #: polls-options.php:80
515
  msgid "Show Poll Achive Link Option"
516
  msgstr ""
517
 
518
+ #: polls-options.php:81
519
  msgid "Current Active Poll Option"
520
  msgstr ""
521
 
522
+ #: polls-options.php:82
523
  msgid "Poll Close Option"
524
  msgstr ""
525
 
526
+ #: polls-options.php:83 polls-options.php:282
 
527
  msgid "Logging Method"
528
  msgstr ""
529
 
530
+ #: polls-options.php:84
531
  msgid "Cookie And Log Expiry Option"
532
  msgstr ""
533
 
534
+ #: polls-options.php:85
535
  msgid "Allow To Vote Option"
536
  msgstr ""
537
 
538
+ #: polls-options.php:90 polls-templates.php:86
 
539
  msgid "Updated"
540
  msgstr ""
541
 
542
+ #: polls-options.php:95 polls-templates.php:91
 
543
  msgid "No Poll Option Updated"
544
  msgstr ""
545
 
546
+ #: polls-options.php:130 wp-polls.php:54
 
547
  msgid "Poll Options"
548
  msgstr ""
549
 
550
+ #: polls-options.php:162
551
  msgid "Use CSS Style"
552
  msgstr ""
553
 
554
+ #: polls-options.php:166
555
  msgid "Poll Bar Background"
556
  msgstr ""
557
 
558
+ #: polls-options.php:171
559
  msgid "Poll Bar Border"
560
  msgstr ""
561
 
562
+ #: polls-options.php:176
563
  msgid "Poll Bar Height"
564
  msgstr ""
565
 
566
+ #: polls-options.php:180
567
  msgid "Your poll bar will look like this"
568
  msgstr ""
569
 
570
+ #: polls-options.php:195
571
  msgid "Polls AJAX Style"
572
  msgstr ""
573
 
574
+ #: polls-options.php:198
575
  msgid "Show Loading Image With Text"
576
  msgstr ""
577
 
578
+ #: polls-options.php:207
579
  msgid "Show Fading In And Fading Out Of Poll"
580
  msgstr ""
581
 
582
+ #: polls-options.php:218
583
  msgid "Sorting Of Poll Answers"
584
  msgstr ""
585
 
586
+ #: polls-options.php:221
587
  msgid "Sort Poll Answers By:"
588
  msgstr ""
589
 
590
+ #: polls-options.php:224 polls-options.php:249
 
591
  msgid "Exact Order"
592
  msgstr ""
593
 
594
+ #: polls-options.php:225 polls-options.php:250
 
595
  msgid "Alphabetical Order"
596
  msgstr ""
597
 
598
+ #: polls-options.php:226 polls-options.php:251
 
599
  msgid "Random Order"
600
  msgstr ""
601
 
602
+ #: polls-options.php:231
603
  msgid "Sort Order Of Poll Answers:"
604
  msgstr ""
605
 
606
+ #: polls-options.php:234 polls-options.php:259
 
607
  msgid "Ascending"
608
  msgstr ""
609
 
610
+ #: polls-options.php:235 polls-options.php:260
 
611
  msgid "Descending"
612
  msgstr ""
613
 
614
+ #: polls-options.php:242
615
  msgid "Sorting Of Poll Results"
616
  msgstr ""
617
 
618
+ #: polls-options.php:245
619
  msgid "Sort Poll Results By:"
620
  msgstr ""
621
 
622
+ #: polls-options.php:248
623
  msgid "Votes Cast"
624
  msgstr ""
625
 
626
+ #: polls-options.php:256
627
  msgid "Sort Order Of Poll Results:"
628
  msgstr ""
629
 
630
+ #: polls-options.php:267
631
  msgid "Allow To Vote"
632
  msgstr ""
633
 
634
+ #: polls-options.php:270
635
  msgid "Who Is Allowed To Vote?"
636
  msgstr ""
637
 
638
+ #: polls-options.php:273
639
  msgid "Guests Only"
640
  msgstr ""
641
 
642
+ #: polls-options.php:274
643
  msgid "Registered Users Only"
644
  msgstr ""
645
 
646
+ #: polls-options.php:275
647
  msgid "Registered Users And Guests"
648
  msgstr ""
649
 
650
+ #: polls-options.php:285
651
  msgid "Poll Logging Method:"
652
  msgstr ""
653
 
654
+ #: polls-options.php:288
655
  msgid "Do Not Log"
656
  msgstr ""
657
 
658
+ #: polls-options.php:289
659
  msgid "Logged By Cookie"
660
  msgstr ""
661
 
662
+ #: polls-options.php:290
663
  msgid "Logged By IP"
664
  msgstr ""
665
 
666
+ #: polls-options.php:291
667
  msgid "Logged By Cookie And IP"
668
  msgstr ""
669
 
670
+ #: polls-options.php:292
671
  msgid "Logged By Username"
672
  msgstr ""
673
 
674
+ #: polls-options.php:297
675
  msgid "Expiry Time For Cookie And Log:"
676
  msgstr ""
677
 
678
+ #: polls-options.php:298
679
  msgid "seconds (0 to disable)"
680
  msgstr ""
681
 
682
+ #: polls-options.php:303
683
  msgid "Poll Archive"
684
  msgstr ""
685
 
686
+ #: polls-options.php:306
687
  msgid "Number Of Polls Per Page:"
688
  msgstr ""
689
 
690
+ #: polls-options.php:310
691
  msgid "Type Of Polls To Display In Poll Archive:"
692
  msgstr ""
693
 
694
+ #: polls-options.php:313
695
  msgid "Closed Polls Only"
696
  msgstr ""
697
 
698
+ #: polls-options.php:314
699
  msgid "Opened Polls Only"
700
  msgstr ""
701
 
702
+ #: polls-options.php:315
703
  msgid "Closed And Opened Polls"
704
  msgstr ""
705
 
706
+ #: polls-options.php:320
707
  msgid "Poll Archive URL:"
708
  msgstr ""
709
 
710
+ #: polls-options.php:324
711
  msgid "Display Poll Archive Link Below Poll?"
712
  msgstr ""
713
 
714
+ #: polls-options.php:333 polls-options.php:368
 
715
  msgid "Note"
716
  msgstr ""
717
 
718
+ #: polls-options.php:334
719
+ msgid ""
720
+ "Only polls' results will be shown in the Poll Archive regardless of whether "
721
+ "the poll is closed or opened."
722
  msgstr ""
723
 
724
+ #: polls-options.php:339 polls-options.php:342
 
725
  msgid "Current Active Poll"
726
  msgstr ""
727
 
728
+ #: polls-options.php:345 wp-polls.php:1570
 
729
  msgid "Do NOT Display Poll (Disable)"
730
  msgstr ""
731
 
732
+ #: polls-options.php:346 wp-polls.php:1571
 
733
  msgid "Display Random Poll"
734
  msgstr ""
735
 
736
+ #: polls-options.php:347 wp-polls.php:1572
 
737
  msgid "Display Latest Poll"
738
  msgstr ""
739
 
740
+ #: polls-options.php:369
741
+ msgid ""
742
+ "If you chose 'Display Multiple Polls' for the above option, you need to "
743
+ "configure it in Presentation -> Widgets -> Poll."
744
  msgstr ""
745
 
746
+ #: polls-options.php:373
747
  msgid "When Poll Is Closed"
748
  msgstr ""
749
 
750
+ #: polls-options.php:376
751
  msgid "Display Poll's Results"
752
  msgstr ""
753
 
754
+ #: polls-options.php:377
755
  msgid "Display Disabled Poll's Voting Form"
756
  msgstr ""
757
 
758
+ #: polls-options.php:378
759
  msgid "Do Not Display Poll In Post/Sidebar"
760
  msgstr ""
761
 
762
+ #: polls-options.php:386 polls-templates.php:497
 
763
  msgid "Save Changes"
764
  msgstr ""
765
 
766
+ #: polls-templates.php:67
767
  msgid "Voting Form Header Template"
768
  msgstr ""
769
 
770
+ #: polls-templates.php:68
771
  msgid "Voting Form Body Template"
772
  msgstr ""
773
 
774
+ #: polls-templates.php:69
775
  msgid "Voting Form Footer Template"
776
  msgstr ""
777
 
778
+ #: polls-templates.php:70
779
  msgid "Result Header Template"
780
  msgstr ""
781
 
782
+ #: polls-templates.php:71
783
  msgid "Result Body Template"
784
  msgstr ""
785
 
786
+ #: polls-templates.php:72
787
  msgid "Result Body2 Template"
788
  msgstr ""
789
 
790
+ #: polls-templates.php:73
791
  msgid "Result Footer Template"
792
  msgstr ""
793
 
794
+ #: polls-templates.php:74
795
  msgid "Result Footer2 Template"
796
  msgstr ""
797
 
798
+ #: polls-templates.php:75
799
  msgid "Poll Archive Link Template"
800
  msgstr ""
801
 
802
+ #: polls-templates.php:76
803
  msgid "Poll Archive Poll Header Template"
804
  msgstr ""
805
 
806
+ #: polls-templates.php:77
807
  msgid "Poll Archive Poll Footer Template"
808
  msgstr ""
809
 
810
+ #: polls-templates.php:78
811
  msgid "Poll Archive Paging Header Template"
812
  msgstr ""
813
 
814
+ #: polls-templates.php:79
815
  msgid "Poll Archive Paging Footer Template"
816
  msgstr ""
817
 
818
+ #: polls-templates.php:80
819
  msgid "Poll Disabled Template"
820
  msgstr ""
821
 
822
+ #: polls-templates.php:81
823
  msgid "Poll Error Template"
824
  msgstr ""
825
 
826
+ #: polls-templates.php:111 polls-templates.php:126 wp-polls.php:1680
827
+ #: wp-polls.php:1693
 
 
828
  msgid "Vote"
829
  msgstr ""
830
 
831
+ #: polls-templates.php:111 wp-polls.php:1681
 
832
  msgid "View Results Of This Poll"
833
  msgstr ""
834
 
835
+ #: polls-templates.php:111 wp-polls.php:1681
 
836
  msgid "View Results"
837
  msgstr ""
838
 
839
+ #: polls-templates.php:117 polls-templates.php:120 wp-polls.php:1686
840
+ #: wp-polls.php:1687
 
 
841
  msgid ","
842
  msgstr ""
843
 
844
+ #: polls-templates.php:117 polls-templates.php:120 wp-polls.php:1686
845
+ #: wp-polls.php:1687
 
 
846
  msgid "Votes"
847
  msgstr ""
848
 
849
+ #: polls-templates.php:120 wp-polls.php:1687
 
850
  msgid "You Have Voted For This Choice"
851
  msgstr ""
852
 
853
+ #: polls-templates.php:126 wp-polls.php:1693
 
854
  msgid "Vote For This Poll"
855
  msgstr ""
856
 
857
+ #: polls-templates.php:129 wp-polls.php:1719
 
858
  msgid "Polls Archive"
859
  msgstr ""
860
 
861
+ #: polls-templates.php:135 wp-polls.php:1723
 
862
  msgid "Start Date:"
863
  msgstr ""
864
 
865
+ #: polls-templates.php:135 wp-polls.php:1723
 
866
  msgid "End Date:"
867
  msgstr ""
868
 
869
+ #: polls-templates.php:144 wp-polls.php:1695
 
870
  msgid "Sorry, there are no polls available at the moment."
871
  msgstr ""
872
 
873
+ #: polls-templates.php:147 wp-polls.php:1696
 
874
  msgid "An error has occurred when processing your poll."
875
  msgstr ""
876
 
877
+ #: polls-templates.php:159 wp-polls.php:55
 
878
  msgid "Poll Templates"
879
  msgstr ""
880
 
881
+ #: polls-templates.php:161
882
  msgid "Template Variables"
883
  msgstr ""
884
 
885
+ #: polls-templates.php:166
886
  msgid "Display the poll's ID"
887
  msgstr ""
888
 
889
+ #: polls-templates.php:170
890
  msgid "Display the poll's answer ID"
891
  msgstr ""
892
 
893
+ #: polls-templates.php:176
894
  msgid "Display the poll's question"
895
  msgstr ""
896
 
897
+ #: polls-templates.php:180
898
  msgid "Display the poll's answer"
899
  msgstr ""
900
 
901
+ #: polls-templates.php:186
902
+ msgid ""
903
+ "Display the poll's total votes NOT the number of people who voted for the "
904
+ "poll"
905
  msgstr ""
906
 
907
+ #: polls-templates.php:190
908
  msgid "Display the poll's answer without HTML formatting."
909
  msgstr ""
910
 
911
+ #: polls-templates.php:196
912
  msgid "Displays URL to poll's result"
913
  msgstr ""
914
 
915
+ #: polls-templates.php:200
916
  msgid "Display the poll's answer votes"
917
  msgstr ""
918
 
919
+ #: polls-templates.php:206
920
  msgid "Display the poll's most voted answer"
921
  msgstr ""
922
 
923
+ #: polls-templates.php:210
924
  msgid "Display the poll's answer percentage"
925
  msgstr ""
926
 
927
+ #: polls-templates.php:216
928
  msgid "Display the poll's answer votes for the most voted answer"
929
  msgstr ""
930
 
931
+ #: polls-templates.php:220
932
  msgid "Display the poll's answer image width"
933
  msgstr ""
934
 
935
+ #: polls-templates.php:226
936
  msgid "Display the poll's answer percentage for the most voted answer"
937
  msgstr ""
938
 
939
+ #: polls-templates.php:230
940
  msgid "Display the poll's least voted answer"
941
  msgstr ""
942
 
943
+ #: polls-templates.php:236
944
  msgid "Display the poll's start date/time"
945
  msgstr ""
946
 
947
+ #: polls-templates.php:240
948
  msgid "Display the poll's answer votes for the least voted answer"
949
  msgstr ""
950
 
951
+ #: polls-templates.php:246
952
  msgid "Display the poll's end date/time"
953
  msgstr ""
954
 
955
+ #: polls-templates.php:250
956
  msgid "Display the poll's answer percentage for the least voted answer"
957
  msgstr ""
958
 
959
+ #: polls-templates.php:256
960
+ msgid ""
961
+ "Display the the maximum number of answers the user can choose if the poll "
962
+ "supports multiple answers"
963
  msgstr ""
964
 
965
+ #: polls-templates.php:260
966
+ msgid ""
967
+ "Display \"checkbox\" or \"radio\" input types depending on the poll type"
968
  msgstr ""
969
 
970
+ #: polls-templates.php:266
971
+ msgid ""
972
+ "Display the number of people who voted for the poll NOT the total votes of "
973
+ "the poll"
974
  msgstr ""
975
 
976
+ #: polls-templates.php:270
977
  msgid "Display the poll archive URL"
978
  msgstr ""
979
 
980
+ #: polls-templates.php:275
981
+ msgid ""
982
+ "Note: <strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</"
983
+ "strong> will be different if your poll supports multiple answers. If your "
984
+ "poll allows only single answer, both value will be the same."
985
  msgstr ""
986
 
987
+ #: polls-templates.php:281
988
  msgid "Poll Voting Form Templates"
989
  msgstr ""
990
 
991
+ #: polls-templates.php:285
992
  msgid "Voting Form Header:"
993
  msgstr ""
994
 
995
+ #: polls-templates.php:286 polls-templates.php:301 polls-templates.php:314
996
+ #: polls-templates.php:330 polls-templates.php:345 polls-templates.php:360
997
+ #: polls-templates.php:375 polls-templates.php:395 polls-templates.php:420
998
+ #: polls-templates.php:429 polls-templates.php:438 polls-templates.php:457
999
+ #: polls-templates.php:466 polls-templates.php:480 polls-templates.php:489
 
 
 
 
 
 
 
 
 
 
1000
  msgid "Allowed Variables:"
1001
  msgstr ""
1002
 
1003
+ #: polls-templates.php:294 polls-templates.php:307 polls-templates.php:318
1004
+ #: polls-templates.php:338 polls-templates.php:353 polls-templates.php:368
1005
+ #: polls-templates.php:388 polls-templates.php:408 polls-templates.php:422
1006
+ #: polls-templates.php:431 polls-templates.php:450 polls-templates.php:459
1007
+ #: polls-templates.php:468 polls-templates.php:482 polls-templates.php:491
 
 
 
 
 
 
 
 
 
 
1008
  msgid "Restore Default Template"
1009
  msgstr ""
1010
 
1011
+ #: polls-templates.php:300
1012
  msgid "Voting Form Body:"
1013
  msgstr ""
1014
 
1015
+ #: polls-templates.php:313
1016
  msgid "Voting Form Footer:"
1017
  msgstr ""
1018
 
1019
+ #: polls-templates.php:325
1020
  msgid "Poll Result Templates"
1021
  msgstr ""
1022
 
1023
+ #: polls-templates.php:329
1024
  msgid "Result Header:"
1025
  msgstr ""
1026
 
1027
+ #: polls-templates.php:344 polls-templates.php:359
 
1028
  msgid "Result Body:"
1029
  msgstr ""
1030
 
1031
+ #: polls-templates.php:344 polls-templates.php:394
 
1032
  msgid "Displayed When The User HAS NOT Voted"
1033
  msgstr ""
1034
 
1035
+ #: polls-templates.php:359 polls-templates.php:374
 
1036
  msgid "Displayed When The User HAS Voted"
1037
  msgstr ""
1038
 
1039
+ #: polls-templates.php:374 polls-templates.php:394
 
1040
  msgid "Result Footer:"
1041
  msgstr ""
1042
 
1043
+ #: polls-templates.php:415
1044
  msgid "Poll Archive Templates"
1045
  msgstr ""
1046
 
1047
+ #: polls-templates.php:419
1048
  msgid "Poll Archive Link"
1049
  msgstr ""
1050
 
1051
+ #: polls-templates.php:419
1052
  msgid "Template For Displaying Poll Archive Link"
1053
  msgstr ""
1054
 
1055
+ #: polls-templates.php:428
1056
  msgid "Individual Poll Header"
1057
  msgstr ""
1058
 
1059
+ #: polls-templates.php:428
1060
  msgid "Displayed Before Each Poll In The Poll Archive"
1061
  msgstr ""
1062
 
1063
+ #: polls-templates.php:430 polls-templates.php:458 polls-templates.php:467
1064
+ #: polls-templates.php:481 polls-templates.php:490
 
 
 
1065
  msgid "N/A"
1066
  msgstr ""
1067
 
1068
+ #: polls-templates.php:437
1069
  msgid "Individual Poll Footer"
1070
  msgstr ""
1071
 
1072
+ #: polls-templates.php:437
1073
  msgid "Displayed After Each Poll In The Poll Archive"
1074
  msgstr ""
1075
 
1076
+ #: polls-templates.php:456
1077
  msgid "Paging Header"
1078
  msgstr ""
1079
 
1080
+ #: polls-templates.php:456
1081
  msgid "Displayed Before Paging In The Poll Archive"
1082
  msgstr ""
1083
 
1084
+ #: polls-templates.php:465
1085
  msgid "Paging Footer"
1086
  msgstr ""
1087
 
1088
+ #: polls-templates.php:465
1089
  msgid "Displayed After Paging In The Poll Archive"
1090
  msgstr ""
1091
 
1092
+ #: polls-templates.php:475
1093
  msgid "Poll Misc Templates"
1094
  msgstr ""
1095
 
1096
+ #: polls-templates.php:479
1097
  msgid "Poll Disabled"
1098
  msgstr ""
1099
 
1100
+ #: polls-templates.php:479
1101
  msgid "Displayed When The Poll Is Disabled"
1102
  msgstr ""
1103
 
1104
+ #: polls-templates.php:488
1105
  msgid "Poll Error"
1106
  msgstr ""
1107
 
1108
+ #: polls-templates.php:488
1109
  msgid "Displayed When An Error Has Occured While Processing The Poll"
1110
  msgstr ""
1111
 
1112
+ #: polls-uninstall.php:39 polls-uninstall.php:130
 
1113
  msgid "UNINSTALL WP-Polls"
1114
  msgstr ""
1115
 
1116
+ #: polls-uninstall.php:47
 
1117
  msgid "Table '%s' has been deleted."
1118
  msgstr ""
1119
 
1120
+ #: polls-uninstall.php:56
 
1121
  msgid "Setting Key '%s' has been deleted."
1122
  msgstr ""
1123
 
1124
+ #: polls-uninstall.php:76 polls-uninstall.php:88 wp-polls.php:56
 
 
 
 
 
 
 
1125
  msgid "Uninstall WP-Polls"
1126
  msgstr ""
1127
 
1128
+ #: polls-uninstall.php:77
1129
+ msgid ""
1130
+ "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-Polls Will "
1131
+ "Be Deactivated Automatically."
1132
  msgstr ""
1133
 
1134
+ #: polls-uninstall.php:90
1135
+ msgid ""
1136
+ "Deactivating WP-Polls plugin does not remove any data that may have been "
1137
+ "created, such as the poll data and the poll's voting logs. To completely "
1138
+ "remove this plugin, you can uninstall it here."
1139
  msgstr ""
1140
 
1141
+ #: polls-uninstall.php:93
1142
  msgid "WARNING:"
1143
  msgstr ""
1144
 
1145
+ #: polls-uninstall.php:94
1146
+ msgid ""
1147
+ "Once uninstalled, this cannot be undone. You should use a Database Backup "
1148
+ "plugin of WordPress to back up all the data first."
1149
  msgstr ""
1150
 
1151
+ #: polls-uninstall.php:97
1152
  msgid "The following WordPress Options/Tables will be DELETED:"
1153
  msgstr ""
1154
 
1155
+ #: polls-uninstall.php:102
1156
  msgid "WordPress Options"
1157
  msgstr ""
1158
 
1159
+ #: polls-uninstall.php:103
1160
  msgid "WordPress Tables"
1161
  msgstr ""
1162
 
1163
+ #: polls-uninstall.php:128
1164
  msgid "Do you really want to uninstall WP-Polls?"
1165
  msgstr ""
1166
 
1167
+ #: polls-uninstall.php:130
1168
  msgid ""
1169
+ "You Are About To Uninstall WP-Polls From WordPress.\\nThis Action Is Not "
1170
+ "Reversible.\\n\\n Choose [Cancel] To Stop, [OK] To Uninstall."
 
 
1171
  msgstr ""
1172
 
1173
+ #: wp-polls.php:216
1174
  msgid "Your last request is still being processed. Please wait a while ..."
1175
  msgstr ""
1176
 
1177
+ #: wp-polls.php:217
1178
  msgid "Please choose a valid poll answer."
1179
  msgstr ""
1180
 
1181
+ #: wp-polls.php:218
1182
  msgid "Maximum number of choices allowed: "
1183
  msgstr ""
1184
 
1185
+ #: wp-polls.php:236 wp-polls.php:1447
1186
+ msgid "Delete Poll"
1187
+ msgstr ""
1188
+
1189
+ #: wp-polls.php:239
1190
  msgid "Please check the \\'Yes\\' checkbox if you want to delete all logs."
1191
  msgstr ""
1192
 
1193
+ #: wp-polls.php:241
1194
+ msgid ""
1195
+ "Please check the \\'Yes\\' checkbox if you want to delete all logs for this "
1196
+ "poll ONLY."
1197
  msgstr ""
1198
 
1199
+ #: wp-polls.php:242 wp-polls.php:1406
1200
+ msgid "Delete Poll Answer"
1201
+ msgstr ""
1202
+
1203
+ #: wp-polls.php:262
1204
  msgid "Enter Poll ID"
1205
  msgstr ""
1206
 
1207
+ #: wp-polls.php:263
1208
  msgid "Error: Poll ID must be numeric"
1209
  msgstr ""
1210
 
1211
+ #: wp-polls.php:263
1212
  msgid "Please enter Poll ID again"
1213
  msgstr ""
1214
 
1215
+ #: wp-polls.php:264
1216
  msgid "Poll"
1217
  msgstr ""
1218
 
1219
+ #: wp-polls.php:265
1220
+ msgid "Insert Poll"
1221
  msgstr ""
1222
 
1223
+ #: wp-polls.php:525 wp-polls.php:700
 
1224
  msgid "Loading"
1225
  msgstr ""
1226
 
1227
+ #: wp-polls.php:747
1228
+ msgid ""
1229
+ "Note: There is a poll embedded within this post, please visit the site to "
1230
+ "participate in this post's poll."
1231
  msgstr ""
1232
 
1233
+ #: wp-polls.php:1112
 
1234
  msgid "Page %s of %s"
1235
  msgstr ""
1236
 
1237
+ #: wp-polls.php:1114
1238
  msgid "&laquo; First"
1239
  msgstr ""
1240
 
1241
+ #: wp-polls.php:1118
1242
  msgid "&laquo;"
1243
  msgstr ""
1244
 
1245
+ #: wp-polls.php:1128
1246
  msgid "&raquo;"
1247
  msgstr ""
1248
 
1249
+ #: wp-polls.php:1132
1250
  msgid "Last &raquo;"
1251
  msgstr ""
1252
 
1253
+ #: wp-polls.php:1287
1254
+ msgid "Invalid Poll ID"
1255
+ msgstr ""
1256
+
1257
+ #: wp-polls.php:1294
1258
+ msgid "Failed To Verify Referrer"
1259
+ msgstr ""
1260
+
1261
+ #: wp-polls.php:1343
1262
  msgid "Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s"
1263
  msgstr ""
1264
 
1265
+ #: wp-polls.php:1346
 
1266
  msgid "You Had Already Voted For This Poll. Poll ID #%s"
1267
  msgstr ""
1268
 
1269
+ #: wp-polls.php:1349
 
1270
  msgid "Invalid Poll ID. Poll ID #%s"
1271
  msgstr ""
1272
 
1273
+ #: wp-polls.php:1385
1274
+ msgid "All Polls Logs Have Been Deleted."
1275
+ msgstr ""
1276
+
1277
+ #: wp-polls.php:1387
1278
+ msgid "An Error Has Occurred While Deleting All Polls Logs."
1279
+ msgstr ""
1280
+
1281
+ #: wp-polls.php:1399
1282
+ msgid "All Logs For '%s' Has Been Deleted."
1283
+ msgstr ""
1284
+
1285
+ #: wp-polls.php:1401
1286
+ msgid "An Error Has Occurred While Deleting All Logs For '%s'"
1287
+ msgstr ""
1288
+
1289
+ #: wp-polls.php:1417
1290
+ msgid "Poll Answer '%s' Deleted Successfully."
1291
+ msgstr ""
1292
+
1293
+ #: wp-polls.php:1419
1294
+ msgid "Error In Deleting Poll Answer '%s'."
1295
+ msgstr ""
1296
+
1297
+ #: wp-polls.php:1429
1298
+ msgid "Poll '%s' Is Now Opened"
1299
+ msgstr ""
1300
+
1301
+ #: wp-polls.php:1431
1302
+ msgid "Error Opening Poll '%s'"
1303
+ msgstr ""
1304
+
1305
+ #: wp-polls.php:1441
1306
+ msgid "Poll '%s' Is Now Closed"
1307
+ msgstr ""
1308
+
1309
+ #: wp-polls.php:1443
1310
+ msgid "Error Closing Poll '%s'"
1311
+ msgstr ""
1312
+
1313
+ #: wp-polls.php:1456
1314
+ msgid "Error In Deleting Poll '%s' Question"
1315
+ msgstr ""
1316
+
1317
+ #: wp-polls.php:1459
1318
+ msgid "Poll '%s' Deleted Successfully"
1319
+ msgstr ""
1320
+
1321
+ #. #-#-#-#-# plugin.pot (WP-Polls 2.63) #-#-#-#-#
1322
+ #. Plugin Name of the plugin/theme
1323
+ #: wp-polls.php:1488 wp-polls.php:1490 wp-polls.php:1500
1324
  msgid "WP-Polls"
1325
  msgstr ""
1326
 
1327
+ #: wp-polls.php:1502
 
1328
  msgid "<strong>%s</strong> poll was created."
1329
  msgid_plural "<strong>%s</strong> polls were created."
1330
  msgstr[0] ""
1331
  msgstr[1] ""
1332
 
1333
+ #: wp-polls.php:1503
 
1334
  msgid "<strong>%s</strong> polls' answer was given."
1335
  msgid_plural "<strong>%s</strong> polls' answers were given."
1336
  msgstr[0] ""
1337
  msgstr[1] ""
1338
 
1339
+ #: wp-polls.php:1504
 
1340
  msgid "<strong>%s</strong> vote was casted."
1341
  msgid_plural "<strong>%s</strong> votes were casted."
1342
  msgstr[0] ""
1343
  msgstr[1] ""
1344
 
1345
+ #: wp-polls.php:1515
1346
  msgid "WP-Polls polls"
1347
  msgstr ""
1348
 
1349
+ #: wp-polls.php:1557
1350
  msgid "Title:"
1351
  msgstr ""
1352
 
1353
+ #: wp-polls.php:1560
1354
  msgid "Display Polls Archive Link Below Poll?"
1355
  msgstr ""
1356
 
1357
+ #: wp-polls.php:1568
1358
  msgid "Poll To Display:"
1359
  msgstr ""
1360
 
1361
+ #: wp-polls.php:1664
1362
  msgid "How Is My Site?"
1363
  msgstr ""
1364
 
1365
+ #: wp-polls.php:1667
1366
  msgid "Good"
1367
  msgstr ""
1368
 
1369
+ #: wp-polls.php:1668
1370
  msgid "Excellent"
1371
  msgstr ""
1372
 
1373
+ #: wp-polls.php:1669
1374
  msgid "Bad"
1375
  msgstr ""
1376
 
1377
+ #: wp-polls.php:1670
1378
  msgid "Can Be Improved"
1379
  msgstr ""
1380
 
1381
+ #: wp-polls.php:1671
1382
  msgid "No Comments"
1383
  msgstr ""
1384
 
1385
+ #. Plugin URI of the plugin/theme
1386
+ msgid "http://lesterchan.net/portfolio/programming/php/"
1387
+ msgstr ""
1388
+
1389
+ #. Description of the plugin/theme
1390
+ msgid ""
1391
+ "Adds an AJAX poll system to your WordPress blog. You can easily include a "
1392
+ "poll into your WordPress's blog post/page. WP-Polls is extremely "
1393
+ "customizable via templates and css styles and there are tons of options for "
1394
+ "you to choose to ensure that WP-Polls runs the way you wanted. It now "
1395
+ "supports multiple selection of answers."
1396
+ msgstr ""
1397
+
1398
+ #. Author of the plugin/theme
1399
+ msgid "Lester 'GaMerZ' Chan"
1400
+ msgstr ""
1401
+
1402
+ #. Author URI of the plugin/theme
1403
+ msgid "http://lesterchan.net"
1404
+ msgstr ""