Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-Polls |
Version | 2.20 |
Comparing to | |
See all releases |
Code changes from version 2.14 to 2.20
- polls/polls-add.php +247 -0
- polls/polls-admin-ajax.php +120 -0
- polls/polls-admin-js.php +202 -0
- polls/polls-css.css +6 -2
- polls/polls-js.php +99 -39
- polls/polls-logs.php +390 -0
- polls/polls-manager.php +376 -647
- polls/polls-options.php +61 -311
- polls/polls-templates.php +467 -0
- polls/polls-uninstall.php +141 -0
- polls/polls-usage.php +8 -2
- polls/polls-widget.php +66 -8
- polls/polls.php +219 -118
- polls/wp-polls.mo +0 -0
- polls/wp-polls.pot +876 -538
- readme.html +106 -76
- readme.txt +2 -1
polls/polls-add.php
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Add Poll |
|
14 |
+
| - wp-content/plugins/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('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 »</a></p>';
|
97 |
+
}
|
98 |
+
break;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
### Add Poll Form
|
103 |
+
$poll_noquestion = 2;
|
104 |
+
$count = 0;
|
105 |
+
?>
|
106 |
+
<script type="text/javascript">
|
107 |
+
/* <![CDATA[*/
|
108 |
+
function check_pollexpiry() {
|
109 |
+
poll_expiry = document.getElementById("pollq_expiry_no").checked;
|
110 |
+
if(poll_expiry) {
|
111 |
+
document.getElementById("pollq_expiry").style.display = 'none';
|
112 |
+
} else {
|
113 |
+
document.getElementById("pollq_expiry").style.display = 'block';
|
114 |
+
}
|
115 |
+
}
|
116 |
+
var count_poll_answer = <?php echo $poll_noquestion; ?>;
|
117 |
+
function create_poll_answer() {
|
118 |
+
// Create Elements
|
119 |
+
var poll_tr = document.createElement("tr");
|
120 |
+
var poll_td1 = document.createElement("td");
|
121 |
+
var poll_td2 = document.createElement("td");
|
122 |
+
var poll_answer = document.createElement("input");
|
123 |
+
var poll_answer_count = document.createTextNode("<?php _e('Answer', 'wp-polls'); ?> " + (count_poll_answer+1) + ":");
|
124 |
+
var poll_answer_bold = document.createElement("strong");
|
125 |
+
var poll_option = document.createElement("option");
|
126 |
+
var poll_option_text = document.createTextNode((count_poll_answer+1));
|
127 |
+
count_poll_answer++;
|
128 |
+
// Elements - Input
|
129 |
+
poll_answer.setAttribute('type', "text");
|
130 |
+
poll_answer.setAttribute('name', "polla_answers[]");
|
131 |
+
poll_answer.setAttribute('size', "50");
|
132 |
+
// Elements - Options
|
133 |
+
poll_option.setAttribute('value', count_poll_answer);
|
134 |
+
poll_option.setAttribute('id', "pollq-multiple-" + (count_poll_answer+1));
|
135 |
+
// Elements - TD/TR
|
136 |
+
if(count_poll_answer%2 != 0) { poll_tr.style.background = "#eee"; }
|
137 |
+
poll_tr.setAttribute('id', "poll-answer-" + count_poll_answer);
|
138 |
+
poll_td1.setAttribute('width', "20%");
|
139 |
+
poll_td2.setAttribute('width', "80%");
|
140 |
+
// Appending
|
141 |
+
poll_tr.appendChild(poll_td1);
|
142 |
+
poll_tr.appendChild(poll_td2);
|
143 |
+
poll_answer_bold.appendChild(poll_answer_count);
|
144 |
+
poll_td1.appendChild(poll_answer_bold);
|
145 |
+
poll_td2.appendChild(poll_answer);
|
146 |
+
poll_option.appendChild(poll_option_text);
|
147 |
+
document.getElementById("poll_answers").appendChild(poll_tr);
|
148 |
+
document.getElementById("pollq_multiple").appendChild(poll_option);
|
149 |
+
}
|
150 |
+
function remove_poll_answer() {
|
151 |
+
if(count_poll_answer == 2) {
|
152 |
+
alert("<?php _e('You need at least a minimum of 2 poll answers.', 'wp-polls'); ?>");
|
153 |
+
} else {
|
154 |
+
document.getElementById("poll_answers").removeChild(document.getElementById("poll-answer-" + count_poll_answer));
|
155 |
+
document.getElementById("pollq_multiple").removeChild(document.getElementById("pollq-multiple-" + (count_poll_answer+1)));
|
156 |
+
document.getElementById("pollq_multiple").value = count_poll_answer;
|
157 |
+
count_poll_answer--;
|
158 |
+
}
|
159 |
+
}
|
160 |
+
function check_pollq_multiple() {
|
161 |
+
if(parseInt(document.getElementById("pollq_multiple_yes").value) == 1) {
|
162 |
+
document.getElementById("pollq_multiple").disabled = false;
|
163 |
+
} else {
|
164 |
+
document.getElementById("pollq_multiple").value = 1;
|
165 |
+
document.getElementById("pollq_multiple").disabled = true;
|
166 |
+
}
|
167 |
+
}
|
168 |
+
/* ]]> */
|
169 |
+
</script>
|
170 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } ?>
|
171 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
172 |
+
<div class="wrap">
|
173 |
+
<h2><?php _e('Add Poll', 'wp-polls'); ?></h2>
|
174 |
+
<!-- Poll Question -->
|
175 |
+
<h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
|
176 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
177 |
+
<tr style="background-color: #eee;">
|
178 |
+
<td width="20%"><strong><?php _e('Question:', 'wp-polls') ?></strong></td>
|
179 |
+
<td width="80%"><input type="text" size="70" name="pollq_question" value="" /></td>
|
180 |
+
</tr>
|
181 |
+
</table>
|
182 |
+
<!-- Poll Answers -->
|
183 |
+
<h3><?php _e('Poll Answers', 'wp-polls'); ?></h3>
|
184 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
185 |
+
<tfoot>
|
186 |
+
<tr>
|
187 |
+
<td width="20%"> </td>
|
188 |
+
<td width="80%"><input type="button" value="<?php _e('Add Answer', 'wp-polls') ?>" onclick="create_poll_answer();" class="button" /> <input type="button" value="<?php _e('Remove Answer', 'wp-polls') ?>" onclick="remove_poll_answer();" class="button" /></td>
|
189 |
+
</tr>
|
190 |
+
</tfoot>
|
191 |
+
<tbody id="poll_answers">
|
192 |
+
<?php
|
193 |
+
for($i = 1; $i <= $poll_noquestion; $i++) {
|
194 |
+
if($i%2 == 0) {
|
195 |
+
$style = 'style=\'background: none;\'';
|
196 |
+
} else {
|
197 |
+
$style = 'style=\'background-color: #eee;\'';
|
198 |
+
}
|
199 |
+
echo "<tr id=\"poll-answer-$i\" $style>\n";
|
200 |
+
echo "<td width=\"20%\"><strong>".sprintf(__('Answer %s:', 'wp-polls'), $i)."</strong></td>\n";
|
201 |
+
echo "<td width=\"80%\"><input type=\"text\" size=\"50\" name=\"polla_answers[]\" /></td>\n";
|
202 |
+
echo "</tr>\n";
|
203 |
+
$count++;
|
204 |
+
}
|
205 |
+
?>
|
206 |
+
</tbody>
|
207 |
+
</table>
|
208 |
+
<!-- Poll Multiple Answers -->
|
209 |
+
<h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3>
|
210 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
211 |
+
<tr style="background-color: #eee;">
|
212 |
+
<td width="40%" valign="top"><strong><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></strong></td>
|
213 |
+
<td width="60%">
|
214 |
+
<select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();">
|
215 |
+
<option value="0"><?php _e('No', 'wp-polls'); ?></option>
|
216 |
+
<option value="1"><?php _e('Yes', 'wp-polls'); ?></option>
|
217 |
+
</select>
|
218 |
+
</td>
|
219 |
+
</tr>
|
220 |
+
<tr>
|
221 |
+
<td width="40%" valign="top"><strong><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></strong></td>
|
222 |
+
<td width="60%">
|
223 |
+
<select name="pollq_multiple" id="pollq_multiple" size="1" disabled="disabled">
|
224 |
+
<?php
|
225 |
+
for($i = 1; $i <= $poll_noquestion; $i++) {
|
226 |
+
echo "<option value=\"$i\">$i</option>\n";
|
227 |
+
}
|
228 |
+
?>
|
229 |
+
</select>
|
230 |
+
</td>
|
231 |
+
</tr>
|
232 |
+
</table>
|
233 |
+
<!-- Poll Start/End Date -->
|
234 |
+
<h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3>
|
235 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
236 |
+
<tr style="background-color: #eee;">
|
237 |
+
<td width="20%"><strong><?php _e('Start Date/Time:', 'wp-polls') ?></strong></td>
|
238 |
+
<td width="80%"><?php poll_timestamp(current_time('timestamp')); ?></td>
|
239 |
+
</tr>
|
240 |
+
<tr>
|
241 |
+
<td width="20%" valign="top"><strong><?php _e('End Date/Time:', 'wp-polls') ?></strong></td>
|
242 |
+
<td width="80%"><input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" checked="checked" onclick="check_pollexpiry();" /> <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>
|
243 |
+
</tr>
|
244 |
+
</table>
|
245 |
+
<p style="text-align: center;"><input type="submit" name="do" value="<?php _e('Add Poll', 'wp-polls'); ?>" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></p>
|
246 |
+
</div>
|
247 |
+
</form>
|
polls/polls-admin-ajax.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Polls AJAX For Admin Backend |
|
14 |
+
| - wp-content/plugins/polls/polls-admin-ajax.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Include wp-config.php
|
21 |
+
@require('../../../wp-config.php');
|
22 |
+
|
23 |
+
|
24 |
+
### Check Whether User Can Manage Polls
|
25 |
+
if(!current_user_can('manage_polls')) {
|
26 |
+
die('Access Denied');
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
### Form Processing
|
31 |
+
if(!empty($_POST['do'])) {
|
32 |
+
// Set Header
|
33 |
+
header('Content-Type: text/html; charset='.get_option('blog_charset').'');
|
34 |
+
|
35 |
+
// Decide What To Do
|
36 |
+
switch($_POST['do']) {
|
37 |
+
// Delete Polls Logs
|
38 |
+
case __('Delete All Logs', 'wp-polls'):
|
39 |
+
if(trim($_POST['delete_logs_yes']) == 'yes') {
|
40 |
+
$delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip");
|
41 |
+
if($delete_logs) {
|
42 |
+
echo '<p style="color: green;">'.__('All Polls Logs Have Been Deleted.', 'wp-polls').'</p>';
|
43 |
+
} else {
|
44 |
+
echo '<p style="color: red;">'.__('An Error Has Occured While Deleting All Polls Logs.', 'wp-polls').'</p>';
|
45 |
+
}
|
46 |
+
}
|
47 |
+
break;
|
48 |
+
// Delete Poll Logs For Individual Poll
|
49 |
+
case __('Delete Logs For This Poll Only', 'wp-polls'):
|
50 |
+
$pollq_id = intval($_POST['pollq_id']);
|
51 |
+
$pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
|
52 |
+
if(trim($_POST['delete_logs_yes']) == 'yes') {
|
53 |
+
$delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
|
54 |
+
if($delete_logs) {
|
55 |
+
echo '<p style="color: green;">'.sprintf(__('All Logs For \'%s\' Has Been Deleted.', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
56 |
+
} else {
|
57 |
+
echo '<p style="color: red;">'.sprintf(__('An Error Has Occured While Deleting All Logs For \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
58 |
+
}
|
59 |
+
}
|
60 |
+
break;
|
61 |
+
// Delete Poll's Answer
|
62 |
+
case __('Delete Poll Answer', 'wp-polls'):
|
63 |
+
$pollq_id = intval($_POST['pollq_id']);
|
64 |
+
$polla_aid = intval($_POST['polla_aid']);
|
65 |
+
$poll_answers = $wpdb->get_row("SELECT polla_votes, polla_answers FROM $wpdb->pollsa WHERE polla_aid = $polla_aid AND polla_qid = $pollq_id");
|
66 |
+
$polla_votes = intval($poll_answers->polla_votes);
|
67 |
+
$polla_answers = stripslashes(trim($poll_answers->polla_answers));
|
68 |
+
$delete_polla_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_aid = $polla_aid AND polla_qid = $pollq_id");
|
69 |
+
$delete_pollip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id AND pollip_aid = $polla_aid");
|
70 |
+
$update_pollq_totalvotes = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes-$polla_votes) WHERE pollq_id = $pollq_id");
|
71 |
+
if($delete_polla_answers) {
|
72 |
+
echo '<p style="color: green;">'.sprintf(__('Poll Answer \'%s\' Deleted Successfully.', 'wp-polls'), $polla_answers).'</p>';
|
73 |
+
} else {
|
74 |
+
echo '<p style="color: red;">'.sprintf(__('Error In Deleting Poll Answer \'%s\'.', 'wp-polls'), $polla_answers).'</p>';
|
75 |
+
}
|
76 |
+
break;
|
77 |
+
// Open Poll
|
78 |
+
case __('Open Poll', 'wp-polls'):
|
79 |
+
$pollq_id = intval($_POST['pollq_id']);
|
80 |
+
$pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
|
81 |
+
$open_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_id = $pollq_id;");
|
82 |
+
if($open_poll) {
|
83 |
+
echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Is Now Opened', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
84 |
+
} else {
|
85 |
+
echo '<p style="color: red;">'.sprintf(__('Error Opening Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
86 |
+
}
|
87 |
+
break;
|
88 |
+
// Close Poll
|
89 |
+
case __('Close Poll', 'wp-polls'):
|
90 |
+
$pollq_id = intval($_POST['pollq_id']);
|
91 |
+
$pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
|
92 |
+
$close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_id = $pollq_id;");
|
93 |
+
if($close_poll) {
|
94 |
+
echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Is Now Closed', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
95 |
+
} else {
|
96 |
+
echo '<p style="color: red;">'.sprintf(__('Error Closing Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
97 |
+
}
|
98 |
+
break;
|
99 |
+
// Delete Poll
|
100 |
+
case __('Delete Poll', 'wp-polls'):
|
101 |
+
$pollq_id = intval($_POST['pollq_id']);
|
102 |
+
$pollq_question = $wpdb->get_var("SELECT pollq_question FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
|
103 |
+
$delete_poll_question = $wpdb->query("DELETE FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
|
104 |
+
$delete_poll_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_qid = $pollq_id");
|
105 |
+
$delete_poll_ip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
|
106 |
+
$poll_option_lastestpoll = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'poll_latestpoll'");
|
107 |
+
if(!$delete_poll_question) {
|
108 |
+
echo '<p style="color: red;">'.sprintf(__('Error In Deleting Poll \'%s\' Question', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
109 |
+
}
|
110 |
+
if(empty($text)) {
|
111 |
+
echo '<p style="color: green;">'.sprintf(__('Poll \'%s\' Deleted Successfully', 'wp-polls'), stripslashes($pollq_question)).'</p>';
|
112 |
+
}
|
113 |
+
// Update Lastest Poll ID To Poll Options
|
114 |
+
$latest_pollid = polls_latest_id();
|
115 |
+
$update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
|
116 |
+
break;
|
117 |
+
}
|
118 |
+
exit();
|
119 |
+
}
|
120 |
+
?>
|
polls/polls-admin-js.php
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Polls Admin Javascript File |
|
14 |
+
| - wp-content/plugins/polls/polls-admin-js.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Include wp-config.php
|
21 |
+
@require('../../../wp-config.php');
|
22 |
+
cache_javascript_headers();
|
23 |
+
|
24 |
+
### Determine polls-admin-ajax.php Path
|
25 |
+
$polls_admin_ajax_url = dirname($_SERVER['PHP_SELF']);
|
26 |
+
if(substr($polls_admin_ajax_url, -1) == '/') {
|
27 |
+
$polls_admin_ajax_url = substr($polls_admin_ajax_url, 0, -1);
|
28 |
+
}
|
29 |
+
?>
|
30 |
+
// Variables
|
31 |
+
var polls_admin_ajax_url = "<?php echo $polls_admin_ajax_url; ?>/polls-admin-ajax.php";
|
32 |
+
var polls_admin = new sack(polls_admin_ajax_url);
|
33 |
+
var global_poll_id = 0;
|
34 |
+
var global_poll_aid = 0;
|
35 |
+
var global_poll_aid_votes = 0;
|
36 |
+
|
37 |
+
// Function: Delete Poll Message
|
38 |
+
function delete_poll_message() {
|
39 |
+
document.getElementById('message').style.display = "block";
|
40 |
+
Fat.fade_element("message", null, 3000, "#FFFF00");
|
41 |
+
Fat.fade_element("poll-" + global_poll_id, null, 1000, "#FF3333");
|
42 |
+
setTimeout("remove_poll()", 1000);
|
43 |
+
}
|
44 |
+
|
45 |
+
// Function: Remove Poll From Manage Poll
|
46 |
+
function remove_poll() {
|
47 |
+
document.getElementById("manage_polls").removeChild(document.getElementById("poll-" + global_poll_id));
|
48 |
+
}
|
49 |
+
|
50 |
+
// Function: Delete Poll
|
51 |
+
function delete_poll(poll_id, poll_confirm) {
|
52 |
+
delete_poll_confirm = confirm(poll_confirm);
|
53 |
+
if(delete_poll_confirm) {
|
54 |
+
global_poll_id = poll_id;
|
55 |
+
polls_admin.reset();
|
56 |
+
polls_admin.setVar("do", "<?php _e('Delete Poll', 'wp-polls'); ?>");
|
57 |
+
polls_admin.setVar("pollq_id", poll_id);
|
58 |
+
polls_admin.method = 'POST';
|
59 |
+
polls_admin.element = 'message';
|
60 |
+
polls_admin.onCompletion = delete_poll_message;
|
61 |
+
polls_admin.runAJAX();
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
// Function: Delete Poll Logs Message
|
66 |
+
function delete_poll_logs_message() {
|
67 |
+
document.getElementById('message').style.display = "block";
|
68 |
+
Fat.fade_element("message", null, 3000, "#FFFF00");
|
69 |
+
document.getElementById("poll_logs").innerHTML = "<?php _e('No poll logs available.', 'wp-polls'); ?>";
|
70 |
+
}
|
71 |
+
|
72 |
+
// Function: Delete Poll Logs
|
73 |
+
function delete_poll_logs(poll_confirm) {
|
74 |
+
delete_poll_logs_confirm = confirm(poll_confirm);
|
75 |
+
if(delete_poll_logs_confirm) {
|
76 |
+
if(document.getElementById("delete_logs_yes").checked == true) {
|
77 |
+
polls_admin.reset();
|
78 |
+
polls_admin.setVar("do", "<?php _e('Delete All Logs', 'wp-polls'); ?>");
|
79 |
+
polls_admin.setVar("delete_logs_yes", "yes");
|
80 |
+
polls_admin.method = 'POST';
|
81 |
+
polls_admin.element = 'message';
|
82 |
+
polls_admin.onCompletion = delete_poll_logs_message;
|
83 |
+
polls_admin.runAJAX();
|
84 |
+
} else {
|
85 |
+
alert("<?php _e('Please check the \'Yes\' checkbox if you want to delete all logs.', 'wp-polls'); ?>");
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
// Function: Delete Individual Poll Logs Message
|
91 |
+
function delete_this_poll_logs_message() {
|
92 |
+
document.getElementById('message').style.display = "block";
|
93 |
+
Fat.fade_element("message", null, 3000, "#FFFF00");
|
94 |
+
document.getElementById("poll_logs").innerHTML = "<?php _e('No poll logs available for this poll.', 'wp-polls'); ?>";
|
95 |
+
document.getElementById("poll_logs_display").style.display = 'none';
|
96 |
+
document.getElementById("poll_logs_display_none").style.display = 'block';
|
97 |
+
}
|
98 |
+
|
99 |
+
// Function: Delete Individual Poll Logs
|
100 |
+
function delete_this_poll_logs(poll_id, poll_confirm) {
|
101 |
+
delete_poll_logs_confirm = confirm(poll_confirm);
|
102 |
+
if(delete_poll_logs_confirm) {
|
103 |
+
if(document.getElementById("delete_logs_yes").checked == true) {
|
104 |
+
global_poll_id = poll_id;
|
105 |
+
polls_admin.reset();
|
106 |
+
polls_admin.setVar("do", "<?php _e('Delete Logs For This Poll Only', 'wp-polls'); ?>");
|
107 |
+
polls_admin.setVar("delete_logs_yes", "yes");
|
108 |
+
polls_admin.setVar("pollq_id", poll_id);
|
109 |
+
polls_admin.method = 'POST';
|
110 |
+
polls_admin.element = 'message';
|
111 |
+
polls_admin.onCompletion = delete_this_poll_logs_message;
|
112 |
+
polls_admin.runAJAX();
|
113 |
+
} else {
|
114 |
+
alert("<?php _e('Please check the \'Yes\' checkbox if you want to delete all logs for this poll ONLY.', 'wp-polls'); ?>");
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
// Function: Delete Poll Answer Message
|
120 |
+
function delete_poll_ans_message() {
|
121 |
+
document.getElementById('message').style.display = "block";
|
122 |
+
Fat.fade_element("message", null, 3000, "#FFFF00");
|
123 |
+
Fat.fade_element("poll-answer-" + global_poll_aid, null, 1000, "#FF3333");
|
124 |
+
setTimeout("remove_poll_ans()", 1000);
|
125 |
+
document.getElementById('poll_total_votes').innerHTML = (parseInt(document.getElementById('poll_total_votes').innerHTML) - parseInt(global_poll_aid_votes));
|
126 |
+
poll_total_votes = parseInt(document.getElementById('pollq_totalvotes').value);
|
127 |
+
poll_answer_vote = parseInt(document.getElementById("polla_votes-" + global_poll_aid).value);
|
128 |
+
poll_total_votes_new = (poll_total_votes - poll_answer_vote);
|
129 |
+
if(poll_total_votes_new < 0) {
|
130 |
+
poll_total_votes_new = 0;
|
131 |
+
}
|
132 |
+
document.getElementById('pollq_totalvotes').value = parseInt(poll_total_votes_new);
|
133 |
+
}
|
134 |
+
|
135 |
+
// Function: Remove Poll From Manage Poll
|
136 |
+
function remove_poll_ans() {
|
137 |
+
document.getElementById("poll_answers").removeChild(document.getElementById("poll-answer-" + global_poll_aid));
|
138 |
+
}
|
139 |
+
|
140 |
+
// Function: Delete Poll Answer
|
141 |
+
function delete_poll_ans(poll_id, poll_aid, poll_aid_vote, poll_confirm) {
|
142 |
+
delete_poll_ans_confirm = confirm(poll_confirm);
|
143 |
+
if(delete_poll_ans_confirm) {
|
144 |
+
global_poll_id = poll_id;
|
145 |
+
global_poll_aid = poll_aid;
|
146 |
+
global_poll_aid_votes = poll_aid_vote;
|
147 |
+
polls_admin.reset();
|
148 |
+
polls_admin.setVar("do", "<?php _e('Delete Poll Answer', 'wp-polls'); ?>");
|
149 |
+
polls_admin.setVar("pollq_id", poll_id);
|
150 |
+
polls_admin.setVar("polla_aid", poll_aid);
|
151 |
+
polls_admin.method = 'POST';
|
152 |
+
polls_admin.element = 'message';
|
153 |
+
polls_admin.onCompletion = delete_poll_ans_message;
|
154 |
+
polls_admin.runAJAX();
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
// Function: Open Poll Message
|
159 |
+
function opening_poll_message() {
|
160 |
+
document.getElementById('message').style.display = "block";
|
161 |
+
Fat.fade_element("message", null, 3000, "#FFFF00");
|
162 |
+
document.getElementById("open_poll").style.display = "none";
|
163 |
+
document.getElementById("close_poll").style.display = "inline";
|
164 |
+
}
|
165 |
+
|
166 |
+
// Function: Open Poll
|
167 |
+
function opening_poll(poll_id, poll_confirm) {
|
168 |
+
open_poll_confirm = confirm(poll_confirm);
|
169 |
+
if(open_poll_confirm) {
|
170 |
+
global_poll_id = poll_id;
|
171 |
+
polls_admin.reset();
|
172 |
+
polls_admin.setVar("do", "<?php _e('Open Poll', 'wp-polls'); ?>");
|
173 |
+
polls_admin.setVar("pollq_id", poll_id);
|
174 |
+
polls_admin.method = 'POST';
|
175 |
+
polls_admin.element = 'message';
|
176 |
+
polls_admin.onCompletion = opening_poll_message;
|
177 |
+
polls_admin.runAJAX();
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
// Function: Close Poll Message
|
182 |
+
function closing_poll_message() {
|
183 |
+
document.getElementById('message').style.display = "block";
|
184 |
+
Fat.fade_element("message", null, 3000, "#FFFF00");
|
185 |
+
document.getElementById("open_poll").style.display = "inline";
|
186 |
+
document.getElementById("close_poll").style.display = "none";
|
187 |
+
}
|
188 |
+
|
189 |
+
// Function: Close Poll
|
190 |
+
function closing_poll(poll_id, poll_confirm) {
|
191 |
+
close_poll_confirm = confirm(poll_confirm);
|
192 |
+
if(close_poll_confirm) {
|
193 |
+
global_poll_id = poll_id;
|
194 |
+
polls_admin.reset();
|
195 |
+
polls_admin.setVar("do", "<?php _e('Close Poll', 'wp-polls'); ?>");
|
196 |
+
polls_admin.setVar("pollq_id", poll_id);
|
197 |
+
polls_admin.method = 'POST';
|
198 |
+
polls_admin.element = 'message';
|
199 |
+
polls_admin.onCompletion = closing_poll_message;
|
200 |
+
polls_admin.runAJAX();
|
201 |
+
}
|
202 |
+
}
|
polls/polls-css.css
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/*
|
2 |
+----------------------------------------------------------------+
|
3 |
| |
|
4 |
-
| WordPress 2.0 Plugin: WP-Polls 2.
|
5 |
-
| Copyright (c)
|
6 |
| |
|
7 |
| File Written By: |
|
8 |
| - Lester "GaMerZ" Chan |
|
@@ -16,9 +16,13 @@
|
|
16 |
*/
|
17 |
|
18 |
|
|
|
|
|
|
|
19 |
.wp-polls ul li, wp-polls-ul li, .wp-polls-ans ul li {
|
20 |
text-align: left;
|
21 |
background-image: none;
|
|
|
22 |
}
|
23 |
.wp-polls ul, .wp-polls-ul, .wp-polls-ans ul {
|
24 |
text-align: left;
|
1 |
/*
|
2 |
+----------------------------------------------------------------+
|
3 |
| |
|
4 |
+
| WordPress 2.0 Plugin: WP-Polls 2.20 |
|
5 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
6 |
| |
|
7 |
| File Written By: |
|
8 |
| - Lester "GaMerZ" Chan |
|
16 |
*/
|
17 |
|
18 |
|
19 |
+
.wp-polls, .wp-polls-form {
|
20 |
+
/* background-color: #ffffff; */
|
21 |
+
}
|
22 |
.wp-polls ul li, wp-polls-ul li, .wp-polls-ans ul li {
|
23 |
text-align: left;
|
24 |
background-image: none;
|
25 |
+
display: block;
|
26 |
}
|
27 |
.wp-polls ul, .wp-polls-ul, .wp-polls-ans ul {
|
28 |
text-align: left;
|
polls/polls-js.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.1 Plugin: WP-Polls 2.
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -11,7 +11,7 @@
|
|
11 |
| |
|
12 |
| File Information: |
|
13 |
| - Polls Javascript File |
|
14 |
-
| - wp-content/plugins/polls/polls-js.
|
15 |
| |
|
16 |
+----------------------------------------------------------------+
|
17 |
*/
|
@@ -26,54 +26,83 @@ $polls_ajax_url = dirname($_SERVER['PHP_SELF']);
|
|
26 |
if(substr($polls_ajax_url, -1) == '/') {
|
27 |
$polls_ajax_url = substr($polls_ajax_url, 0, -1);
|
28 |
}
|
|
|
|
|
|
|
29 |
?>
|
30 |
|
31 |
// Variables
|
32 |
var polls_ajax_url = "<?php echo $polls_ajax_url; ?>/polls.php";
|
33 |
var polls_text_wait = "<?php _e('Your last request is still being processed. Please wait a while ...', 'wp-polls'); ?>";
|
34 |
var polls_text_valid = "<?php _e('Please choose a valid poll answer.', 'wp-polls'); ?>";
|
|
|
35 |
var polls = new sack(polls_ajax_url);
|
36 |
var poll_id = 0;
|
37 |
-
var poll_answer_id =
|
38 |
var poll_fadein_opacity = 0;
|
39 |
var poll_fadeout_opacity = 100;
|
|
|
|
|
40 |
var is_ie = (document.all && document.getElementById);
|
41 |
var is_moz = (!document.all && document.getElementById);
|
42 |
var is_opera = (navigator.userAgent.indexOf("Opera") > -1);
|
43 |
var is_being_voted = false;
|
44 |
|
45 |
-
|
46 |
-
// When User Vote For Poll
|
47 |
function poll_vote(current_poll_id) {
|
48 |
if(!is_being_voted) {
|
49 |
is_being_voted = true;
|
50 |
poll_id = current_poll_id;
|
51 |
poll_form = document.getElementById('polls_form_' + poll_id);
|
52 |
poll_answer = eval("poll_form.poll_" + poll_id);
|
53 |
-
poll_answer_id =
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
if(poll_answer.length != null) {
|
55 |
for(i = 0; i < poll_answer.length; i++) {
|
56 |
-
if (poll_answer[i].checked) {
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
}
|
60 |
} else {
|
61 |
poll_answer_id = poll_answer.value;
|
62 |
}
|
63 |
-
if(
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
} else {
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
} else {
|
71 |
alert(polls_text_wait);
|
72 |
}
|
73 |
}
|
74 |
|
75 |
-
|
76 |
-
// When User View Poll's Result
|
77 |
function poll_result(current_poll_id) {
|
78 |
if(!is_being_voted) {
|
79 |
is_being_voted = true;
|
@@ -85,8 +114,7 @@ function poll_result(current_poll_id) {
|
|
85 |
}
|
86 |
}
|
87 |
|
88 |
-
|
89 |
-
// When User View Poll's Voting Booth
|
90 |
function poll_booth(current_poll_id) {
|
91 |
if(!is_being_voted) {
|
92 |
is_being_voted = true;
|
@@ -98,8 +126,7 @@ function poll_booth(current_poll_id) {
|
|
98 |
}
|
99 |
}
|
100 |
|
101 |
-
|
102 |
-
// Poll Fade In Text
|
103 |
function poll_fadein_text() {
|
104 |
if(poll_fadein_opacity == 90) {
|
105 |
poll_unloading_text();
|
@@ -110,9 +137,19 @@ function poll_fadein_text() {
|
|
110 |
poll_fadein_opacity = 100;
|
111 |
poll_unloading_text();
|
112 |
} else if(is_ie) {
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
114 |
} else if(is_moz) {
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
setTimeout("poll_fadein_text()", 100);
|
118 |
} else {
|
@@ -121,29 +158,38 @@ function poll_fadein_text() {
|
|
121 |
}
|
122 |
}
|
123 |
|
124 |
-
|
125 |
-
// Poll Loading Text
|
126 |
function poll_loading_text() {
|
127 |
-
|
|
|
|
|
128 |
}
|
129 |
|
130 |
-
|
131 |
-
// Poll Finish Loading Text
|
132 |
function poll_unloading_text() {
|
133 |
-
|
|
|
|
|
134 |
}
|
135 |
|
136 |
-
|
137 |
-
// Process The Poll
|
138 |
function poll_process() {
|
139 |
if(poll_fadeout_opacity > 0) {
|
140 |
poll_fadeout_opacity -= 10;
|
141 |
if(is_opera) {
|
142 |
poll_fadeout_opacity = 0;
|
143 |
} else if(is_ie) {
|
144 |
-
|
|
|
|
|
|
|
|
|
145 |
} else if(is_moz) {
|
146 |
-
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
setTimeout("poll_process()", 100);
|
149 |
} else {
|
@@ -161,17 +207,24 @@ function poll_process() {
|
|
161 |
}
|
162 |
}
|
163 |
|
164 |
-
|
165 |
-
// Process Poll's Result
|
166 |
function poll_process_result() {
|
167 |
if(poll_fadeout_opacity > 0) {
|
168 |
poll_fadeout_opacity -= 10;
|
169 |
if(is_opera) {
|
170 |
poll_fadeout_opacity = 0;
|
171 |
} else if(is_ie) {
|
172 |
-
|
|
|
|
|
|
|
|
|
173 |
} else if(is_moz) {
|
174 |
-
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
setTimeout("poll_process_result()", 100);
|
177 |
} else {
|
@@ -187,17 +240,24 @@ function poll_process_result() {
|
|
187 |
}
|
188 |
}
|
189 |
|
190 |
-
|
191 |
-
// Process Poll's Voting Booth
|
192 |
function poll_process_booth() {
|
193 |
if(poll_fadeout_opacity > 0) {
|
194 |
poll_fadeout_opacity -= 10;
|
195 |
if(is_opera) {
|
196 |
poll_fadeout_opacity = 0;
|
197 |
} else if(is_ie) {
|
198 |
-
|
|
|
|
|
|
|
|
|
199 |
} else if(is_moz) {
|
200 |
-
|
|
|
|
|
|
|
|
|
201 |
}
|
202 |
setTimeout("poll_process_booth()", 100);
|
203 |
} else {
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
11 |
| |
|
12 |
| File Information: |
|
13 |
| - Polls Javascript File |
|
14 |
+
| - wp-content/plugins/polls/polls-js.php |
|
15 |
| |
|
16 |
+----------------------------------------------------------------+
|
17 |
*/
|
26 |
if(substr($polls_ajax_url, -1) == '/') {
|
27 |
$polls_ajax_url = substr($polls_ajax_url, 0, -1);
|
28 |
}
|
29 |
+
|
30 |
+
### Get Poll AJAX Style
|
31 |
+
$poll_ajax_style = get_option('poll_ajax_style');
|
32 |
?>
|
33 |
|
34 |
// Variables
|
35 |
var polls_ajax_url = "<?php echo $polls_ajax_url; ?>/polls.php";
|
36 |
var polls_text_wait = "<?php _e('Your last request is still being processed. Please wait a while ...', 'wp-polls'); ?>";
|
37 |
var polls_text_valid = "<?php _e('Please choose a valid poll answer.', 'wp-polls'); ?>";
|
38 |
+
var polls_text_multiple = "<?php _e('Maximum number of choices allowed:', 'wp-polls'); ?>";
|
39 |
var polls = new sack(polls_ajax_url);
|
40 |
var poll_id = 0;
|
41 |
+
var poll_answer_id = "";
|
42 |
var poll_fadein_opacity = 0;
|
43 |
var poll_fadeout_opacity = 100;
|
44 |
+
var poll_show_loading = <?php echo intval($poll_ajax_style['loading']); ?>;
|
45 |
+
var poll_show_fading = <?php echo intval($poll_ajax_style['fading']); ?>;
|
46 |
var is_ie = (document.all && document.getElementById);
|
47 |
var is_moz = (!document.all && document.getElementById);
|
48 |
var is_opera = (navigator.userAgent.indexOf("Opera") > -1);
|
49 |
var is_being_voted = false;
|
50 |
|
51 |
+
// Function: When User Vote For Poll
|
|
|
52 |
function poll_vote(current_poll_id) {
|
53 |
if(!is_being_voted) {
|
54 |
is_being_voted = true;
|
55 |
poll_id = current_poll_id;
|
56 |
poll_form = document.getElementById('polls_form_' + poll_id);
|
57 |
poll_answer = eval("poll_form.poll_" + poll_id);
|
58 |
+
poll_answer_id = "";
|
59 |
+
if(document.getElementById('poll_multiple_ans_' + poll_id)) {
|
60 |
+
poll_multiple_ans = parseInt(document.getElementById('poll_multiple_ans_' + poll_id).value);
|
61 |
+
} else {
|
62 |
+
poll_multiple_ans = 0;
|
63 |
+
}
|
64 |
+
poll_multiple_ans_count = 0;
|
65 |
if(poll_answer.length != null) {
|
66 |
for(i = 0; i < poll_answer.length; i++) {
|
67 |
+
if (poll_answer[i].checked) {
|
68 |
+
if(poll_multiple_ans > 0) {
|
69 |
+
poll_answer_id = poll_answer[i].value + "," + poll_answer_id;
|
70 |
+
poll_multiple_ans_count++;
|
71 |
+
} else {
|
72 |
+
poll_answer_id = parseInt(poll_answer[i].value);
|
73 |
+
}
|
74 |
}
|
75 |
}
|
76 |
} else {
|
77 |
poll_answer_id = poll_answer.value;
|
78 |
}
|
79 |
+
if(poll_multiple_ans > 0) {
|
80 |
+
if(poll_multiple_ans_count > 0 && poll_multiple_ans_count <= poll_multiple_ans) {
|
81 |
+
poll_answer_id = poll_answer_id.substring(0, (poll_answer_id.length-1));
|
82 |
+
poll_loading_text();
|
83 |
+
poll_process();
|
84 |
+
} else if(poll_multiple_ans_count == 0) {
|
85 |
+
is_being_voted = false;
|
86 |
+
alert(polls_text_valid);
|
87 |
+
} else {
|
88 |
+
is_being_voted = false;
|
89 |
+
alert(polls_text_multiple + " " + poll_multiple_ans + ".");
|
90 |
+
}
|
91 |
} else {
|
92 |
+
if(poll_answer_id > 0) {
|
93 |
+
poll_loading_text();
|
94 |
+
poll_process();
|
95 |
+
} else {
|
96 |
+
is_being_voted = false;
|
97 |
+
alert(polls_text_valid);
|
98 |
+
}
|
99 |
}
|
100 |
} else {
|
101 |
alert(polls_text_wait);
|
102 |
}
|
103 |
}
|
104 |
|
105 |
+
// Function: When User View Poll's Result
|
|
|
106 |
function poll_result(current_poll_id) {
|
107 |
if(!is_being_voted) {
|
108 |
is_being_voted = true;
|
114 |
}
|
115 |
}
|
116 |
|
117 |
+
// Function: When User View Poll's Voting Booth
|
|
|
118 |
function poll_booth(current_poll_id) {
|
119 |
if(!is_being_voted) {
|
120 |
is_being_voted = true;
|
126 |
}
|
127 |
}
|
128 |
|
129 |
+
// Function: Poll Fade In Text
|
|
|
130 |
function poll_fadein_text() {
|
131 |
if(poll_fadein_opacity == 90) {
|
132 |
poll_unloading_text();
|
137 |
poll_fadein_opacity = 100;
|
138 |
poll_unloading_text();
|
139 |
} else if(is_ie) {
|
140 |
+
if(poll_show_fading) {
|
141 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadein_opacity;
|
142 |
+
} else {
|
143 |
+
poll_fadein_opacity = 100;
|
144 |
+
poll_unloading_text();
|
145 |
+
}
|
146 |
} else if(is_moz) {
|
147 |
+
if(poll_show_fading) {
|
148 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadein_opacity/100);
|
149 |
+
} else {
|
150 |
+
poll_fadein_opacity = 100;
|
151 |
+
poll_unloading_text();
|
152 |
+
}
|
153 |
}
|
154 |
setTimeout("poll_fadein_text()", 100);
|
155 |
} else {
|
158 |
}
|
159 |
}
|
160 |
|
161 |
+
// Function: Poll Loading Text
|
|
|
162 |
function poll_loading_text() {
|
163 |
+
if(poll_show_loading) {
|
164 |
+
document.getElementById('polls-' + poll_id + '-loading').style.display = 'block';
|
165 |
+
}
|
166 |
}
|
167 |
|
168 |
+
// Function: Poll Finish Loading Text
|
|
|
169 |
function poll_unloading_text() {
|
170 |
+
if(poll_show_loading) {
|
171 |
+
document.getElementById('polls-' + poll_id + '-loading').style.display = 'none';
|
172 |
+
}
|
173 |
}
|
174 |
|
175 |
+
// Function: Process The Poll
|
|
|
176 |
function poll_process() {
|
177 |
if(poll_fadeout_opacity > 0) {
|
178 |
poll_fadeout_opacity -= 10;
|
179 |
if(is_opera) {
|
180 |
poll_fadeout_opacity = 0;
|
181 |
} else if(is_ie) {
|
182 |
+
if(poll_show_fading) {
|
183 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadeout_opacity;
|
184 |
+
} else {
|
185 |
+
poll_fadeout_opacity = 0;
|
186 |
+
}
|
187 |
} else if(is_moz) {
|
188 |
+
if(poll_show_fading) {
|
189 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadeout_opacity/100);
|
190 |
+
} else {
|
191 |
+
poll_fadeout_opacity = 0;
|
192 |
+
}
|
193 |
}
|
194 |
setTimeout("poll_process()", 100);
|
195 |
} else {
|
207 |
}
|
208 |
}
|
209 |
|
210 |
+
// Function: Process Poll's Result
|
|
|
211 |
function poll_process_result() {
|
212 |
if(poll_fadeout_opacity > 0) {
|
213 |
poll_fadeout_opacity -= 10;
|
214 |
if(is_opera) {
|
215 |
poll_fadeout_opacity = 0;
|
216 |
} else if(is_ie) {
|
217 |
+
if(poll_show_fading) {
|
218 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadeout_opacity;
|
219 |
+
} else {
|
220 |
+
poll_fadeout_opacity = 0;
|
221 |
+
}
|
222 |
} else if(is_moz) {
|
223 |
+
if(poll_show_fading) {
|
224 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadeout_opacity/100);
|
225 |
+
} else {
|
226 |
+
poll_fadeout_opacity = 0;
|
227 |
+
}
|
228 |
}
|
229 |
setTimeout("poll_process_result()", 100);
|
230 |
} else {
|
240 |
}
|
241 |
}
|
242 |
|
243 |
+
// Function: Process Poll's Voting Booth
|
|
|
244 |
function poll_process_booth() {
|
245 |
if(poll_fadeout_opacity > 0) {
|
246 |
poll_fadeout_opacity -= 10;
|
247 |
if(is_opera) {
|
248 |
poll_fadeout_opacity = 0;
|
249 |
} else if(is_ie) {
|
250 |
+
if(poll_show_fading) {
|
251 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadeout_opacity;
|
252 |
+
} else {
|
253 |
+
poll_fadeout_opacity = 0;
|
254 |
+
}
|
255 |
} else if(is_moz) {
|
256 |
+
if(poll_show_fading) {
|
257 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadeout_opacity/100);
|
258 |
+
} else {
|
259 |
+
poll_fadeout_opacity = 0;
|
260 |
+
}
|
261 |
}
|
262 |
setTimeout("poll_process_booth()", 100);
|
263 |
} else {
|
polls/polls-logs.php
ADDED
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Polls Logs |
|
14 |
+
| - wp-content/plugins/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 |
+
<h2><?php _e('Poll\'s Logs', 'wp-polls'); ?></h2>
|
124 |
+
<p><strong><?php echo $poll_question; ?></strong></p>
|
125 |
+
<p>
|
126 |
+
<?php printf(__('There are a total of <strong>%s</strong> recorded votes for this poll.', 'wp-polls'), $poll_totalrecorded); ?><br />
|
127 |
+
<?php printf(__('<strong>»</strong> <strong>%s</strong> vote(s) are voted by registered users', 'wp-polls'), $poll_registered); ?><br />
|
128 |
+
<?php printf(__('<strong>»</strong> <strong>%s</strong> vote(s) are voted by comment authors', 'wp-polls'), $poll_comments); ?><br />
|
129 |
+
<?php printf(__('<strong>»</strong> <strong>%s</strong> vote(s) are voted by guests', 'wp-polls'), $poll_guest); ?>
|
130 |
+
</p>
|
131 |
+
</div>
|
132 |
+
<?php if($poll_totalrecorded > 0) { ?>
|
133 |
+
<div class="wrap">
|
134 |
+
<h2><?php _e('Filter Poll\'s Logs', 'wp-polls') ?></h2>
|
135 |
+
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
136 |
+
<tr>
|
137 |
+
<td width="50%">
|
138 |
+
<form method="post" action="<?php echo htmlspecialchars($base_page); ?>&mode=logs&id=<?php echo $poll_id; ?>">
|
139 |
+
<p style="display: none;"><input type="hidden" name="filter" value="1" /></p>
|
140 |
+
<table border="0" cellspacing="3" cellpadding="3">
|
141 |
+
<tr>
|
142 |
+
<td>
|
143 |
+
<strong><?php _e('Display All Users That Voted For:', 'wp-polls'); ?></strong>
|
144 |
+
</td>
|
145 |
+
<td>
|
146 |
+
<select name="users_voted_for" size="1">
|
147 |
+
<?php
|
148 |
+
if($poll_answers_data) {
|
149 |
+
foreach($poll_answers_data as $data) {
|
150 |
+
$polla_id = intval($data->polla_aid);
|
151 |
+
$polla_answers = stripslashes(strip_tags(htmlspecialchars($data->polla_answers)));
|
152 |
+
if($polla_id == $users_voted_for) {
|
153 |
+
echo '<option value="'.$polla_id .'" selected="selected">'.$polla_answers.'</option>';
|
154 |
+
} else {
|
155 |
+
echo '<option value="'.$polla_id .'">'.$polla_answers.'</option>';
|
156 |
+
}
|
157 |
+
$pollip_answers[$polla_id] = $polla_answers;
|
158 |
+
}
|
159 |
+
}
|
160 |
+
?>
|
161 |
+
</select>
|
162 |
+
</td>
|
163 |
+
</tr>
|
164 |
+
<tr>
|
165 |
+
<td valign="top">
|
166 |
+
<strong><?php _e('Voters To EXCLUDE', 'wp-polls'); ?></strong>
|
167 |
+
</td>
|
168 |
+
<td>
|
169 |
+
<input type="checkbox" id="exclude_registered_1" name="exclude_registered" value="1" <?php checked('1', $exclude_registered); ?> /> <label for="exclude_registered_1"><?php _e('Registered Users', 'wp-polls'); ?></label><br />
|
170 |
+
<input type="checkbox" id="exclude_comment_1" name="exclude_comment" value="1" <?php checked('1', $exclude_comment); ?> /> <label for="exclude_comment_1"><?php _e('Comment Authors', 'wp-polls'); ?></label><br />
|
171 |
+
<input type="checkbox" id="exclude_guest_1" name="exclude_guest" value="1" <?php checked('1', $exclude_guest); ?> /> <label for="exclude_guest_1"><?php _e('Guests', 'wp-polls'); ?></label>
|
172 |
+
</td>
|
173 |
+
</tr>
|
174 |
+
<tr>
|
175 |
+
<td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
|
176 |
+
</tr>
|
177 |
+
</table>
|
178 |
+
</form>
|
179 |
+
</td>
|
180 |
+
<td width="50%">
|
181 |
+
<?php if($poll_multiple > 0) { ?>
|
182 |
+
<form method="post" action="<?php echo htmlspecialchars($base_page); ?>&mode=logs&id=<?php echo $poll_id; ?>">
|
183 |
+
<p style="display: none;"><input type="hidden" name="filter" value="2" /></p>
|
184 |
+
<table border="0" cellspacing="3" cellpadding="3">
|
185 |
+
<tr>
|
186 |
+
<td>
|
187 |
+
<strong><?php _e('Display Users That Voted For: ', 'wp-polls'); ?></strong>
|
188 |
+
</td>
|
189 |
+
<td>
|
190 |
+
<select name="num_choices_sign" size="1">
|
191 |
+
<option value="more" <?php selected('more', $num_choices_sign); ?>><?php _e('More Than', 'wp-polls'); ?></option>
|
192 |
+
<option value="more_exactly" <?php selected('more_exactly', $num_choices_sign); ?>><?php _e('More Than Or Exactly', 'wp-polls'); ?></option>
|
193 |
+
<option value="exactly" <?php selected('exactly', $num_choices_sign); ?>><?php _e('Exactly', 'wp-polls'); ?></option>
|
194 |
+
<option value="less_exactly" <?php selected('less_exactly', $num_choices_sign); ?>><?php _e('Less Than Or Exactly', 'wp-polls'); ?></option>
|
195 |
+
<option value="less" <?php selected('less', $num_choices_sign); ?>><?php _e('Less Than', 'wp-polls'); ?></option>
|
196 |
+
</select>
|
197 |
+
|
198 |
+
<select name="num_choices" size="1">
|
199 |
+
<?php
|
200 |
+
for($i = 1; $i <= $poll_multiple; $i++) {
|
201 |
+
if($i == 1) {
|
202 |
+
echo '<option value="1">'.__('1 Answer', 'wp-polls').'</option>';
|
203 |
+
} else {
|
204 |
+
if($i == $num_choices) {
|
205 |
+
echo '<option value="'.$i.'" selected="selected">'.sprintf(__('%s Answers', 'wp-polls'), $i).'</option>';
|
206 |
+
} else {
|
207 |
+
echo '<option value="'.$i.'">'.sprintf(__('%s Answers', 'wp-polls'), $i).'</option>';
|
208 |
+
}
|
209 |
+
}
|
210 |
+
}
|
211 |
+
?>
|
212 |
+
</select>
|
213 |
+
</td>
|
214 |
+
</tr>
|
215 |
+
<tr>
|
216 |
+
<td valign="top">
|
217 |
+
<strong><?php _e('Voters To EXCLUDE', 'wp-polls'); ?></strong>
|
218 |
+
</td>
|
219 |
+
<td>
|
220 |
+
<input type="checkbox" id="exclude_registered_2" name="exclude_registered_2" value="1" <?php checked('1', $exclude_registered_2); ?> /> <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); ?> /> <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 |
+
|
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 htmlspecialchars($base_page); ?>&mode=logs&id=<?php echo $poll_id; ?>">
|
239 |
+
<p style="display: none;"><input type="hidden" name="filter" value="3" /></p>
|
240 |
+
<table border="0" cellspacing="3" cellpadding="3">
|
241 |
+
<tr>
|
242 |
+
<td>
|
243 |
+
<strong><?php _e('Display What This User Has Voted:', 'wp-polls'); ?></strong>
|
244 |
+
</td>
|
245 |
+
<td>
|
246 |
+
<select name="what_user_voted" size="1">
|
247 |
+
<?php
|
248 |
+
if($poll_voters) {
|
249 |
+
foreach($poll_voters as $pollip_user) {
|
250 |
+
if($pollip_user == $what_user_voted) {
|
251 |
+
echo '<option value="'.stripslashes(htmlspecialchars($pollip_user)).'" selected="selected">'.stripslashes(htmlspecialchars($pollip_user)).'</option>';
|
252 |
+
} else {
|
253 |
+
echo '<option value="'.stripslashes(htmlspecialchars($pollip_user)).'">'.stripslashes(htmlspecialchars($pollip_user)).'</option>';
|
254 |
+
}
|
255 |
+
}
|
256 |
+
}
|
257 |
+
?>
|
258 |
+
</select>
|
259 |
+
</td>
|
260 |
+
</tr>
|
261 |
+
<tr>
|
262 |
+
<td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Filter', 'wp-polls'); ?>" class="button" /></td>
|
263 |
+
</tr>
|
264 |
+
</table>
|
265 |
+
</form>
|
266 |
+
<?php } else { ?>
|
267 |
+
|
268 |
+
<?php } // End if($poll_multiple > -1) ?>
|
269 |
+
</td>
|
270 |
+
<td>
|
271 |
+
<input type="button" value="<?php _e('Clear Filter', 'wp-polls'); ?>" onclick="self.location.href = '<?php echo htmlspecialchars($base_page); ?>&mode=logs&id=<?php echo $poll_id; ?>';" class="button" />
|
272 |
+
</td>
|
273 |
+
</tr>
|
274 |
+
</table>
|
275 |
+
</div>
|
276 |
+
<?php } // End if($poll_totalrecorded > 0) ?>
|
277 |
+
<div class="wrap">
|
278 |
+
<h2><?php _e('Poll Logs', 'wp-polls'); ?></h2>
|
279 |
+
<div id="poll_logs_display">
|
280 |
+
<?php
|
281 |
+
if($poll_ips) {
|
282 |
+
if(empty($_POST['do'])) {
|
283 |
+
echo '<p>'.__('This default filter is limited to display only <strong>100</strong> records.', 'wp-polls').'</p>';
|
284 |
+
}
|
285 |
+
echo '<table width="100%" border="0" cellspacing="3" cellpadding="3">'."\n";
|
286 |
+
$k = 1;
|
287 |
+
$j = 0;
|
288 |
+
$poll_last_aid = -1;
|
289 |
+
if(intval($_POST['filter']) > 1) {
|
290 |
+
echo "<tr class=\"thead\">\n";
|
291 |
+
echo "<th>".__('Answer', 'wp-polls')."</th>\n";
|
292 |
+
echo "<th>".__('IP', 'wp-polls')."</th>\n";
|
293 |
+
echo "<th>".__('Host', 'wp-polls')."</th>\n";
|
294 |
+
echo "<th>".__('Date', 'wp-polls')."</th>\n";
|
295 |
+
echo "</tr>\n";
|
296 |
+
foreach($poll_ips as $poll_ip) {
|
297 |
+
$pollip_aid = intval($poll_ip->pollip_aid);
|
298 |
+
$pollip_user = stripslashes($poll_ip->pollip_user);
|
299 |
+
$pollip_ip = $poll_ip->pollip_ip;
|
300 |
+
$pollip_host = $poll_ip->pollip_host;
|
301 |
+
$pollip_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));
|
302 |
+
if($i%2 == 0) {
|
303 |
+
$style = 'style=\'background-color: none\'';
|
304 |
+
} else {
|
305 |
+
$style = 'style=\'background-color: #eee\'';
|
306 |
+
}
|
307 |
+
if($pollip_user != $temp_pollip_user) {
|
308 |
+
echo '<tr style="background-color: #b8d4ff">'."\n";
|
309 |
+
echo "<td colspan=\"4\"><strong>".__('User', 'wp-polls')." $k: $pollip_user</strong></td>\n";
|
310 |
+
echo '</tr>';
|
311 |
+
$k++;
|
312 |
+
}
|
313 |
+
echo "<tr $style>\n";
|
314 |
+
echo "<td>{$pollip_answers[$pollip_aid]}</td>\n";
|
315 |
+
echo "<td>$pollip_ip</td>\n";
|
316 |
+
echo "<td>$pollip_host</td>\n";
|
317 |
+
echo "<td>$pollip_date</td>\n";
|
318 |
+
echo "</tr>\n";
|
319 |
+
$temp_pollip_user = $pollip_user;
|
320 |
+
$i++;
|
321 |
+
$j++;
|
322 |
+
}
|
323 |
+
} else {
|
324 |
+
foreach($poll_ips as $poll_ip) {
|
325 |
+
$pollip_aid = intval($poll_ip->pollip_aid);
|
326 |
+
$pollip_user = stripslashes($poll_ip->pollip_user);
|
327 |
+
$pollip_ip = $poll_ip->pollip_ip;
|
328 |
+
$pollip_host = $poll_ip->pollip_host;
|
329 |
+
$pollip_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));
|
330 |
+
if($pollip_aid != $poll_last_aid) {
|
331 |
+
if($pollip_aid == 0) {
|
332 |
+
echo "<tr style='background-color: #b8d4ff'>\n<td colspan=\"4\"><strong>$pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
|
333 |
+
} else {
|
334 |
+
echo "<tr style='background-color: #b8d4ff'>\n<td colspan=\"4\"><strong>".__('Answer', 'wp-polls')." $k: $pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
|
335 |
+
$k++;
|
336 |
+
}
|
337 |
+
echo "<tr class=\"thead\">\n";
|
338 |
+
echo "<th>".__('No.', 'wp-polls')."</th>\n";
|
339 |
+
echo "<th>".__('User', 'wp-polls')."</th>\n";
|
340 |
+
echo "<th>".__('IP/Host', 'wp-polls')."</th>\n";
|
341 |
+
echo "<th>".__('Date', 'wp-polls')."</th>\n";
|
342 |
+
echo "</tr>\n";
|
343 |
+
$i = 1;
|
344 |
+
}
|
345 |
+
if($i%2 == 0) {
|
346 |
+
$style = 'style=\'background-color: none\'';
|
347 |
+
} else {
|
348 |
+
$style = 'style=\'background-color: #eee\'';
|
349 |
+
}
|
350 |
+
echo "<tr $style>\n";
|
351 |
+
echo "<td>$i</td>\n";
|
352 |
+
echo "<td>$pollip_user</td>\n";
|
353 |
+
echo "<td>$pollip_ip / $pollip_host</td>\n";
|
354 |
+
echo "<td>$pollip_date</td>\n";
|
355 |
+
echo "</tr>\n";
|
356 |
+
$poll_last_aid = $pollip_aid;
|
357 |
+
$i++;
|
358 |
+
$j++;
|
359 |
+
}
|
360 |
+
}
|
361 |
+
echo "<tr class=\"thead\">\n";
|
362 |
+
echo "<td colspan=\"4\">".sprintf(__('Total number of records that matches this filter: <strong>%s</strong>', 'wp-polls'), number_format($j))."</td>";
|
363 |
+
echo "</tr>\n";
|
364 |
+
echo '</table>'."\n";
|
365 |
+
}
|
366 |
+
?>
|
367 |
+
</div>
|
368 |
+
<?php if(!empty($_POST['do'])) { ?>
|
369 |
+
<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>
|
370 |
+
<?php } else { ?>
|
371 |
+
<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>
|
372 |
+
<?php } ?>
|
373 |
+
</div>
|
374 |
+
|
375 |
+
<!-- Delete Poll Logs -->
|
376 |
+
<div class="wrap">
|
377 |
+
<h2><?php _e('Delete Poll Logs', 'wp-polls'); ?></h2>
|
378 |
+
<div align="center" id="poll_logs">
|
379 |
+
<?php if($poll_logs_count) { ?>
|
380 |
+
<strong><?php _e('Are You Sure You Want To Delete Logs For This Poll Only?', 'wp-polls'); ?></strong><br /><br />
|
381 |
+
<input type="checkbox" id="delete_logs_yes" name="delete_logs_yes" value="yes" /> <label for="delete_logs_yes"><?php _e('Yes', 'wp-polls'); ?></label><br /><br />
|
382 |
+
<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_text)); ?>');" />
|
383 |
+
<?php
|
384 |
+
} else {
|
385 |
+
_e('No poll logs available for this poll.', 'wp-polls');
|
386 |
+
}
|
387 |
+
?>
|
388 |
+
</div>
|
389 |
+
<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>
|
390 |
+
</div>
|
polls/polls-manager.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.1 Plugin: WP-Polls 2.
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -35,68 +35,21 @@ $poll_aid = intval($_GET['aid']);
|
|
35 |
if(!empty($_POST['do'])) {
|
36 |
// Decide What To Do
|
37 |
switch($_POST['do']) {
|
38 |
-
// Add Poll
|
39 |
-
case __('Add Poll', 'wp-polls'):
|
40 |
-
// Add Poll Question
|
41 |
-
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
42 |
-
$timestamp_sql = '';
|
43 |
-
$pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
|
44 |
-
$pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
|
45 |
-
$pollq_timestamp_year = intval($_POST['pollq_timestamp_year']);
|
46 |
-
$pollq_timestamp_hour = intval($_POST['pollq_timestamp_hour']);
|
47 |
-
$pollq_timestamp_minute = intval($_POST['pollq_timestamp_minute']);
|
48 |
-
$pollq_timestamp_second = intval($_POST['pollq_timestamp_second']);
|
49 |
-
$pollq_timestamp = gmmktime($pollq_timestamp_hour, $pollq_timestamp_minute, $pollq_timestamp_second, $pollq_timestamp_month, $pollq_timestamp_day, $pollq_timestamp_year);
|
50 |
-
if($pollq_timestamp > current_time('timestamp')) {
|
51 |
-
$pollq_active = -1;
|
52 |
-
} else {
|
53 |
-
$pollq_active = 1;
|
54 |
-
}
|
55 |
-
$pollq_expiry_no = intval($_POST['pollq_expiry_no']);
|
56 |
-
if($pollq_expiry_no == 1) {
|
57 |
-
$pollq_expiry = '';
|
58 |
-
} else {
|
59 |
-
$pollq_expiry_day = intval($_POST['pollq_expiry_day']);
|
60 |
-
$pollq_expiry_month = intval($_POST['pollq_expiry_month']);
|
61 |
-
$pollq_expiry_year = intval($_POST['pollq_expiry_year']);
|
62 |
-
$pollq_expiry_hour = intval($_POST['pollq_expiry_hour']);
|
63 |
-
$pollq_expiry_minute = intval($_POST['pollq_expiry_minute']);
|
64 |
-
$pollq_expiry_second = intval($_POST['pollq_expiry_second']);
|
65 |
-
$pollq_expiry = gmmktime($pollq_expiry_hour, $pollq_expiry_minute, $pollq_expiry_second, $pollq_expiry_month, $pollq_expiry_day, $pollq_expiry_year);
|
66 |
-
if($pollq_expiry <= current_time('timestamp')) {
|
67 |
-
$pollq_active = 0;
|
68 |
-
}
|
69 |
-
}
|
70 |
-
$add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (0, '$pollq_question', '$pollq_timestamp', 0, $pollq_active, '$pollq_expiry')");
|
71 |
-
if(!$add_poll_question) {
|
72 |
-
$text .= '<font color="red">'.sprintf(__('Error In Adding Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</font>';
|
73 |
-
}
|
74 |
-
// Add Poll Answers
|
75 |
-
$polla_answers = $_POST['polla_answers'];
|
76 |
-
$polla_qid = intval($wpdb->insert_id);
|
77 |
-
foreach($polla_answers as $polla_answer) {
|
78 |
-
$polla_answer = addslashes(trim($polla_answer));
|
79 |
-
$add_poll_answers = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $polla_qid, '$polla_answer', 0)");
|
80 |
-
if(!$add_poll_answers) {
|
81 |
-
$text .= '<font color="red">'.sprintf(__('Error In Adding Poll\'s Answer \'%s\'', 'wp-polls'), stripslashes($polla_answer)).'</font>';
|
82 |
-
}
|
83 |
-
}
|
84 |
-
// Update Lastest Poll ID To Poll Options
|
85 |
-
$latest_pollid = polls_latest_id();
|
86 |
-
$update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
|
87 |
-
if(empty($text)) {
|
88 |
-
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Added Successfully', 'wp-polls').'</font>';
|
89 |
-
}
|
90 |
-
break;
|
91 |
// Edit Poll
|
92 |
case __('Edit Poll', 'wp-polls'):
|
93 |
-
//
|
94 |
$pollq_id = intval($_POST['pollq_id']);
|
|
|
95 |
$pollq_totalvotes = intval($_POST['pollq_totalvotes']);
|
|
|
|
|
|
|
96 |
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
|
|
|
|
|
|
97 |
$edit_polltimestamp = intval($_POST['edit_polltimestamp']);
|
98 |
$timestamp_sql = '';
|
99 |
-
$pollq_active = 1;
|
100 |
if($edit_polltimestamp == 1) {
|
101 |
$pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
|
102 |
$pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
|
@@ -110,6 +63,7 @@ if(!empty($_POST['do'])) {
|
|
110 |
$pollq_active = -1;
|
111 |
}
|
112 |
}
|
|
|
113 |
$pollq_expiry_no = intval($_POST['pollq_expiry_no']);
|
114 |
if($pollq_expiry_no == 1) {
|
115 |
$pollq_expiry = '';
|
@@ -130,9 +84,18 @@ if(!empty($_POST['do'])) {
|
|
130 |
}
|
131 |
}
|
132 |
}
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
if(!$edit_poll_question) {
|
135 |
-
$text = '<
|
136 |
}
|
137 |
// Update Polls' Answers
|
138 |
$polla_aids = array();
|
@@ -146,257 +109,103 @@ if(!empty($_POST['do'])) {
|
|
146 |
$polla_votes = intval($_POST['polla_votes-'.$polla_aid]);
|
147 |
$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");
|
148 |
if(!$edit_poll_answer) {
|
149 |
-
$text .= '<
|
|
|
|
|
150 |
}
|
151 |
}
|
152 |
} else {
|
153 |
-
$text .= '<
|
154 |
-
}
|
155 |
-
if(empty($text)) {
|
156 |
-
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Edited Successfully', 'wp-polls').'</font>';
|
157 |
-
}
|
158 |
-
// Update Lastest Poll ID To Poll Options
|
159 |
-
$latest_pollid = polls_latest_id();
|
160 |
-
$update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
|
161 |
-
break;
|
162 |
-
// Open Poll
|
163 |
-
case __('Open Poll', 'wp-polls'):
|
164 |
-
$pollq_id = intval($_POST['pollq_id']);
|
165 |
-
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
166 |
-
$close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_id = $pollq_id;");
|
167 |
-
if($close_poll) {
|
168 |
-
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Is Now Opened', 'wp-polls').'</font>';
|
169 |
-
} else {
|
170 |
-
$text = '<font color="red">'.__('Error Opening Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\'</font>';
|
171 |
-
}
|
172 |
-
break;
|
173 |
-
// Close Poll
|
174 |
-
case __('Close Poll', 'wp-polls'):
|
175 |
-
$pollq_id = intval($_POST['pollq_id']);
|
176 |
-
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
177 |
-
$close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_id = $pollq_id;");
|
178 |
-
if($close_poll) {
|
179 |
-
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Is Now Closed', 'wp-polls').'</font>';
|
180 |
-
} else {
|
181 |
-
$text = '<font color="red">'.__('Error Closing Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\'</font>';
|
182 |
}
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
200 |
}
|
201 |
if(empty($text)) {
|
202 |
-
$text = '<
|
203 |
}
|
204 |
// Update Lastest Poll ID To Poll Options
|
205 |
$latest_pollid = polls_latest_id();
|
206 |
$update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
|
207 |
break;
|
208 |
-
// Add Poll's Answer
|
209 |
-
case __('Add Answer', 'wp-polls'):
|
210 |
-
$polla_qid = intval($_POST['polla_qid']);
|
211 |
-
$polla_answers = addslashes(trim($_POST['polla_answers']));
|
212 |
-
$add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $polla_qid, '$polla_answers', 0)");
|
213 |
-
if(!$add_poll_question) {
|
214 |
-
$text = '<font color="red">'.sprintf(__('Error In Adding Poll Answer \'%s\'', 'wp-polls'), stripslashes($polla_answers)).'</font>';
|
215 |
-
} else {
|
216 |
-
$text = '<font color="green">'.__('Poll Answer', 'wp-polls').' \''.stripslashes($polla_answers).'\' '.__('Added Successfully', 'wp-polls').'</font>';
|
217 |
-
}
|
218 |
-
break;
|
219 |
-
// Delete Polls Logs
|
220 |
-
case __('Delete All Logs', 'wp-polls'):
|
221 |
-
if(trim($_POST['delete_logs_yes']) == 'yes') {
|
222 |
-
$delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip");
|
223 |
-
if($delete_logs) {
|
224 |
-
$text = '<font color="green">'.__('All Polls Logs Have Been Deleted.', 'wp-polls').'</font>';
|
225 |
-
} else {
|
226 |
-
$text = '<font color="red">'.__('An Error Has Occured While Deleting All Polls Logs.', 'wp-polls').'</font>';
|
227 |
-
}
|
228 |
-
}
|
229 |
-
break;
|
230 |
-
// Delete Poll Logs For Individual Poll
|
231 |
-
case __('Delete Logs For This Poll Only', 'wp-polls'):
|
232 |
-
$pollq_id = intval($_POST['pollq_id']);
|
233 |
-
if(trim($_POST['delete_logs_yes']) == 'yes') {
|
234 |
-
$delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
|
235 |
-
if($delete_logs) {
|
236 |
-
$text = '<font color="green">'.__('All Logs For This Poll Have Been Deleted.', 'wp-polls').'</font>';
|
237 |
-
} else {
|
238 |
-
$text = '<font color="red">'.__('An Error Has Occured While Deleting All Logs For This Poll.', 'wp-polls').'</font>';
|
239 |
-
}
|
240 |
-
}
|
241 |
-
break;
|
242 |
-
// Uninstall WP-Polls (By: Philippe Corbes)
|
243 |
-
case __('UNINSTALL Polls', 'wp-polls') :
|
244 |
-
if(trim($_POST['uninstall_poll_yes']) == 'yes') {
|
245 |
-
echo '<div id="message" class="updated fade"><p>';
|
246 |
-
$polls_tables = array($wpdb->pollsq, $wpdb->pollsa, $wpdb->pollsip);
|
247 |
-
foreach($polls_tables as $table) {
|
248 |
-
$wpdb->query("DROP TABLE {$table}");
|
249 |
-
echo '<font color="green">';
|
250 |
-
printf(__('Table "%s" Has Been Dropped.', 'wp-polls'), "<strong><em>{$table}</em></strong>");
|
251 |
-
echo '</font><br />';
|
252 |
-
}
|
253 |
-
$polls_settings = array('poll_template_voteheader', 'poll_template_votebody', 'poll_template_votefooter', 'poll_template_resultheader',
|
254 |
-
'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2',
|
255 |
-
'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll',
|
256 |
-
'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby',
|
257 |
-
'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show',
|
258 |
-
'poll_archive_url', 'poll_bar', 'poll_close');
|
259 |
-
foreach($polls_settings as $setting) {
|
260 |
-
$delete_setting = delete_option($setting);
|
261 |
-
if($delete_setting) {
|
262 |
-
echo '<font color="green">';
|
263 |
-
printf(__('Setting Key \'%s\' Has been Errased.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
|
264 |
-
} else {
|
265 |
-
echo '<font color="red">';
|
266 |
-
printf(__('Error Deleting Setting Key \'%s\'.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
|
267 |
-
}
|
268 |
-
echo '</font><br />';
|
269 |
-
}
|
270 |
-
echo '</p></div>';
|
271 |
-
$mode = 'end-UNINSTALL';
|
272 |
-
}
|
273 |
-
break;
|
274 |
}
|
275 |
}
|
276 |
|
277 |
|
278 |
### Determines Which Mode It Is
|
279 |
switch($mode) {
|
280 |
-
//
|
281 |
-
case '
|
|
|
|
|
282 |
?>
|
283 |
-
|
284 |
-
/* <![CDATA[*/
|
285 |
-
function check_pollexpiry() {
|
286 |
-
poll_expiry = document.getElementById("pollq_expiry_no").checked;
|
287 |
-
if(poll_expiry) {
|
288 |
-
document.getElementById("pollq_expiry").style.display = 'none';
|
289 |
-
} else {
|
290 |
-
document.getElementById("pollq_expiry").style.display = 'block';
|
291 |
-
}
|
292 |
-
}
|
293 |
-
/* ]]> */
|
294 |
-
</script>
|
295 |
-
<div class="wrap">
|
296 |
-
<h2><?php _e('Add Poll', 'wp-polls'); ?></h2>
|
297 |
-
<?php
|
298 |
-
if(isset($_POST['addpollquestion'])) {
|
299 |
-
$poll_noquestion = intval($_POST['poll_noquestion']);
|
300 |
-
$pollq_question = stripslashes(trim($_POST['pollq_question']));
|
301 |
-
?>
|
302 |
-
<form action="<?php echo $base_page; ?>" method="post">
|
303 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
304 |
-
<tr class="thead">
|
305 |
-
<th align="left"><?php _e('Question', 'wp-polls') ?></th>
|
306 |
-
<td><input type="text" size="50" maxlength="200" name="pollq_question" value="<?php echo htmlspecialchars($pollq_question); ?>" /></td>
|
307 |
-
</tr>
|
308 |
-
<?php
|
309 |
-
$count = 0;
|
310 |
-
for($i=1; $i<=$poll_noquestion; $i++) {
|
311 |
-
if($i%2 == 0) {
|
312 |
-
$style = 'style=\'background-color: #eee;\'';
|
313 |
-
} else {
|
314 |
-
$style = 'style=\'background: none;\'';
|
315 |
-
}
|
316 |
-
echo "<tr $style>\n";
|
317 |
-
echo "<th align=\"left\" scope=\"row\">Answers $i:</th>\n";
|
318 |
-
echo "<td><input type=\"text\" size=\"30\" maxlength=\"200\" name=\"polla_answers[]\" /></td>\n";
|
319 |
-
echo "</tr>\n";
|
320 |
-
$count++;
|
321 |
-
}
|
322 |
-
?>
|
323 |
-
<tr style="<?php if($count%2 == 0) { echo 'background: none;'; } else { echo 'background-color: #eee;' ;} $count++; ?>">
|
324 |
-
<th align="left"><?php _e('Start Date/Time:', 'wp-polls') ?></th>
|
325 |
-
<td>
|
326 |
-
<?php
|
327 |
-
poll_timestamp(current_time('timestamp'));
|
328 |
-
?>
|
329 |
-
</td>
|
330 |
-
</tr>
|
331 |
-
<tr style="<?php if($count%2 == 0) { echo 'background: none;'; } else { echo 'background-color: #eee;' ;} ?>">
|
332 |
-
<th valign="top" align="left"><?php _e('End Date/Time:', 'wp-polls') ?></th>
|
333 |
-
<td>
|
334 |
-
<input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" checked="checked" onclick="check_pollexpiry();" /> <label for="pollq_expiry_no"><?php _e('Do NOT Expire This Poll', 'wp-polls'); ?></label>
|
335 |
-
<?php
|
336 |
-
poll_timestamp(current_time('timestamp'), 'pollq_expiry', 'none');
|
337 |
-
?>
|
338 |
-
</td>
|
339 |
-
</tr>
|
340 |
-
<tr>
|
341 |
-
<td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Add Poll', 'wp-polls'); ?>" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
342 |
-
</tr>
|
343 |
-
</table>
|
344 |
-
</form>
|
345 |
-
<?php } else {?>
|
346 |
-
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>&mode=add" method="post">
|
347 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
348 |
-
<tr>
|
349 |
-
<th align="left"><?php _e('Question', 'wp-polls') ?></th>
|
350 |
-
<td><input type="text" size="50" maxlength="200" name="pollq_question" /></td>
|
351 |
-
</tr>
|
352 |
-
<tr>
|
353 |
-
<th align="left"><?php _e('No. Of Answers:', 'wp-polls') ?></th>
|
354 |
-
<td>
|
355 |
-
<select size="1" name="poll_noquestion">
|
356 |
-
<?php
|
357 |
-
for($i=2; $i <= 20; $i++) {
|
358 |
-
echo "<option value=\"$i\">$i</option>";
|
359 |
-
}
|
360 |
-
?>
|
361 |
-
</select>
|
362 |
-
</td>
|
363 |
-
</tr>
|
364 |
-
<tr>
|
365 |
-
<td colspan="2" align="center"><input type="submit" name="addpollquestion" value="<?php _e('Add Question', 'wp-polls'); ?>" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
366 |
-
</tr>
|
367 |
-
</table>
|
368 |
-
</form>
|
369 |
-
<?php } ?>
|
370 |
-
</div>
|
371 |
-
<?php
|
372 |
break;
|
373 |
// Edit A Poll
|
374 |
case 'edit':
|
375 |
-
$poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active, pollq_expiry FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
376 |
$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");
|
|
|
377 |
$poll_question_text = stripslashes($poll_question->pollq_question);
|
378 |
$poll_totalvotes = intval($poll_question->pollq_totalvote);
|
379 |
$poll_timestamp = $poll_question->pollq_timestamp;
|
380 |
$poll_active = intval($poll_question->pollq_active);
|
381 |
$poll_expiry = trim($poll_question->pollq_expiry);
|
|
|
|
|
382 |
?>
|
383 |
<script type="text/javascript">
|
384 |
/* <![CDATA[*/
|
|
|
|
|
385 |
function check_totalvotes() {
|
386 |
-
var total_votes = 0;
|
387 |
var temp_vote = 0;
|
|
|
388 |
<?php
|
389 |
foreach($poll_answers as $poll_answer) {
|
390 |
$polla_aid = intval($poll_answer->polla_aid);
|
391 |
-
echo "\t\t\t\
|
392 |
-
echo "\t\t\t\
|
393 |
-
echo "\t\t\t\
|
394 |
-
echo "\t\t\t\
|
|
|
|
|
|
|
395 |
echo "\t\t\t\t}\n";
|
396 |
-
echo "\t\t\t\ttotal_votes += temp_vote;\n";
|
397 |
}
|
398 |
?>
|
399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
function check_polltimestamp() {
|
402 |
poll_edit_polltimestamp = document.getElementById("edit_polltimestamp").checked;
|
@@ -406,25 +215,112 @@ switch($mode) {
|
|
406 |
document.getElementById("pollq_timestamp").style.display = 'none';
|
407 |
}
|
408 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
/* ]]> */
|
410 |
</script>
|
411 |
-
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"
|
|
|
412 |
<!-- Edit Poll -->
|
|
|
|
|
|
|
413 |
<div class="wrap">
|
414 |
<h2><?php _e('Edit Poll', 'wp-polls'); ?></h2>
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
|
|
|
|
|
|
|
|
427 |
</tr>
|
|
|
|
|
428 |
<?php
|
429 |
$i=1;
|
430 |
$poll_actual_totalvotes = 0;
|
@@ -432,393 +328,232 @@ switch($mode) {
|
|
432 |
$pollip_answers = array();
|
433 |
$pollip_answers[0] = __('Null Votes', 'wp-polls');
|
434 |
foreach($poll_answers as $poll_answer) {
|
|
|
|
|
|
|
|
|
|
|
435 |
$polla_aid = intval($poll_answer->polla_aid);
|
436 |
$polla_answers = stripslashes($poll_answer->polla_answers);
|
437 |
$polla_votes = intval($poll_answer->polla_votes);
|
438 |
$pollip_answers[$polla_aid] = $polla_answers;
|
439 |
-
echo "<tr>\n";
|
440 |
-
echo
|
441 |
-
echo "<
|
442 |
-
echo "<
|
|
|
443 |
$poll_actual_totalvotes += $polla_votes;
|
444 |
$i++;
|
445 |
}
|
446 |
}
|
447 |
?>
|
|
|
|
|
448 |
<tr>
|
449 |
-
<td
|
450 |
-
|
451 |
-
|
452 |
-
<td><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>: <?php echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td>
|
453 |
</tr>
|
454 |
<tr>
|
455 |
-
<td
|
|
|
|
|
456 |
</tr>
|
457 |
-
|
458 |
-
|
459 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
<?php
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
|
|
|
|
465 |
}
|
466 |
?>
|
467 |
-
</
|
468 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
<tr>
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
poll_timestamp(current_time('timestamp'), 'pollq_expiry');
|
476 |
} else {
|
477 |
-
|
478 |
-
}
|
479 |
-
?>
|
480 |
-
<br />
|
481 |
-
</td>
|
482 |
-
</tr>
|
483 |
-
<tr>
|
484 |
-
<td align="center" colspan="2"><input type="submit" name="do" value="<?php _e('Edit Poll', 'wp-polls'); ?>" class="button" />
|
485 |
-
<?php if($poll_active == 1) { ?>
|
486 |
-
<input type="submit" class="button" name="do" value="<?php _e('Close Poll', 'wp-polls'); ?>" alt="test" onclick="return confirm('<?php _e('You Are About To Close This Poll', 'wp-polls'); ?>.')" />
|
487 |
-
<?php } else { ?>
|
488 |
-
<input type="submit" class="button" name="do" value="<?php _e('Open Poll', 'wp-polls'); ?>" onclick="return confirm('<?php _e('You Are About To Open This Poll', 'wp-polls'); ?>.')" />
|
489 |
-
<?php } ?>
|
490 |
-
<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
491 |
-
</tr>
|
492 |
-
</table>
|
493 |
-
</form>
|
494 |
-
</div>
|
495 |
-
<!-- Add Poll's Answer -->
|
496 |
-
<div class="wrap">
|
497 |
-
<h2><?php _e('Add Answer', 'wp-polls') ?></h2>
|
498 |
-
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>&mode=edit&id=<?php echo $poll_id; ?>" method="post">
|
499 |
-
<input type="hidden" name="polla_qid" value="<?php echo $poll_id; ?>" />
|
500 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
501 |
-
<tr>
|
502 |
-
<td><strong><?php _e('Add Answer', 'wp-polls') ?></strong></td>
|
503 |
-
<td><input type="text" size="50" maxlength="200" name="polla_answers" /></td>
|
504 |
-
</tr>
|
505 |
-
<tr>
|
506 |
-
<td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Add Answer', 'wp-polls'); ?>" class="button" /></td>
|
507 |
-
</tr>
|
508 |
-
</table>
|
509 |
-
</form>
|
510 |
-
</div>
|
511 |
-
<!-- Users Voted For This Poll -->
|
512 |
-
<?php
|
513 |
-
$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");
|
514 |
-
?>
|
515 |
-
<div class="wrap">
|
516 |
-
<h2><?php _e('Users Voted For This Poll', 'wp-polls') ?></h2>
|
517 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
518 |
-
<?php
|
519 |
-
if($poll_ips) {
|
520 |
-
$k = 1;
|
521 |
-
$poll_last_aid = -1;
|
522 |
-
foreach($poll_ips as $poll_ip) {
|
523 |
-
$pollip_aid = intval($poll_ip->pollip_aid);
|
524 |
-
$pollip_user = stripslashes($poll_ip->pollip_user);
|
525 |
-
$pollip_ip = $poll_ip->pollip_ip;
|
526 |
-
$pollip_host = $poll_ip->pollip_host;
|
527 |
-
$pollip_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));
|
528 |
-
if($pollip_aid != $poll_last_aid) {
|
529 |
-
if($pollip_aid == 0) {
|
530 |
-
echo "<tr style='background-color: #b8d4ff'>\n<td colspan=\"4\"><strong>$pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
|
531 |
-
} else {
|
532 |
-
echo "<tr style='background-color: #b8d4ff'>\n<td colspan=\"4\"><strong>".__('Answer', 'wp-polls')." $k: $pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
|
533 |
-
$k++;
|
534 |
-
}
|
535 |
-
echo "<tr>\n";
|
536 |
-
echo "<th scope=\"row\">".__('No.', 'wp-polls')."</th>\n";
|
537 |
-
echo "<th scope=\"row\">".__('User', 'wp-polls')."</th>\n";
|
538 |
-
echo "<th scope=\"row\">".__('IP/Host', 'wp-polls')."</th>\n";
|
539 |
-
echo "<th scope=\"row\">".__('Date', 'wp-polls')."</th>\n";
|
540 |
-
echo "</tr>\n";
|
541 |
-
$i = 1;
|
542 |
-
}
|
543 |
-
if($i%2 == 0) {
|
544 |
-
$style = 'style=\'background-color: none\'';
|
545 |
-
} else {
|
546 |
-
$style = 'style=\'background-color: #eee\'';
|
547 |
-
}
|
548 |
-
echo "<tr $style>\n";
|
549 |
-
echo "<td>$i</td>\n";
|
550 |
-
echo "<td>$pollip_user</td>\n";
|
551 |
-
echo "<td>$pollip_ip / $pollip_host</td>\n";
|
552 |
-
echo "<td>$pollip_date</td>\n";
|
553 |
-
echo "</tr>\n";
|
554 |
-
$poll_last_aid = $pollip_aid;
|
555 |
-
$i++;
|
556 |
}
|
557 |
-
|
558 |
-
|
559 |
-
}
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
568 |
-
<input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
|
569 |
-
<strong><?php _e('Are You Sure You Want To Delete Logs For This Poll Only?', 'wp-polls'); ?></strong><br /><br />
|
570 |
-
<input type="checkbox" name="delete_logs_yes" value="yes" /> <?php _e('Yes', 'wp-polls'); ?><br /><br />
|
571 |
-
<input type="submit" name="do" value="<?php _e('Delete Logs For This Poll Only', 'wp-polls'); ?>" class="button" onclick="return confirm('<?php _e('You Are About To Delete Logs For This Poll Only.', 'wp-polls'); ?>\n\n<?php _e('This Action Is Not Reversible. Are you sure?', 'wp-polls'); ?>')" />
|
572 |
-
</form>
|
573 |
-
</div>
|
574 |
-
<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>
|
575 |
-
</div>
|
576 |
-
<?php
|
577 |
-
break;
|
578 |
-
// Delete A Poll
|
579 |
-
case 'delete':
|
580 |
-
$poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active, pollq_expiry FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
581 |
-
$poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY polla_answers");
|
582 |
-
$poll_question_text = stripslashes($poll_question->pollq_question);
|
583 |
-
$poll_totalvotes = intval($poll_question->pollq_totalvotes);
|
584 |
-
$poll_active = intval($poll_question->pollq_active);
|
585 |
-
$poll_timestamp = $poll_question->pollq_timestamp;
|
586 |
-
$poll_expiry = trim($poll_question->pollq_expiry);
|
587 |
-
?>
|
588 |
-
<!-- Delete Poll -->
|
589 |
-
<div class="wrap">
|
590 |
-
<h2><?php _e('Delete Poll', 'wp-polls') ?></h2>
|
591 |
-
<form action="<?php echo $base_page; ?>" method="post">
|
592 |
-
<input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
|
593 |
-
<input type="hidden" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" />
|
594 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
595 |
-
<tr>
|
596 |
-
<th colspan="2"><?php _e('Question', 'wp-polls') ?></th>
|
597 |
-
</tr>
|
598 |
-
<tr>
|
599 |
-
<td colspan="2" align="center"><?php echo $poll_question_text; ?></td>
|
600 |
-
</tr>
|
601 |
-
<tr>
|
602 |
-
<th align="left"><?php _e('Answers', 'wp-polls') ?></th>
|
603 |
-
<th><?php _e('No. Of Votes', 'wp-polls') ?></th>
|
604 |
-
</tr>
|
605 |
-
<?php
|
606 |
-
$i=1;
|
607 |
-
if($poll_answers) {
|
608 |
-
foreach($poll_answers as $poll_answer) {
|
609 |
-
$polla_answers = stripslashes($poll_answer->polla_answers);
|
610 |
-
$polla_votes = intval($poll_answer->polla_votes);
|
611 |
-
echo "<tr>\n";
|
612 |
-
echo "<td>".__('Answer', 'wp-polls')." $i: $polla_answers</td>\n";
|
613 |
-
echo "<td align=\"center\">$polla_votes</td>\n</tr>\n";
|
614 |
-
$i++;
|
615 |
}
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
} elseif($poll_active == -1) {
|
628 |
-
_e('Future', 'wp-polls');
|
629 |
-
} else {
|
630 |
-
_e('Closed', 'wp-polls');
|
631 |
-
}
|
632 |
-
?>
|
633 |
-
</td>
|
634 |
-
</tr>
|
635 |
-
<tr>
|
636 |
-
<td colspan="2"><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>: <?php echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td>
|
637 |
-
</tr>
|
638 |
-
<tr>
|
639 |
-
<td colspan="2"><strong><?php _e('End Date/Time', 'wp-polls'); ?></strong>:
|
640 |
-
<?php
|
641 |
-
if(empty($poll_expiry)) {
|
642 |
-
_e('This Poll Will Not Expire', 'wp-polls');
|
643 |
-
} else {
|
644 |
-
echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
645 |
-
}
|
646 |
-
?>
|
647 |
-
</td>
|
648 |
-
</tr>
|
649 |
-
<tr>
|
650 |
-
<td align="center" colspan="2"><br /><p><strong><?php _e('You Are About To Delete This Poll', 'wp-polls'); ?> '<?php echo $poll_question_text; ?>'</strong></p>
|
651 |
-
<input type="submit" class="button" name="do" value="<?php _e('Delete Poll', 'wp-polls'); ?>" onclick="return confirm('<?php _e('You Are About To Delete This Poll', 'wp-polls'); ?>.\n\n<?php _e('This Action Is Not Reversible. Are you sure?', 'wp-polls'); ?>')" />
|
652 |
-
<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
653 |
-
</tr>
|
654 |
-
</table>
|
655 |
-
</form>
|
656 |
-
</div>
|
657 |
-
<?php
|
658 |
-
break;
|
659 |
-
// Delete A Poll Answer
|
660 |
-
case 'deleteans':
|
661 |
-
$poll_answers = $wpdb->get_row("SELECT polla_votes, polla_answers FROM $wpdb->pollsa WHERE polla_aid = $poll_aid AND polla_qid = $poll_id");
|
662 |
-
$polla_votes = intval($poll_answers->polla_votes);
|
663 |
-
$polla_answers = stripslashes(trim($poll_answers->polla_answers));
|
664 |
-
$delete_polla_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_aid = $poll_aid AND polla_qid = $poll_id");
|
665 |
-
$delete_pollip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_aid = $poll_aid");
|
666 |
-
$update_pollq_totalvotes = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes-$polla_votes) WHERE pollq_id=$poll_id");
|
667 |
-
?>
|
668 |
-
<!-- Delete Poll's Answer -->
|
669 |
-
<div class="wrap">
|
670 |
-
<h2><?php _e('Delete Poll\'s Answer', 'wp-polls') ?></h2>
|
671 |
-
<?php
|
672 |
-
if($delete_polla_answers) {
|
673 |
-
echo "<font color=\"green\">".__('Poll Answer', 'wp-polls')." '$polla_answers' ".__('Deleted Successfully', 'wp-polls')."</font>";
|
674 |
-
} else {
|
675 |
-
echo "<font color=\"red\">".__('Error In Deleting Poll Answer', 'wp-polls')." '$polla_answers'</font>";
|
676 |
-
}
|
677 |
-
if($update_pollq_totalvotes) {
|
678 |
-
echo "<br /><font color=\"green\">".__('Poll Question\'s Total Votes Updated Successfully', 'wp-polls')."</font>";
|
679 |
-
} else {
|
680 |
-
echo "<br /><font color=\"blue\">".__('No Changes Have Been Made To The Poll\'s Total Votes', 'wp-polls')."</font>";
|
681 |
-
}
|
682 |
-
if($delete_pollip) {
|
683 |
-
echo "<br /><font color=\"green\">".__('Poll IP Logs Updated Successfully', 'wp-polls')."</font>";
|
684 |
} else {
|
685 |
-
|
|
|
686 |
}
|
687 |
?>
|
688 |
-
|
|
|
|
|
|
|
689 |
</div>
|
|
|
690 |
<?php
|
691 |
break;
|
692 |
-
// Deactivating WP-Polls (By: Philippe Corbes)
|
693 |
-
case 'end-UNINSTALL':
|
694 |
-
echo '<div class="wrap">';
|
695 |
-
echo '<h2>'; _e('Uninstall Polls', 'wp-polls'); echo'</h2>';
|
696 |
-
echo '<p><strong>';
|
697 |
-
$deactivate_url = "plugins.php?action=deactivate&plugin=polls/polls.php";
|
698 |
-
if(function_exists('wp_nonce_url')) {
|
699 |
-
$deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_polls/polls.php');
|
700 |
-
}
|
701 |
-
printf(__('<a href="%s">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically.', 'wp-polls'), $deactivate_url);
|
702 |
-
echo '</a>';
|
703 |
-
echo '</strong></p>';
|
704 |
-
echo '</div>';
|
705 |
-
break;
|
706 |
// Main Page
|
707 |
default:
|
708 |
$polls = $wpdb->get_results("SELECT * FROM $wpdb->pollsq ORDER BY pollq_timestamp DESC");
|
709 |
$total_ans = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->pollsa");
|
710 |
$total_votes = 0;
|
|
|
711 |
?>
|
712 |
-
|
|
|
|
|
713 |
<!-- Manage Polls -->
|
714 |
<div class="wrap">
|
715 |
<h2><?php _e('Manage Polls', 'wp-polls'); ?></h2>
|
716 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
717 |
-
<
|
718 |
-
<
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
$
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
$poll_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp));
|
735 |
-
$poll_totalvotes = intval($poll->pollq_totalvotes);
|
736 |
-
$poll_active = intval($poll->pollq_active);
|
737 |
-
$poll_expiry = trim($poll->pollq_expiry);
|
738 |
-
if(empty($poll_expiry)) {
|
739 |
-
$poll_expiry_text = __('No Expiry', 'wp-polls');
|
740 |
} else {
|
741 |
-
$
|
742 |
}
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
751 |
}
|
752 |
-
|
753 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
754 |
$style = 'style=\'background-color: #b8d4ff;\'';
|
755 |
}
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
763 |
}
|
764 |
-
|
765 |
-
|
766 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
768 |
}
|
769 |
-
|
770 |
-
echo
|
771 |
-
echo "<td>$poll_date</td>\n";
|
772 |
-
echo "<td>$poll_expiry_text</td>\n";
|
773 |
-
echo '<td>';
|
774 |
-
if($poll_active == 1) {
|
775 |
-
_e('Open', 'wp-polls');
|
776 |
-
} elseif($poll_active == -1) {
|
777 |
-
_e('Future', 'wp-polls');
|
778 |
-
} else {
|
779 |
-
_e('Closed', 'wp-polls');
|
780 |
-
}
|
781 |
-
echo "</td>\n";
|
782 |
-
echo "<td><a href=\"$base_page&mode=edit&id=$poll_id\" class=\"edit\">".__('Edit')."</a></td>\n";
|
783 |
-
echo "<td><a href=\"$base_page&mode=delete&id=$poll_id\" class=\"delete\">".__('Delete')."</a></td>\n";
|
784 |
-
echo '</tr>';
|
785 |
-
$i++;
|
786 |
-
$total_votes+= $poll_totalvotes;
|
787 |
-
|
788 |
}
|
789 |
-
|
790 |
-
|
791 |
-
}
|
792 |
-
?>
|
793 |
</table>
|
794 |
</div>
|
795 |
-
<!-- Add A Poll -->
|
796 |
-
<div class="wrap">
|
797 |
-
<h2><?php _e('Add A Poll', 'wp-polls'); ?></h2>
|
798 |
-
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>&mode=add" method="post">
|
799 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
800 |
-
<tr>
|
801 |
-
<th align="left"><?php _e('Question', 'wp-polls') ?></th>
|
802 |
-
<td><input type="text" size="50" maxlength="200" name="pollq_question" /></td>
|
803 |
-
</tr>
|
804 |
-
<tr>
|
805 |
-
<th align="left"><?php _e('No. Of Answers:', 'wp-polls') ?></th>
|
806 |
-
<td>
|
807 |
-
<select size="1" name="poll_noquestion">
|
808 |
-
<?php
|
809 |
-
for($k=2; $k <= 20; $k++) {
|
810 |
-
echo "<option value=\"$k\">$k</option>";
|
811 |
-
}
|
812 |
-
?>
|
813 |
-
</select>
|
814 |
-
</td>
|
815 |
-
</tr>
|
816 |
-
<tr>
|
817 |
-
<td colspan="2" align="center"><input type="submit" name="addpollquestion" value="<?php _e('Add Question', 'wp-polls'); ?>" class="button" /></td>
|
818 |
-
</tr>
|
819 |
-
</table>
|
820 |
-
</form>
|
821 |
-
</div>
|
822 |
<!-- Polls Stats -->
|
823 |
<div class="wrap">
|
824 |
<h2><?php _e('Polls Stats', 'wp-polls'); ?></h2>
|
@@ -835,37 +570,31 @@ switch($mode) {
|
|
835 |
<th align="left"><?php _e('Total Votes Casted:', 'wp-polls'); ?></th>
|
836 |
<td align="left"><?php echo number_format($total_votes); ?></td>
|
837 |
</tr>
|
|
|
|
|
|
|
|
|
838 |
</table>
|
839 |
</div>
|
840 |
<!-- Delete Polls Logs -->
|
841 |
<div class="wrap">
|
842 |
<h2><?php _e('Polls Logs', 'wp-polls'); ?></h2>
|
843 |
-
<div align="center">
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
</div>
|
850 |
<p style="text-align: left;"><?php _e('Note:<br />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>
|
851 |
</div>
|
852 |
-
<!-- Uninstall WP-Polls (By: Philippe Corbes) -->
|
853 |
-
<div class="wrap">
|
854 |
-
<h2><?php _e('Uninstall Polls', 'wp-polls'); ?></h2>
|
855 |
-
<div align="center">
|
856 |
-
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
857 |
-
<p style="text-align: left;">
|
858 |
-
<?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'); ?>
|
859 |
-
</p>
|
860 |
-
<p style="text-align: left; color: red">
|
861 |
-
<?php
|
862 |
-
vprintf(__('<strong>WARNING:</strong><br />Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first. Your data is stored in the %1$s, %2$s, %3$s and %4$s tables.', 'wp-polls'), array("<strong><em>{$wpdb->pollsq}</em></strong>", "<strong><em>{$wpdb->pollsa}</em></strong>", "<strong><em>{$wpdb->pollsip}</em></strong>", "<strong><em>{$wpdb->options}</em></strong>")); ?>
|
863 |
-
</p>
|
864 |
-
<input type="checkbox" name="uninstall_poll_yes" value="yes" /> <?php _e('Yes', 'wp-polls'); ?><br /><br />
|
865 |
-
<input type="submit" name="do" value="<?php _e('UNINSTALL 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'); ?>')" />
|
866 |
-
</form>
|
867 |
-
</div>
|
868 |
-
</div>
|
869 |
<?php
|
870 |
} // End switch($mode)
|
871 |
?>
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
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']);
|
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 = '';
|
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();
|
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 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
147 |
}
|
148 |
|
149 |
|
150 |
### Determines Which Mode It Is
|
151 |
switch($mode) {
|
152 |
+
// Poll Logging
|
153 |
+
case 'logs':
|
154 |
+
require('polls-logs.php');
|
155 |
+
break;
|
156 |
?>
|
157 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
break;
|
159 |
// Edit A Poll
|
160 |
case 'edit':
|
161 |
+
$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");
|
162 |
$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");
|
163 |
+
$poll_noquestion = $wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa WHERE polla_qid = $poll_id");
|
164 |
$poll_question_text = stripslashes($poll_question->pollq_question);
|
165 |
$poll_totalvotes = intval($poll_question->pollq_totalvote);
|
166 |
$poll_timestamp = $poll_question->pollq_timestamp;
|
167 |
$poll_active = intval($poll_question->pollq_active);
|
168 |
$poll_expiry = trim($poll_question->pollq_expiry);
|
169 |
+
$poll_multiple = intval($poll_question->pollq_multiple);
|
170 |
+
$poll_totalvoters = intval($poll_question->pollq_totalvoters);
|
171 |
?>
|
172 |
<script type="text/javascript">
|
173 |
/* <![CDATA[*/
|
174 |
+
var total_votes = 0;
|
175 |
+
var total_new_votes = 0;
|
176 |
function check_totalvotes() {
|
|
|
177 |
var temp_vote = 0;
|
178 |
+
total_votes = 0;
|
179 |
<?php
|
180 |
foreach($poll_answers as $poll_answer) {
|
181 |
$polla_aid = intval($poll_answer->polla_aid);
|
182 |
+
echo "\t\t\t\tif(document.getElementById('polla_votes-$polla_aid')) {\n";
|
183 |
+
echo "\t\t\t\t\ttemp_vote = parseInt(document.getElementById('polla_votes-$polla_aid').value);\n";
|
184 |
+
echo "\t\t\t\t\tif(isNaN(temp_vote)) {\n";
|
185 |
+
echo "\t\t\t\t\t\tdocument.getElementById('polla_votes-$polla_aid').value = 0;\n";
|
186 |
+
echo "\t\t\t\t\t\ttemp_vote = 0;\n";
|
187 |
+
echo "\t\t\t\t\t}\n";
|
188 |
+
echo "\t\t\t\t\ttotal_votes += temp_vote;\n";
|
189 |
echo "\t\t\t\t}\n";
|
|
|
190 |
}
|
191 |
?>
|
192 |
+
totalvotes();
|
193 |
+
}
|
194 |
+
function check_totalvotes_new() {
|
195 |
+
var new_votes = document.getElementsByName("polla_answers_new_votes[]");
|
196 |
+
var temp_new_vote = 0;
|
197 |
+
total_new_votes = 0;
|
198 |
+
for(i = 0; i < new_votes.length; i++) {
|
199 |
+
temp_new_vote = parseInt(new_votes[i].value);
|
200 |
+
if(isNaN(temp_new_vote)) {
|
201 |
+
temp_new_vote = 0;
|
202 |
+
}
|
203 |
+
total_new_votes += temp_new_vote;
|
204 |
+
}
|
205 |
+
totalvotes();
|
206 |
+
}
|
207 |
+
function totalvotes() {
|
208 |
+
document.getElementById('pollq_totalvotes').value = (parseInt(total_votes) + parseInt(total_new_votes));
|
209 |
}
|
210 |
function check_polltimestamp() {
|
211 |
poll_edit_polltimestamp = document.getElementById("edit_polltimestamp").checked;
|
215 |
document.getElementById("pollq_timestamp").style.display = 'none';
|
216 |
}
|
217 |
}
|
218 |
+
function check_pollexpiry() {
|
219 |
+
pollq_expiry_no = document.getElementById("pollq_expiry_no").checked;
|
220 |
+
if(pollq_expiry_no) {
|
221 |
+
document.getElementById("pollq_expiry_timestamp").style.display = 'none';
|
222 |
+
} else {
|
223 |
+
document.getElementById("pollq_expiry_timestamp").style.display = 'block';
|
224 |
+
}
|
225 |
+
}
|
226 |
+
var count_poll_answer = <?php echo $poll_noquestion; ?>;
|
227 |
+
var count_poll_answer_new = 0;
|
228 |
+
function create_poll_answer() {
|
229 |
+
// Create Elements
|
230 |
+
var poll_tr = document.createElement("tr");
|
231 |
+
var poll_td1 = document.createElement("td");
|
232 |
+
var poll_td2 = document.createElement("td");
|
233 |
+
var poll_td3 = document.createElement("td");
|
234 |
+
var poll_answer = document.createElement("input");
|
235 |
+
var poll_votes = document.createElement("input");
|
236 |
+
var poll_answer_count = document.createTextNode("<?php _e('Answer', 'wp-polls'); ?> " + (count_poll_answer+1) + ":");
|
237 |
+
var poll_votes_count = document.createTextNode("0 ");
|
238 |
+
var poll_answer_bold = document.createElement("strong");
|
239 |
+
var poll_option = document.createElement("option");
|
240 |
+
var poll_option_text = document.createTextNode((count_poll_answer+1));
|
241 |
+
count_poll_answer++;
|
242 |
+
count_poll_answer_new++;
|
243 |
+
// Elements - Input
|
244 |
+
poll_answer.setAttribute('type', "text");
|
245 |
+
poll_answer.setAttribute('name', "polla_answers_new[]");
|
246 |
+
poll_answer.setAttribute('size', "50");
|
247 |
+
poll_votes.setAttribute('type', "text");
|
248 |
+
poll_votes.setAttribute('name', "polla_answers_new_votes[]")
|
249 |
+
poll_votes.setAttribute('size', "4");
|
250 |
+
poll_votes.setAttribute('value', "0");
|
251 |
+
poll_votes.setAttribute('onblur', "check_totalvotes_new();");
|
252 |
+
// Elements - Options
|
253 |
+
poll_option.setAttribute('value', count_poll_answer);
|
254 |
+
poll_option.setAttribute('id', "pollq-multiple-" + (count_poll_answer+1));
|
255 |
+
// Elements - TD/TR
|
256 |
+
if(count_poll_answer%2 != 0) { poll_tr.style.background = "#eee"; }
|
257 |
+
poll_tr.setAttribute('id', "poll-answer-new-" + count_poll_answer_new);
|
258 |
+
poll_td1.setAttribute('width', "20%");
|
259 |
+
poll_td2.setAttribute('width', "60%");
|
260 |
+
poll_td3.setAttribute('width', "10%");
|
261 |
+
poll_td3.setAttribute('align', "right");
|
262 |
+
// Appending To Elements
|
263 |
+
poll_tr.appendChild(poll_td1);
|
264 |
+
poll_tr.appendChild(poll_td2);
|
265 |
+
poll_tr.appendChild(poll_td3);
|
266 |
+
poll_answer_bold.appendChild(poll_answer_count);
|
267 |
+
poll_td1.appendChild(poll_answer_bold);
|
268 |
+
poll_td2.appendChild(poll_answer);
|
269 |
+
poll_td3.appendChild(poll_votes_count);
|
270 |
+
poll_td3.appendChild(poll_votes);
|
271 |
+
poll_option.appendChild(poll_option_text);
|
272 |
+
document.getElementById("poll_answers").appendChild(poll_tr);
|
273 |
+
document.getElementById("pollq_multiple").appendChild(poll_option);
|
274 |
+
}
|
275 |
+
function remove_poll_answer() {
|
276 |
+
if(count_poll_answer_new == 0) {
|
277 |
+
alert("<?php _e('No more poll\'s answer to be removed.', 'wp-polls'); ?>");
|
278 |
+
} else {
|
279 |
+
document.getElementById("poll_answers").removeChild(document.getElementById("poll-answer-new-" + count_poll_answer_new));
|
280 |
+
document.getElementById("pollq_multiple").removeChild(document.getElementById("pollq-multiple-" + (count_poll_answer+1)));
|
281 |
+
document.getElementById("pollq_multiple").value = count_poll_answer;
|
282 |
+
count_poll_answer--;
|
283 |
+
count_poll_answer_new--;
|
284 |
+
check_totalvotes_new();
|
285 |
+
}
|
286 |
+
}
|
287 |
+
function check_pollq_multiple() {
|
288 |
+
if(parseInt(document.getElementById("pollq_multiple_yes").value) == 1) {
|
289 |
+
document.getElementById("pollq_multiple").disabled = false;
|
290 |
+
} else {
|
291 |
+
document.getElementById("pollq_multiple").value = 1;
|
292 |
+
document.getElementById("pollq_multiple").disabled = true;
|
293 |
+
}
|
294 |
+
}
|
295 |
/* ]]> */
|
296 |
</script>
|
297 |
+
<?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>'; } ?>
|
298 |
+
|
299 |
<!-- Edit Poll -->
|
300 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
301 |
+
<input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
|
302 |
+
<input type="hidden" name="pollq_active" value="<?php echo $poll_active; ?>" />
|
303 |
<div class="wrap">
|
304 |
<h2><?php _e('Edit Poll', 'wp-polls'); ?></h2>
|
305 |
+
<!-- Poll Question -->
|
306 |
+
<h3><?php _e('Poll Question', 'wp-polls'); ?></h3>
|
307 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
308 |
+
<tr style="background-color: #eee;">
|
309 |
+
<td width="20%"><strong><?php _e('Question', 'wp-polls') ?></strong></td>
|
310 |
+
<td width="80%"><input type="text" size="70" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" /></td>
|
311 |
+
</tr>
|
312 |
+
</table>
|
313 |
+
<!-- Poll Answers -->
|
314 |
+
<h3><?php _e('Poll Answers', 'wp-polls'); ?></h3>
|
315 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
316 |
+
<thead>
|
317 |
+
<tr class="thead">
|
318 |
+
<td width="20%"><strong><?php _e('Answer No.:', 'wp-polls') ?></strong></td>
|
319 |
+
<td width="60%"><strong><?php _e('Answer Text:', 'wp-polls') ?></strong></td>
|
320 |
+
<td width="20%" align="right"><strong><?php _e('No. Of Votes', 'wp-polls') ?></strong></td>
|
321 |
</tr>
|
322 |
+
</thead>
|
323 |
+
<tbody id="poll_answers">
|
324 |
<?php
|
325 |
$i=1;
|
326 |
$poll_actual_totalvotes = 0;
|
328 |
$pollip_answers = array();
|
329 |
$pollip_answers[0] = __('Null Votes', 'wp-polls');
|
330 |
foreach($poll_answers as $poll_answer) {
|
331 |
+
if($i%2 == 0) {
|
332 |
+
$style = 'style=\'background: none;\'';
|
333 |
+
} else {
|
334 |
+
$style = 'style=\'background-color: #eee;\'';
|
335 |
+
}
|
336 |
$polla_aid = intval($poll_answer->polla_aid);
|
337 |
$polla_answers = stripslashes($poll_answer->polla_answers);
|
338 |
$polla_votes = intval($poll_answer->polla_votes);
|
339 |
$pollip_answers[$polla_aid] = $polla_answers;
|
340 |
+
echo "<tr id=\"poll-answer-$polla_aid\" $style>\n";
|
341 |
+
echo '<td width="20%"><strong>'.sprintf(__('Answer %s:', 'wp-polls'), $i).'</strong></td>'."\n";
|
342 |
+
echo "<td width=\"60%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_aid-$polla_aid\" value=\"".htmlspecialchars($polla_answers)."\" /> ";
|
343 |
+
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')), htmlspecialchars($polla_answers))."');\" class=\"button\" /></td>\n";
|
344 |
+
echo "<td width=\"20%\" align=\"right\">$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";
|
345 |
$poll_actual_totalvotes += $polla_votes;
|
346 |
$i++;
|
347 |
}
|
348 |
}
|
349 |
?>
|
350 |
+
</tbody>
|
351 |
+
<tbody>
|
352 |
<tr>
|
353 |
+
<td width="20%"> </td>
|
354 |
+
<td width="60%"><input type="button" value="<?php _e('Add Answer', 'wp-polls') ?>" onclick="create_poll_answer();" class="button" /> <input type="button" value="<?php _e('Remove Answer', 'wp-polls') ?>" onclick="remove_poll_answer();" class="button" /></td>
|
355 |
+
<td width="20%" align="right"><strong><?php _e('Total Votes:', 'wp-polls'); ?></strong><strong id="poll_total_votes"><?php echo $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>
|
|
|
356 |
</tr>
|
357 |
<tr>
|
358 |
+
<td width="20%"> </td>
|
359 |
+
<td width="60%"> </td>
|
360 |
+
<td width="20%" align="right"><strong><?php _e('Total Voters:', 'wp-polls'); ?><?php echo $poll_totalvoters; ?></strong> <input type="text" size="4" name="pollq_totalvoters" value="<?php echo $poll_totalvoters; ?>" /></td>
|
361 |
</tr>
|
362 |
+
</tbody>
|
363 |
+
</table>
|
364 |
+
<!-- Poll Multiple Answers -->
|
365 |
+
<h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3>
|
366 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
367 |
+
<tr style="background-color: #eee;">
|
368 |
+
<td width="40%" valign="top"><strong><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></strong></td>
|
369 |
+
<td width="60%">
|
370 |
+
<select name="pollq_multiple_yes" id="pollq_multiple_yes" size="1" onchange="check_pollq_multiple();">
|
371 |
+
<option value="0"<?php selected('0', $poll_multiple); ?>><?php _e('No', 'wp-polls'); ?></option>
|
372 |
+
<option value="1"<?php if($poll_multiple > 0) { echo ' selected="selected"'; } ?>><?php _e('Yes', 'wp-polls'); ?></option>
|
373 |
+
</select>
|
374 |
+
</td>
|
375 |
+
</tr>
|
376 |
+
<tr>
|
377 |
+
<td width="40%" valign="top"><strong><?php _e('Maximum Number Of Selected Answers Allowed?', 'wp-polls') ?></strong></td>
|
378 |
+
<td width="60%">
|
379 |
+
<select name="pollq_multiple" id="pollq_multiple" size="1" <?php if($poll_multiple == 0) { echo 'disabled="true"'; } ?>>
|
380 |
<?php
|
381 |
+
for($i = 1; $i <= $poll_noquestion; $i++) {
|
382 |
+
if($poll_multiple > 0 && $poll_multiple == $i) {
|
383 |
+
echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
384 |
+
} else {
|
385 |
+
echo "<option value=\"$i\">$i</option>\n";
|
386 |
+
}
|
387 |
}
|
388 |
?>
|
389 |
+
</select>
|
390 |
+
</td>
|
391 |
+
</tr>
|
392 |
+
</table>
|
393 |
+
<!-- Poll Start/End Date -->
|
394 |
+
<h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3>
|
395 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
396 |
+
<tr style="background-color: #eee;">
|
397 |
+
<td width="20%" valign="top"><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>:</td>
|
398 |
+
<td width="80%">
|
399 |
+
<?php echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?><br />
|
400 |
+
<input type="checkbox" name="edit_polltimestamp" id="edit_polltimestamp" value="1" onclick="check_polltimestamp()" /> <label for="edit_polltimestamp"><?php _e('Edit Start Date/Time', 'wp-polls'); ?></label><br />
|
401 |
+
<?php poll_timestamp($poll_timestamp, 'pollq_timestamp', 'none'); ?>
|
402 |
+
</td>
|
403 |
+
</tr>
|
404 |
<tr>
|
405 |
+
<td width="20%" valign="top"><strong><?php _e('End Date/Time', 'wp-polls'); ?></strong>:</td>
|
406 |
+
<td width="80%">
|
407 |
+
<?php
|
408 |
+
if(empty($poll_expiry)) {
|
409 |
+
_e('This Poll Will Not Expire', 'wp-polls');
|
|
|
410 |
} else {
|
411 |
+
echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
}
|
413 |
+
?>
|
414 |
+
<br />
|
415 |
+
<input type="checkbox" name="pollq_expiry_no" id="pollq_expiry_no" value="1" onclick="check_pollexpiry();" <?php if(empty($poll_expiry)) { echo 'checked="checked"'; } ?> />
|
416 |
+
<label for="pollq_expiry_no"><?php _e('Do NOT Expire This Poll', 'wp-polls'); ?></label><br />
|
417 |
+
<div id="pollq_expiry_timestamp" style="display: <?php if(empty($poll_expiry)) { echo 'none'; } else { echo 'block'; } ?>;">
|
418 |
+
<?php
|
419 |
+
if(empty($poll_expiry)) {
|
420 |
+
poll_timestamp(current_time('timestamp'), 'pollq_expiry');
|
421 |
+
} else {
|
422 |
+
poll_timestamp($poll_expiry, 'pollq_expiry');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
}
|
424 |
+
?>
|
425 |
+
</div>
|
426 |
+
</td>
|
427 |
+
</tr>
|
428 |
+
</table>
|
429 |
+
<p style="text-align: center;">
|
430 |
+
<input type="submit" name="do" value="<?php _e('Edit Poll', 'wp-polls'); ?>" class="button" />
|
431 |
+
<?php
|
432 |
+
if($poll_active == 1) {
|
433 |
+
$poll_open_display = 'none';
|
434 |
+
$poll_close_display = 'inline';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
} else {
|
436 |
+
$poll_open_display = 'inline';
|
437 |
+
$poll_close_display = 'none';
|
438 |
}
|
439 |
?>
|
440 |
+
<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($poll_question_text)); ?>');" style="display: <?php echo $poll_close_display; ?>;" />
|
441 |
+
<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($poll_question_text)); ?>');" style="display: <?php echo $poll_open_display; ?>;" />
|
442 |
+
<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" />
|
443 |
+
</p>
|
444 |
</div>
|
445 |
+
</form>
|
446 |
<?php
|
447 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
// Main Page
|
449 |
default:
|
450 |
$polls = $wpdb->get_results("SELECT * FROM $wpdb->pollsq ORDER BY pollq_timestamp DESC");
|
451 |
$total_ans = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->pollsa");
|
452 |
$total_votes = 0;
|
453 |
+
$total_voters = 0;
|
454 |
?>
|
455 |
+
<!-- Last Action -->
|
456 |
+
<div id="message" class="updated" style="display: none;"></div>
|
457 |
+
|
458 |
<!-- Manage Polls -->
|
459 |
<div class="wrap">
|
460 |
<h2><?php _e('Manage Polls', 'wp-polls'); ?></h2>
|
461 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
462 |
+
<thead>
|
463 |
+
<tr class="thead">
|
464 |
+
<th><?php _e('ID', 'wp-polls'); ?></th>
|
465 |
+
<th><?php _e('Question', 'wp-polls'); ?></th>
|
466 |
+
<th><?php _e('Total Voters', 'wp-polls'); ?></th>
|
467 |
+
<th><?php _e('Start Date/Time', 'wp-polls'); ?></th>
|
468 |
+
<th><?php _e('End Date/Time', 'wp-polls'); ?></th>
|
469 |
+
<th><?php _e('Status', 'wp-polls'); ?></th>
|
470 |
+
<th colspan="3"><?php _e('Action', 'wp-polls'); ?></th>
|
471 |
+
</tr>
|
472 |
+
</thead>
|
473 |
+
<tbody id="manage_polls">
|
474 |
+
<?php
|
475 |
+
if($polls) {
|
476 |
+
if(function_exists('dynamic_sidebar')) {
|
477 |
+
$options = get_option('widget_polls');
|
478 |
+
$multiple_polls = explode(',', $options['multiple_polls']);
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
} else {
|
480 |
+
$multiple_polls = array();
|
481 |
}
|
482 |
+
$i = 0;
|
483 |
+
$current_poll = intval(get_option('poll_currentpoll'));
|
484 |
+
$latest_poll = intval(get_option('poll_latestpoll'));
|
485 |
+
foreach($polls as $poll) {
|
486 |
+
$poll_id = intval($poll->pollq_id);
|
487 |
+
$poll_question = stripslashes($poll->pollq_question);
|
488 |
+
$poll_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp));
|
489 |
+
$poll_totalvotes = intval($poll->pollq_totalvotes);
|
490 |
+
$poll_totalvoters = intval($poll->pollq_totalvoters);
|
491 |
+
$poll_active = intval($poll->pollq_active);
|
492 |
+
$poll_expiry = trim($poll->pollq_expiry);
|
493 |
+
if(empty($poll_expiry)) {
|
494 |
+
$poll_expiry_text = __('No Expiry', 'wp-polls');
|
495 |
+
} else {
|
496 |
+
$poll_expiry_text = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
497 |
+
}
|
498 |
+
if($i%2 == 0) {
|
499 |
+
$style = 'style=\'background-color: #eee;\'';
|
500 |
+
} else {
|
501 |
+
$style = 'style=\'background: none;\'';
|
502 |
}
|
503 |
+
if($current_poll > 0) {
|
504 |
+
if($current_poll == $poll_id) {
|
505 |
+
$style = 'style=\'background-color: #b8d4ff;\'';
|
506 |
+
}
|
507 |
+
} elseif($current_poll == 0) {
|
508 |
+
if($poll_id == $latest_poll) {
|
509 |
+
$style = 'style=\'background-color: #b8d4ff;\'';
|
510 |
+
}
|
511 |
+
} else if(in_array($poll_id, $multiple_polls)) {
|
512 |
$style = 'style=\'background-color: #b8d4ff;\'';
|
513 |
}
|
514 |
+
echo "<tr id=\"poll-$poll_id\" $style>\n";
|
515 |
+
echo "<td><strong>$poll_id</strong></td>\n";
|
516 |
+
echo '<td>';
|
517 |
+
if($current_poll > 0) {
|
518 |
+
if($current_poll == $poll_id) {
|
519 |
+
echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
|
520 |
+
}
|
521 |
+
} elseif($current_poll == 0) {
|
522 |
+
if($poll_id == $latest_poll) {
|
523 |
+
echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
|
524 |
+
}
|
525 |
+
} else if(in_array($poll_id, $multiple_polls)) {
|
526 |
+
echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
|
527 |
}
|
528 |
+
echo "$poll_question</td>\n";
|
529 |
+
echo "<td>$poll_totalvoters</td>\n";
|
530 |
+
echo "<td>$poll_date</td>\n";
|
531 |
+
echo "<td>$poll_expiry_text</td>\n";
|
532 |
+
echo '<td>';
|
533 |
+
if($poll_active == 1) {
|
534 |
+
_e('Open', 'wp-polls');
|
535 |
+
} elseif($poll_active == -1) {
|
536 |
+
_e('Future', 'wp-polls');
|
537 |
+
} else {
|
538 |
+
_e('Closed', 'wp-polls');
|
539 |
}
|
540 |
+
echo "</td>\n";
|
541 |
+
echo "<td><a href=\"$base_page&mode=logs&id=$poll_id\" class=\"edit\">".__('Logs', 'wp-polls')."</a></td>\n";
|
542 |
+
echo "<td><a href=\"$base_page&mode=edit&id=$poll_id\" class=\"edit\">".__('Edit', 'wp-polls')."</a></td>\n";
|
543 |
+
echo "<td><a href=\"#DeletePoll\" onclick=\"delete_poll($poll_id, '".sprintf(js_escape(__('You are about to delete this poll, \'%s\'.', 'wp-polls')), $poll_question)."')\" class=\"delete\">".__('Delete', 'wp-polls')."</a></td>\n";
|
544 |
+
echo '</tr>';
|
545 |
+
$i++;
|
546 |
+
$total_votes+= $poll_totalvotes;
|
547 |
+
$total_voters+= $poll_totalvoters;
|
548 |
+
|
549 |
}
|
550 |
+
} else {
|
551 |
+
echo '<tr><td colspan="9" align="center"><strong>'.__('No Polls Found', 'wp-polls').'</strong></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
}
|
553 |
+
?>
|
554 |
+
</tbody>
|
|
|
|
|
555 |
</table>
|
556 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
<!-- Polls Stats -->
|
558 |
<div class="wrap">
|
559 |
<h2><?php _e('Polls Stats', 'wp-polls'); ?></h2>
|
570 |
<th align="left"><?php _e('Total Votes Casted:', 'wp-polls'); ?></th>
|
571 |
<td align="left"><?php echo number_format($total_votes); ?></td>
|
572 |
</tr>
|
573 |
+
<tr>
|
574 |
+
<th align="left"><?php _e('Total Voters:', 'wp-polls'); ?></th>
|
575 |
+
<td align="left"><?php echo number_format($total_voters); ?></td>
|
576 |
+
</tr>
|
577 |
</table>
|
578 |
</div>
|
579 |
<!-- Delete Polls Logs -->
|
580 |
<div class="wrap">
|
581 |
<h2><?php _e('Polls Logs', 'wp-polls'); ?></h2>
|
582 |
+
<div align="center" id="poll_logs">
|
583 |
+
<?php
|
584 |
+
$poll_ips = intval($wpdb->get_var("SELECT COUNT(pollip_id) FROM $wpdb->pollsip"));
|
585 |
+
if($poll_ips > 0) {
|
586 |
+
?>
|
587 |
+
<strong><?php _e('Are You Sure You Want To Delete All Polls Logs?', 'wp-polls'); ?></strong><br /><br />
|
588 |
+
<input type="checkbox" name="delete_logs_yes" id="delete_logs_yes" value="yes" /> <label for="delete_logs_yes"><?php _e('Yes', 'wp-polls'); ?></label><br /><br />
|
589 |
+
<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')); ?>');" />
|
590 |
+
<?php
|
591 |
+
} else {
|
592 |
+
_e('No poll logs available.', 'wp-polls');
|
593 |
+
}
|
594 |
+
?>
|
595 |
</div>
|
596 |
<p style="text-align: left;"><?php _e('Note:<br />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>
|
597 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
<?php
|
599 |
} // End switch($mode)
|
600 |
?>
|
polls/polls-options.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.1 Plugin: WP-Polls 2.
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -36,21 +36,13 @@ if($_POST['Submit']) {
|
|
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_ans_sortby = strip_tags(trim($_POST['poll_ans_sortby']));
|
40 |
$poll_ans_sortorder = strip_tags(trim($_POST['poll_ans_sortorder']));
|
41 |
$poll_ans_result_sortby = strip_tags(trim($_POST['poll_ans_result_sortby']));
|
42 |
$poll_ans_result_sortorder = strip_tags(trim($_POST['poll_ans_result_sortorder']));
|
43 |
-
$poll_template_voteheader =trim($_POST['poll_template_voteheader']);
|
44 |
-
$poll_template_votebody = trim($_POST['poll_template_votebody']);
|
45 |
-
$poll_template_votefooter = trim($_POST['poll_template_votefooter']);
|
46 |
-
$poll_template_resultheader = trim($_POST['poll_template_resultheader']);
|
47 |
-
$poll_template_resultbody = trim($_POST['poll_template_resultbody']);
|
48 |
-
$poll_template_resultbody2 = trim($_POST['poll_template_resultbody2']);
|
49 |
-
$poll_template_resultfooter = trim($_POST['poll_template_resultfooter']);
|
50 |
-
$poll_template_resultfooter2 = trim($_POST['poll_template_resultfooter2']);
|
51 |
-
$poll_template_disable = trim($_POST['poll_template_disable']);
|
52 |
-
$poll_template_error = trim($_POST['poll_template_error']);
|
53 |
$poll_archive_perpage = intval($_POST['poll_archive_perpage']);
|
|
|
54 |
$poll_archive_url = strip_tags(trim($_POST['poll_archive_url']));
|
55 |
$poll_archive_show = intval($_POST['poll_archive_show']);
|
56 |
$poll_currentpoll = intval($_POST['poll_currentpoll']);
|
@@ -60,21 +52,13 @@ if($_POST['Submit']) {
|
|
60 |
$update_poll_queries = array();
|
61 |
$update_poll_text = array();
|
62 |
$update_poll_queries[] = update_option('poll_bar', $poll_bar);
|
|
|
63 |
$update_poll_queries[] = update_option('poll_ans_sortby', $poll_ans_sortby);
|
64 |
$update_poll_queries[] = update_option('poll_ans_sortorder', $poll_ans_sortorder);
|
65 |
$update_poll_queries[] = update_option('poll_ans_result_sortby', $poll_ans_result_sortby);
|
66 |
$update_poll_queries[] = update_option('poll_ans_result_sortorder', $poll_ans_result_sortorder);
|
67 |
-
$update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
|
68 |
-
$update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
|
69 |
-
$update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
|
70 |
-
$update_poll_queries[] = update_option('poll_template_resultheader', $poll_template_resultheader);
|
71 |
-
$update_poll_queries[] = update_option('poll_template_resultbody', $poll_template_resultbody);
|
72 |
-
$update_poll_queries[] = update_option('poll_template_resultbody2', $poll_template_resultbody2);
|
73 |
-
$update_poll_queries[] = update_option('poll_template_resultfooter', $poll_template_resultfooter);
|
74 |
-
$update_poll_queries[] = update_option('poll_template_resultfooter2', $poll_template_resultfooter2);
|
75 |
-
$update_poll_queries[] = update_option('poll_template_disable', $poll_template_disable);
|
76 |
-
$update_poll_queries[] = update_option('poll_template_error', $poll_template_error);
|
77 |
$update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage);
|
|
|
78 |
$update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url);
|
79 |
$update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show);
|
80 |
$update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll);
|
@@ -82,23 +66,15 @@ if($_POST['Submit']) {
|
|
82 |
$update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method);
|
83 |
$update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote);
|
84 |
$update_poll_text[] = __('Poll Bar Style', 'wp-polls');
|
|
|
85 |
$update_poll_text[] = __('Sort Poll Answers By Option', 'wp-polls');
|
86 |
$update_poll_text[] = __('Sort Order Of Poll Answers Option', 'wp-polls');
|
87 |
$update_poll_text[] = __('Sort Poll Results By Option', 'wp-polls');
|
88 |
$update_poll_text[] = __('Sort Order Of Poll Results Option', 'wp-polls');
|
89 |
-
$update_poll_text[] = __('
|
90 |
-
$update_poll_text[] = __('
|
91 |
-
$update_poll_text[] = __('
|
92 |
-
$update_poll_text[] = __('
|
93 |
-
$update_poll_text[] = __('Result Body Template', 'wp-polls');
|
94 |
-
$update_poll_text[] = __('Result Body2 Template', 'wp-polls');
|
95 |
-
$update_poll_text[] = __('Result Footer Template', 'wp-polls');
|
96 |
-
$update_poll_text[] = __('Result Footer2 Template', 'wp-polls');
|
97 |
-
$update_poll_text[] = __('Poll Disabled Template', 'wp-polls');
|
98 |
-
$update_poll_text[] = __('Poll Error Template', 'wp-polls');
|
99 |
-
$update_poll_text[] = __('Archive Polls Per Page Option', 'wp-polls');
|
100 |
-
$update_poll_text[] = __('Polls Archive URL Option', 'wp-polls');
|
101 |
-
$update_poll_text[] = __('Show Polls Achive Link Option', 'wp-polls');
|
102 |
$update_poll_text[] = __('Current Active Poll Option', 'wp-polls');
|
103 |
$update_poll_text[] = __('Poll Close Option', 'wp-polls');
|
104 |
$update_poll_text[] = __('Logging Method', 'wp-polls');
|
@@ -122,42 +98,6 @@ if($_POST['Submit']) {
|
|
122 |
?>
|
123 |
<script type="text/javascript">
|
124 |
/* <![CDATA[*/
|
125 |
-
function poll_default_templates(template) {
|
126 |
-
var default_template;
|
127 |
-
switch(template) {
|
128 |
-
case "voteheader":
|
129 |
-
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\">";
|
130 |
-
break;
|
131 |
-
case "votebody":
|
132 |
-
default_template = "<li><input type=\"radio\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" /> <label for=\"poll-answer-%POLL_ANSWER_ID%\">%POLL_ANSWER%</label></li>";
|
133 |
-
break;
|
134 |
-
case "votefooter":
|
135 |
-
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>";
|
136 |
-
break;
|
137 |
-
case "resultheader":
|
138 |
-
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\">";
|
139 |
-
break;
|
140 |
-
case "resultbody":
|
141 |
-
default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
|
142 |
-
break;
|
143 |
-
case "resultbody2":
|
144 |
-
default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'wp-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
|
145 |
-
break;
|
146 |
-
case "resultfooter":
|
147 |
-
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Votes', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTES%</strong></p>\n</div>";
|
148 |
-
break;
|
149 |
-
case "resultfooter2":
|
150 |
-
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Votes', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTES%</strong></p>\n<p style=\"text-align: center;\"><a href=\"#VotePoll\" onclick=\"poll_booth(%POLL_ID%); return false;\" title=\"<?php _e('Vote For This Poll', 'wp-polls'); ?>\"><?php _e('Vote', 'wp-polls'); ?></a></p>\n</div>";
|
151 |
-
break;
|
152 |
-
case "disable":
|
153 |
-
default_template = "<?php _e('Sorry, there are no polls available at the moment.', 'wp-polls'); ?>";
|
154 |
-
break;
|
155 |
-
case "error":
|
156 |
-
default_template = "<?php _e('An error has occurred when processing your poll.', 'wp-polls'); ?>";
|
157 |
-
break;
|
158 |
-
}
|
159 |
-
document.getElementById("poll_template_" + template).value = default_template;
|
160 |
-
}
|
161 |
function set_pollbar_height(height) {
|
162 |
document.getElementById('poll_bar_height').value = height;
|
163 |
}
|
@@ -189,9 +129,9 @@ if($_POST['Submit']) {
|
|
189 |
/* ]]> */
|
190 |
</script>
|
191 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
|
|
192 |
<div class="wrap">
|
193 |
<h2><?php _e('Poll Options', 'wp-polls'); ?></h2>
|
194 |
-
<form id="poll_options_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
195 |
<fieldset class="options">
|
196 |
<legend><?php _e('Poll Bar Style', 'wp-polls'); ?></legend>
|
197 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
@@ -253,6 +193,30 @@ if($_POST['Submit']) {
|
|
253 |
</tr>
|
254 |
</table>
|
255 |
</fieldset>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
<fieldset class="options">
|
257 |
<legend><?php _e('Sorting Of Poll Answers', 'wp-polls'); ?></legend>
|
258 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
@@ -336,15 +300,25 @@ if($_POST['Submit']) {
|
|
336 |
<legend><?php _e('Poll Archive', 'wp-polls'); ?></legend>
|
337 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
338 |
<tr valign="top">
|
339 |
-
<th align="left" width="30%"><?php _e('Polls Per Page:', 'wp-polls'); ?></th>
|
340 |
<td align="left"><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_option('poll_archive_perpage')); ?>" size="2" /></td>
|
341 |
</tr>
|
342 |
<tr valign="top">
|
343 |
-
<th align="left" width="30%"><?php _e('Polls Archive
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
<td align="left"><input type="text" name="poll_archive_url" value="<?php echo get_option('poll_archive_url'); ?>" size="50" /></td>
|
345 |
</tr>
|
346 |
<tr valign="top">
|
347 |
-
<th align="left" width="30%"><?php _e('Display
|
348 |
<td align="left">
|
349 |
<select name="poll_archive_show" size="1">
|
350 |
<option value="0"<?php selected('0', get_option('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option>
|
@@ -352,6 +326,9 @@ if($_POST['Submit']) {
|
|
352 |
</select>
|
353 |
</td>
|
354 |
</tr>
|
|
|
|
|
|
|
355 |
</table>
|
356 |
</fieldset>
|
357 |
<fieldset class="options">
|
@@ -364,6 +341,9 @@ if($_POST['Submit']) {
|
|
364 |
<option value="-1"<?php selected(-1, get_option('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
|
365 |
<option value="-2"<?php selected(-2, get_option('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
|
366 |
<option value="0"<?php selected(0, get_option('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
|
|
|
|
|
|
|
367 |
<option value="0"> </option>
|
368 |
<?php
|
369 |
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
@@ -382,6 +362,11 @@ if($_POST['Submit']) {
|
|
382 |
</select>
|
383 |
</td>
|
384 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
385 |
<tr valign="top">
|
386 |
<th align="left" width="30%"><?php _e('When Poll Is Closed', 'wp-polls'); ?>:</th>
|
387 |
<td align="left">
|
@@ -393,243 +378,8 @@ if($_POST['Submit']) {
|
|
393 |
</tr>
|
394 |
</table>
|
395 |
</fieldset>
|
396 |
-
<fieldset class="options">
|
397 |
-
<legend><?php _e('Template Variables', 'wp-polls'); ?></legend>
|
398 |
-
<table width="100%" border="0" cellspacing="0" cellpadding="5">
|
399 |
-
<tr>
|
400 |
-
<td>
|
401 |
-
<strong>%POLL_ID%</strong><br />
|
402 |
-
<?php _e('Display the poll\'s ID', 'wp-polls'); ?>
|
403 |
-
</td>
|
404 |
-
<td>
|
405 |
-
<strong>%POLL_ANSWER_ID%</strong><br />
|
406 |
-
<?php _e('Display the poll\'s answer ID', 'wp-polls'); ?>
|
407 |
-
</td>
|
408 |
-
</tr>
|
409 |
-
<tr>
|
410 |
-
<td>
|
411 |
-
<strong>%POLL_QUESTION%</strong><br />
|
412 |
-
<?php _e('Display the poll\'s question', 'wp-polls'); ?>
|
413 |
-
</td>
|
414 |
-
<td>
|
415 |
-
<strong>%POLL_ANSWER%</strong><br />
|
416 |
-
<?php _e('Display the poll\'s answer', 'wp-polls'); ?>
|
417 |
-
</td>
|
418 |
-
</tr>
|
419 |
-
<tr>
|
420 |
-
<td>
|
421 |
-
<strong>%POLL_TOTALVOTES%</strong><br />
|
422 |
-
<?php _e('Display the poll\'s total votes', 'wp-polls'); ?>
|
423 |
-
</td>
|
424 |
-
<td>
|
425 |
-
<strong>%POLL_ANSWER_TEXT%</strong><br />
|
426 |
-
<?php _e('Display the poll\'s answer without HTML formatting.', 'wp-polls'); ?>
|
427 |
-
</td>
|
428 |
-
</tr>
|
429 |
-
<tr>
|
430 |
-
<td>
|
431 |
-
<strong>%POLL_RESULT_URL%</strong><br />
|
432 |
-
<?php _e('Displays URL to poll\'s result', 'wp-polls'); ?>
|
433 |
-
</td>
|
434 |
-
<td>
|
435 |
-
<strong>%POLL_ANSWER_VOTES%</strong><br />
|
436 |
-
<?php _e('Display the poll\'s answer votes', 'wp-polls'); ?>
|
437 |
-
</td>
|
438 |
-
</tr>
|
439 |
-
<tr>
|
440 |
-
<td>
|
441 |
-
<strong>%POLL_MOST_ANSWER%</strong><br />
|
442 |
-
<?php _e('Display the poll\'s most voted answer', 'wp-polls'); ?>
|
443 |
-
</td>
|
444 |
-
<td>
|
445 |
-
<strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
|
446 |
-
<?php _e('Display the poll\'s answer percentage', 'wp-polls'); ?>
|
447 |
-
</td>
|
448 |
-
</tr>
|
449 |
-
<tr>
|
450 |
-
<td>
|
451 |
-
<strong>%POLL_MOST_VOTES%</strong><br />
|
452 |
-
<?php _e('Display the poll\'s answer votes for the most voted answer', 'wp-polls'); ?>
|
453 |
-
</td>
|
454 |
-
<td>
|
455 |
-
<strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
|
456 |
-
<?php _e('Display the poll\'s answer image width', 'wp-polls'); ?>
|
457 |
-
</td>
|
458 |
-
</tr>
|
459 |
-
<tr>
|
460 |
-
<td>
|
461 |
-
<strong>%POLL_MOST_PERCENTAGE%</strong><br />
|
462 |
-
<?php _e('Display the poll\'s answer percentage for the most voted answer', 'wp-polls'); ?>
|
463 |
-
</td>
|
464 |
-
<td>
|
465 |
-
<strong>%POLL_LEAST_ANSWER%</strong><br />
|
466 |
-
<?php _e('Display the poll\'s least voted answer', 'wp-polls'); ?>
|
467 |
-
</td>
|
468 |
-
</tr>
|
469 |
-
<tr>
|
470 |
-
<td><strong>%POLL_START_DATE%</strong><br />
|
471 |
-
<?php _e('Display the poll\'s start date/time', 'wp-polls'); ?></td>
|
472 |
-
<td><strong>%POLL_LEAST_VOTES%</strong><br />
|
473 |
-
<?php _e('Display the poll\'s answer votes for the least voted answer', 'wp-polls'); ?>
|
474 |
-
</td>
|
475 |
-
</tr>
|
476 |
-
<tr>
|
477 |
-
<td><strong>%POLL_END_DATE%</strong><br />
|
478 |
-
<?php _e('Display the poll\'s end date/time', 'wp-polls'); ?></td>
|
479 |
-
<td>
|
480 |
-
<strong>%POLL_LEAST_PERCENTAGE%</strong><br />
|
481 |
-
<?php _e('Display the poll\'s answer percentage for the least voted answer', 'wp-polls'); ?>
|
482 |
-
</td>
|
483 |
-
</tr>
|
484 |
-
</table>
|
485 |
-
</fieldset>
|
486 |
-
<fieldset class="options">
|
487 |
-
<legend><?php _e('Poll Voting Form Templates', 'wp-polls'); ?></legend>
|
488 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
489 |
-
<tr valign="top">
|
490 |
-
<td width="30%" align="left">
|
491 |
-
<strong><?php _e('Voting Form Header:', 'wp-polls'); ?></strong><br /><br /><br />
|
492 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
493 |
-
- %POLL_ID%<br />
|
494 |
-
- %POLL_QUESTION%<br />
|
495 |
-
- %POLL_START_DATE%<br />
|
496 |
-
- %POLL_END_DATE%<br />
|
497 |
-
- %POLL_TOTALVOTES%<br /><br />
|
498 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('voteheader');" class="button" />
|
499 |
-
</td>
|
500 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_voteheader'))); ?></textarea></td>
|
501 |
-
</tr>
|
502 |
-
<tr valign="top">
|
503 |
-
<td width="30%" align="left">
|
504 |
-
<strong><?php _e('Voting Form Body:', 'wp-polls'); ?></strong><br /><br /><br />
|
505 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
506 |
-
- %POLL_ID%<br />
|
507 |
-
- %POLL_ANSWER_ID%<br />
|
508 |
-
- %POLL_ANSWER%<br />
|
509 |
-
- %POLL_ANSWER_VOTES%<br /><br />
|
510 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votebody');" class="button" />
|
511 |
-
</td>
|
512 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_votebody" name="poll_template_votebody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votebody'))); ?></textarea></td>
|
513 |
-
</tr>
|
514 |
-
<tr valign="top">
|
515 |
-
<td width="30%" align="left">
|
516 |
-
<strong><?php _e('Voting Form Footer:', 'wp-polls'); ?></strong><br /><br /><br />
|
517 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
518 |
-
- %POLL_ID%<br />
|
519 |
-
- %POLL_RESULT_URL%<br /><br />
|
520 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votefooter');" class="button" />
|
521 |
-
</td>
|
522 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votefooter'))); ?></textarea></td>
|
523 |
-
</tr>
|
524 |
-
</table>
|
525 |
-
</fieldset>
|
526 |
-
<fieldset class="options">
|
527 |
-
<legend><?php _e('Poll Result Templates', 'wp-polls'); ?></legend>
|
528 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
529 |
-
<tr valign="top">
|
530 |
-
<td width="30%" align="left">
|
531 |
-
<strong><?php _e('Result Header:', 'wp-polls'); ?></strong><br /><br /><br />
|
532 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
533 |
-
- %POLL_ID%<br />
|
534 |
-
- %POLL_QUESTION%<br />
|
535 |
-
- %POLL_START_DATE%<br />
|
536 |
-
- %POLL_END_DATE%<br />
|
537 |
-
- %POLL_TOTALVOTES%<br /><br />
|
538 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultheader');" class="button" />
|
539 |
-
</td>
|
540 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultheader'))); ?></textarea></td>
|
541 |
-
</tr>
|
542 |
-
<tr valign="top">
|
543 |
-
<td width="30%" align="left">
|
544 |
-
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Normal', 'wp-polls'); ?><br /><br />
|
545 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
546 |
-
- %POLL_ANSWER_ID%<br />
|
547 |
-
- %POLL_ANSWER%<br />
|
548 |
-
- %POLL_ANSWER_TEXT%<br />
|
549 |
-
- %POLL_ANSWER_VOTES%<br />
|
550 |
-
- %POLL_ANSWER_PERCENTAGE%<br />
|
551 |
-
- %POLL_ANSWER_IMAGEWIDTH%<br /><br />
|
552 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody');" class="button" />
|
553 |
-
</td>
|
554 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody'))); ?></textarea></td>
|
555 |
-
</tr>
|
556 |
-
<tr valign="top">
|
557 |
-
<td width="30%" align="left">
|
558 |
-
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displaying Of User\'s Voted Answer', 'wp-polls'); ?><br /><br />
|
559 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
560 |
-
- %POLL_ANSWER_ID%<br />
|
561 |
-
- %POLL_ANSWER%<br />
|
562 |
-
- %POLL_ANSWER_TEXT%<br />
|
563 |
-
- %POLL_ANSWER_VOTES%<br />
|
564 |
-
- %POLL_ANSWER_PERCENTAGE%<br />
|
565 |
-
- %POLL_ANSWER_IMAGEWIDTH%<br /><br />
|
566 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody2');" class="button" />
|
567 |
-
</td>
|
568 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody2'))); ?></textarea></td>
|
569 |
-
</tr>
|
570 |
-
<tr valign="top">
|
571 |
-
<td width="30%" align="left">
|
572 |
-
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Normal', 'wp-polls'); ?><br /><br />
|
573 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
574 |
-
- %POLL_ID%<br />
|
575 |
-
- %POLL_START_DATE%<br />
|
576 |
-
- %POLL_END_DATE%<br />
|
577 |
-
- %POLL_TOTALVOTES%<br />
|
578 |
-
- %POLL_MOST_ANSWER%<br />
|
579 |
-
- %POLL_MOST_VOTES%<br />
|
580 |
-
- %POLL_MOST_PERCENTAGE%<br />
|
581 |
-
- %POLL_LEAST_ANSWER%<br />
|
582 |
-
- %POLL_LEAST_VOTES%<br />
|
583 |
-
- %POLL_LEAST_PERCENTAGE%<br /><br />
|
584 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter');" class="button" />
|
585 |
-
</td>
|
586 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter'))); ?></textarea></td>
|
587 |
-
</tr>
|
588 |
-
<tr valign="top">
|
589 |
-
<td width="30%" align="left">
|
590 |
-
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displaying Of Vote Poll Link If User Has Not Voted', 'wp-polls'); ?><br /><br />
|
591 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
592 |
-
- %POLL_ID%<br />
|
593 |
-
- %POLL_START_DATE%<br />
|
594 |
-
- %POLL_END_DATE%<br />
|
595 |
-
- %POLL_TOTALVOTES%<br />
|
596 |
-
- %POLL_MOST_ANSWER%<br />
|
597 |
-
- %POLL_MOST_VOTES%<br />
|
598 |
-
- %POLL_MOST_PERCENTAGE%<br />
|
599 |
-
- %POLL_LEAST_ANSWER%<br />
|
600 |
-
- %POLL_LEAST_VOTES%<br />
|
601 |
-
- %POLL_LEAST_PERCENTAGE%<br /><br />
|
602 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter2');" class="button" />
|
603 |
-
</td>
|
604 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter2'))); ?></textarea></td>
|
605 |
-
</tr>
|
606 |
-
</table>
|
607 |
-
</fieldset>
|
608 |
-
<fieldset class="options">
|
609 |
-
<legend><?php _e('Poll Misc Templates', 'wp-polls'); ?></legend>
|
610 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
611 |
-
<tr valign="top">
|
612 |
-
<td width="30%" align="left">
|
613 |
-
<strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><br /><br />
|
614 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
615 |
-
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
616 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('disable');" class="button" />
|
617 |
-
</td>
|
618 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_disable" name="poll_template_disable"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_disable'))); ?></textarea></td>
|
619 |
-
</tr>
|
620 |
-
<tr valign="top">
|
621 |
-
<td width="30%" align="left">
|
622 |
-
<strong><?php _e('Poll Error', 'wp-polls'); ?></strong><br /><br /><br />
|
623 |
-
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
624 |
-
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
625 |
-
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('error');" class="button" />
|
626 |
-
</td>
|
627 |
-
<td align="left"><textarea cols="80" rows="10" id="poll_template_error" name="poll_template_error"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_error'))); ?></textarea></td>
|
628 |
-
</tr>
|
629 |
-
</table>
|
630 |
-
</fieldset>
|
631 |
<div align="center">
|
632 |
<input type="submit" name="Submit" class="button" value="<?php _e('Update Options', 'wp-polls'); ?>" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" />
|
633 |
</div>
|
634 |
-
|
635 |
-
</
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
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']);
|
52 |
$update_poll_queries = array();
|
53 |
$update_poll_text = array();
|
54 |
$update_poll_queries[] = update_option('poll_bar', $poll_bar);
|
55 |
+
$update_poll_queries[] = update_option('poll_ajax_style', $poll_ajax_style);
|
56 |
$update_poll_queries[] = update_option('poll_ans_sortby', $poll_ans_sortby);
|
57 |
$update_poll_queries[] = update_option('poll_ans_sortorder', $poll_ans_sortorder);
|
58 |
$update_poll_queries[] = update_option('poll_ans_result_sortby', $poll_ans_result_sortby);
|
59 |
$update_poll_queries[] = update_option('poll_ans_result_sortorder', $poll_ans_result_sortorder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
$update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage);
|
61 |
+
$update_poll_queries[] = update_option('poll_archive_displaypoll', $poll_archive_displaypoll);
|
62 |
$update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url);
|
63 |
$update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show);
|
64 |
$update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll);
|
66 |
$update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method);
|
67 |
$update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote);
|
68 |
$update_poll_text[] = __('Poll Bar Style', 'wp-polls');
|
69 |
+
$update_poll_text[] = __('Poll AJAX Style', 'wp-polls');
|
70 |
$update_poll_text[] = __('Sort Poll Answers By Option', 'wp-polls');
|
71 |
$update_poll_text[] = __('Sort Order Of Poll Answers Option', 'wp-polls');
|
72 |
$update_poll_text[] = __('Sort Poll Results By Option', 'wp-polls');
|
73 |
$update_poll_text[] = __('Sort Order Of Poll Results Option', 'wp-polls');
|
74 |
+
$update_poll_text[] = __('Number Of Polls Per Page To Display In Poll Archive Option', 'wp-polls');
|
75 |
+
$update_poll_text[] = __('Type Of Polls To Display In Poll Archive Option', 'wp-polls');
|
76 |
+
$update_poll_text[] = __('Poll Archive URL Option', 'wp-polls');
|
77 |
+
$update_poll_text[] = __('Show Poll Achive Link Option', 'wp-polls');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
$update_poll_text[] = __('Current Active Poll Option', 'wp-polls');
|
79 |
$update_poll_text[] = __('Poll Close Option', 'wp-polls');
|
80 |
$update_poll_text[] = __('Logging Method', 'wp-polls');
|
98 |
?>
|
99 |
<script type="text/javascript">
|
100 |
/* <![CDATA[*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
function set_pollbar_height(height) {
|
102 |
document.getElementById('poll_bar_height').value = height;
|
103 |
}
|
129 |
/* ]]> */
|
130 |
</script>
|
131 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
132 |
+
<form id="poll_options_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
133 |
<div class="wrap">
|
134 |
<h2><?php _e('Poll Options', 'wp-polls'); ?></h2>
|
|
|
135 |
<fieldset class="options">
|
136 |
<legend><?php _e('Poll Bar Style', 'wp-polls'); ?></legend>
|
137 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
193 |
</tr>
|
194 |
</table>
|
195 |
</fieldset>
|
196 |
+
<?php $poll_ajax_style = get_option('poll_ajax_style'); ?>
|
197 |
+
<fieldset class="options">
|
198 |
+
<legend><?php _e('Polls AJAX Style', 'wp-polls'); ?></legend>
|
199 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
200 |
+
<tr valign="top">
|
201 |
+
<th align="left" width="30%"><?php _e('Show Loading Image With Text', 'wp-polls'); ?></th>
|
202 |
+
<td align="left">
|
203 |
+
<select name="poll_ajax_style_loading" size="1">
|
204 |
+
<option value="0"<?php selected('0', $poll_ajax_style['loading']); ?>><?php _e('No', 'wp-polls'); ?></option>
|
205 |
+
<option value="1"<?php selected('1', $poll_ajax_style['loading']); ?>><?php _e('Yes', 'wp-polls'); ?></option>
|
206 |
+
</select>
|
207 |
+
</td>
|
208 |
+
</tr>
|
209 |
+
<tr valign="top">
|
210 |
+
<th align="left" width="30%"><?php _e('Show Fading In And Fading Out Of Poll', 'wp-polls'); ?></th>
|
211 |
+
<td align="left">
|
212 |
+
<select name="poll_ajax_style_fading" size="1">
|
213 |
+
<option value="0"<?php selected('0', $poll_ajax_style['fading']); ?>><?php _e('No', 'wp-polls'); ?></option>
|
214 |
+
<option value="1"<?php selected('1', $poll_ajax_style['fading']); ?>><?php _e('Yes', 'wp-polls'); ?></option>
|
215 |
+
</select>
|
216 |
+
</td>
|
217 |
+
</tr>
|
218 |
+
</table>
|
219 |
+
</fieldset>
|
220 |
<fieldset class="options">
|
221 |
<legend><?php _e('Sorting Of Poll Answers', 'wp-polls'); ?></legend>
|
222 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
300 |
<legend><?php _e('Poll Archive', 'wp-polls'); ?></legend>
|
301 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
302 |
<tr valign="top">
|
303 |
+
<th align="left" width="30%"><?php _e('Number Of Polls Per Page:', 'wp-polls'); ?></th>
|
304 |
<td align="left"><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_option('poll_archive_perpage')); ?>" size="2" /></td>
|
305 |
</tr>
|
306 |
<tr valign="top">
|
307 |
+
<th align="left" width="30%"><?php _e('Type Of Polls To Display In Poll Archive:', 'wp-polls'); ?></th>
|
308 |
+
<td align="left">
|
309 |
+
<select name="poll_archive_displaypoll" size="1">
|
310 |
+
<option value="1"<?php selected('1', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed Polls Only', 'wp-polls'); ?></option>
|
311 |
+
<option value="2"<?php selected('2', get_option('poll_archive_displaypoll')); ?>><?php _e('Opened Polls Only', 'wp-polls'); ?></option>
|
312 |
+
<option value="3"<?php selected('3', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed And Opened Polls', 'wp-polls'); ?></option>
|
313 |
+
</select>
|
314 |
+
</td>
|
315 |
+
</tr>
|
316 |
+
<tr valign="top">
|
317 |
+
<th align="left" width="30%"><?php _e('Poll Archive URL:', 'wp-polls'); ?></th>
|
318 |
<td align="left"><input type="text" name="poll_archive_url" value="<?php echo get_option('poll_archive_url'); ?>" size="50" /></td>
|
319 |
</tr>
|
320 |
<tr valign="top">
|
321 |
+
<th align="left" width="30%"><?php _e('Display Poll Archive Link Below Poll?', 'wp-polls'); ?></th>
|
322 |
<td align="left">
|
323 |
<select name="poll_archive_show" size="1">
|
324 |
<option value="0"<?php selected('0', get_option('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option>
|
326 |
</select>
|
327 |
</td>
|
328 |
</tr>
|
329 |
+
<tr valign="top">
|
330 |
+
<th align="left" colspan="2"><em><?php _e('Note: Only polls\' results will be shown in the Poll Archive regardless of whether the poll is closed or opened.', 'wp-polls'); ?></em></th>
|
331 |
+
</tr>
|
332 |
</table>
|
333 |
</fieldset>
|
334 |
<fieldset class="options">
|
341 |
<option value="-1"<?php selected(-1, get_option('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
|
342 |
<option value="-2"<?php selected(-2, get_option('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
|
343 |
<option value="0"<?php selected(0, get_option('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
|
344 |
+
<?php if(function_exists('dynamic_sidebar')) { ?>
|
345 |
+
<option value="-3"<?php selected(-3, get_option('poll_currentpoll')); ?>><?php _e('Display Multiple Polls', 'wp-polls'); ?></option>
|
346 |
+
<?php } ?>
|
347 |
<option value="0"> </option>
|
348 |
<?php
|
349 |
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
362 |
</select>
|
363 |
</td>
|
364 |
</tr>
|
365 |
+
<?php if(function_exists('dynamic_sidebar')) { ?>
|
366 |
+
<tr valign="top">
|
367 |
+
<th align="left" colspan="2"><em><?php _e('Note: If you chose \'Display Multiple Polls\' for the above option, you need to configure it in Presentation -> Sidebar Widgets -> Poll.', 'wp-polls'); ?></em></th>
|
368 |
+
</tr>
|
369 |
+
<?php } ?>
|
370 |
<tr valign="top">
|
371 |
<th align="left" width="30%"><?php _e('When Poll Is Closed', 'wp-polls'); ?>:</th>
|
372 |
<td align="left">
|
378 |
</tr>
|
379 |
</table>
|
380 |
</fieldset>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
<div align="center">
|
382 |
<input type="submit" name="Submit" class="button" value="<?php _e('Update Options', 'wp-polls'); ?>" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" />
|
383 |
</div>
|
384 |
+
</div>
|
385 |
+
</form>
|
polls/polls-templates.php
ADDED
@@ -0,0 +1,467 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Configure Poll Templates |
|
14 |
+
| - wp-content/plugins/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('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_disable = trim($_POST['poll_template_disable']);
|
46 |
+
$poll_template_error = trim($_POST['poll_template_error']);
|
47 |
+
$update_poll_queries = array();
|
48 |
+
$update_poll_text = array();
|
49 |
+
$update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
|
50 |
+
$update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
|
51 |
+
$update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
|
52 |
+
$update_poll_queries[] = update_option('poll_template_resultheader', $poll_template_resultheader);
|
53 |
+
$update_poll_queries[] = update_option('poll_template_resultbody', $poll_template_resultbody);
|
54 |
+
$update_poll_queries[] = update_option('poll_template_resultbody2', $poll_template_resultbody2);
|
55 |
+
$update_poll_queries[] = update_option('poll_template_resultfooter', $poll_template_resultfooter);
|
56 |
+
$update_poll_queries[] = update_option('poll_template_resultfooter2', $poll_template_resultfooter2);
|
57 |
+
$update_poll_queries[] = update_option('poll_template_pollarchivelink', $poll_template_pollarchivelink);
|
58 |
+
$update_poll_queries[] = update_option('poll_template_pollarchiveheader', $poll_template_pollarchiveheader);
|
59 |
+
$update_poll_queries[] = update_option('poll_template_pollarchivefooter', $poll_template_pollarchivefooter);
|
60 |
+
$update_poll_queries[] = update_option('poll_template_disable', $poll_template_disable);
|
61 |
+
$update_poll_queries[] = update_option('poll_template_error', $poll_template_error);
|
62 |
+
$update_poll_text[] = __('Voting Form Header Template', 'wp-polls');
|
63 |
+
$update_poll_text[] = __('Voting Form Body Template', 'wp-polls');
|
64 |
+
$update_poll_text[] = __('Voting Form Footer Template', 'wp-polls');
|
65 |
+
$update_poll_text[] = __('Result Header Template', 'wp-polls');
|
66 |
+
$update_poll_text[] = __('Result Body Template', 'wp-polls');
|
67 |
+
$update_poll_text[] = __('Result Body2 Template', 'wp-polls');
|
68 |
+
$update_poll_text[] = __('Result Footer Template', 'wp-polls');
|
69 |
+
$update_poll_text[] = __('Result Footer2 Template', 'wp-polls');
|
70 |
+
$update_poll_text[] = __('Poll Archive Link Template', 'wp-polls');
|
71 |
+
$update_poll_text[] = __('Poll Archive Poll Header Template', 'wp-polls');
|
72 |
+
$update_poll_text[] = __('Poll Archive Poll Footer Template', 'wp-polls');
|
73 |
+
$update_poll_text[] = __('Poll Disabled Template', 'wp-polls');
|
74 |
+
$update_poll_text[] = __('Poll Error Template', 'wp-polls');
|
75 |
+
$i=0;
|
76 |
+
$text = '';
|
77 |
+
foreach($update_poll_queries as $update_poll_query) {
|
78 |
+
if($update_poll_query) {
|
79 |
+
$text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />';
|
80 |
+
}
|
81 |
+
$i++;
|
82 |
+
}
|
83 |
+
if(empty($text)) {
|
84 |
+
$text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>';
|
85 |
+
}
|
86 |
+
wp_clear_scheduled_hook('polls_cron');
|
87 |
+
if (!wp_next_scheduled('polls_cron')) {
|
88 |
+
wp_schedule_event(time(), 'daily', 'polls_cron');
|
89 |
+
}
|
90 |
+
}
|
91 |
+
?>
|
92 |
+
<script type="text/javascript">
|
93 |
+
/* <![CDATA[*/
|
94 |
+
function poll_default_templates(template) {
|
95 |
+
var default_template;
|
96 |
+
switch(template) {
|
97 |
+
case "voteheader":
|
98 |
+
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\">";
|
99 |
+
break;
|
100 |
+
case "votebody":
|
101 |
+
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>";
|
102 |
+
break;
|
103 |
+
case "votefooter":
|
104 |
+
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>";
|
105 |
+
break;
|
106 |
+
case "resultheader":
|
107 |
+
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\">";
|
108 |
+
break;
|
109 |
+
case "resultbody":
|
110 |
+
default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %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>";
|
111 |
+
break;
|
112 |
+
case "resultbody2":
|
113 |
+
default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %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>";
|
114 |
+
break;
|
115 |
+
case "resultfooter":
|
116 |
+
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n</div>";
|
117 |
+
break;
|
118 |
+
case "resultfooter2":
|
119 |
+
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>";
|
120 |
+
break;
|
121 |
+
case "pollarchivelink":
|
122 |
+
default_template = "<ul>\n<li><a href=\"%POLL_ARCHIVE_URL%\"><?php _e('Polls Archive', 'wp-polls'); ?></a></li>\n</ul>";
|
123 |
+
break;
|
124 |
+
case "pollarchiveheader":
|
125 |
+
default_template = "";
|
126 |
+
break;
|
127 |
+
case "pollarchivefooter":
|
128 |
+
default_template = "<p><?php _e('Start Date:', 'wp-polls'); ?> %POLL_START_DATE%<br /><?php _e('End Date:', 'wp-polls'); ?> %POLL_END_DATE%</p>";
|
129 |
+
break;
|
130 |
+
case "disable":
|
131 |
+
default_template = "<?php _e('Sorry, there are no polls available at the moment.', 'wp-polls'); ?>";
|
132 |
+
break;
|
133 |
+
case "error":
|
134 |
+
default_template = "<?php _e('An error has occurred when processing your poll.', 'wp-polls'); ?>";
|
135 |
+
break;
|
136 |
+
}
|
137 |
+
document.getElementById("poll_template_" + template).value = default_template;
|
138 |
+
}
|
139 |
+
/* ]]> */
|
140 |
+
</script>
|
141 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
142 |
+
<form id="poll_options_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
143 |
+
<div class="wrap">
|
144 |
+
<h2><?php _e('Poll Templates', 'wp-polls'); ?></h2>
|
145 |
+
<fieldset class="options">
|
146 |
+
<legend><?php _e('Template Variables', 'wp-polls'); ?></legend>
|
147 |
+
<table width="100%" border="0" cellspacing="0" cellpadding="5">
|
148 |
+
<tr>
|
149 |
+
<td>
|
150 |
+
<strong>%POLL_ID%</strong><br />
|
151 |
+
<?php _e('Display the poll\'s ID', 'wp-polls'); ?>
|
152 |
+
</td>
|
153 |
+
<td>
|
154 |
+
<strong>%POLL_ANSWER_ID%</strong><br />
|
155 |
+
<?php _e('Display the poll\'s answer ID', 'wp-polls'); ?>
|
156 |
+
</td>
|
157 |
+
</tr>
|
158 |
+
<tr>
|
159 |
+
<td>
|
160 |
+
<strong>%POLL_QUESTION%</strong><br />
|
161 |
+
<?php _e('Display the poll\'s question', 'wp-polls'); ?>
|
162 |
+
</td>
|
163 |
+
<td>
|
164 |
+
<strong>%POLL_ANSWER%</strong><br />
|
165 |
+
<?php _e('Display the poll\'s answer', 'wp-polls'); ?>
|
166 |
+
</td>
|
167 |
+
</tr>
|
168 |
+
<tr>
|
169 |
+
<td>
|
170 |
+
<strong>%POLL_TOTALVOTES%</strong><br />
|
171 |
+
<?php _e('Display the poll\'s total votes NOT the number of people who voted for the poll', 'wp-polls'); ?>
|
172 |
+
</td>
|
173 |
+
<td>
|
174 |
+
<strong>%POLL_ANSWER_TEXT%</strong><br />
|
175 |
+
<?php _e('Display the poll\'s answer without HTML formatting.', 'wp-polls'); ?>
|
176 |
+
</td>
|
177 |
+
</tr>
|
178 |
+
<tr>
|
179 |
+
<td>
|
180 |
+
<strong>%POLL_RESULT_URL%</strong><br />
|
181 |
+
<?php _e('Displays URL to poll\'s result', 'wp-polls'); ?>
|
182 |
+
</td>
|
183 |
+
<td>
|
184 |
+
<strong>%POLL_ANSWER_VOTES%</strong><br />
|
185 |
+
<?php _e('Display the poll\'s answer votes', 'wp-polls'); ?>
|
186 |
+
</td>
|
187 |
+
</tr>
|
188 |
+
<tr>
|
189 |
+
<td>
|
190 |
+
<strong>%POLL_MOST_ANSWER%</strong><br />
|
191 |
+
<?php _e('Display the poll\'s most voted answer', 'wp-polls'); ?>
|
192 |
+
</td>
|
193 |
+
<td>
|
194 |
+
<strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
|
195 |
+
<?php _e('Display the poll\'s answer percentage', 'wp-polls'); ?>
|
196 |
+
</td>
|
197 |
+
</tr>
|
198 |
+
<tr>
|
199 |
+
<td>
|
200 |
+
<strong>%POLL_MOST_VOTES%</strong><br />
|
201 |
+
<?php _e('Display the poll\'s answer votes for the most voted answer', 'wp-polls'); ?>
|
202 |
+
</td>
|
203 |
+
<td>
|
204 |
+
<strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
|
205 |
+
<?php _e('Display the poll\'s answer image width', 'wp-polls'); ?>
|
206 |
+
</td>
|
207 |
+
</tr>
|
208 |
+
<tr>
|
209 |
+
<td>
|
210 |
+
<strong>%POLL_MOST_PERCENTAGE%</strong><br />
|
211 |
+
<?php _e('Display the poll\'s answer percentage for the most voted answer', 'wp-polls'); ?>
|
212 |
+
</td>
|
213 |
+
<td>
|
214 |
+
<strong>%POLL_LEAST_ANSWER%</strong><br />
|
215 |
+
<?php _e('Display the poll\'s least voted answer', 'wp-polls'); ?>
|
216 |
+
</td>
|
217 |
+
</tr>
|
218 |
+
<tr>
|
219 |
+
<td>
|
220 |
+
<strong>%POLL_START_DATE%</strong><br />
|
221 |
+
<?php _e('Display the poll\'s start date/time', 'wp-polls'); ?>
|
222 |
+
</td>
|
223 |
+
<td>
|
224 |
+
<strong>%POLL_LEAST_VOTES%</strong><br />
|
225 |
+
<?php _e('Display the poll\'s answer votes for the least voted answer', 'wp-polls'); ?>
|
226 |
+
</td>
|
227 |
+
</tr>
|
228 |
+
<tr>
|
229 |
+
<td>
|
230 |
+
<strong>%POLL_END_DATE%</strong><br />
|
231 |
+
<?php _e('Display the poll\'s end date/time', 'wp-polls'); ?>
|
232 |
+
</td>
|
233 |
+
<td>
|
234 |
+
<strong>%POLL_LEAST_PERCENTAGE%</strong><br />
|
235 |
+
<?php _e('Display the poll\'s answer percentage for the least voted answer', 'wp-polls'); ?>
|
236 |
+
</td>
|
237 |
+
</tr>
|
238 |
+
<tr>
|
239 |
+
<td>
|
240 |
+
<strong>%POLL_MULTIPLE_ANS_MAX%</strong><br />
|
241 |
+
<?php _e('Display the the maximum number of answers the user can choose if the poll supports multiple answers', 'wp-polls'); ?>
|
242 |
+
</td>
|
243 |
+
<td>
|
244 |
+
<strong>%POLL_CHECKBOX_RADIO%</strong><br />
|
245 |
+
<?php _e('Display "checkbox" or "radio" input types depending on the poll type', 'wp-polls'); ?>
|
246 |
+
</td>
|
247 |
+
</tr>
|
248 |
+
<tr>
|
249 |
+
<td>
|
250 |
+
<strong>%POLL_TOTALVOTERS%</strong><br />
|
251 |
+
<?php _e('Display the number of people who voted for the poll NOT the total votes of the poll', 'wp-polls'); ?>
|
252 |
+
</td>
|
253 |
+
<td>
|
254 |
+
<strong>%POLL_ARCHIVE_URL%</strong><br />
|
255 |
+
<?php _e('Display the poll archive URL', 'wp-polls'); ?>
|
256 |
+
</td>
|
257 |
+
</tr>
|
258 |
+
<tr>
|
259 |
+
<td colspan="2">
|
260 |
+
<strong><?php _e('Note:', 'wp-polls'); ?></strong><br />
|
261 |
+
<?php _e('<strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</strong> will be different if your poll supports multiple answers. If your poll allows only single answer, both value will be the same.', 'wp-polls'); ?>
|
262 |
+
</td>
|
263 |
+
</tr>
|
264 |
+
</table>
|
265 |
+
</fieldset>
|
266 |
+
<fieldset class="options">
|
267 |
+
<legend><?php _e('Poll Voting Form Templates', 'wp-polls'); ?></legend>
|
268 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
269 |
+
<tr valign="top">
|
270 |
+
<td width="30%" align="left">
|
271 |
+
<strong><?php _e('Voting Form Header:', 'wp-polls'); ?></strong><br /><br /><br />
|
272 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
273 |
+
- %POLL_ID%<br />
|
274 |
+
- %POLL_QUESTION%<br />
|
275 |
+
- %POLL_START_DATE%<br />
|
276 |
+
- %POLL_END_DATE%<br />
|
277 |
+
- %POLL_TOTALVOTES%<br />
|
278 |
+
- %POLL_TOTALVOTERS%<br />
|
279 |
+
- %POLL_MULTIPLE_ANS_MAX%<br /><br />
|
280 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('voteheader');" class="button" />
|
281 |
+
</td>
|
282 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_voteheader'))); ?></textarea></td>
|
283 |
+
</tr>
|
284 |
+
<tr valign="top">
|
285 |
+
<td width="30%" align="left">
|
286 |
+
<strong><?php _e('Voting Form Body:', 'wp-polls'); ?></strong><br /><br /><br />
|
287 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
288 |
+
- %POLL_ID%<br />
|
289 |
+
- %POLL_ANSWER_ID%<br />
|
290 |
+
- %POLL_ANSWER%<br />
|
291 |
+
- %POLL_ANSWER_VOTES%<br />
|
292 |
+
- %POLL_CHECKBOX_RADIO%<br /><br />
|
293 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votebody');" class="button" />
|
294 |
+
</td>
|
295 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_votebody" name="poll_template_votebody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votebody'))); ?></textarea></td>
|
296 |
+
</tr>
|
297 |
+
<tr valign="top">
|
298 |
+
<td width="30%" align="left">
|
299 |
+
<strong><?php _e('Voting Form Footer:', 'wp-polls'); ?></strong><br /><br /><br />
|
300 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
301 |
+
- %POLL_ID%<br />
|
302 |
+
- %POLL_RESULT_URL%<br />
|
303 |
+
- %POLL_MULTIPLE_ANS_MAX%<br /><br />
|
304 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votefooter');" class="button" />
|
305 |
+
</td>
|
306 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votefooter'))); ?></textarea></td>
|
307 |
+
</tr>
|
308 |
+
</table>
|
309 |
+
</fieldset>
|
310 |
+
<fieldset class="options">
|
311 |
+
<legend><?php _e('Poll Result Templates', 'wp-polls'); ?></legend>
|
312 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
313 |
+
<tr valign="top">
|
314 |
+
<td width="30%" align="left">
|
315 |
+
<strong><?php _e('Result Header:', 'wp-polls'); ?></strong><br /><br /><br />
|
316 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
317 |
+
- %POLL_ID%<br />
|
318 |
+
- %POLL_QUESTION%<br />
|
319 |
+
- %POLL_START_DATE%<br />
|
320 |
+
- %POLL_END_DATE%<br />
|
321 |
+
- %POLL_TOTALVOTES%<br />
|
322 |
+
- %POLL_TOTALVOTERS%<br />
|
323 |
+
- %POLL_MULTIPLE_ANS_MAX%<br /><br />
|
324 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultheader');" class="button" />
|
325 |
+
</td>
|
326 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultheader'))); ?></textarea></td>
|
327 |
+
</tr>
|
328 |
+
<tr valign="top">
|
329 |
+
<td width="30%" align="left">
|
330 |
+
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
|
331 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
332 |
+
- %POLL_ANSWER_ID%<br />
|
333 |
+
- %POLL_ANSWER%<br />
|
334 |
+
- %POLL_ANSWER_TEXT%<br />
|
335 |
+
- %POLL_ANSWER_VOTES%<br />
|
336 |
+
- %POLL_ANSWER_PERCENTAGE%<br />
|
337 |
+
- %POLL_ANSWER_IMAGEWIDTH%<br /><br />
|
338 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody');" class="button" />
|
339 |
+
</td>
|
340 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody'))); ?></textarea></td>
|
341 |
+
</tr>
|
342 |
+
<tr valign="top">
|
343 |
+
<td width="30%" align="left">
|
344 |
+
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
|
345 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
346 |
+
- %POLL_ANSWER_ID%<br />
|
347 |
+
- %POLL_ANSWER%<br />
|
348 |
+
- %POLL_ANSWER_TEXT%<br />
|
349 |
+
- %POLL_ANSWER_VOTES%<br />
|
350 |
+
- %POLL_ANSWER_PERCENTAGE%<br />
|
351 |
+
- %POLL_ANSWER_IMAGEWIDTH%<br /><br />
|
352 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody2');" class="button" />
|
353 |
+
</td>
|
354 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody2'))); ?></textarea></td>
|
355 |
+
</tr>
|
356 |
+
<tr valign="top">
|
357 |
+
<td width="30%" align="left">
|
358 |
+
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
|
359 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
360 |
+
- %POLL_ID%<br />
|
361 |
+
- %POLL_START_DATE%<br />
|
362 |
+
- %POLL_END_DATE%<br />
|
363 |
+
- %POLL_TOTALVOTES%<br />
|
364 |
+
- %POLL_TOTALVOTERS%<br />
|
365 |
+
- %POLL_MOST_ANSWER%<br />
|
366 |
+
- %POLL_MOST_VOTES%<br />
|
367 |
+
- %POLL_MOST_PERCENTAGE%<br />
|
368 |
+
- %POLL_LEAST_ANSWER%<br />
|
369 |
+
- %POLL_LEAST_VOTES%<br />
|
370 |
+
- %POLL_LEAST_PERCENTAGE%<br />
|
371 |
+
- %POLL_MULTIPLE_ANS_MAX%<br /><br />
|
372 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter');" class="button" />
|
373 |
+
</td>
|
374 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter'))); ?></textarea></td>
|
375 |
+
</tr>
|
376 |
+
<tr valign="top">
|
377 |
+
<td width="30%" align="left">
|
378 |
+
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
|
379 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
380 |
+
- %POLL_ID%<br />
|
381 |
+
- %POLL_START_DATE%<br />
|
382 |
+
- %POLL_END_DATE%<br />
|
383 |
+
- %POLL_TOTALVOTES%<br />
|
384 |
+
- %POLL_TOTALVOTERS%<br />
|
385 |
+
- %POLL_MOST_ANSWER%<br />
|
386 |
+
- %POLL_MOST_VOTES%<br />
|
387 |
+
- %POLL_MOST_PERCENTAGE%<br />
|
388 |
+
- %POLL_LEAST_ANSWER%<br />
|
389 |
+
- %POLL_LEAST_VOTES%<br />
|
390 |
+
- %POLL_LEAST_PERCENTAGE%<br />
|
391 |
+
- %POLL_MULTIPLE_ANS_MAX%<br /><br />
|
392 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter2');" class="button" />
|
393 |
+
</td>
|
394 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter2'))); ?></textarea></td>
|
395 |
+
</tr>
|
396 |
+
</table>
|
397 |
+
</fieldset>
|
398 |
+
<fieldset class="options">
|
399 |
+
<legend><?php _e('Poll Archive Templates', 'wp-polls'); ?></legend>
|
400 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
401 |
+
<tr valign="top">
|
402 |
+
<td width="30%" align="left">
|
403 |
+
<strong><?php _e('Poll Archive Link', 'wp-polls'); ?></strong><br /><?php _e('Template For Displaying Poll Archive Link', 'wp-polls'); ?><br /><br />
|
404 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
405 |
+
- %POLL_ARCHIVE_URL%<br /><br />
|
406 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('pollarchivelink');" class="button" />
|
407 |
+
</td>
|
408 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_pollarchivelink" name="poll_template_pollarchivelink"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivelink'))); ?></textarea></td>
|
409 |
+
</tr>
|
410 |
+
<tr valign="top">
|
411 |
+
<td width="30%" align="left">
|
412 |
+
<strong><?php _e('Individual Poll Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
|
413 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
414 |
+
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
415 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('pollarchiveheader');" class="button" />
|
416 |
+
</td>
|
417 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_pollarchiveheader" name="poll_template_pollarchiveheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchiveheader'))); ?></textarea></td>
|
418 |
+
</tr>
|
419 |
+
<tr valign="top">
|
420 |
+
<td width="30%" align="left">
|
421 |
+
<strong><?php _e('Individual Poll Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
|
422 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
423 |
+
- %POLL_START_DATE%<br />
|
424 |
+
- %POLL_END_DATE%<br />
|
425 |
+
- %POLL_TOTALVOTES%<br />
|
426 |
+
- %POLL_TOTALVOTERS%<br />
|
427 |
+
- %POLL_MOST_ANSWER%<br />
|
428 |
+
- %POLL_MOST_VOTES%<br />
|
429 |
+
- %POLL_MOST_PERCENTAGE%<br />
|
430 |
+
- %POLL_LEAST_ANSWER%<br />
|
431 |
+
- %POLL_LEAST_VOTES%<br />
|
432 |
+
- %POLL_LEAST_PERCENTAGE%<br />
|
433 |
+
- %POLL_MULTIPLE_ANS_MAX%<br /><br />
|
434 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('pollarchivefooter');" class="button" />
|
435 |
+
</td>
|
436 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_pollarchivefooter" name="poll_template_pollarchivefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_pollarchivefooter'))); ?></textarea></td>
|
437 |
+
</tr>
|
438 |
+
</table>
|
439 |
+
</fieldset>
|
440 |
+
<fieldset class="options">
|
441 |
+
<legend><?php _e('Poll Misc Templates', 'wp-polls'); ?></legend>
|
442 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
443 |
+
<tr valign="top">
|
444 |
+
<td width="30%" align="left">
|
445 |
+
<strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The Poll Is Disabled', 'wp-polls'); ?><br /><br />
|
446 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
447 |
+
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
448 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('disable');" class="button" />
|
449 |
+
</td>
|
450 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_disable" name="poll_template_disable"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_disable'))); ?></textarea></td>
|
451 |
+
</tr>
|
452 |
+
<tr valign="top">
|
453 |
+
<td width="30%" align="left">
|
454 |
+
<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 />
|
455 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
456 |
+
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
457 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('error');" class="button" />
|
458 |
+
</td>
|
459 |
+
<td align="left"><textarea cols="80" rows="12" id="poll_template_error" name="poll_template_error"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_error'))); ?></textarea></td>
|
460 |
+
</tr>
|
461 |
+
</table>
|
462 |
+
</fieldset>
|
463 |
+
<div align="center">
|
464 |
+
<input type="submit" name="Submit" class="button" value="<?php _e('Update Templates', 'wp-polls'); ?>" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-polls'); ?>" class="button" onclick="javascript:history.go(-1)" />
|
465 |
+
</div>
|
466 |
+
</div>
|
467 |
+
</form>
|
polls/polls-uninstall.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Uninstall WP-Polls |
|
14 |
+
| - wp-content/plugins/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('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',
|
32 |
+
'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2',
|
33 |
+
'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll',
|
34 |
+
'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby',
|
35 |
+
'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show',
|
36 |
+
'poll_archive_url', 'poll_bar', 'poll_close', 'poll_ajax_style', 'poll_template_pollarchivelink', 'widget_polls', 'poll_archive_displaypoll', 'poll_archive_pollarchiveheader', 'poll_archive_pollarchivefooter');
|
37 |
+
|
38 |
+
### Form Processing
|
39 |
+
if(!empty($_POST['do'])) {
|
40 |
+
// Decide What To Do
|
41 |
+
switch($_POST['do']) {
|
42 |
+
// Uninstall WP-Polls (By: Philippe Corbes)
|
43 |
+
case __('UNINSTALL WP-Polls', 'wp-polls') :
|
44 |
+
if(trim($_POST['uninstall_poll_yes']) == 'yes') {
|
45 |
+
echo '<div id="message" class="updated fade">';
|
46 |
+
echo '<p>';
|
47 |
+
foreach($polls_tables as $table) {
|
48 |
+
$wpdb->query("DROP TABLE {$table}");
|
49 |
+
echo '<font style="color: green;">';
|
50 |
+
printf(__('Table \'%s\' has been deleted.', 'wp-polls'), "<strong><em>{$table}</em></strong>");
|
51 |
+
echo '</font><br />';
|
52 |
+
}
|
53 |
+
echo '</p>';
|
54 |
+
echo '<p>';
|
55 |
+
foreach($polls_settings as $setting) {
|
56 |
+
$delete_setting = delete_option($setting);
|
57 |
+
if($delete_setting) {
|
58 |
+
echo '<font color="green">';
|
59 |
+
printf(__('Setting Key \'%s\' has been deleted.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
|
60 |
+
echo '</font><br />';
|
61 |
+
} else {
|
62 |
+
echo '<font color="red">';
|
63 |
+
printf(__('Error deleting Setting Key \'%s\'.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
|
64 |
+
echo '</font><br />';
|
65 |
+
}
|
66 |
+
}
|
67 |
+
echo '</p>';
|
68 |
+
echo '</div>';
|
69 |
+
$mode = 'end-UNINSTALL';
|
70 |
+
}
|
71 |
+
break;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
### Determines Which Mode It Is
|
77 |
+
switch($mode) {
|
78 |
+
// Deactivating WP-Polls (By: Philippe Corbes)
|
79 |
+
case 'end-UNINSTALL':
|
80 |
+
$deactivate_url = "plugins.php?action=deactivate&plugin=polls/polls.php";
|
81 |
+
if(function_exists('wp_nonce_url')) {
|
82 |
+
$deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_polls/polls.php');
|
83 |
+
}
|
84 |
+
echo '<div class="wrap">';
|
85 |
+
echo '<h2>'.__('Uninstall WP-Polls', 'wp-polls').'</h2>';
|
86 |
+
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>';
|
87 |
+
echo '</div>';
|
88 |
+
break;
|
89 |
+
// Main Page
|
90 |
+
default:
|
91 |
+
?>
|
92 |
+
<!-- Uninstall WP-Polls (By: Philippe Corbes) -->
|
93 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
94 |
+
<div class="wrap">
|
95 |
+
<h2><?php _e('Uninstall WP-Polls', 'wp-polls'); ?></h2>
|
96 |
+
<p style="text-align: left;">
|
97 |
+
<?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'); ?>
|
98 |
+
</p>
|
99 |
+
<p style="text-align: left; color: red">
|
100 |
+
<strong><?php _e('WARNING:', 'wp-polls'); ?></strong><br />
|
101 |
+
<?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') ?>
|
102 |
+
</p>
|
103 |
+
<p style="text-align: left; color: red">
|
104 |
+
<strong><?php _e('The following WordPress Options/Tables will be DELETED:', 'wp-polls'); ?></strong><br />
|
105 |
+
</p>
|
106 |
+
<table width="50%" border="0" cellspacing="3" cellpadding="3">
|
107 |
+
<tr class="thead">
|
108 |
+
<td align="center"><strong><?php _e('WordPress Options', 'wp-polls'); ?></strong></td>
|
109 |
+
<td align="center"><strong><?php _e('WordPress Tables', 'wp-polls'); ?></strong></td>
|
110 |
+
</tr>
|
111 |
+
<tr>
|
112 |
+
<td valign="top" style="background-color: #eee;">
|
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" style="background-color: #eee;">
|
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> </p>
|
133 |
+
<p style="text-align: center;">
|
134 |
+
<input type="checkbox" name="uninstall_poll_yes" value="yes" /> <?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 |
+
?>
|
polls/polls-usage.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
-
| WordPress 2.1 Plugin: WP-Polls 2.
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
@@ -31,7 +31,7 @@ if(!current_user_can('manage_polls')) {
|
|
31 |
<li>
|
32 |
<?php _e("Add:", 'wp-polls'); ?>
|
33 |
<blockquote>
|
34 |
-
<pre class="wp-polls-usage-pre"><?php if (function_exists('vote_poll') &&
|
35 |
<li>
|
36 |
<h2>Polls</h2>
|
37 |
<ul>
|
@@ -117,6 +117,12 @@ if(!current_user_can('manage_polls')) {
|
|
117 |
<blockquote>
|
118 |
<pre class="wp-polls-usage-pre"><?php if (function_exists('get_pollvotes')): ?>
|
119 |
<?php get_pollvotes(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
<?php endif; ?> </pre>
|
121 |
</blockquote>
|
122 |
</div>
|
2 |
/*
|
3 |
+----------------------------------------------------------------+
|
4 |
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-Polls 2.20 |
|
6 |
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
| |
|
8 |
| File Written By: |
|
31 |
<li>
|
32 |
<?php _e("Add:", 'wp-polls'); ?>
|
33 |
<blockquote>
|
34 |
+
<pre class="wp-polls-usage-pre"><?php if (function_exists('vote_poll') && !in_pollarchive()): ?>
|
35 |
<li>
|
36 |
<h2>Polls</h2>
|
37 |
<ul>
|
117 |
<blockquote>
|
118 |
<pre class="wp-polls-usage-pre"><?php if (function_exists('get_pollvotes')): ?>
|
119 |
<?php get_pollvotes(); ?>
|
120 |
+
<?php endif; ?> </pre>
|
121 |
+
</blockquote>
|
122 |
+
<h3><?php _e("To Display Total Poll Voters", 'wp-polls'); ?></h3>
|
123 |
+
<blockquote>
|
124 |
+
<pre class="wp-polls-usage-pre"><?php if (function_exists('get_pollvoters')): ?>
|
125 |
+
<?php get_pollvoters(); ?>
|
126 |
<?php endif; ?> </pre>
|
127 |
</blockquote>
|
128 |
</div>
|
polls/polls-widget.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
/*
|
3 |
Plugin Name: WP-Polls Widget
|
4 |
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
-
Description: Adds a
|
6 |
-
Version: 2.
|
7 |
-
Author: GaMerZ
|
8 |
Author URI: http://www.lesterchan.net
|
9 |
*/
|
10 |
|
@@ -40,9 +40,16 @@ function widget_polls_init() {
|
|
40 |
extract($args);
|
41 |
$options = get_option('widget_polls');
|
42 |
$title = htmlspecialchars($options['title']);
|
43 |
-
if (function_exists('vote_poll') &&
|
44 |
echo $before_widget.$before_title.$title.$after_title;
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
display_polls_archive_link();
|
47 |
echo $after_widget;
|
48 |
}
|
@@ -54,16 +61,37 @@ function widget_polls_init() {
|
|
54 |
$options = get_option('widget_polls');
|
55 |
$current_poll = get_option('poll_currentpoll');
|
56 |
if (!is_array($options)) {
|
57 |
-
$options = array('title' => __('Polls', 'wp-polls'));
|
58 |
}
|
59 |
if ($_POST['polls-submit']) {
|
60 |
$poll_currentpoll = intval($_POST['poll_currentpoll']);
|
61 |
$poll_archive_show = intval($_POST['poll_archive_show']);
|
62 |
$options['title'] = strip_tags(stripslashes($_POST['polls-title']));
|
|
|
|
|
|
|
|
|
|
|
63 |
update_option('widget_polls', $options);
|
64 |
update_option('poll_currentpoll', $poll_currentpoll);
|
65 |
update_option('poll_archive_show', $poll_archive_show);
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
echo '<p style="text-align: left;"><label for="polls-title">';
|
68 |
_e('Title');
|
69 |
echo ': </label><input type="text" id="polls-title" name="polls-title" value="'.htmlspecialchars($options['title']).'" />'."\n";
|
@@ -85,7 +113,7 @@ function widget_polls_init() {
|
|
85 |
echo '<p style="text-align: left;"><label for="poll_currentpoll">';
|
86 |
_e('Current Active Poll', 'wp-polls');
|
87 |
echo ': </label>'."\n";
|
88 |
-
echo '<select id="poll_currentpoll" name="poll_currentpoll" size="1">'."\n";
|
89 |
echo '<option value="-1"';
|
90 |
selected(-1, $current_poll);
|
91 |
echo '>';
|
@@ -101,6 +129,11 @@ function widget_polls_init() {
|
|
101 |
echo '>';
|
102 |
_e('Display Latest Poll', 'wp-polls');
|
103 |
echo '</option>'."\n";
|
|
|
|
|
|
|
|
|
|
|
104 |
echo '<option value="0"> </option>'."\n";
|
105 |
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
106 |
if($polls) {
|
@@ -114,6 +147,31 @@ function widget_polls_init() {
|
|
114 |
}
|
115 |
}
|
116 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
echo '</select>'."\n";
|
118 |
echo '</p>'."\n";
|
119 |
echo '<input type="hidden" id="polls-submit" name="polls-submit" value="1" />'."\n";
|
@@ -121,7 +179,7 @@ function widget_polls_init() {
|
|
121 |
|
122 |
// Register Widgets
|
123 |
register_sidebar_widget(array('Polls', 'wp-polls'), 'widget_polls');
|
124 |
-
register_widget_control(array('Polls', 'wp-polls'), 'widget_polls_options', 400,
|
125 |
}
|
126 |
|
127 |
|
2 |
/*
|
3 |
Plugin Name: WP-Polls Widget
|
4 |
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
+
Description: Adds a Poll Widget to display single or multiple polls from WP-Polls Plugin. You will need to activate WP-Polls first.
|
6 |
+
Version: 2.20
|
7 |
+
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://www.lesterchan.net
|
9 |
*/
|
10 |
|
40 |
extract($args);
|
41 |
$options = get_option('widget_polls');
|
42 |
$title = htmlspecialchars($options['title']);
|
43 |
+
if (function_exists('vote_poll') && !in_pollarchive()) {
|
44 |
echo $before_widget.$before_title.$title.$after_title;
|
45 |
+
if(intval(get_option('poll_currentpoll')) == -3) {
|
46 |
+
$multiple_polls = explode(',', $options['multiple_polls']);
|
47 |
+
foreach($multiple_polls as $multiple_poll) {
|
48 |
+
get_poll($multiple_poll);
|
49 |
+
}
|
50 |
+
} else {
|
51 |
+
get_poll();
|
52 |
+
}
|
53 |
display_polls_archive_link();
|
54 |
echo $after_widget;
|
55 |
}
|
61 |
$options = get_option('widget_polls');
|
62 |
$current_poll = get_option('poll_currentpoll');
|
63 |
if (!is_array($options)) {
|
64 |
+
$options = array('title' => __('Polls', 'wp-polls'), 'poll_multiplepolls' => '');
|
65 |
}
|
66 |
if ($_POST['polls-submit']) {
|
67 |
$poll_currentpoll = intval($_POST['poll_currentpoll']);
|
68 |
$poll_archive_show = intval($_POST['poll_archive_show']);
|
69 |
$options['title'] = strip_tags(stripslashes($_POST['polls-title']));
|
70 |
+
if(is_array($_POST['poll_multiplepolls'])) {
|
71 |
+
$options['multiple_polls'] = implode(',', $_POST['poll_multiplepolls']);
|
72 |
+
} else {
|
73 |
+
$options['multiple_polls'] = $_POST['poll_multiplepolls'];
|
74 |
+
}
|
75 |
update_option('widget_polls', $options);
|
76 |
update_option('poll_currentpoll', $poll_currentpoll);
|
77 |
update_option('poll_archive_show', $poll_archive_show);
|
78 |
}
|
79 |
+
?>
|
80 |
+
<script type="text/javascript">
|
81 |
+
/* <![CDATA[*/
|
82 |
+
function show_multiple_polls() {
|
83 |
+
if(document.getElementById('poll_currentpoll').value == -3) {
|
84 |
+
document.getElementById('poll_multiplepolls').disabled = false;
|
85 |
+
document.getElementById('poll_multiplepolls_text').style.display = 'block';
|
86 |
+
} else {
|
87 |
+
document.getElementById('poll_multiplepolls').selectedIndex = -1;
|
88 |
+
document.getElementById('poll_multiplepolls').disabled = true;
|
89 |
+
document.getElementById('poll_multiplepolls_text').style.display = 'none';
|
90 |
+
}
|
91 |
+
}
|
92 |
+
/* ]]> */
|
93 |
+
</script>
|
94 |
+
<?php
|
95 |
echo '<p style="text-align: left;"><label for="polls-title">';
|
96 |
_e('Title');
|
97 |
echo ': </label><input type="text" id="polls-title" name="polls-title" value="'.htmlspecialchars($options['title']).'" />'."\n";
|
113 |
echo '<p style="text-align: left;"><label for="poll_currentpoll">';
|
114 |
_e('Current Active Poll', 'wp-polls');
|
115 |
echo ': </label>'."\n";
|
116 |
+
echo '<select id="poll_currentpoll" name="poll_currentpoll" size="1" onchange="show_multiple_polls()">'."\n";
|
117 |
echo '<option value="-1"';
|
118 |
selected(-1, $current_poll);
|
119 |
echo '>';
|
129 |
echo '>';
|
130 |
_e('Display Latest Poll', 'wp-polls');
|
131 |
echo '</option>'."\n";
|
132 |
+
echo '<option value="-3"';
|
133 |
+
selected(-3, $current_poll);
|
134 |
+
echo '>';
|
135 |
+
_e('Display Multiple Polls', 'wp-polls');
|
136 |
+
echo '</option>'."\n";
|
137 |
echo '<option value="0"> </option>'."\n";
|
138 |
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
139 |
if($polls) {
|
147 |
}
|
148 |
}
|
149 |
}
|
150 |
+
echo '</select></p>'."\n";
|
151 |
+
if($current_poll == -3) {
|
152 |
+
$display = 'display: block;';
|
153 |
+
$disabled = '';
|
154 |
+
} else {
|
155 |
+
$display = 'display: none;';
|
156 |
+
$disabled = 'disabled="disabled"';
|
157 |
+
}
|
158 |
+
echo '<p id="poll_multiplepolls_text" style="text-align: left; '.$display.'"><label for="poll_multiplepolls">';
|
159 |
+
_e('Select Multiple Polls', 'wp-polls');
|
160 |
+
echo ': </label>'."\n";
|
161 |
+
echo '<select id="poll_multiplepolls" name="poll_multiplepolls[]" size="5" multiple="true" style="vertical-align: text-top;" $disabled>'."\n";
|
162 |
+
$multiple_polls = explode(',', $options['multiple_polls']);
|
163 |
+
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
164 |
+
if($polls) {
|
165 |
+
foreach($polls as $poll) {
|
166 |
+
$poll_question = stripslashes($poll->pollq_question);
|
167 |
+
$poll_id = intval($poll->pollq_id);
|
168 |
+
if(in_array($poll_id, $multiple_polls)) {
|
169 |
+
echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n";
|
170 |
+
} else {
|
171 |
+
echo "<option value=\"$poll_id\">$poll_question</option>\n";
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
echo '</select>'."\n";
|
176 |
echo '</p>'."\n";
|
177 |
echo '<input type="hidden" id="polls-submit" name="polls-submit" value="1" />'."\n";
|
179 |
|
180 |
// Register Widgets
|
181 |
register_sidebar_widget(array('Polls', 'wp-polls'), 'widget_polls');
|
182 |
+
register_widget_control(array('Polls', 'wp-polls'), 'widget_polls_options', 400, 300);
|
183 |
}
|
184 |
|
185 |
|
polls/polls.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
/*
|
3 |
Plugin Name: WP-Polls
|
4 |
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
-
Description: Adds an AJAX poll system to your WordPress blog. You can
|
6 |
-
Version: 2.
|
7 |
-
Author: GaMerZ
|
8 |
Author URI: http://www.lesterchan.net
|
9 |
*/
|
10 |
|
@@ -52,8 +52,11 @@ function poll_menu() {
|
|
52 |
}
|
53 |
if (function_exists('add_submenu_page')) {
|
54 |
add_submenu_page('polls/polls-manager.php', __('Manage Polls', 'wp-polls'), __('Manage Polls', 'wp-polls'), 'manage_polls', 'polls/polls-manager.php');
|
|
|
55 |
add_submenu_page('polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'polls/polls-options.php');
|
|
|
56 |
add_submenu_page('polls/polls-manager.php', __('Poll Usage', 'wp-polls'), __('Poll Usage', 'wp-polls'), 'manage_polls', 'polls/polls-usage.php');
|
|
|
57 |
}
|
58 |
}
|
59 |
|
@@ -144,8 +147,8 @@ function get_poll($temp_poll_id = 0, $display = true) {
|
|
144 |
### Function: Displays Polls Header
|
145 |
add_action('wp_head', 'poll_header');
|
146 |
function poll_header() {
|
147 |
-
echo "\n".'<!-- Start Of Script Generated By WP-Polls 2.
|
148 |
-
wp_register_script('wp-polls', '/wp-content/plugins/polls/polls-js.php', false, '2.
|
149 |
wp_print_scripts(array('sack', 'wp-polls'));
|
150 |
echo '<link rel="stylesheet" href="'.get_option('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";
|
151 |
echo '<style type="text/css">'."\n";
|
@@ -170,13 +173,15 @@ function poll_header() {
|
|
170 |
echo '}'."\n";
|
171 |
}
|
172 |
echo '</style>'."\n";
|
173 |
-
echo '<!-- End Of Script Generated By WP-Polls 2.
|
174 |
}
|
175 |
|
176 |
|
177 |
### Function: Displays Polls Header In WP-Admin
|
178 |
add_action('admin_head', 'poll_header_admin');
|
179 |
function poll_header_admin() {
|
|
|
|
|
180 |
echo '<link rel="stylesheet" href="'.get_option('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";
|
181 |
}
|
182 |
|
@@ -228,7 +233,7 @@ function check_voted($poll_id) {
|
|
228 |
// Logged By Cookie And IP
|
229 |
case 3:
|
230 |
$check_voted_cookie = check_voted_cookie($poll_id);
|
231 |
-
if($check_voted_cookie
|
232 |
return $check_voted_cookie;
|
233 |
} else {
|
234 |
return check_voted_ip($poll_id);
|
@@ -244,8 +249,12 @@ function check_voted($poll_id) {
|
|
244 |
|
245 |
### Function: Check Voted By Cookie
|
246 |
function check_voted_cookie($poll_id) {
|
247 |
-
|
248 |
-
|
|
|
|
|
|
|
|
|
249 |
}
|
250 |
|
251 |
|
@@ -253,9 +262,8 @@ function check_voted_cookie($poll_id) {
|
|
253 |
function check_voted_ip($poll_id) {
|
254 |
global $wpdb;
|
255 |
// Check IP From IP Logging Database
|
256 |
-
$
|
257 |
-
|
258 |
-
return intval($get_voted_aid);
|
259 |
}
|
260 |
|
261 |
|
@@ -268,9 +276,8 @@ function check_voted_username($poll_id) {
|
|
268 |
}
|
269 |
$pollsip_userid = intval($user_ID);
|
270 |
// Check User ID From IP Logging Database
|
271 |
-
$
|
272 |
-
|
273 |
-
return intval($get_voted_aid);
|
274 |
}
|
275 |
|
276 |
|
@@ -280,11 +287,12 @@ function display_pollvote($poll_id, $without_poll_title = false) {
|
|
280 |
// Temp Poll Result
|
281 |
$temp_pollvote = '';
|
282 |
// Get Poll Question Data
|
283 |
-
$poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_timestamp, pollq_expiry FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
|
284 |
// Poll Question Variables
|
285 |
$poll_question_text = stripslashes($poll_question->pollq_question);
|
286 |
$poll_question_id = intval($poll_question->pollq_id);
|
287 |
$poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
|
|
|
288 |
$poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
|
289 |
$poll_expiry = trim($poll_question->pollq_expiry);
|
290 |
if(empty($poll_expiry)) {
|
@@ -292,12 +300,19 @@ function display_pollvote($poll_id, $without_poll_title = false) {
|
|
292 |
} else {
|
293 |
$poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
294 |
}
|
|
|
295 |
$template_question = stripslashes(get_option('poll_template_voteheader'));
|
296 |
$template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
|
297 |
$template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
|
298 |
$template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
|
|
|
299 |
$template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
|
300 |
$template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
|
|
|
|
|
|
|
|
|
|
|
301 |
// Get Poll Answers Data
|
302 |
$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'));
|
303 |
// If There Is Poll Question With Answers
|
@@ -305,8 +320,11 @@ function display_pollvote($poll_id, $without_poll_title = false) {
|
|
305 |
// Display Poll Voting Form
|
306 |
if(!$without_poll_title) {
|
307 |
$temp_pollvote .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
|
308 |
-
$temp_pollvote .= "\t<form id=\"polls_form_$poll_question_id\" action=\"".htmlspecialchars($_SERVER['REQUEST_URI'])."\" method=\"post\">\n";
|
309 |
-
$temp_pollvote .= "\t\t<p><input type=\"hidden\" name=\"poll_id\" value=\"$poll_question_id\" /></p>\n";
|
|
|
|
|
|
|
310 |
// Print Out Voting Form Header Template
|
311 |
$temp_pollvote .= "\t\t$template_question\n";
|
312 |
}
|
@@ -320,6 +338,11 @@ function display_pollvote($poll_id, $without_poll_title = false) {
|
|
320 |
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
321 |
$template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
|
322 |
$template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format($poll_answer_votes), $template_answer);
|
|
|
|
|
|
|
|
|
|
|
323 |
// Print Out Voting Form Body Template
|
324 |
$temp_pollvote .= "\t\t$template_answer\n";
|
325 |
}
|
@@ -339,12 +362,20 @@ function display_pollvote($poll_id, $without_poll_title = false) {
|
|
339 |
$template_footer = str_replace("%POLL_RESULT_URL%", $poll_result_url, $template_footer);
|
340 |
$template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
|
341 |
$template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
|
|
|
|
|
|
|
|
|
|
|
342 |
// Print Out Voting Form Footer Template
|
343 |
$temp_pollvote .= "\t\t$template_footer\n";
|
344 |
if(!$without_poll_title) {
|
345 |
$temp_pollvote .= "\t</form>\n";
|
346 |
$temp_pollvote .= "</div>\n";
|
347 |
-
$
|
|
|
|
|
|
|
348 |
}
|
349 |
} else {
|
350 |
$temp_pollvote .= stripslashes(get_option('poll_template_disable'));
|
@@ -355,8 +386,12 @@ function display_pollvote($poll_id, $without_poll_title = false) {
|
|
355 |
|
356 |
|
357 |
### Function: Display Results Form
|
358 |
-
function display_pollresult($poll_id, $user_voted =
|
359 |
global $wpdb;
|
|
|
|
|
|
|
|
|
360 |
// Temp Poll Result
|
361 |
$temp_pollresult = '';
|
362 |
// Most/Least Variables
|
@@ -367,11 +402,12 @@ function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = fal
|
|
367 |
$poll_least_votes = 0;
|
368 |
$poll_least_percentage = 0;
|
369 |
// Get Poll Question Data
|
370 |
-
$poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes, pollq_active, pollq_timestamp, pollq_expiry FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
|
371 |
// Poll Question Variables
|
372 |
$poll_question_text = stripslashes($poll_question->pollq_question);
|
373 |
$poll_question_id = intval($poll_question->pollq_id);
|
374 |
$poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
|
|
|
375 |
$poll_question_active = intval($poll_question->pollq_active);
|
376 |
$poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
|
377 |
$poll_expiry = trim($poll_question->pollq_expiry);
|
@@ -380,12 +416,19 @@ function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = fal
|
|
380 |
} else {
|
381 |
$poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
382 |
}
|
|
|
383 |
$template_question = stripslashes(get_option('poll_template_resultheader'));
|
384 |
$template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
|
385 |
$template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
|
386 |
$template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
|
|
|
387 |
$template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
|
388 |
$template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
|
|
|
|
|
|
|
|
|
|
|
389 |
// Get Poll Answers Data
|
390 |
$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'));
|
391 |
// If There Is Poll Question With Answers
|
@@ -410,7 +453,7 @@ function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = fal
|
|
410 |
// Calculate Percentage And Image Bar Width
|
411 |
if(!$poll_totalvotes_zero) {
|
412 |
if($poll_answer_votes > 0) {
|
413 |
-
$poll_answer_percentage = round((($poll_answer_votes/$
|
414 |
$poll_answer_imagewidth = round($poll_answer_percentage);
|
415 |
if($poll_answer_imagewidth == 100) {
|
416 |
$poll_answer_imagewidth = 99;
|
@@ -424,7 +467,7 @@ function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = fal
|
|
424 |
$poll_answer_imagewidth = 1;
|
425 |
}
|
426 |
// Let User See What Options They Voted
|
427 |
-
if($
|
428 |
// Results Body Variables
|
429 |
$template_answer = stripslashes(get_option('poll_template_resultbody2'));
|
430 |
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
@@ -464,7 +507,7 @@ function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = fal
|
|
464 |
}
|
465 |
}
|
466 |
// Results Footer Variables
|
467 |
-
if($user_voted
|
468 |
$template_footer = stripslashes(get_option('poll_template_resultfooter'));
|
469 |
} else {
|
470 |
$template_footer = stripslashes(get_option('poll_template_resultfooter2'));
|
@@ -473,17 +516,26 @@ function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = fal
|
|
473 |
$template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
|
474 |
$template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
|
475 |
$template_footer = str_replace("%POLL_TOTALVOTES%", number_format($poll_question_totalvotes), $template_footer);
|
|
|
476 |
$template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
|
477 |
$template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer);
|
478 |
$template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
|
479 |
$template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
|
480 |
$template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer);
|
481 |
$template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
|
|
|
|
|
|
|
|
|
|
|
482 |
// Print Out Results Footer Template
|
483 |
$temp_pollresult .= "\t\t$template_footer\n";
|
484 |
if(!$without_poll_title) {
|
485 |
$temp_pollresult .= "</div>\n";
|
486 |
-
$
|
|
|
|
|
|
|
487 |
}
|
488 |
} else {
|
489 |
$temp_pollresult .= stripslashes(get_option('poll_template_disable'));
|
@@ -513,7 +565,7 @@ if(!function_exists('get_ipaddress')) {
|
|
513 |
### Function: Place Polls Archive In Content
|
514 |
add_filter('the_content', 'place_pollsarchive', '7');
|
515 |
function place_pollsarchive($content){
|
516 |
-
$content = preg_replace(
|
517 |
return $content;
|
518 |
}
|
519 |
|
@@ -521,7 +573,11 @@ function place_pollsarchive($content){
|
|
521 |
### Function: Place Poll In Content (By: Robert Accettura Of http://robert.accettura.com/)
|
522 |
add_filter('the_content', 'place_poll', '7');
|
523 |
function place_poll($content){
|
524 |
-
|
|
|
|
|
|
|
|
|
525 |
return $content;
|
526 |
}
|
527 |
|
@@ -564,11 +620,25 @@ if(!function_exists('get_pollanswers')) {
|
|
564 |
if(!function_exists('get_pollvotes')) {
|
565 |
function get_pollvotes($display = true) {
|
566 |
global $wpdb;
|
567 |
-
$
|
568 |
if($display) {
|
569 |
-
echo number_format($
|
570 |
} else {
|
571 |
-
return number_format($
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
}
|
573 |
}
|
574 |
}
|
@@ -577,14 +647,14 @@ if(!function_exists('get_pollvotes')) {
|
|
577 |
### Function: Check Voted To Get Voted Answer
|
578 |
function check_voted_multiple($poll_id) {
|
579 |
global $polls_ips;
|
580 |
-
$temp_voted_aid =
|
581 |
-
if(
|
582 |
-
$temp_voted_aid =
|
583 |
} else {
|
584 |
if($polls_ips) {
|
585 |
foreach($polls_ips as $polls_ip) {
|
586 |
if($polls_ip['qid'] == $poll_id) {
|
587 |
-
$temp_voted_aid = $polls_ip['aid'];
|
588 |
}
|
589 |
}
|
590 |
}
|
@@ -612,17 +682,19 @@ function polls_archive_link($page) {
|
|
612 |
### Function: Displays Polls Archive Link
|
613 |
function display_polls_archive_link($display = true) {
|
614 |
if(intval(get_option('poll_archive_show')) == 1) {
|
|
|
|
|
615 |
if($display) {
|
616 |
-
echo
|
617 |
} else{
|
618 |
-
return
|
619 |
}
|
620 |
}
|
621 |
}
|
622 |
|
623 |
|
624 |
### Function: Display Polls Archive
|
625 |
-
function polls_archive(
|
626 |
global $wpdb, $polls_ips, $in_pollsarchive;
|
627 |
// Polls Variables
|
628 |
$in_pollsarchive = true;
|
@@ -635,13 +707,23 @@ function polls_archive($output = 'both') {
|
|
635 |
$poll_voted = false;
|
636 |
$poll_voted_aid = 0;
|
637 |
$poll_id = 0;
|
638 |
-
$pollsarchive_output_current_title = '';
|
639 |
-
$pollsarchive_output_current = '';
|
640 |
-
$pollsarchive_output_archive_title = '';
|
641 |
$pollsarchive_output_archive = '';
|
642 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
// Get Total Polls
|
644 |
-
$total_polls = $wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq WHERE
|
645 |
|
646 |
// Checking $page and $offset
|
647 |
if (empty($page) || $page == 0) { $page = 1; }
|
@@ -667,33 +749,11 @@ function polls_archive($output = 'both') {
|
|
667 |
// Determing Total Amount Of Pages
|
668 |
$total_pages = ceil($total_polls / $polls_perpage);
|
669 |
|
670 |
-
// Make Sure Poll Is Not Disabled
|
671 |
-
if(intval(get_option('poll_currentpoll')) != -1 && $page < 2) {
|
672 |
-
// Hardcoded Poll ID Is Not Specified
|
673 |
-
if(intval($temp_poll_id) == 0) {
|
674 |
-
// Random Poll
|
675 |
-
if(intval(get_option('poll_currentpoll')) == -2) {
|
676 |
-
$random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1");
|
677 |
-
$poll_id = intval($random_poll_id);
|
678 |
-
// Current Poll ID Is Not Specified
|
679 |
-
} else if(intval(get_option('poll_currentpoll')) == 0) {
|
680 |
-
// Get Lastest Poll ID
|
681 |
-
$poll_id = intval(get_option('poll_latestpoll'));
|
682 |
-
} else {
|
683 |
-
// Get Current Poll ID
|
684 |
-
$poll_id = intval(get_option('poll_currentpoll'));
|
685 |
-
}
|
686 |
-
// Get Hardcoded Poll ID
|
687 |
-
} else {
|
688 |
-
$poll_id = intval($temp_poll_id);
|
689 |
-
}
|
690 |
-
}
|
691 |
-
|
692 |
// Get Poll Questions
|
693 |
-
$questions = $wpdb->get_results("SELECT * FROM $wpdb->pollsq WHERE
|
694 |
if($questions) {
|
695 |
foreach($questions as $question) {
|
696 |
-
$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));
|
697 |
$poll_questions_ids .= intval($question->pollq_id).', ';
|
698 |
}
|
699 |
$poll_questions_ids = substr($poll_questions_ids, 0, -2);
|
@@ -715,31 +775,7 @@ function polls_archive($output = 'both') {
|
|
715 |
}
|
716 |
}
|
717 |
|
718 |
-
// Current Poll
|
719 |
-
if($page < 2) {
|
720 |
-
$pollsarchive_output_current_title = '<h2>'.__('Current Poll', 'wp-polls').'</h2>'."\n";
|
721 |
-
// Current Poll
|
722 |
-
if(intval(get_option('poll_currentpoll')) == -1) {
|
723 |
-
$pollsarchive_output_current .= get_option('poll_template_disable');
|
724 |
-
} else {
|
725 |
-
// User Click on View Results Link
|
726 |
-
if(intval($_GET['pollresult']) == $poll_id) {
|
727 |
-
$pollsarchive_output_current .= display_pollresult($poll_id);
|
728 |
-
// Check Whether User Has Voted
|
729 |
-
} else {
|
730 |
-
$poll_active = $wpdb->get_var("SELECT pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
731 |
-
$poll_active = intval($poll_active);
|
732 |
-
$check_voted = check_voted($poll_id);
|
733 |
-
if($check_voted > 0 || $poll_active == 0) {
|
734 |
-
$pollsarchive_output_current .= display_pollresult($poll_id, $check_voted);
|
735 |
-
} else {
|
736 |
-
$pollsarchive_output_current .= display_pollvote($poll_id);
|
737 |
-
}
|
738 |
-
}
|
739 |
-
}
|
740 |
-
}
|
741 |
// Poll Archives
|
742 |
-
$pollsarchive_output_archive_title = "<h2>".__('Polls Archive', 'wp-polls')."</h2>\n";
|
743 |
$pollsarchive_output_archive .= "<div class=\"wp-polls\">\n";
|
744 |
foreach($polls_questions as $polls_question) {
|
745 |
// Most/Least Variables
|
@@ -760,21 +796,30 @@ function polls_archive($output = 'both') {
|
|
760 |
} else {
|
761 |
$poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $polls_question['end']));
|
762 |
}
|
|
|
|
|
763 |
// Poll Question Variables
|
764 |
$template_question = stripslashes(get_option('poll_template_resultheader'));
|
765 |
$template_question = str_replace("%POLL_QUESTION%", $polls_question['question'], $template_question);
|
766 |
$template_question = str_replace("%POLL_ID%", $polls_question['id'], $template_question);
|
767 |
$template_question = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_question);
|
|
|
768 |
$template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
|
769 |
$template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
|
|
|
|
|
|
|
|
|
|
|
770 |
// Print Out Result Header Template
|
|
|
771 |
$pollsarchive_output_archive .= $template_question;
|
772 |
foreach($polls_answers as $polls_answer) {
|
773 |
if($polls_question['id'] == $polls_answer['qid']) {
|
774 |
// Calculate Percentage And Image Bar Width
|
775 |
if(!$poll_totalvotes_zero) {
|
776 |
if($polls_answer['votes'] > 0) {
|
777 |
-
$poll_answer_percentage = round((($polls_answer['votes']/$polls_question['
|
778 |
$poll_answer_imagewidth = round($poll_answer_percentage*0.9);
|
779 |
} else {
|
780 |
$poll_answer_percentage = 0;
|
@@ -785,7 +830,7 @@ function polls_archive($output = 'both') {
|
|
785 |
$poll_answer_imagewidth = 1;
|
786 |
}
|
787 |
// Let User See What Options They Voted
|
788 |
-
if(
|
789 |
// Results Body Variables
|
790 |
$template_answer = stripslashes(get_option('poll_template_resultbody2'));
|
791 |
$template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
|
@@ -832,14 +877,39 @@ function polls_archive($output = 'both') {
|
|
832 |
$template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
|
833 |
$template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
|
834 |
$template_footer = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_footer);
|
|
|
835 |
$template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
|
836 |
$template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer);
|
837 |
$template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
|
838 |
$template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
|
839 |
$template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer);
|
840 |
$template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
841 |
// Print Out Results Footer Template
|
842 |
$pollsarchive_output_archive .= $template_footer;
|
|
|
|
|
843 |
}
|
844 |
$pollsarchive_output_archive .= "</div>\n";
|
845 |
|
@@ -892,7 +962,7 @@ function polls_archive($output = 'both') {
|
|
892 |
}
|
893 |
|
894 |
// Output Polls Archive Page
|
895 |
-
return $
|
896 |
}
|
897 |
|
898 |
|
@@ -994,15 +1064,33 @@ function polls_latest_id() {
|
|
994 |
}
|
995 |
|
996 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
997 |
### Function: Vote Poll
|
998 |
vote_poll();
|
999 |
function vote_poll() {
|
1000 |
global $wpdb, $user_identity, $user_ID;
|
|
|
1001 |
if(!empty($_POST['vote'])) {
|
1002 |
-
header('Content-Type: text/html; charset='.get_option('blog_charset'));
|
1003 |
$poll_id = intval($_POST['poll_id']);
|
1004 |
-
$poll_aid =
|
1005 |
-
|
|
|
1006 |
$check_voted = check_voted($poll_id);
|
1007 |
if($check_voted == 0) {
|
1008 |
if(!empty($user_identity)) {
|
@@ -1014,35 +1102,33 @@ function vote_poll() {
|
|
1014 |
}
|
1015 |
$pollip_userid = intval($user_ID);
|
1016 |
$pollip_ip = get_ipaddress();
|
1017 |
-
$pollip_host = gethostbyaddr($pollip_ip);
|
1018 |
$pollip_timestamp = current_time('timestamp');
|
1019 |
// Only Create Cookie If User Choose Logging Method 1 Or 2
|
1020 |
$poll_logging_method = intval(get_option('poll_logging_method'));
|
1021 |
if($poll_logging_method == 1 || $poll_logging_method == 3) {
|
1022 |
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH);
|
1023 |
}
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
exit();
|
1035 |
-
} // End if($vote_q)
|
1036 |
} else {
|
1037 |
-
|
1038 |
exit();
|
1039 |
} // End if($vote_a)
|
1040 |
} else {
|
1041 |
-
|
1042 |
exit();
|
1043 |
}// End if($check_voted)
|
1044 |
} else {
|
1045 |
-
|
1046 |
exit();
|
1047 |
} // End if($poll_id > 0 && $poll_aid > 0)
|
1048 |
} elseif (intval($_GET['pollresult']) > 0) {
|
@@ -1071,6 +1157,8 @@ function create_poll_table() {
|
|
1071 |
"pollq_totalvotes int(10) NOT NULL default '0',".
|
1072 |
"pollq_active tinyint(1) NOT NULL default '1',".
|
1073 |
"pollq_expiry varchar(20) NOT NULL default '',".
|
|
|
|
|
1074 |
"PRIMARY KEY (pollq_id))";
|
1075 |
$create_table['pollsa'] = "CREATE TABLE $wpdb->pollsa (".
|
1076 |
"polla_aid int(10) NOT NULL auto_increment,".
|
@@ -1096,7 +1184,7 @@ function create_poll_table() {
|
|
1096 |
// If Install, Insert 1st Poll Question With 5 Poll Answers
|
1097 |
if(empty($first_poll)) {
|
1098 |
// Insert Poll Question (1 Record)
|
1099 |
-
$insert_pollq = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (1, '".__('How Is My Site?', 'wp-polls')."', '".current_time('timestamp')."', 0, 1, '');");
|
1100 |
if($insert_pollq) {
|
1101 |
// Insert Poll Answers (5 Records)
|
1102 |
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (1, 1, '".__('Good', 'wp-polls')."', 0);");
|
@@ -1110,7 +1198,7 @@ function create_poll_table() {
|
|
1110 |
add_option('poll_template_voteheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
|
1111 |
'<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
|
1112 |
'<ul class="wp-polls-ul">', 'Template For Poll\'s Question');
|
1113 |
-
add_option('poll_template_votebody', '<li><input type="
|
1114 |
add_option('poll_template_votefooter', '</ul>'.
|
1115 |
'<p style="text-align: center;"><input type="button" name="vote" value=" '.__('Vote', 'wp-polls').' " class="Buttons" onclick="poll_vote(%POLL_ID%);" onkeypress="poll_result(%POLL_ID%);" /></p>'.
|
1116 |
'<p style="text-align: center;"><a href="#ViewPollResults" onclick="poll_result(%POLL_ID%); return false;" onkeypress="poll_result(%POLL_ID%); return false;" title="'.__('View Results Of This Poll', 'wp-polls').'">'.__('View Results', 'wp-polls').'</a></p>'.
|
@@ -1118,13 +1206,13 @@ function create_poll_table() {
|
|
1118 |
add_option('poll_template_resultheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
|
1119 |
'<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
|
1120 |
'<ul class="wp-polls-ul">', 'Template For Poll Header');
|
1121 |
-
add_option('poll_template_resultbody', '<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE
|
1122 |
-
add_option('poll_template_resultbody2', '<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE
|
1123 |
add_option('poll_template_resultfooter', '</ul>'.
|
1124 |
-
'<p style="text-align: center;">'.__('Total
|
1125 |
'</div>', 'Template For Poll Result Footer');
|
1126 |
add_option('poll_template_resultfooter2', '</ul>'.
|
1127 |
-
'<p style="text-align: center;">'.__('Total
|
1128 |
'<p style="text-align: center;"><a href="#VotePoll" onclick="poll_booth(%POLL_ID%); return false;" onkeypress="poll_booth(%POLL_ID%); return false;" title="'.__('Vote For This Poll', 'wp-polls').'">'.__('Vote', 'wp-polls').'</a></p>'.
|
1129 |
'</div>', 'Template For Poll Result Footer');
|
1130 |
add_option('poll_template_disable', __('Sorry, there are no polls available at the moment.', 'wp-polls'), 'Template For Poll When It Is Disabled');
|
@@ -1149,6 +1237,19 @@ function create_poll_table() {
|
|
1149 |
// Database Upgrade For WP-Polls 2.14
|
1150 |
maybe_add_column($wpdb->pollsq, 'pollq_expiry', "ALTER TABLE $wpdb->pollsq ADD pollq_expiry varchar(20) NOT NULL default '';");
|
1151 |
add_option('poll_close', 1, 'Poll Close');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1152 |
// Set 'manage_polls' Capabilities To Administrator
|
1153 |
$role = get_role('administrator');
|
1154 |
if(!$role->has_cap('manage_polls')) {
|
2 |
/*
|
3 |
Plugin Name: WP-Polls
|
4 |
Plugin URI: http://www.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.20
|
7 |
+
Author: Lester 'GaMerZ' Chan
|
8 |
Author URI: http://www.lesterchan.net
|
9 |
*/
|
10 |
|
52 |
}
|
53 |
if (function_exists('add_submenu_page')) {
|
54 |
add_submenu_page('polls/polls-manager.php', __('Manage Polls', 'wp-polls'), __('Manage Polls', 'wp-polls'), 'manage_polls', 'polls/polls-manager.php');
|
55 |
+
add_submenu_page('polls/polls-manager.php', __('Add Poll', 'wp-polls'), __('Add Poll', 'wp-polls'), 'manage_polls', 'polls/polls-add.php');
|
56 |
add_submenu_page('polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'polls/polls-options.php');
|
57 |
+
add_submenu_page('polls/polls-manager.php', __('Poll Templates', 'wp-polls'), __('Poll Templates', 'wp-polls'), 'manage_polls', 'polls/polls-templates.php');
|
58 |
add_submenu_page('polls/polls-manager.php', __('Poll Usage', 'wp-polls'), __('Poll Usage', 'wp-polls'), 'manage_polls', 'polls/polls-usage.php');
|
59 |
+
add_submenu_page('polls/polls-manager.php', __('Uninstall WP-Polls', 'wp-polls'), __('Uninstall WP-Polls', 'wp-polls'), 'manage_polls', 'polls/polls-uninstall.php');
|
60 |
}
|
61 |
}
|
62 |
|
147 |
### Function: Displays Polls Header
|
148 |
add_action('wp_head', 'poll_header');
|
149 |
function poll_header() {
|
150 |
+
echo "\n".'<!-- Start Of Script Generated By WP-Polls 2.20 -->'."\n";
|
151 |
+
wp_register_script('wp-polls', '/wp-content/plugins/polls/polls-js.php', false, '2.20');
|
152 |
wp_print_scripts(array('sack', 'wp-polls'));
|
153 |
echo '<link rel="stylesheet" href="'.get_option('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";
|
154 |
echo '<style type="text/css">'."\n";
|
173 |
echo '}'."\n";
|
174 |
}
|
175 |
echo '</style>'."\n";
|
176 |
+
echo '<!-- End Of Script Generated By WP-Polls 2.20 -->'."\n";
|
177 |
}
|
178 |
|
179 |
|
180 |
### Function: Displays Polls Header In WP-Admin
|
181 |
add_action('admin_head', 'poll_header_admin');
|
182 |
function poll_header_admin() {
|
183 |
+
wp_register_script('wp-polls-admin', '/wp-content/plugins/polls/polls-admin-js.php', false, '2.20');
|
184 |
+
wp_print_scripts(array('sack', 'wp-polls-admin'));
|
185 |
echo '<link rel="stylesheet" href="'.get_option('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";
|
186 |
}
|
187 |
|
233 |
// Logged By Cookie And IP
|
234 |
case 3:
|
235 |
$check_voted_cookie = check_voted_cookie($poll_id);
|
236 |
+
if(!empty($check_voted_cookie)) {
|
237 |
return $check_voted_cookie;
|
238 |
} else {
|
239 |
return check_voted_ip($poll_id);
|
249 |
|
250 |
### Function: Check Voted By Cookie
|
251 |
function check_voted_cookie($poll_id) {
|
252 |
+
if(!empty($_COOKIE["voted_$poll_id"])) {
|
253 |
+
$get_voted_aids = explode(',', $_COOKIE["voted_$poll_id"]);
|
254 |
+
} else {
|
255 |
+
$get_voted_aids = 0;
|
256 |
+
}
|
257 |
+
return $get_voted_aids;
|
258 |
}
|
259 |
|
260 |
|
262 |
function check_voted_ip($poll_id) {
|
263 |
global $wpdb;
|
264 |
// Check IP From IP Logging Database
|
265 |
+
$get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."'");
|
266 |
+
return $get_voted_aids;
|
|
|
267 |
}
|
268 |
|
269 |
|
276 |
}
|
277 |
$pollsip_userid = intval($user_ID);
|
278 |
// Check User ID From IP Logging Database
|
279 |
+
$get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid = $pollsip_userid");
|
280 |
+
return $get_voted_aids;
|
|
|
281 |
}
|
282 |
|
283 |
|
287 |
// Temp Poll Result
|
288 |
$temp_pollvote = '';
|
289 |
// Get Poll Question Data
|
290 |
+
$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");
|
291 |
// Poll Question Variables
|
292 |
$poll_question_text = stripslashes($poll_question->pollq_question);
|
293 |
$poll_question_id = intval($poll_question->pollq_id);
|
294 |
$poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
|
295 |
+
$poll_question_totalvoters = intval($poll_question->pollq_totalvoters);
|
296 |
$poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
|
297 |
$poll_expiry = trim($poll_question->pollq_expiry);
|
298 |
if(empty($poll_expiry)) {
|
300 |
} else {
|
301 |
$poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
302 |
}
|
303 |
+
$poll_multiple_ans = intval($poll_question->pollq_multiple);
|
304 |
$template_question = stripslashes(get_option('poll_template_voteheader'));
|
305 |
$template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
|
306 |
$template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
|
307 |
$template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
|
308 |
+
$template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question);
|
309 |
$template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
|
310 |
$template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
|
311 |
+
if($poll_multiple_ans > 0) {
|
312 |
+
$template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question);
|
313 |
+
} else {
|
314 |
+
$template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
|
315 |
+
}
|
316 |
// Get Poll Answers Data
|
317 |
$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'));
|
318 |
// If There Is Poll Question With Answers
|
320 |
// Display Poll Voting Form
|
321 |
if(!$without_poll_title) {
|
322 |
$temp_pollvote .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
|
323 |
+
$temp_pollvote .= "\t<form id=\"polls_form_$poll_question_id\" class=\"wp-polls-form\" action=\"".htmlspecialchars($_SERVER['REQUEST_URI'])."\" method=\"post\">\n";
|
324 |
+
$temp_pollvote .= "\t\t<p style=\"display: none;\"><input type=\"hidden\" name=\"poll_id\" value=\"$poll_question_id\" /></p>\n";
|
325 |
+
if($poll_multiple_ans > 0) {
|
326 |
+
$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";
|
327 |
+
}
|
328 |
// Print Out Voting Form Header Template
|
329 |
$temp_pollvote .= "\t\t$template_question\n";
|
330 |
}
|
338 |
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
339 |
$template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
|
340 |
$template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format($poll_answer_votes), $template_answer);
|
341 |
+
if($poll_multiple_ans > 0) {
|
342 |
+
$template_answer = str_replace("%POLL_CHECKBOX_RADIO%", 'checkbox', $template_answer);
|
343 |
+
} else {
|
344 |
+
$template_answer = str_replace("%POLL_CHECKBOX_RADIO%", 'radio', $template_answer);
|
345 |
+
}
|
346 |
// Print Out Voting Form Body Template
|
347 |
$temp_pollvote .= "\t\t$template_answer\n";
|
348 |
}
|
362 |
$template_footer = str_replace("%POLL_RESULT_URL%", $poll_result_url, $template_footer);
|
363 |
$template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
|
364 |
$template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
|
365 |
+
if($poll_multiple_ans > 0) {
|
366 |
+
$template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer);
|
367 |
+
} else {
|
368 |
+
$template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
|
369 |
+
}
|
370 |
// Print Out Voting Form Footer Template
|
371 |
$temp_pollvote .= "\t\t$template_footer\n";
|
372 |
if(!$without_poll_title) {
|
373 |
$temp_pollvote .= "\t</form>\n";
|
374 |
$temp_pollvote .= "</div>\n";
|
375 |
+
$poll_ajax_style = get_option('poll_ajax_style');
|
376 |
+
if(intval($poll_ajax_style['loading']) == 1) {
|
377 |
+
$temp_pollvote .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".get_option('siteurl')."/wp-content/plugins/polls/images/loading.gif\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" /> ".__('Loading', 'wp-polls')." ...</div>\n";
|
378 |
+
}
|
379 |
}
|
380 |
} else {
|
381 |
$temp_pollvote .= stripslashes(get_option('poll_template_disable'));
|
386 |
|
387 |
|
388 |
### Function: Display Results Form
|
389 |
+
function display_pollresult($poll_id, $user_voted = '', $without_poll_title = false) {
|
390 |
global $wpdb;
|
391 |
+
// User Voted
|
392 |
+
if(!is_array($user_voted)) {
|
393 |
+
$user_voted = array();
|
394 |
+
}
|
395 |
// Temp Poll Result
|
396 |
$temp_pollresult = '';
|
397 |
// Most/Least Variables
|
402 |
$poll_least_votes = 0;
|
403 |
$poll_least_percentage = 0;
|
404 |
// Get Poll Question Data
|
405 |
+
$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");
|
406 |
// Poll Question Variables
|
407 |
$poll_question_text = stripslashes($poll_question->pollq_question);
|
408 |
$poll_question_id = intval($poll_question->pollq_id);
|
409 |
$poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
|
410 |
+
$poll_question_totalvoters = intval($poll_question->pollq_totalvoters);
|
411 |
$poll_question_active = intval($poll_question->pollq_active);
|
412 |
$poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));
|
413 |
$poll_expiry = trim($poll_question->pollq_expiry);
|
416 |
} else {
|
417 |
$poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));
|
418 |
}
|
419 |
+
$poll_multiple_ans = intval($poll_question->pollq_multiple);
|
420 |
$template_question = stripslashes(get_option('poll_template_resultheader'));
|
421 |
$template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
|
422 |
$template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
|
423 |
$template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
|
424 |
+
$template_question = str_replace("%POLL_TOTALVOTERS%", $poll_question_totalvoters, $template_question);
|
425 |
$template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
|
426 |
$template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
|
427 |
+
if($poll_multiple_ans > 0) {
|
428 |
+
$template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_question);
|
429 |
+
} else {
|
430 |
+
$template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
|
431 |
+
}
|
432 |
// Get Poll Answers Data
|
433 |
$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'));
|
434 |
// If There Is Poll Question With Answers
|
453 |
// Calculate Percentage And Image Bar Width
|
454 |
if(!$poll_totalvotes_zero) {
|
455 |
if($poll_answer_votes > 0) {
|
456 |
+
$poll_answer_percentage = round((($poll_answer_votes/$poll_question_totalvoters)*100));
|
457 |
$poll_answer_imagewidth = round($poll_answer_percentage);
|
458 |
if($poll_answer_imagewidth == 100) {
|
459 |
$poll_answer_imagewidth = 99;
|
467 |
$poll_answer_imagewidth = 1;
|
468 |
}
|
469 |
// Let User See What Options They Voted
|
470 |
+
if(in_array($poll_answer_id, $user_voted)) {
|
471 |
// Results Body Variables
|
472 |
$template_answer = stripslashes(get_option('poll_template_resultbody2'));
|
473 |
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
507 |
}
|
508 |
}
|
509 |
// Results Footer Variables
|
510 |
+
if(!empty($user_voted) || $poll_question_active == 0 || !check_allowtovote()) {
|
511 |
$template_footer = stripslashes(get_option('poll_template_resultfooter'));
|
512 |
} else {
|
513 |
$template_footer = stripslashes(get_option('poll_template_resultfooter2'));
|
516 |
$template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
|
517 |
$template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
|
518 |
$template_footer = str_replace("%POLL_TOTALVOTES%", number_format($poll_question_totalvotes), $template_footer);
|
519 |
+
$template_footer = str_replace("%POLL_TOTALVOTERS%", number_format($poll_question_totalvoters), $template_footer);
|
520 |
$template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
|
521 |
$template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer);
|
522 |
$template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
|
523 |
$template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
|
524 |
$template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer);
|
525 |
$template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
|
526 |
+
if($poll_multiple_ans > 0) {
|
527 |
+
$template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $poll_multiple_ans, $template_footer);
|
528 |
+
} else {
|
529 |
+
$template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
|
530 |
+
}
|
531 |
// Print Out Results Footer Template
|
532 |
$temp_pollresult .= "\t\t$template_footer\n";
|
533 |
if(!$without_poll_title) {
|
534 |
$temp_pollresult .= "</div>\n";
|
535 |
+
$poll_ajax_style = get_option('poll_ajax_style');
|
536 |
+
if(intval($poll_ajax_style['loading']) == 1) {
|
537 |
+
$temp_pollresult .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".get_option('siteurl')."/wp-content/plugins/polls/images/loading.gif\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" /> ".__('Loading', 'wp-polls')." ...</div>\n";
|
538 |
+
}
|
539 |
}
|
540 |
} else {
|
541 |
$temp_pollresult .= stripslashes(get_option('poll_template_disable'));
|
565 |
### Function: Place Polls Archive In Content
|
566 |
add_filter('the_content', 'place_pollsarchive', '7');
|
567 |
function place_pollsarchive($content){
|
568 |
+
$content = preg_replace("/\[page_polls\]/ise", "polls_archive()", $content);
|
569 |
return $content;
|
570 |
}
|
571 |
|
573 |
### Function: Place Poll In Content (By: Robert Accettura Of http://robert.accettura.com/)
|
574 |
add_filter('the_content', 'place_poll', '7');
|
575 |
function place_poll($content){
|
576 |
+
if(!is_feed()) {
|
577 |
+
$content = preg_replace("/\[poll=(\d+)\]/ise", "display_poll('\\1')", $content);
|
578 |
+
} else {
|
579 |
+
$content = preg_replace("/\[poll=(\d+)\]/i", __('Note: There is a poll within this post, please visit the site to participate in this post\'s poll.', 'wp-polls'), $content);
|
580 |
+
}
|
581 |
return $content;
|
582 |
}
|
583 |
|
620 |
if(!function_exists('get_pollvotes')) {
|
621 |
function get_pollvotes($display = true) {
|
622 |
global $wpdb;
|
623 |
+
$totalvotes = $wpdb->get_var("SELECT SUM(pollq_totalvotes) FROM $wpdb->pollsq");
|
624 |
if($display) {
|
625 |
+
echo number_format($totalvotes);
|
626 |
} else {
|
627 |
+
return number_format($totalvotes);
|
628 |
+
}
|
629 |
+
}
|
630 |
+
}
|
631 |
+
|
632 |
+
|
633 |
+
### Function: Get Poll Total Voters
|
634 |
+
if(!function_exists('get_pollvoters')) {
|
635 |
+
function get_pollvoters($display = true) {
|
636 |
+
global $wpdb;
|
637 |
+
$totalvoters = $wpdb->get_var("SELECT SUM(pollq_totalvoters) FROM $wpdb->pollsq");
|
638 |
+
if($display) {
|
639 |
+
echo number_format($totalvoters);
|
640 |
+
} else {
|
641 |
+
return number_format($totalvoters);
|
642 |
}
|
643 |
}
|
644 |
}
|
647 |
### Function: Check Voted To Get Voted Answer
|
648 |
function check_voted_multiple($poll_id) {
|
649 |
global $polls_ips;
|
650 |
+
$temp_voted_aid = array();
|
651 |
+
if(!empty($_COOKIE["voted_$poll_id"])) {
|
652 |
+
$temp_voted_aid = explode(',', $_COOKIE["voted_$poll_id"]);
|
653 |
} else {
|
654 |
if($polls_ips) {
|
655 |
foreach($polls_ips as $polls_ip) {
|
656 |
if($polls_ip['qid'] == $poll_id) {
|
657 |
+
$temp_voted_aid[] = $polls_ip['aid'];
|
658 |
}
|
659 |
}
|
660 |
}
|
682 |
### Function: Displays Polls Archive Link
|
683 |
function display_polls_archive_link($display = true) {
|
684 |
if(intval(get_option('poll_archive_show')) == 1) {
|
685 |
+
$template_pollarchivelink = stripslashes(get_option('poll_template_pollarchivelink'));
|
686 |
+
$template_pollarchivelink = str_replace("%POLL_ARCHIVE_URL%", get_option('poll_archive_url'), $template_pollarchivelink);
|
687 |
if($display) {
|
688 |
+
echo $template_pollarchivelink;
|
689 |
} else{
|
690 |
+
return $template_pollarchivelink;
|
691 |
}
|
692 |
}
|
693 |
}
|
694 |
|
695 |
|
696 |
### Function: Display Polls Archive
|
697 |
+
function polls_archive() {
|
698 |
global $wpdb, $polls_ips, $in_pollsarchive;
|
699 |
// Polls Variables
|
700 |
$in_pollsarchive = true;
|
707 |
$poll_voted = false;
|
708 |
$poll_voted_aid = 0;
|
709 |
$poll_id = 0;
|
|
|
|
|
|
|
710 |
$pollsarchive_output_archive = '';
|
711 |
+
$polls_type = intval(get_option('poll_archive_displaypoll'));
|
712 |
+
$polls_type_sql = '';
|
713 |
+
// Determine What Type Of Polls To Show
|
714 |
+
switch($polls_type) {
|
715 |
+
case 1:
|
716 |
+
$polls_type_sql = 'pollq_active = 0';
|
717 |
+
break;
|
718 |
+
case 2:
|
719 |
+
$polls_type_sql = 'pollq_active = 1';
|
720 |
+
break;
|
721 |
+
case 3:
|
722 |
+
$polls_type_sql = 'pollq_active IN (0,1)';
|
723 |
+
break;
|
724 |
+
}
|
725 |
// Get Total Polls
|
726 |
+
$total_polls = $wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq WHERE $polls_type_sql AND pollq_active != -1");
|
727 |
|
728 |
// Checking $page and $offset
|
729 |
if (empty($page) || $page == 0) { $page = 1; }
|
749 |
// Determing Total Amount Of Pages
|
750 |
$total_pages = ceil($total_polls / $polls_perpage);
|
751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
// Get Poll Questions
|
753 |
+
$questions = $wpdb->get_results("SELECT * FROM $wpdb->pollsq WHERE $polls_type_sql ORDER BY pollq_id DESC LIMIT $offset, $polls_perpage");
|
754 |
if($questions) {
|
755 |
foreach($questions as $question) {
|
756 |
+
$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));
|
757 |
$poll_questions_ids .= intval($question->pollq_id).', ';
|
758 |
}
|
759 |
$poll_questions_ids = substr($poll_questions_ids, 0, -2);
|
775 |
}
|
776 |
}
|
777 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
// Poll Archives
|
|
|
779 |
$pollsarchive_output_archive .= "<div class=\"wp-polls\">\n";
|
780 |
foreach($polls_questions as $polls_question) {
|
781 |
// Most/Least Variables
|
796 |
} else {
|
797 |
$poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $polls_question['end']));
|
798 |
}
|
799 |
+
// Archive Poll Header
|
800 |
+
$template_archive_header = stripslashes(get_option('poll_template_pollarchiveheader'));
|
801 |
// Poll Question Variables
|
802 |
$template_question = stripslashes(get_option('poll_template_resultheader'));
|
803 |
$template_question = str_replace("%POLL_QUESTION%", $polls_question['question'], $template_question);
|
804 |
$template_question = str_replace("%POLL_ID%", $polls_question['id'], $template_question);
|
805 |
$template_question = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_question);
|
806 |
+
$template_question = str_replace("%POLL_TOTALVOTERS%", $polls_question['totalvoters'], $template_question);
|
807 |
$template_question = str_replace("%POLL_START_DATE%", $poll_start_date, $template_question);
|
808 |
$template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question);
|
809 |
+
if($polls_question['multiple'] > 0) {
|
810 |
+
$template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_question);
|
811 |
+
} else {
|
812 |
+
$template_question = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_question);
|
813 |
+
}
|
814 |
// Print Out Result Header Template
|
815 |
+
$pollsarchive_output_archive .= $template_archive_header;
|
816 |
$pollsarchive_output_archive .= $template_question;
|
817 |
foreach($polls_answers as $polls_answer) {
|
818 |
if($polls_question['id'] == $polls_answer['qid']) {
|
819 |
// Calculate Percentage And Image Bar Width
|
820 |
if(!$poll_totalvotes_zero) {
|
821 |
if($polls_answer['votes'] > 0) {
|
822 |
+
$poll_answer_percentage = round((($polls_answer['votes']/$polls_question['totalvoters'])*100));
|
823 |
$poll_answer_imagewidth = round($poll_answer_percentage*0.9);
|
824 |
} else {
|
825 |
$poll_answer_percentage = 0;
|
830 |
$poll_answer_imagewidth = 1;
|
831 |
}
|
832 |
// Let User See What Options They Voted
|
833 |
+
if(in_array($polls_answer['aid'], check_voted_multiple($polls_question['id']))) {
|
834 |
// Results Body Variables
|
835 |
$template_answer = stripslashes(get_option('poll_template_resultbody2'));
|
836 |
$template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
|
877 |
$template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer);
|
878 |
$template_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_footer);
|
879 |
$template_footer = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_footer);
|
880 |
+
$template_footer = str_replace("%POLL_TOTALVOTERS%", $polls_question['totalvoters'], $template_footer);
|
881 |
$template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
|
882 |
$template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer);
|
883 |
$template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
|
884 |
$template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
|
885 |
$template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer);
|
886 |
$template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
|
887 |
+
if($polls_question['multiple'] > 0) {
|
888 |
+
$template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_footer);
|
889 |
+
} else {
|
890 |
+
$template_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_footer);
|
891 |
+
}
|
892 |
+
// Archive Poll Footer
|
893 |
+
$template_archive_footer = stripslashes(get_option('poll_template_pollarchivefooter'));
|
894 |
+
$template_archive_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_archive_footer);
|
895 |
+
$template_archive_footer = str_replace("%POLL_END_DATE%", $poll_end_date, $template_archive_footer);
|
896 |
+
$template_archive_footer = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_archive_footer);
|
897 |
+
$template_archive_footer = str_replace("%POLL_TOTALVOTERS%", $polls_question['totalvoters'], $template_archive_footer);
|
898 |
+
$template_archive_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_archive_footer);
|
899 |
+
$template_archive_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_archive_footer);
|
900 |
+
$template_archive_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_archive_footer);
|
901 |
+
$template_archive_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_archive_footer);
|
902 |
+
$template_archive_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_archive_footer);
|
903 |
+
$template_archive_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_archive_footer);
|
904 |
+
if($polls_question['multiple'] > 0) {
|
905 |
+
$template_archive_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", $polls_question['multiple'], $template_archive_footer);
|
906 |
+
} else {
|
907 |
+
$template_archive_footer = str_replace("%POLL_MULTIPLE_ANS_MAX%", '1', $template_archive_footer);
|
908 |
+
}
|
909 |
// Print Out Results Footer Template
|
910 |
$pollsarchive_output_archive .= $template_footer;
|
911 |
+
// Print Out Archive Poll Footer Template
|
912 |
+
$pollsarchive_output_archive .= $template_archive_footer;
|
913 |
}
|
914 |
$pollsarchive_output_archive .= "</div>\n";
|
915 |
|
962 |
}
|
963 |
|
964 |
// Output Polls Archive Page
|
965 |
+
return $pollsarchive_output_archive;
|
966 |
}
|
967 |
|
968 |
|
1064 |
}
|
1065 |
|
1066 |
|
1067 |
+
### Check If In Poll Archive Page
|
1068 |
+
function in_pollarchive() {
|
1069 |
+
$poll_archive_url = get_option('poll_archive_url');
|
1070 |
+
$poll_archive_url_array = explode('/', $poll_archive_url);
|
1071 |
+
$poll_archive_url = $poll_archive_url_array[sizeof($poll_archive_url_array)-1];
|
1072 |
+
if(empty($poll_archive_url)) {
|
1073 |
+
$poll_archive_url = $poll_archive_url_array[sizeof($poll_archive_url_array)-2];
|
1074 |
+
}
|
1075 |
+
$current_url = $_SERVER['REQUEST_URI'];
|
1076 |
+
if(strpos($current_url, $poll_archive_url) === false) {
|
1077 |
+
return false;
|
1078 |
+
} else {
|
1079 |
+
return true;
|
1080 |
+
}
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
|
1084 |
### Function: Vote Poll
|
1085 |
vote_poll();
|
1086 |
function vote_poll() {
|
1087 |
global $wpdb, $user_identity, $user_ID;
|
1088 |
+
header('Content-Type: text/html; charset='.get_option('blog_charset').'');
|
1089 |
if(!empty($_POST['vote'])) {
|
|
|
1090 |
$poll_id = intval($_POST['poll_id']);
|
1091 |
+
$poll_aid = $_POST["poll_$poll_id"];
|
1092 |
+
$poll_aid_array = explode(',', $poll_aid);
|
1093 |
+
if($poll_id > 0 && !empty($poll_aid_array) && check_allowtovote()) {
|
1094 |
$check_voted = check_voted($poll_id);
|
1095 |
if($check_voted == 0) {
|
1096 |
if(!empty($user_identity)) {
|
1102 |
}
|
1103 |
$pollip_userid = intval($user_ID);
|
1104 |
$pollip_ip = get_ipaddress();
|
1105 |
+
$pollip_host = @gethostbyaddr($pollip_ip);
|
1106 |
$pollip_timestamp = current_time('timestamp');
|
1107 |
// Only Create Cookie If User Choose Logging Method 1 Or 2
|
1108 |
$poll_logging_method = intval(get_option('poll_logging_method'));
|
1109 |
if($poll_logging_method == 1 || $poll_logging_method == 3) {
|
1110 |
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH);
|
1111 |
}
|
1112 |
+
foreach($poll_aid_array as $polla_aid) {
|
1113 |
+
$wpdb->query("UPDATE $wpdb->pollsa SET polla_votes = (polla_votes+1) WHERE polla_qid = $poll_id AND polla_aid = $polla_aid");
|
1114 |
+
}
|
1115 |
+
$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");
|
1116 |
+
if($vote_q) {
|
1117 |
+
foreach($poll_aid_array as $polla_aid) {
|
1118 |
+
$wpdb->query("INSERT INTO $wpdb->pollsip VALUES (0, $poll_id, $polla_aid, '$pollip_ip', '$pollip_host', '$pollip_timestamp', '$pollip_user', $pollip_userid)");
|
1119 |
+
}
|
1120 |
+
echo "<ul class=\"wp-polls-ul\">\n".display_pollresult($poll_id,$poll_aid_array, 1);
|
1121 |
+
exit();
|
|
|
|
|
1122 |
} else {
|
1123 |
+
printf(__('Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s', 'wp-polls'), $poll_id);
|
1124 |
exit();
|
1125 |
} // End if($vote_a)
|
1126 |
} else {
|
1127 |
+
printf(__('You Had Already Voted For This Poll. Poll ID #%s', 'wp-polls'), $poll_id);
|
1128 |
exit();
|
1129 |
}// End if($check_voted)
|
1130 |
} else {
|
1131 |
+
printf(__('Invalid Poll ID. Poll ID #%s', 'wp-polls'), $poll_id);
|
1132 |
exit();
|
1133 |
} // End if($poll_id > 0 && $poll_aid > 0)
|
1134 |
} elseif (intval($_GET['pollresult']) > 0) {
|
1157 |
"pollq_totalvotes int(10) NOT NULL default '0',".
|
1158 |
"pollq_active tinyint(1) NOT NULL default '1',".
|
1159 |
"pollq_expiry varchar(20) NOT NULL default '',".
|
1160 |
+
"pollq_multiple tinyint(3) NOT NULL default '0',".
|
1161 |
+
"pollq_totalvoters int(10) NOT NULL default '0',".
|
1162 |
"PRIMARY KEY (pollq_id))";
|
1163 |
$create_table['pollsa'] = "CREATE TABLE $wpdb->pollsa (".
|
1164 |
"polla_aid int(10) NOT NULL auto_increment,".
|
1184 |
// If Install, Insert 1st Poll Question With 5 Poll Answers
|
1185 |
if(empty($first_poll)) {
|
1186 |
// Insert Poll Question (1 Record)
|
1187 |
+
$insert_pollq = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (1, '".__('How Is My Site?', 'wp-polls')."', '".current_time('timestamp')."', 0, 1, '', 0, 0);");
|
1188 |
if($insert_pollq) {
|
1189 |
// Insert Poll Answers (5 Records)
|
1190 |
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (1, 1, '".__('Good', 'wp-polls')."', 0);");
|
1198 |
add_option('poll_template_voteheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
|
1199 |
'<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
|
1200 |
'<ul class="wp-polls-ul">', 'Template For Poll\'s Question');
|
1201 |
+
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');
|
1202 |
add_option('poll_template_votefooter', '</ul>'.
|
1203 |
'<p style="text-align: center;"><input type="button" name="vote" value=" '.__('Vote', 'wp-polls').' " class="Buttons" onclick="poll_vote(%POLL_ID%);" onkeypress="poll_result(%POLL_ID%);" /></p>'.
|
1204 |
'<p style="text-align: center;"><a href="#ViewPollResults" onclick="poll_result(%POLL_ID%); return false;" onkeypress="poll_result(%POLL_ID%); return false;" title="'.__('View Results Of This Poll', 'wp-polls').'">'.__('View Results', 'wp-polls').'</a></p>'.
|
1206 |
add_option('poll_template_resultheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
|
1207 |
'<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
|
1208 |
'<ul class="wp-polls-ul">', 'Template For Poll Header');
|
1209 |
+
add_option('poll_template_resultbody', '<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %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');
|
1210 |
+
add_option('poll_template_resultbody2', '<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%, %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)');
|
1211 |
add_option('poll_template_resultfooter', '</ul>'.
|
1212 |
+
'<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'.
|
1213 |
'</div>', 'Template For Poll Result Footer');
|
1214 |
add_option('poll_template_resultfooter2', '</ul>'.
|
1215 |
+
'<p style="text-align: center;">'.__('Total Voters', 'wp-polls').': <strong>%POLL_TOTALVOTERS%</strong></p>'.
|
1216 |
'<p style="text-align: center;"><a href="#VotePoll" onclick="poll_booth(%POLL_ID%); return false;" onkeypress="poll_booth(%POLL_ID%); return false;" title="'.__('Vote For This Poll', 'wp-polls').'">'.__('Vote', 'wp-polls').'</a></p>'.
|
1217 |
'</div>', 'Template For Poll Result Footer');
|
1218 |
add_option('poll_template_disable', __('Sorry, there are no polls available at the moment.', 'wp-polls'), 'Template For Poll When It Is Disabled');
|
1237 |
// Database Upgrade For WP-Polls 2.14
|
1238 |
maybe_add_column($wpdb->pollsq, 'pollq_expiry', "ALTER TABLE $wpdb->pollsq ADD pollq_expiry varchar(20) NOT NULL default '';");
|
1239 |
add_option('poll_close', 1, 'Poll Close');
|
1240 |
+
// Database Upgrade For WP-Polls 2.20
|
1241 |
+
add_option('poll_ajax_style', array('loading' => 1, 'fading' => 1), 'Poll AJAX Style');
|
1242 |
+
add_option('poll_template_pollarchivelink', '<ul>'.
|
1243 |
+
'<li><a href="%POLL_ARCHIVE_URL%">'.__('Polls Archive', 'wp-polls').'</a></li>'.
|
1244 |
+
'</ul>', 'Template For Poll Archive Link');
|
1245 |
+
add_option('poll_archive_displaypoll', 2, 'Type Of Polls To Display In Polls Archive');
|
1246 |
+
add_option('poll_template_pollarchiveheader', '', 'Displayed Before Each Poll In The Poll Archive');
|
1247 |
+
add_option('poll_template_pollarchivefooter', '<p>Start Date: %POLL_START_DATE%<br />End Date: %POLL_END_DATE%</p>', 'Displayed After Each Poll In The Poll Archive');
|
1248 |
+
maybe_add_column($wpdb->pollsq, 'pollq_multiple', "ALTER TABLE $wpdb->pollsq ADD pollq_multiple TINYINT( 3 ) NOT NULL DEFAULT '0';");
|
1249 |
+
$pollq_totalvoters = maybe_add_column($wpdb->pollsq, 'pollq_totalvoters', "ALTER TABLE $wpdb->pollsq ADD pollq_totalvoters INT( 10 ) NOT NULL DEFAULT '0';");
|
1250 |
+
if($pollq_totalvoters) {
|
1251 |
+
$wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvoters = pollq_totalvotes");
|
1252 |
+
}
|
1253 |
// Set 'manage_polls' Capabilities To Administrator
|
1254 |
$role = get_role('administrator');
|
1255 |
if(!$role->has_cap('manage_polls')) {
|
polls/wp-polls.mo
ADDED
Binary file
|
polls/wp-polls.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP-Polls 2.
|
4 |
"POT-Creation-Date: \n"
|
5 |
-
"PO-Revision-Date: 2007-
|
6 |
"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
|
7 |
"Language-Team: Ravan <ravanhagen@gmail.com>\n"
|
8 |
"MIME-Version: 1.0\n"
|
@@ -14,976 +14,1322 @@ msgstr ""
|
|
14 |
"X-Poedit-Language: English\n"
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
-
#: polls-
|
18 |
-
|
|
|
|
|
|
|
19 |
msgstr ""
|
20 |
|
21 |
-
#: polls-
|
22 |
-
|
|
|
23 |
msgstr ""
|
24 |
|
25 |
-
#: polls-
|
26 |
-
#: polls-manager.php:
|
27 |
-
|
28 |
-
msgid "
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: polls-
|
32 |
#, php-format
|
33 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: polls-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
#, php-format
|
38 |
-
msgid "
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: polls-
|
42 |
-
#: polls-manager.php:
|
43 |
-
|
44 |
-
#: polls-manager.php:179
|
45 |
-
#: polls-manager.php:202
|
46 |
-
msgid "Poll"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: polls-
|
50 |
-
#: polls-manager.php:
|
51 |
-
msgid "
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: polls-
|
55 |
-
#: polls-manager.php:
|
56 |
-
#: polls-
|
57 |
-
|
|
|
|
|
|
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: polls-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: polls-
|
65 |
-
|
|
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: polls-
|
69 |
-
|
|
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: polls-
|
73 |
-
msgid "
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: polls-
|
77 |
-
|
78 |
-
msgid "Open Poll"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: polls-
|
82 |
-
|
|
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: polls-
|
86 |
-
|
|
|
|
|
|
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: polls-
|
90 |
-
#: polls-
|
91 |
-
|
|
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: polls-
|
95 |
-
msgid "
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: polls-
|
99 |
-
msgid "Error
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: polls-
|
103 |
-
#: polls-
|
104 |
-
#: polls-
|
105 |
-
msgid "Delete Poll"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: polls-
|
109 |
#, php-format
|
110 |
-
msgid "
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: polls-
|
114 |
#, php-format
|
115 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: polls-
|
119 |
#, php-format
|
120 |
-
msgid "
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: polls-
|
124 |
-
|
125 |
-
msgid "
|
126 |
msgstr ""
|
127 |
|
128 |
-
#: polls-
|
129 |
-
#: polls-
|
130 |
-
#: polls-manager.php:
|
131 |
-
|
132 |
-
msgid "Add Answer"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: polls-
|
136 |
#, php-format
|
137 |
-
msgid "
|
138 |
msgstr ""
|
139 |
|
140 |
-
#: polls-
|
141 |
-
|
142 |
-
msgid "Poll
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: polls-
|
146 |
-
#: polls-
|
147 |
-
|
|
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: polls-
|
151 |
-
|
|
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: polls-
|
155 |
-
|
|
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: polls-
|
159 |
-
#: polls-
|
160 |
-
msgid "Delete
|
161 |
msgstr ""
|
162 |
|
163 |
-
#: polls-
|
164 |
-
|
|
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: polls-
|
168 |
-
|
|
|
169 |
msgstr ""
|
170 |
|
171 |
-
#: polls-
|
172 |
-
#: polls-manager.php:
|
173 |
-
msgid "
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: polls-
|
177 |
-
|
178 |
-
msgid "Table \"%s\" Has Been Dropped."
|
179 |
msgstr ""
|
180 |
|
181 |
-
#: polls-
|
182 |
-
|
183 |
-
|
|
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: polls-
|
187 |
-
|
188 |
-
msgid "Error Deleting Setting Key '%s'."
|
189 |
msgstr ""
|
190 |
|
191 |
-
#: polls-
|
192 |
-
|
193 |
-
#: polls-manager.php:419
|
194 |
-
#: polls-manager.php:596
|
195 |
-
#: polls-manager.php:719
|
196 |
-
#: polls-manager.php:801
|
197 |
-
msgid "Question"
|
198 |
msgstr ""
|
199 |
|
200 |
-
#: polls-
|
201 |
-
msgid "
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: polls-
|
205 |
-
msgid "
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: polls-
|
209 |
-
#: polls-
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: polls-
|
214 |
-
|
215 |
-
#: polls-manager.php:490
|
216 |
-
#: polls-manager.php:652
|
217 |
-
#: polls-options.php:632
|
218 |
-
msgid "Cancel"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: polls-
|
222 |
-
|
223 |
-
msgid "
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: polls-
|
227 |
-
|
228 |
-
msgid "
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: polls-
|
232 |
-
|
|
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: polls-
|
236 |
-
|
237 |
-
msgid "
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: polls-
|
241 |
-
msgid "
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: polls-
|
245 |
-
|
246 |
-
#: polls-manager.php:612
|
247 |
-
msgid "Answer"
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: polls-
|
251 |
-
|
|
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: polls-
|
255 |
-
#: polls-
|
256 |
-
|
257 |
-
#: polls-manager.php:847
|
258 |
-
msgid "This Action Is Not Reversible. Are you sure?"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: polls-
|
262 |
-
#: polls-
|
263 |
-
msgid "
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: polls-
|
267 |
-
|
268 |
-
#: polls-manager.php:720
|
269 |
-
#: polls-options.php:147
|
270 |
-
#: polls-options.php:150
|
271 |
-
#: polls.php:1124
|
272 |
-
#: polls.php:1127
|
273 |
-
msgid "Total Votes"
|
274 |
msgstr ""
|
275 |
|
276 |
-
#: polls-
|
277 |
-
#: polls-
|
278 |
-
#: polls-
|
279 |
-
msgid "
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: polls-
|
283 |
-
msgid "
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: polls-
|
287 |
-
|
288 |
-
#: polls-manager.php:722
|
289 |
-
msgid "End Date/Time"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: polls-
|
293 |
-
|
294 |
-
msgid "This Poll Will Not Expire"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: polls-
|
298 |
-
msgid "
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: polls-
|
302 |
-
msgid "
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: polls-
|
306 |
-
msgid "
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: polls-
|
310 |
-
msgid "
|
311 |
msgstr ""
|
312 |
|
313 |
-
#: polls-
|
314 |
-
|
|
|
|
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: polls-
|
318 |
-
msgid "
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: polls-
|
322 |
-
msgid "
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: polls-
|
326 |
-
msgid "
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: polls-
|
330 |
msgid "Poll Logs"
|
331 |
msgstr ""
|
332 |
|
333 |
-
#: polls-
|
334 |
-
msgid "
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: polls-
|
338 |
-
|
339 |
-
#: polls-manager.php:864
|
340 |
-
#: polls-options.php:351
|
341 |
-
#: polls-widget.php:82
|
342 |
-
msgid "Yes"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: polls-
|
346 |
-
msgid "
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: polls-
|
350 |
-
|
|
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: polls-
|
354 |
-
|
|
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: polls-
|
358 |
-
|
359 |
-
msgid "Status"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: polls-
|
363 |
-
|
364 |
-
msgid "Open"
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: polls-
|
368 |
-
|
369 |
-
msgid "
|
370 |
msgstr ""
|
371 |
|
372 |
-
#: polls-
|
373 |
-
|
374 |
-
msgid "Closed"
|
375 |
msgstr ""
|
376 |
|
377 |
-
#: polls-
|
378 |
-
|
379 |
-
msgid "You Are About To Delete This Poll"
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: polls-
|
383 |
-
msgid "Delete Poll
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: polls-
|
387 |
-
|
|
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: polls-
|
391 |
-
msgid "
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: polls-manager.php:
|
395 |
-
|
|
|
|
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: polls-manager.php:
|
399 |
-
|
|
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: polls-manager.php:
|
403 |
-
|
|
|
404 |
msgstr ""
|
405 |
|
406 |
-
#: polls-manager.php:
|
407 |
-
|
|
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: polls-manager.php:
|
411 |
-
|
412 |
-
msgid "
|
413 |
msgstr ""
|
414 |
|
415 |
-
#: polls-manager.php:
|
416 |
#, php-format
|
417 |
-
msgid "
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: polls-manager.php:
|
421 |
-
|
422 |
-
msgid "
|
423 |
msgstr ""
|
424 |
|
425 |
-
#: polls-manager.php:
|
426 |
-
msgid "
|
427 |
msgstr ""
|
428 |
|
429 |
-
#: polls-manager.php:
|
430 |
-
|
|
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: polls-manager.php:
|
434 |
-
|
435 |
-
#: polls.php:379
|
436 |
-
#: polls.php:759
|
437 |
-
msgid "No Expiry"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: polls-manager.php:
|
441 |
-
|
442 |
-
msgid "Displayed:"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: polls-manager.php:
|
446 |
-
msgid "
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: polls-manager.php:
|
450 |
-
msgid "
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: polls-manager.php:
|
454 |
-
|
|
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: polls-manager.php:
|
458 |
-
|
459 |
-
msgid "
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: polls-manager.php:
|
463 |
-
msgid "Total
|
464 |
msgstr ""
|
465 |
|
466 |
-
#: polls-manager.php:
|
467 |
-
|
|
|
468 |
msgstr ""
|
469 |
|
470 |
-
#: polls-manager.php:
|
471 |
-
|
|
|
472 |
msgstr ""
|
473 |
|
474 |
-
#: polls-manager.php:
|
475 |
-
msgid "
|
476 |
msgstr ""
|
477 |
|
478 |
-
#: polls-manager.php:
|
479 |
-
|
|
|
480 |
msgstr ""
|
481 |
|
482 |
-
#: polls-manager.php:
|
483 |
-
msgid "
|
484 |
msgstr ""
|
485 |
|
486 |
-
#: polls-manager.php:
|
487 |
-
|
|
|
488 |
msgstr ""
|
489 |
|
490 |
-
#: polls-manager.php:
|
491 |
-
|
|
|
492 |
msgstr ""
|
493 |
|
494 |
-
#: polls-manager.php:
|
495 |
-
|
496 |
-
msgid "
|
497 |
msgstr ""
|
498 |
|
499 |
-
#: polls-manager.php:
|
500 |
-
msgid ""
|
501 |
-
"You Are About To Uninstall WP-Polls From WordPress.\\n"
|
502 |
-
"This Action Is Not Reversible.\\n"
|
503 |
-
"\\n"
|
504 |
-
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: polls-
|
508 |
-
#: polls-
|
509 |
-
#: polls-
|
510 |
-
|
|
|
|
|
511 |
msgstr ""
|
512 |
|
513 |
-
#: polls-
|
514 |
-
msgid "
|
515 |
msgstr ""
|
516 |
|
517 |
-
#: polls-
|
518 |
-
msgid "
|
519 |
msgstr ""
|
520 |
|
521 |
-
#: polls-
|
522 |
-
|
|
|
|
|
|
|
523 |
msgstr ""
|
524 |
|
525 |
-
#: polls-
|
526 |
-
|
|
|
|
|
527 |
msgstr ""
|
528 |
|
529 |
-
#: polls-
|
530 |
-
msgid "
|
531 |
msgstr ""
|
532 |
|
533 |
-
#: polls-
|
534 |
-
msgid "
|
535 |
msgstr ""
|
536 |
|
537 |
-
#: polls-
|
538 |
-
msgid "
|
539 |
msgstr ""
|
540 |
|
541 |
-
#: polls-
|
542 |
-
msgid "
|
543 |
msgstr ""
|
544 |
|
545 |
-
#: polls-
|
546 |
-
msgid "
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: polls-
|
550 |
-
|
|
|
551 |
msgstr ""
|
552 |
|
553 |
-
#: polls-
|
554 |
-
msgid "
|
555 |
msgstr ""
|
556 |
|
557 |
-
#: polls-
|
558 |
-
|
|
|
559 |
msgstr ""
|
560 |
|
561 |
-
#: polls-
|
562 |
-
msgid "
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: polls-
|
566 |
-
msgid "
|
567 |
msgstr ""
|
568 |
|
569 |
-
#: polls-
|
570 |
-
msgid "
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: polls-
|
574 |
-
msgid "Polls
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: polls-
|
578 |
-
msgid "
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: polls-
|
582 |
-
msgid "
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: polls-
|
586 |
-
msgid "
|
587 |
msgstr ""
|
588 |
|
589 |
-
#: polls-options.php:
|
590 |
-
#: polls-options.php:
|
591 |
-
|
|
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: polls-options.php:
|
595 |
-
msgid "
|
596 |
msgstr ""
|
597 |
|
598 |
-
#: polls-options.php:
|
599 |
-
msgid "
|
600 |
msgstr ""
|
601 |
|
602 |
-
#: polls-options.php:
|
603 |
-
msgid "
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: polls-options.php:
|
607 |
-
|
608 |
-
#: polls.php:1115
|
609 |
-
#: polls.php:1128
|
610 |
-
msgid "Vote"
|
611 |
msgstr ""
|
612 |
|
613 |
-
#: polls-options.php:
|
614 |
-
|
615 |
-
msgid "View Results Of This Poll"
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: polls-options.php:
|
619 |
-
|
620 |
-
msgid "View Results"
|
621 |
msgstr ""
|
622 |
|
623 |
-
#: polls-options.php:
|
624 |
-
|
625 |
-
#: polls-options.php:286
|
626 |
-
#: polls.php:1121
|
627 |
-
#: polls.php:1122
|
628 |
-
msgid "Votes"
|
629 |
msgstr ""
|
630 |
|
631 |
-
#: polls-options.php:
|
632 |
-
|
633 |
-
msgid "You Have Voted For This Choice"
|
634 |
msgstr ""
|
635 |
|
636 |
-
#: polls-options.php:
|
637 |
-
|
638 |
-
msgid "Vote For This Poll"
|
639 |
msgstr ""
|
640 |
|
641 |
-
#: polls-options.php:
|
642 |
-
|
643 |
-
msgid "Sorry, there are no polls available at the moment."
|
644 |
msgstr ""
|
645 |
|
646 |
-
#: polls-options.php:
|
647 |
-
|
648 |
-
msgid "An error has occurred when processing your poll."
|
649 |
msgstr ""
|
650 |
|
651 |
-
#: polls-options.php:
|
652 |
-
#: polls.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
653 |
msgid "Poll Options"
|
654 |
msgstr ""
|
655 |
|
656 |
-
#: polls-options.php:
|
657 |
msgid "Use CSS Style"
|
658 |
msgstr ""
|
659 |
|
660 |
-
#: polls-options.php:
|
661 |
msgid "Poll Bar Background"
|
662 |
msgstr ""
|
663 |
|
664 |
-
#: polls-options.php:
|
665 |
msgid "Poll Bar Border"
|
666 |
msgstr ""
|
667 |
|
668 |
-
#: polls-options.php:
|
669 |
msgid "Poll Bar Height"
|
670 |
msgstr ""
|
671 |
|
672 |
-
#: polls-options.php:
|
673 |
msgid "Your poll bar will look like this"
|
674 |
msgstr ""
|
675 |
|
676 |
-
#: polls-options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
msgid "Sorting Of Poll Answers"
|
678 |
msgstr ""
|
679 |
|
680 |
-
#: polls-options.php:
|
681 |
msgid "Sort Poll Answers By:"
|
682 |
msgstr ""
|
683 |
|
684 |
-
#: polls-options.php:
|
685 |
-
#: polls-options.php:
|
686 |
msgid "Exact Order"
|
687 |
msgstr ""
|
688 |
|
689 |
-
#: polls-options.php:
|
690 |
-
#: polls-options.php:
|
691 |
msgid "Alphabetical Order"
|
692 |
msgstr ""
|
693 |
|
694 |
-
#: polls-options.php:
|
695 |
msgid "Sort Order Of Poll Answers:"
|
696 |
msgstr ""
|
697 |
|
698 |
-
#: polls-options.php:
|
699 |
-
#: polls-options.php:
|
700 |
msgid "Ascending"
|
701 |
msgstr ""
|
702 |
|
703 |
-
#: polls-options.php:
|
704 |
-
#: polls-options.php:
|
705 |
msgid "Descending"
|
706 |
msgstr ""
|
707 |
|
708 |
-
#: polls-options.php:
|
709 |
msgid "Sorting Of Poll Results"
|
710 |
msgstr ""
|
711 |
|
712 |
-
#: polls-options.php:
|
713 |
msgid "Sort Poll Results By:"
|
714 |
msgstr ""
|
715 |
|
716 |
-
#: polls-options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
717 |
msgid "Sort Order Of Poll Results:"
|
718 |
msgstr ""
|
719 |
|
720 |
-
#: polls-options.php:
|
721 |
msgid "Allow To Vote"
|
722 |
msgstr ""
|
723 |
|
724 |
-
#: polls-options.php:
|
725 |
msgid "Who Is Allowed To Vote?"
|
726 |
msgstr ""
|
727 |
|
728 |
-
#: polls-options.php:
|
729 |
msgid "Guests Only"
|
730 |
msgstr ""
|
731 |
|
732 |
-
#: polls-options.php:
|
733 |
msgid "Registered Users Only"
|
734 |
msgstr ""
|
735 |
|
736 |
-
#: polls-options.php:
|
737 |
msgid "Registered Users And Guests"
|
738 |
msgstr ""
|
739 |
|
740 |
-
#: polls-options.php:
|
741 |
msgid "Poll Logging Method:"
|
742 |
msgstr ""
|
743 |
|
744 |
-
#: polls-options.php:
|
745 |
msgid "Do Not Log"
|
746 |
msgstr ""
|
747 |
|
748 |
-
#: polls-options.php:
|
749 |
msgid "Logged By Cookie"
|
750 |
msgstr ""
|
751 |
|
752 |
-
#: polls-options.php:
|
753 |
msgid "Logged By IP"
|
754 |
msgstr ""
|
755 |
|
756 |
-
#: polls-options.php:
|
757 |
msgid "Logged By Cookie And IP"
|
758 |
msgstr ""
|
759 |
|
760 |
-
#: polls-options.php:
|
761 |
msgid "Logged By Username"
|
762 |
msgstr ""
|
763 |
|
764 |
-
#: polls-options.php:
|
765 |
msgid "Poll Archive"
|
766 |
msgstr ""
|
767 |
|
768 |
-
#: polls-options.php:
|
769 |
-
msgid "Polls Per Page:"
|
770 |
msgstr ""
|
771 |
|
772 |
-
#: polls-options.php:
|
773 |
-
msgid "Polls Archive
|
774 |
msgstr ""
|
775 |
|
776 |
-
#: polls-options.php:
|
777 |
-
|
778 |
-
msgid "Display Polls Archive Link Below Poll?"
|
779 |
msgstr ""
|
780 |
|
781 |
-
#: polls-options.php:
|
782 |
-
|
783 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
msgstr ""
|
785 |
|
786 |
-
#: polls-options.php:
|
787 |
-
|
788 |
-
|
|
|
|
|
|
|
|
|
789 |
msgid "Current Active Poll"
|
790 |
msgstr ""
|
791 |
|
792 |
-
#: polls-options.php:
|
793 |
-
#: polls-widget.php:
|
794 |
msgid "Do NOT Display Poll (Disable)"
|
795 |
msgstr ""
|
796 |
|
797 |
-
#: polls-options.php:
|
798 |
-
#: polls-widget.php:
|
799 |
msgid "Display Random Poll"
|
800 |
msgstr ""
|
801 |
|
802 |
-
#: polls-options.php:
|
803 |
-
#: polls-widget.php:
|
804 |
msgid "Display Latest Poll"
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: polls-options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
msgid "When Poll Is Closed"
|
809 |
msgstr ""
|
810 |
|
811 |
-
#: polls-options.php:
|
812 |
msgid "Display Poll's Results"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: polls-options.php:
|
816 |
msgid "Do Not Display Poll In Post/Sidebar"
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: polls-options.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
820 |
msgid "Template Variables"
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: polls-
|
824 |
msgid "Display the poll's ID"
|
825 |
msgstr ""
|
826 |
|
827 |
-
#: polls-
|
828 |
msgid "Display the poll's answer ID"
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: polls-
|
832 |
msgid "Display the poll's question"
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: polls-
|
836 |
msgid "Display the poll's answer"
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: polls-
|
840 |
-
msgid "Display the poll's total votes"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: polls-
|
844 |
msgid "Display the poll's answer without HTML formatting."
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: polls-
|
848 |
msgid "Displays URL to poll's result"
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: polls-
|
852 |
msgid "Display the poll's answer votes"
|
853 |
msgstr ""
|
854 |
|
855 |
-
#: polls-
|
856 |
msgid "Display the poll's most voted answer"
|
857 |
msgstr ""
|
858 |
|
859 |
-
#: polls-
|
860 |
msgid "Display the poll's answer percentage"
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: polls-
|
864 |
msgid "Display the poll's answer votes for the most voted answer"
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: polls-
|
868 |
msgid "Display the poll's answer image width"
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: polls-
|
872 |
msgid "Display the poll's answer percentage for the most voted answer"
|
873 |
msgstr ""
|
874 |
|
875 |
-
#: polls-
|
876 |
msgid "Display the poll's least voted answer"
|
877 |
msgstr ""
|
878 |
|
879 |
-
#: polls-
|
880 |
msgid "Display the poll's start date/time"
|
881 |
msgstr ""
|
882 |
|
883 |
-
#: polls-
|
884 |
msgid "Display the poll's answer votes for the least voted answer"
|
885 |
msgstr ""
|
886 |
|
887 |
-
#: polls-
|
888 |
msgid "Display the poll's end date/time"
|
889 |
msgstr ""
|
890 |
|
891 |
-
#: polls-
|
892 |
msgid "Display the poll's answer percentage for the least voted answer"
|
893 |
msgstr ""
|
894 |
|
895 |
-
#: polls-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
896 |
msgid "Poll Voting Form Templates"
|
897 |
msgstr ""
|
898 |
|
899 |
-
#: polls-
|
900 |
msgid "Voting Form Header:"
|
901 |
msgstr ""
|
902 |
|
903 |
-
#: polls-
|
904 |
-
#: polls-
|
905 |
-
#: polls-
|
906 |
-
#: polls-
|
907 |
-
#: polls-
|
908 |
-
#: polls-
|
909 |
-
#: polls-
|
910 |
-
#: polls-
|
911 |
-
#: polls-
|
912 |
-
#: polls-
|
|
|
|
|
|
|
913 |
msgid "Allowed Variables:"
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: polls-
|
917 |
-
#: polls-
|
918 |
-
#: polls-
|
919 |
-
#: polls-
|
920 |
-
#: polls-
|
921 |
-
#: polls-
|
922 |
-
#: polls-
|
923 |
-
#: polls-
|
924 |
-
#: polls-
|
925 |
-
#: polls-
|
|
|
|
|
|
|
926 |
msgid "Restore Default Template"
|
927 |
msgstr ""
|
928 |
|
929 |
-
#: polls-
|
930 |
msgid "Voting Form Body:"
|
931 |
msgstr ""
|
932 |
|
933 |
-
#: polls-
|
934 |
msgid "Voting Form Footer:"
|
935 |
msgstr ""
|
936 |
|
937 |
-
#: polls-
|
938 |
msgid "Poll Result Templates"
|
939 |
msgstr ""
|
940 |
|
941 |
-
#: polls-
|
942 |
msgid "Result Header:"
|
943 |
msgstr ""
|
944 |
|
945 |
-
#: polls-
|
946 |
-
#: polls-
|
947 |
msgid "Result Body:"
|
948 |
msgstr ""
|
949 |
|
950 |
-
#: polls-
|
951 |
-
#: polls-
|
952 |
-
msgid "
|
953 |
msgstr ""
|
954 |
|
955 |
-
#: polls-
|
956 |
-
|
|
|
957 |
msgstr ""
|
958 |
|
959 |
-
#: polls-
|
960 |
-
#: polls-
|
961 |
msgid "Result Footer:"
|
962 |
msgstr ""
|
963 |
|
964 |
-
#: polls-
|
965 |
-
msgid "
|
966 |
msgstr ""
|
967 |
|
968 |
-
#: polls-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
969 |
msgid "Poll Misc Templates"
|
970 |
msgstr ""
|
971 |
|
972 |
-
#: polls-
|
973 |
msgid "Poll Disabled"
|
974 |
msgstr ""
|
975 |
|
976 |
-
#: polls-
|
977 |
-
|
978 |
-
msgid "N/A"
|
979 |
msgstr ""
|
980 |
|
981 |
-
#: polls-
|
982 |
msgid "Poll Error"
|
983 |
msgstr ""
|
984 |
|
985 |
-
#: polls-
|
986 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
987 |
msgstr ""
|
988 |
|
989 |
#: polls-usage.php:26
|
@@ -1047,13 +1393,6 @@ msgstr ""
|
|
1047 |
msgid " down for instructions on how to create a <b>Polls Archive</b>."
|
1048 |
msgstr ""
|
1049 |
|
1050 |
-
#: polls-usage.php:80
|
1051 |
-
#: polls.php:616
|
1052 |
-
#: polls.php:618
|
1053 |
-
#: polls.php:742
|
1054 |
-
msgid "Polls Archive"
|
1055 |
-
msgstr ""
|
1056 |
-
|
1057 |
#: polls-usage.php:83
|
1058 |
msgid "Go to 'WP-Admin -> Write -> Write Page'"
|
1059 |
msgstr ""
|
@@ -1090,138 +1429,137 @@ msgstr ""
|
|
1090 |
msgid "To Display Total Poll Votes"
|
1091 |
msgstr ""
|
1092 |
|
1093 |
-
#: polls-usage.php:
|
|
|
|
|
|
|
|
|
1094 |
msgid "Note"
|
1095 |
msgstr ""
|
1096 |
|
1097 |
-
#: polls-usage.php:
|
1098 |
msgid "In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,"
|
1099 |
msgstr ""
|
1100 |
|
1101 |
-
#: polls-usage.php:
|
1102 |
msgid "Open <b>poll-css.css</b>"
|
1103 |
msgstr ""
|
1104 |
|
1105 |
-
#: polls-usage.php:
|
1106 |
msgid "Find:"
|
1107 |
msgstr ""
|
1108 |
|
1109 |
-
#: polls-usage.php:
|
1110 |
msgid "Replace:"
|
1111 |
msgstr ""
|
1112 |
|
1113 |
-
#: polls-usage.php:
|
1114 |
msgid "Where <b>#ffffff</b> should be your background color for the poll."
|
1115 |
msgstr ""
|
1116 |
|
1117 |
-
#: polls-widget.php:
|
1118 |
#: polls.php:51
|
1119 |
msgid "Polls"
|
1120 |
msgstr ""
|
1121 |
|
1122 |
-
#: polls-widget.php:
|
1123 |
msgid "Title"
|
1124 |
msgstr ""
|
1125 |
|
1126 |
-
#: polls.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1127 |
msgid "Poll Usage"
|
1128 |
msgstr ""
|
1129 |
|
1130 |
-
#: polls.php:
|
1131 |
-
#: polls.php:
|
1132 |
msgid "Loading"
|
1133 |
msgstr ""
|
1134 |
|
1135 |
-
#: polls.php:
|
1136 |
-
msgid "
|
1137 |
msgstr ""
|
1138 |
|
1139 |
-
#: polls.php:
|
1140 |
msgid "Previous Page"
|
1141 |
msgstr ""
|
1142 |
|
1143 |
-
#: polls.php:
|
1144 |
msgid "Next Page"
|
1145 |
msgstr ""
|
1146 |
|
1147 |
-
#: polls.php:
|
1148 |
msgid "Pages"
|
1149 |
msgstr ""
|
1150 |
|
1151 |
-
#: polls.php:
|
1152 |
msgid "Go to First Page"
|
1153 |
msgstr ""
|
1154 |
|
1155 |
-
#: polls.php:
|
1156 |
msgid "First"
|
1157 |
msgstr ""
|
1158 |
|
1159 |
-
#: polls.php:
|
1160 |
-
#: polls.php:
|
1161 |
msgid "Go to Page"
|
1162 |
msgstr ""
|
1163 |
|
1164 |
-
#: polls.php:
|
1165 |
msgid "Page"
|
1166 |
msgstr ""
|
1167 |
|
1168 |
-
#: polls.php:
|
1169 |
msgid "Go to Last Page"
|
1170 |
msgstr ""
|
1171 |
|
1172 |
-
#: polls.php:
|
1173 |
msgid "Last"
|
1174 |
msgstr ""
|
1175 |
|
1176 |
-
#: polls.php:
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
#: polls.php:1033
|
1181 |
-
#: polls.php:1037
|
1182 |
-
#: polls.php:1041
|
1183 |
-
#: polls.php:1045
|
1184 |
-
msgid "Poll ID"
|
1185 |
-
msgstr ""
|
1186 |
-
|
1187 |
-
#: polls.php:1037
|
1188 |
-
msgid "Unable To Update Poll Answer Votes."
|
1189 |
-
msgstr ""
|
1190 |
-
|
1191 |
-
#: polls.php:1037
|
1192 |
-
#: polls.php:1045
|
1193 |
-
msgid "Poll Answer ID"
|
1194 |
msgstr ""
|
1195 |
|
1196 |
-
#: polls.php:
|
1197 |
-
|
|
|
1198 |
msgstr ""
|
1199 |
|
1200 |
-
#: polls.php:
|
1201 |
-
|
|
|
1202 |
msgstr ""
|
1203 |
|
1204 |
-
#: polls.php:
|
1205 |
msgid "How Is My Site?"
|
1206 |
msgstr ""
|
1207 |
|
1208 |
-
#: polls.php:
|
1209 |
msgid "Good"
|
1210 |
msgstr ""
|
1211 |
|
1212 |
-
#: polls.php:
|
1213 |
msgid "Excellent"
|
1214 |
msgstr ""
|
1215 |
|
1216 |
-
#: polls.php:
|
1217 |
msgid "Bad"
|
1218 |
msgstr ""
|
1219 |
|
1220 |
-
#: polls.php:
|
1221 |
msgid "Can Be Improved"
|
1222 |
msgstr ""
|
1223 |
|
1224 |
-
#: polls.php:
|
1225 |
msgid "No Comments"
|
1226 |
msgstr ""
|
1227 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP-Polls 2.20\n"
|
4 |
"POT-Creation-Date: \n"
|
5 |
+
"PO-Revision-Date: 2007-06-10 23:28+0800\n"
|
6 |
"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
|
7 |
"Language-Team: Ravan <ravanhagen@gmail.com>\n"
|
8 |
"MIME-Version: 1.0\n"
|
14 |
"X-Poedit-Language: English\n"
|
15 |
"X-Poedit-SearchPath-0: .\n"
|
16 |
|
17 |
+
#: polls-add.php:36
|
18 |
+
#: polls-add.php:173
|
19 |
+
#: polls-add.php:245
|
20 |
+
#: polls.php:55
|
21 |
+
msgid "Add Poll"
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: polls-add.php:80
|
25 |
+
#, php-format
|
26 |
+
msgid "Error In Adding Poll '%s'."
|
27 |
msgstr ""
|
28 |
|
29 |
+
#: polls-add.php:89
|
30 |
+
#: polls-manager.php:131
|
31 |
+
#, php-format
|
32 |
+
msgid "Error In Adding Poll's Answer '%s'."
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: polls-add.php:96
|
36 |
#, php-format
|
37 |
+
msgid "Poll '%s' Added Successfully."
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
#: polls-add.php:123
|
41 |
+
#: polls-logs.php:291
|
42 |
+
#: polls-logs.php:334
|
43 |
+
#: polls-manager.php:236
|
44 |
+
msgid "Answer"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: polls-add.php:152
|
48 |
+
msgid "You need at least a minimum of 2 poll answers."
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: polls-add.php:175
|
52 |
+
#: polls-manager.php:306
|
53 |
+
msgid "Poll Question"
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: polls-add.php:178
|
57 |
+
msgid "Question:"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: polls-add.php:183
|
61 |
+
#: polls-manager.php:314
|
62 |
+
msgid "Poll Answers"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: polls-add.php:188
|
66 |
+
#: polls-manager.php:354
|
67 |
+
msgid "Add Answer"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: polls-add.php:188
|
71 |
+
#: polls-manager.php:354
|
72 |
+
msgid "Remove Answer"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: polls-add.php:200
|
76 |
+
#: polls-manager.php:341
|
77 |
#, php-format
|
78 |
+
msgid "Answer %s:"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: polls-add.php:209
|
82 |
+
#: polls-manager.php:365
|
83 |
+
msgid "Poll Multiple Answers"
|
|
|
|
|
|
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: polls-add.php:212
|
87 |
+
#: polls-manager.php:368
|
88 |
+
msgid "Allows Users To Select More Than One Answer?"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: polls-add.php:215
|
92 |
+
#: polls-manager.php:371
|
93 |
+
#: polls-options.php:204
|
94 |
+
#: polls-options.php:213
|
95 |
+
#: polls-options.php:324
|
96 |
+
#: polls-widget.php:105
|
97 |
+
msgid "No"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: polls-add.php:216
|
101 |
+
#: polls-logs.php:381
|
102 |
+
#: polls-manager.php:372
|
103 |
+
#: polls-manager.php:588
|
104 |
+
#: polls-options.php:205
|
105 |
+
#: polls-options.php:214
|
106 |
+
#: polls-options.php:325
|
107 |
+
#: polls-uninstall.php:134
|
108 |
+
#: polls-widget.php:110
|
109 |
+
msgid "Yes"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: polls-add.php:221
|
113 |
+
#: polls-manager.php:377
|
114 |
+
msgid "Maximum Number Of Selected Answers Allowed?"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: polls-add.php:234
|
118 |
+
#: polls-manager.php:394
|
119 |
+
msgid "Poll Start/End Date"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: polls-add.php:237
|
123 |
+
msgid "Start Date/Time:"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: polls-add.php:241
|
127 |
+
msgid "End Date/Time:"
|
|
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: polls-add.php:242
|
131 |
+
#: polls-manager.php:416
|
132 |
+
msgid "Do NOT Expire This Poll"
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: polls-add.php:245
|
136 |
+
#: polls-manager.php:442
|
137 |
+
#: polls-options.php:382
|
138 |
+
#: polls-templates.php:464
|
139 |
+
msgid "Cancel"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: polls-admin-ajax.php:38
|
143 |
+
#: polls-admin-js.php:78
|
144 |
+
#: polls-manager.php:589
|
145 |
+
msgid "Delete All Logs"
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: polls-admin-ajax.php:42
|
149 |
+
msgid "All Polls Logs Have Been Deleted."
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: polls-admin-ajax.php:44
|
153 |
+
msgid "An Error Has Occured While Deleting All Polls Logs."
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: polls-admin-ajax.php:49
|
157 |
+
#: polls-admin-js.php:106
|
158 |
+
#: polls-logs.php:382
|
159 |
+
msgid "Delete Logs For This Poll Only"
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: polls-admin-ajax.php:55
|
163 |
#, php-format
|
164 |
+
msgid "All Logs For '%s' Has Been Deleted."
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: polls-admin-ajax.php:57
|
168 |
#, php-format
|
169 |
+
msgid "An Error Has Occured While Deleting All Logs For '%s'"
|
170 |
+
msgstr ""
|
171 |
+
|
172 |
+
#: polls-admin-ajax.php:62
|
173 |
+
#: polls-admin-js.php:148
|
174 |
+
msgid "Delete Poll Answer"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: polls-admin-ajax.php:72
|
178 |
#, php-format
|
179 |
+
msgid "Poll Answer '%s' Deleted Successfully."
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: polls-admin-ajax.php:74
|
183 |
+
#, php-format
|
184 |
+
msgid "Error In Deleting Poll Answer '%s'."
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: polls-admin-ajax.php:78
|
188 |
+
#: polls-admin-js.php:172
|
189 |
+
#: polls-manager.php:441
|
190 |
+
msgid "Open Poll"
|
|
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: polls-admin-ajax.php:83
|
194 |
#, php-format
|
195 |
+
msgid "Poll '%s' Is Now Opened"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: polls-admin-ajax.php:85
|
199 |
+
#, php-format
|
200 |
+
msgid "Error Opening Poll '%s'"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: polls-admin-ajax.php:89
|
204 |
+
#: polls-admin-js.php:195
|
205 |
+
#: polls-manager.php:440
|
206 |
+
msgid "Close Poll"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: polls-admin-ajax.php:94
|
210 |
+
#, php-format
|
211 |
+
msgid "Poll '%s' Is Now Closed"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: polls-admin-ajax.php:96
|
215 |
+
#, php-format
|
216 |
+
msgid "Error Closing Poll '%s'"
|
217 |
msgstr ""
|
218 |
|
219 |
+
#: polls-admin-ajax.php:100
|
220 |
+
#: polls-admin-js.php:56
|
221 |
+
msgid "Delete Poll"
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: polls-admin-ajax.php:108
|
225 |
+
#, php-format
|
226 |
+
msgid "Error In Deleting Poll '%s' Question"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: polls-admin-ajax.php:111
|
230 |
+
#, php-format
|
231 |
+
msgid "Poll '%s' Deleted Successfully"
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: polls-admin-js.php:69
|
235 |
+
#: polls-manager.php:592
|
236 |
+
msgid "No poll logs available."
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: polls-admin-js.php:85
|
240 |
+
msgid "Please check the 'Yes' checkbox if you want to delete all logs."
|
|
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: polls-admin-js.php:94
|
244 |
+
#: polls-logs.php:371
|
245 |
+
#: polls-logs.php:385
|
246 |
+
msgid "No poll logs available for this poll."
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: polls-admin-js.php:114
|
250 |
+
msgid "Please check the 'Yes' checkbox if you want to delete all logs for this poll ONLY."
|
|
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: polls-js.php:36
|
254 |
+
msgid "Your last request is still being processed. Please wait a while ..."
|
|
|
|
|
|
|
|
|
|
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: polls-js.php:37
|
258 |
+
msgid "Please choose a valid poll answer."
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: polls-js.php:38
|
262 |
+
msgid "Maximum number of choices allowed:"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: polls-logs.php:33
|
266 |
+
#: polls-logs.php:34
|
267 |
+
#: polls-logs.php:37
|
268 |
+
#: polls-logs.php:65
|
269 |
+
#: polls-logs.php:69
|
270 |
+
#: polls-logs.php:102
|
271 |
+
#: polls-logs.php:105
|
272 |
+
msgid "Guest"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: polls-logs.php:123
|
276 |
+
msgid "Poll's Logs"
|
|
|
|
|
|
|
|
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: polls-logs.php:126
|
280 |
+
#, php-format
|
281 |
+
msgid "There are a total of <strong>%s</strong> recorded votes for this poll."
|
282 |
msgstr ""
|
283 |
|
284 |
+
#: polls-logs.php:127
|
285 |
+
#, php-format
|
286 |
+
msgid "<strong>»</strong> <strong>%s</strong> vote(s) are voted by registered users"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: polls-logs.php:128
|
290 |
+
#, php-format
|
291 |
+
msgid "<strong>»</strong> <strong>%s</strong> vote(s) are voted by comment authors"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: polls-logs.php:129
|
295 |
+
#, php-format
|
296 |
+
msgid "<strong>»</strong> <strong>%s</strong> vote(s) are voted by guests"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: polls-logs.php:134
|
300 |
+
msgid "Filter Poll's Logs"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: polls-logs.php:143
|
304 |
+
msgid "Display All Users That Voted For:"
|
|
|
|
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: polls-logs.php:166
|
308 |
+
#: polls-logs.php:217
|
309 |
+
msgid "Voters To EXCLUDE"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: polls-logs.php:169
|
313 |
+
#: polls-logs.php:220
|
314 |
+
msgid "Registered Users"
|
|
|
|
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: polls-logs.php:170
|
318 |
+
#: polls-logs.php:221
|
319 |
+
msgid "Comment Authors"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: polls-logs.php:171
|
323 |
+
msgid "Guests"
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: polls-logs.php:175
|
327 |
+
#: polls-logs.php:226
|
328 |
+
#: polls-logs.php:262
|
329 |
+
msgid "Filter"
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: polls-logs.php:187
|
333 |
+
msgid "Display Users That Voted For: "
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: polls-logs.php:191
|
337 |
+
msgid "More Than"
|
|
|
|
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: polls-logs.php:192
|
341 |
+
msgid "More Than Or Exactly"
|
|
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: polls-logs.php:193
|
345 |
+
msgid "Exactly"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: polls-logs.php:194
|
349 |
+
msgid "Less Than Or Exactly"
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: polls-logs.php:195
|
353 |
+
msgid "Less Than"
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: polls-logs.php:202
|
357 |
+
msgid "1 Answer"
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: polls-logs.php:205
|
361 |
+
#: polls-logs.php:207
|
362 |
+
#, php-format
|
363 |
+
msgid "%s Answers"
|
364 |
msgstr ""
|
365 |
|
366 |
+
#: polls-logs.php:222
|
367 |
+
msgid "Guests will automatically be excluded"
|
368 |
msgstr ""
|
369 |
|
370 |
+
#: polls-logs.php:243
|
371 |
+
msgid "Display What This User Has Voted:"
|
372 |
msgstr ""
|
373 |
|
374 |
+
#: polls-logs.php:271
|
375 |
+
msgid "Clear Filter"
|
376 |
msgstr ""
|
377 |
|
378 |
+
#: polls-logs.php:278
|
379 |
msgid "Poll Logs"
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: polls-logs.php:283
|
383 |
+
msgid "This default filter is limited to display only <strong>100</strong> records."
|
384 |
msgstr ""
|
385 |
|
386 |
+
#: polls-logs.php:292
|
387 |
+
msgid "IP"
|
|
|
|
|
|
|
|
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: polls-logs.php:293
|
391 |
+
msgid "Host"
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: polls-logs.php:294
|
395 |
+
#: polls-logs.php:341
|
396 |
+
msgid "Date"
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: polls-logs.php:309
|
400 |
+
#: polls-logs.php:339
|
401 |
+
msgid "User"
|
402 |
msgstr ""
|
403 |
|
404 |
+
#: polls-logs.php:338
|
405 |
+
msgid "No."
|
|
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: polls-logs.php:340
|
409 |
+
msgid "IP/Host"
|
|
|
410 |
msgstr ""
|
411 |
|
412 |
+
#: polls-logs.php:362
|
413 |
+
#, php-format
|
414 |
+
msgid "Total number of records that matches this filter: <strong>%s</strong>"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: polls-logs.php:369
|
418 |
+
msgid "No poll logs matches the filter."
|
|
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: polls-logs.php:377
|
422 |
+
msgid "Delete Poll Logs"
|
|
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: polls-logs.php:380
|
426 |
+
msgid "Are You Sure You Want To Delete Logs For This Poll Only?"
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: polls-logs.php:382
|
430 |
+
#, php-format
|
431 |
+
msgid "You are about to delete poll logs for this poll '%s' ONLY. This action is not reversible."
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: polls-logs.php:389
|
435 |
+
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."
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: polls-manager.php:39
|
439 |
+
#: polls-manager.php:304
|
440 |
+
#: polls-manager.php:430
|
441 |
+
msgid "Edit Poll"
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: polls-manager.php:98
|
445 |
+
#, php-format
|
446 |
+
msgid "No Changes Had Been Made To Poll's Question '%s'."
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: polls-manager.php:112
|
450 |
+
#, php-format
|
451 |
+
msgid "No Changes Had Been Made To Poll's Answer '%s'."
|
452 |
msgstr ""
|
453 |
|
454 |
+
#: polls-manager.php:114
|
455 |
+
#, php-format
|
456 |
+
msgid "Poll's Answer '%s' Edited Successfully."
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: polls-manager.php:118
|
460 |
+
#, php-format
|
461 |
+
msgid "Invalid Poll '%s'."
|
462 |
msgstr ""
|
463 |
|
464 |
+
#: polls-manager.php:133
|
465 |
#, php-format
|
466 |
+
msgid "Poll's Answer '%s' Added Successfully."
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: polls-manager.php:140
|
470 |
+
#, php-format
|
471 |
+
msgid "Poll '%s' Edited Successfully."
|
472 |
msgstr ""
|
473 |
|
474 |
+
#: polls-manager.php:277
|
475 |
+
msgid "No more poll's answer to be removed."
|
476 |
msgstr ""
|
477 |
|
478 |
+
#: polls-manager.php:309
|
479 |
+
#: polls-manager.php:465
|
480 |
+
msgid "Question"
|
481 |
msgstr ""
|
482 |
|
483 |
+
#: polls-manager.php:318
|
484 |
+
msgid "Answer No.:"
|
|
|
|
|
|
|
485 |
msgstr ""
|
486 |
|
487 |
+
#: polls-manager.php:319
|
488 |
+
msgid "Answer Text:"
|
|
|
489 |
msgstr ""
|
490 |
|
491 |
+
#: polls-manager.php:320
|
492 |
+
msgid "No. Of Votes"
|
493 |
msgstr ""
|
494 |
|
495 |
+
#: polls-manager.php:329
|
496 |
+
msgid "Null Votes"
|
497 |
msgstr ""
|
498 |
|
499 |
+
#: polls-manager.php:343
|
500 |
+
#: polls-manager.php:543
|
501 |
+
msgid "Delete"
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: polls-manager.php:343
|
505 |
+
#, php-format
|
506 |
+
msgid "You are about to delete this poll's answer '%s'."
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: polls-manager.php:355
|
510 |
+
msgid "Total Votes:"
|
511 |
msgstr ""
|
512 |
|
513 |
+
#: polls-manager.php:360
|
514 |
+
#: polls-manager.php:574
|
515 |
+
msgid "Total Voters:"
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: polls-manager.php:397
|
519 |
+
#: polls-manager.php:467
|
520 |
+
msgid "Start Date/Time"
|
521 |
msgstr ""
|
522 |
|
523 |
+
#: polls-manager.php:400
|
524 |
+
msgid "Edit Start Date/Time"
|
525 |
msgstr ""
|
526 |
|
527 |
+
#: polls-manager.php:405
|
528 |
+
#: polls-manager.php:468
|
529 |
+
msgid "End Date/Time"
|
530 |
msgstr ""
|
531 |
|
532 |
+
#: polls-manager.php:409
|
533 |
+
msgid "This Poll Will Not Expire"
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: polls-manager.php:440
|
537 |
+
#, php-format
|
538 |
+
msgid "You are about to CLOSE this poll '%s'."
|
539 |
msgstr ""
|
540 |
|
541 |
+
#: polls-manager.php:441
|
542 |
+
#, php-format
|
543 |
+
msgid "You are about to OPEN this poll '%s'."
|
544 |
msgstr ""
|
545 |
|
546 |
+
#: polls-manager.php:460
|
547 |
+
#: polls.php:54
|
548 |
+
msgid "Manage Polls"
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: polls-manager.php:464
|
552 |
+
msgid "ID"
|
|
|
|
|
|
|
|
|
553 |
msgstr ""
|
554 |
|
555 |
+
#: polls-manager.php:466
|
556 |
+
#: polls-templates.php:116
|
557 |
+
#: polls-templates.php:119
|
558 |
+
#: polls.php:1212
|
559 |
+
#: polls.php:1215
|
560 |
+
msgid "Total Voters"
|
561 |
msgstr ""
|
562 |
|
563 |
+
#: polls-manager.php:469
|
564 |
+
msgid "Status"
|
565 |
msgstr ""
|
566 |
|
567 |
+
#: polls-manager.php:470
|
568 |
+
msgid "Action"
|
569 |
msgstr ""
|
570 |
|
571 |
+
#: polls-manager.php:494
|
572 |
+
#: polls.php:299
|
573 |
+
#: polls.php:415
|
574 |
+
#: polls.php:795
|
575 |
+
msgid "No Expiry"
|
576 |
msgstr ""
|
577 |
|
578 |
+
#: polls-manager.php:519
|
579 |
+
#: polls-manager.php:523
|
580 |
+
#: polls-manager.php:526
|
581 |
+
msgid "Displayed:"
|
582 |
msgstr ""
|
583 |
|
584 |
+
#: polls-manager.php:534
|
585 |
+
msgid "Open"
|
586 |
msgstr ""
|
587 |
|
588 |
+
#: polls-manager.php:536
|
589 |
+
msgid "Future"
|
590 |
msgstr ""
|
591 |
|
592 |
+
#: polls-manager.php:538
|
593 |
+
msgid "Closed"
|
594 |
msgstr ""
|
595 |
|
596 |
+
#: polls-manager.php:541
|
597 |
+
msgid "Logs"
|
598 |
msgstr ""
|
599 |
|
600 |
+
#: polls-manager.php:542
|
601 |
+
msgid "Edit"
|
602 |
msgstr ""
|
603 |
|
604 |
+
#: polls-manager.php:543
|
605 |
+
#, php-format
|
606 |
+
msgid "You are about to delete this poll, '%s'."
|
607 |
msgstr ""
|
608 |
|
609 |
+
#: polls-manager.php:551
|
610 |
+
msgid "No Polls Found"
|
611 |
msgstr ""
|
612 |
|
613 |
+
#: polls-manager.php:559
|
614 |
+
#: polls-usage.php:103
|
615 |
+
msgid "Polls Stats"
|
616 |
msgstr ""
|
617 |
|
618 |
+
#: polls-manager.php:562
|
619 |
+
msgid "Total Polls:"
|
620 |
msgstr ""
|
621 |
|
622 |
+
#: polls-manager.php:566
|
623 |
+
msgid "Total Polls' Answers:"
|
624 |
msgstr ""
|
625 |
|
626 |
+
#: polls-manager.php:570
|
627 |
+
msgid "Total Votes Casted:"
|
628 |
msgstr ""
|
629 |
|
630 |
+
#: polls-manager.php:581
|
631 |
+
msgid "Polls Logs"
|
632 |
msgstr ""
|
633 |
|
634 |
+
#: polls-manager.php:587
|
635 |
+
msgid "Are You Sure You Want To Delete All Polls Logs?"
|
636 |
msgstr ""
|
637 |
|
638 |
+
#: polls-manager.php:589
|
639 |
+
msgid "You are about to delete all poll logs. This action is not reversible."
|
640 |
msgstr ""
|
641 |
|
642 |
+
#: polls-manager.php:596
|
643 |
+
msgid "Note:<br />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."
|
644 |
msgstr ""
|
645 |
|
646 |
+
#: polls-options.php:68
|
647 |
+
#: polls-options.php:136
|
648 |
+
#: polls-options.php:139
|
649 |
+
msgid "Poll Bar Style"
|
650 |
msgstr ""
|
651 |
|
652 |
+
#: polls-options.php:69
|
653 |
+
msgid "Poll AJAX Style"
|
654 |
msgstr ""
|
655 |
|
656 |
+
#: polls-options.php:70
|
657 |
+
msgid "Sort Poll Answers By Option"
|
658 |
msgstr ""
|
659 |
|
660 |
+
#: polls-options.php:71
|
661 |
+
msgid "Sort Order Of Poll Answers Option"
|
662 |
msgstr ""
|
663 |
|
664 |
+
#: polls-options.php:72
|
665 |
+
msgid "Sort Poll Results By Option"
|
|
|
|
|
|
|
666 |
msgstr ""
|
667 |
|
668 |
+
#: polls-options.php:73
|
669 |
+
msgid "Sort Order Of Poll Results Option"
|
|
|
670 |
msgstr ""
|
671 |
|
672 |
+
#: polls-options.php:74
|
673 |
+
msgid "Number Of Polls Per Page To Display In Poll Archive Option"
|
|
|
674 |
msgstr ""
|
675 |
|
676 |
+
#: polls-options.php:75
|
677 |
+
msgid "Type Of Polls To Display In Poll Archive Option"
|
|
|
|
|
|
|
|
|
678 |
msgstr ""
|
679 |
|
680 |
+
#: polls-options.php:76
|
681 |
+
msgid "Poll Archive URL Option"
|
|
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: polls-options.php:77
|
685 |
+
msgid "Show Poll Achive Link Option"
|
|
|
686 |
msgstr ""
|
687 |
|
688 |
+
#: polls-options.php:78
|
689 |
+
msgid "Current Active Poll Option"
|
|
|
690 |
msgstr ""
|
691 |
|
692 |
+
#: polls-options.php:79
|
693 |
+
msgid "Poll Close Option"
|
|
|
694 |
msgstr ""
|
695 |
|
696 |
+
#: polls-options.php:80
|
697 |
+
#: polls-options.php:283
|
698 |
+
msgid "Logging Method"
|
699 |
+
msgstr ""
|
700 |
+
|
701 |
+
#: polls-options.php:81
|
702 |
+
msgid "Allow To Vote Option"
|
703 |
+
msgstr ""
|
704 |
+
|
705 |
+
#: polls-options.php:86
|
706 |
+
#: polls-templates.php:79
|
707 |
+
msgid "Updated"
|
708 |
+
msgstr ""
|
709 |
+
|
710 |
+
#: polls-options.php:91
|
711 |
+
#: polls-templates.php:84
|
712 |
+
msgid "No Poll Option Updated"
|
713 |
+
msgstr ""
|
714 |
+
|
715 |
+
#: polls-options.php:134
|
716 |
+
#: polls.php:56
|
717 |
msgid "Poll Options"
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: polls-options.php:165
|
721 |
msgid "Use CSS Style"
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: polls-options.php:169
|
725 |
msgid "Poll Bar Background"
|
726 |
msgstr ""
|
727 |
|
728 |
+
#: polls-options.php:174
|
729 |
msgid "Poll Bar Border"
|
730 |
msgstr ""
|
731 |
|
732 |
+
#: polls-options.php:179
|
733 |
msgid "Poll Bar Height"
|
734 |
msgstr ""
|
735 |
|
736 |
+
#: polls-options.php:183
|
737 |
msgid "Your poll bar will look like this"
|
738 |
msgstr ""
|
739 |
|
740 |
+
#: polls-options.php:198
|
741 |
+
msgid "Polls AJAX Style"
|
742 |
+
msgstr ""
|
743 |
+
|
744 |
+
#: polls-options.php:201
|
745 |
+
msgid "Show Loading Image With Text"
|
746 |
+
msgstr ""
|
747 |
+
|
748 |
+
#: polls-options.php:210
|
749 |
+
msgid "Show Fading In And Fading Out Of Poll"
|
750 |
+
msgstr ""
|
751 |
+
|
752 |
+
#: polls-options.php:221
|
753 |
msgid "Sorting Of Poll Answers"
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: polls-options.php:224
|
757 |
msgid "Sort Poll Answers By:"
|
758 |
msgstr ""
|
759 |
|
760 |
+
#: polls-options.php:227
|
761 |
+
#: polls-options.php:251
|
762 |
msgid "Exact Order"
|
763 |
msgstr ""
|
764 |
|
765 |
+
#: polls-options.php:228
|
766 |
+
#: polls-options.php:252
|
767 |
msgid "Alphabetical Order"
|
768 |
msgstr ""
|
769 |
|
770 |
+
#: polls-options.php:233
|
771 |
msgid "Sort Order Of Poll Answers:"
|
772 |
msgstr ""
|
773 |
|
774 |
+
#: polls-options.php:236
|
775 |
+
#: polls-options.php:260
|
776 |
msgid "Ascending"
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: polls-options.php:237
|
780 |
+
#: polls-options.php:261
|
781 |
msgid "Descending"
|
782 |
msgstr ""
|
783 |
|
784 |
+
#: polls-options.php:244
|
785 |
msgid "Sorting Of Poll Results"
|
786 |
msgstr ""
|
787 |
|
788 |
+
#: polls-options.php:247
|
789 |
msgid "Sort Poll Results By:"
|
790 |
msgstr ""
|
791 |
|
792 |
+
#: polls-options.php:250
|
793 |
+
#: polls-templates.php:110
|
794 |
+
#: polls-templates.php:113
|
795 |
+
#: polls.php:1209
|
796 |
+
#: polls.php:1210
|
797 |
+
msgid "Votes"
|
798 |
+
msgstr ""
|
799 |
+
|
800 |
+
#: polls-options.php:257
|
801 |
msgid "Sort Order Of Poll Results:"
|
802 |
msgstr ""
|
803 |
|
804 |
+
#: polls-options.php:268
|
805 |
msgid "Allow To Vote"
|
806 |
msgstr ""
|
807 |
|
808 |
+
#: polls-options.php:271
|
809 |
msgid "Who Is Allowed To Vote?"
|
810 |
msgstr ""
|
811 |
|
812 |
+
#: polls-options.php:274
|
813 |
msgid "Guests Only"
|
814 |
msgstr ""
|
815 |
|
816 |
+
#: polls-options.php:275
|
817 |
msgid "Registered Users Only"
|
818 |
msgstr ""
|
819 |
|
820 |
+
#: polls-options.php:276
|
821 |
msgid "Registered Users And Guests"
|
822 |
msgstr ""
|
823 |
|
824 |
+
#: polls-options.php:286
|
825 |
msgid "Poll Logging Method:"
|
826 |
msgstr ""
|
827 |
|
828 |
+
#: polls-options.php:289
|
829 |
msgid "Do Not Log"
|
830 |
msgstr ""
|
831 |
|
832 |
+
#: polls-options.php:290
|
833 |
msgid "Logged By Cookie"
|
834 |
msgstr ""
|
835 |
|
836 |
+
#: polls-options.php:291
|
837 |
msgid "Logged By IP"
|
838 |
msgstr ""
|
839 |
|
840 |
+
#: polls-options.php:292
|
841 |
msgid "Logged By Cookie And IP"
|
842 |
msgstr ""
|
843 |
|
844 |
+
#: polls-options.php:293
|
845 |
msgid "Logged By Username"
|
846 |
msgstr ""
|
847 |
|
848 |
+
#: polls-options.php:300
|
849 |
msgid "Poll Archive"
|
850 |
msgstr ""
|
851 |
|
852 |
+
#: polls-options.php:303
|
853 |
+
msgid "Number Of Polls Per Page:"
|
854 |
msgstr ""
|
855 |
|
856 |
+
#: polls-options.php:307
|
857 |
+
msgid "Type Of Polls To Display In Poll Archive:"
|
858 |
msgstr ""
|
859 |
|
860 |
+
#: polls-options.php:310
|
861 |
+
msgid "Closed Polls Only"
|
|
|
862 |
msgstr ""
|
863 |
|
864 |
+
#: polls-options.php:311
|
865 |
+
msgid "Opened Polls Only"
|
866 |
+
msgstr ""
|
867 |
+
|
868 |
+
#: polls-options.php:312
|
869 |
+
msgid "Closed And Opened Polls"
|
870 |
+
msgstr ""
|
871 |
+
|
872 |
+
#: polls-options.php:317
|
873 |
+
msgid "Poll Archive URL:"
|
874 |
+
msgstr ""
|
875 |
+
|
876 |
+
#: polls-options.php:321
|
877 |
+
msgid "Display Poll Archive Link Below Poll?"
|
878 |
msgstr ""
|
879 |
|
880 |
+
#: polls-options.php:330
|
881 |
+
msgid "Note: Only polls' results will be shown in the Poll Archive regardless of whether the poll is closed or opened."
|
882 |
+
msgstr ""
|
883 |
+
|
884 |
+
#: polls-options.php:335
|
885 |
+
#: polls-options.php:338
|
886 |
+
#: polls-widget.php:114
|
887 |
msgid "Current Active Poll"
|
888 |
msgstr ""
|
889 |
|
890 |
+
#: polls-options.php:341
|
891 |
+
#: polls-widget.php:120
|
892 |
msgid "Do NOT Display Poll (Disable)"
|
893 |
msgstr ""
|
894 |
|
895 |
+
#: polls-options.php:342
|
896 |
+
#: polls-widget.php:125
|
897 |
msgid "Display Random Poll"
|
898 |
msgstr ""
|
899 |
|
900 |
+
#: polls-options.php:343
|
901 |
+
#: polls-widget.php:130
|
902 |
msgid "Display Latest Poll"
|
903 |
msgstr ""
|
904 |
|
905 |
+
#: polls-options.php:345
|
906 |
+
#: polls-widget.php:135
|
907 |
+
msgid "Display Multiple Polls"
|
908 |
+
msgstr ""
|
909 |
+
|
910 |
+
#: polls-options.php:367
|
911 |
+
msgid "Note: If you chose 'Display Multiple Polls' for the above option, you need to configure it in Presentation -> Sidebar Widgets -> Poll."
|
912 |
+
msgstr ""
|
913 |
+
|
914 |
+
#: polls-options.php:371
|
915 |
msgid "When Poll Is Closed"
|
916 |
msgstr ""
|
917 |
|
918 |
+
#: polls-options.php:374
|
919 |
msgid "Display Poll's Results"
|
920 |
msgstr ""
|
921 |
|
922 |
+
#: polls-options.php:375
|
923 |
msgid "Do Not Display Poll In Post/Sidebar"
|
924 |
msgstr ""
|
925 |
|
926 |
+
#: polls-options.php:382
|
927 |
+
msgid "Update Options"
|
928 |
+
msgstr ""
|
929 |
+
|
930 |
+
#: polls-templates.php:62
|
931 |
+
msgid "Voting Form Header Template"
|
932 |
+
msgstr ""
|
933 |
+
|
934 |
+
#: polls-templates.php:63
|
935 |
+
msgid "Voting Form Body Template"
|
936 |
+
msgstr ""
|
937 |
+
|
938 |
+
#: polls-templates.php:64
|
939 |
+
msgid "Voting Form Footer Template"
|
940 |
+
msgstr ""
|
941 |
+
|
942 |
+
#: polls-templates.php:65
|
943 |
+
msgid "Result Header Template"
|
944 |
+
msgstr ""
|
945 |
+
|
946 |
+
#: polls-templates.php:66
|
947 |
+
msgid "Result Body Template"
|
948 |
+
msgstr ""
|
949 |
+
|
950 |
+
#: polls-templates.php:67
|
951 |
+
msgid "Result Body2 Template"
|
952 |
+
msgstr ""
|
953 |
+
|
954 |
+
#: polls-templates.php:68
|
955 |
+
msgid "Result Footer Template"
|
956 |
+
msgstr ""
|
957 |
+
|
958 |
+
#: polls-templates.php:69
|
959 |
+
msgid "Result Footer2 Template"
|
960 |
+
msgstr ""
|
961 |
+
|
962 |
+
#: polls-templates.php:70
|
963 |
+
msgid "Poll Archive Link Template"
|
964 |
+
msgstr ""
|
965 |
+
|
966 |
+
#: polls-templates.php:71
|
967 |
+
msgid "Poll Archive Poll Header Template"
|
968 |
+
msgstr ""
|
969 |
+
|
970 |
+
#: polls-templates.php:72
|
971 |
+
msgid "Poll Archive Poll Footer Template"
|
972 |
+
msgstr ""
|
973 |
+
|
974 |
+
#: polls-templates.php:73
|
975 |
+
msgid "Poll Disabled Template"
|
976 |
+
msgstr ""
|
977 |
+
|
978 |
+
#: polls-templates.php:74
|
979 |
+
msgid "Poll Error Template"
|
980 |
+
msgstr ""
|
981 |
+
|
982 |
+
#: polls-templates.php:104
|
983 |
+
#: polls-templates.php:119
|
984 |
+
#: polls.php:1203
|
985 |
+
#: polls.php:1216
|
986 |
+
msgid "Vote"
|
987 |
+
msgstr ""
|
988 |
+
|
989 |
+
#: polls-templates.php:104
|
990 |
+
#: polls.php:1204
|
991 |
+
msgid "View Results Of This Poll"
|
992 |
+
msgstr ""
|
993 |
+
|
994 |
+
#: polls-templates.php:104
|
995 |
+
#: polls.php:1204
|
996 |
+
msgid "View Results"
|
997 |
+
msgstr ""
|
998 |
+
|
999 |
+
#: polls-templates.php:113
|
1000 |
+
#: polls.php:1210
|
1001 |
+
msgid "You Have Voted For This Choice"
|
1002 |
+
msgstr ""
|
1003 |
+
|
1004 |
+
#: polls-templates.php:119
|
1005 |
+
#: polls.php:1216
|
1006 |
+
msgid "Vote For This Poll"
|
1007 |
+
msgstr ""
|
1008 |
+
|
1009 |
+
#: polls-templates.php:122
|
1010 |
+
#: polls-usage.php:80
|
1011 |
+
#: polls.php:1243
|
1012 |
+
msgid "Polls Archive"
|
1013 |
+
msgstr ""
|
1014 |
+
|
1015 |
+
#: polls-templates.php:128
|
1016 |
+
msgid "Start Date:"
|
1017 |
+
msgstr ""
|
1018 |
+
|
1019 |
+
#: polls-templates.php:128
|
1020 |
+
msgid "End Date:"
|
1021 |
+
msgstr ""
|
1022 |
+
|
1023 |
+
#: polls-templates.php:131
|
1024 |
+
#: polls.php:1218
|
1025 |
+
msgid "Sorry, there are no polls available at the moment."
|
1026 |
+
msgstr ""
|
1027 |
+
|
1028 |
+
#: polls-templates.php:134
|
1029 |
+
#: polls.php:1219
|
1030 |
+
msgid "An error has occurred when processing your poll."
|
1031 |
+
msgstr ""
|
1032 |
+
|
1033 |
+
#: polls-templates.php:144
|
1034 |
+
#: polls.php:57
|
1035 |
+
msgid "Poll Templates"
|
1036 |
+
msgstr ""
|
1037 |
+
|
1038 |
+
#: polls-templates.php:146
|
1039 |
msgid "Template Variables"
|
1040 |
msgstr ""
|
1041 |
|
1042 |
+
#: polls-templates.php:151
|
1043 |
msgid "Display the poll's ID"
|
1044 |
msgstr ""
|
1045 |
|
1046 |
+
#: polls-templates.php:155
|
1047 |
msgid "Display the poll's answer ID"
|
1048 |
msgstr ""
|
1049 |
|
1050 |
+
#: polls-templates.php:161
|
1051 |
msgid "Display the poll's question"
|
1052 |
msgstr ""
|
1053 |
|
1054 |
+
#: polls-templates.php:165
|
1055 |
msgid "Display the poll's answer"
|
1056 |
msgstr ""
|
1057 |
|
1058 |
+
#: polls-templates.php:171
|
1059 |
+
msgid "Display the poll's total votes NOT the number of people who voted for the poll"
|
1060 |
msgstr ""
|
1061 |
|
1062 |
+
#: polls-templates.php:175
|
1063 |
msgid "Display the poll's answer without HTML formatting."
|
1064 |
msgstr ""
|
1065 |
|
1066 |
+
#: polls-templates.php:181
|
1067 |
msgid "Displays URL to poll's result"
|
1068 |
msgstr ""
|
1069 |
|
1070 |
+
#: polls-templates.php:185
|
1071 |
msgid "Display the poll's answer votes"
|
1072 |
msgstr ""
|
1073 |
|
1074 |
+
#: polls-templates.php:191
|
1075 |
msgid "Display the poll's most voted answer"
|
1076 |
msgstr ""
|
1077 |
|
1078 |
+
#: polls-templates.php:195
|
1079 |
msgid "Display the poll's answer percentage"
|
1080 |
msgstr ""
|
1081 |
|
1082 |
+
#: polls-templates.php:201
|
1083 |
msgid "Display the poll's answer votes for the most voted answer"
|
1084 |
msgstr ""
|
1085 |
|
1086 |
+
#: polls-templates.php:205
|
1087 |
msgid "Display the poll's answer image width"
|
1088 |
msgstr ""
|
1089 |
|
1090 |
+
#: polls-templates.php:211
|
1091 |
msgid "Display the poll's answer percentage for the most voted answer"
|
1092 |
msgstr ""
|
1093 |
|
1094 |
+
#: polls-templates.php:215
|
1095 |
msgid "Display the poll's least voted answer"
|
1096 |
msgstr ""
|
1097 |
|
1098 |
+
#: polls-templates.php:221
|
1099 |
msgid "Display the poll's start date/time"
|
1100 |
msgstr ""
|
1101 |
|
1102 |
+
#: polls-templates.php:225
|
1103 |
msgid "Display the poll's answer votes for the least voted answer"
|
1104 |
msgstr ""
|
1105 |
|
1106 |
+
#: polls-templates.php:231
|
1107 |
msgid "Display the poll's end date/time"
|
1108 |
msgstr ""
|
1109 |
|
1110 |
+
#: polls-templates.php:235
|
1111 |
msgid "Display the poll's answer percentage for the least voted answer"
|
1112 |
msgstr ""
|
1113 |
|
1114 |
+
#: polls-templates.php:241
|
1115 |
+
msgid "Display the the maximum number of answers the user can choose if the poll supports multiple answers"
|
1116 |
+
msgstr ""
|
1117 |
+
|
1118 |
+
#: polls-templates.php:245
|
1119 |
+
msgid "Display \"checkbox\" or \"radio\" input types depending on the poll type"
|
1120 |
+
msgstr ""
|
1121 |
+
|
1122 |
+
#: polls-templates.php:251
|
1123 |
+
msgid "Display the number of people who voted for the poll NOT the total votes of the poll"
|
1124 |
+
msgstr ""
|
1125 |
+
|
1126 |
+
#: polls-templates.php:255
|
1127 |
+
msgid "Display the poll archive URL"
|
1128 |
+
msgstr ""
|
1129 |
+
|
1130 |
+
#: polls-templates.php:260
|
1131 |
+
msgid "Note:"
|
1132 |
+
msgstr ""
|
1133 |
+
|
1134 |
+
#: polls-templates.php:261
|
1135 |
+
msgid "<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."
|
1136 |
+
msgstr ""
|
1137 |
+
|
1138 |
+
#: polls-templates.php:267
|
1139 |
msgid "Poll Voting Form Templates"
|
1140 |
msgstr ""
|
1141 |
|
1142 |
+
#: polls-templates.php:271
|
1143 |
msgid "Voting Form Header:"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: polls-templates.php:272
|
1147 |
+
#: polls-templates.php:287
|
1148 |
+
#: polls-templates.php:300
|
1149 |
+
#: polls-templates.php:316
|
1150 |
+
#: polls-templates.php:331
|
1151 |
+
#: polls-templates.php:345
|
1152 |
+
#: polls-templates.php:359
|
1153 |
+
#: polls-templates.php:379
|
1154 |
+
#: polls-templates.php:404
|
1155 |
+
#: polls-templates.php:413
|
1156 |
+
#: polls-templates.php:422
|
1157 |
+
#: polls-templates.php:446
|
1158 |
+
#: polls-templates.php:455
|
1159 |
msgid "Allowed Variables:"
|
1160 |
msgstr ""
|
1161 |
|
1162 |
+
#: polls-templates.php:280
|
1163 |
+
#: polls-templates.php:293
|
1164 |
+
#: polls-templates.php:304
|
1165 |
+
#: polls-templates.php:324
|
1166 |
+
#: polls-templates.php:338
|
1167 |
+
#: polls-templates.php:352
|
1168 |
+
#: polls-templates.php:372
|
1169 |
+
#: polls-templates.php:392
|
1170 |
+
#: polls-templates.php:406
|
1171 |
+
#: polls-templates.php:415
|
1172 |
+
#: polls-templates.php:434
|
1173 |
+
#: polls-templates.php:448
|
1174 |
+
#: polls-templates.php:457
|
1175 |
msgid "Restore Default Template"
|
1176 |
msgstr ""
|
1177 |
|
1178 |
+
#: polls-templates.php:286
|
1179 |
msgid "Voting Form Body:"
|
1180 |
msgstr ""
|
1181 |
|
1182 |
+
#: polls-templates.php:299
|
1183 |
msgid "Voting Form Footer:"
|
1184 |
msgstr ""
|
1185 |
|
1186 |
+
#: polls-templates.php:311
|
1187 |
msgid "Poll Result Templates"
|
1188 |
msgstr ""
|
1189 |
|
1190 |
+
#: polls-templates.php:315
|
1191 |
msgid "Result Header:"
|
1192 |
msgstr ""
|
1193 |
|
1194 |
+
#: polls-templates.php:330
|
1195 |
+
#: polls-templates.php:344
|
1196 |
msgid "Result Body:"
|
1197 |
msgstr ""
|
1198 |
|
1199 |
+
#: polls-templates.php:330
|
1200 |
+
#: polls-templates.php:378
|
1201 |
+
msgid "Displayed When The User HAS NOT Voted"
|
1202 |
msgstr ""
|
1203 |
|
1204 |
+
#: polls-templates.php:344
|
1205 |
+
#: polls-templates.php:358
|
1206 |
+
msgid "Displayed When The User HAS Voted"
|
1207 |
msgstr ""
|
1208 |
|
1209 |
+
#: polls-templates.php:358
|
1210 |
+
#: polls-templates.php:378
|
1211 |
msgid "Result Footer:"
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: polls-templates.php:399
|
1215 |
+
msgid "Poll Archive Templates"
|
1216 |
msgstr ""
|
1217 |
|
1218 |
+
#: polls-templates.php:403
|
1219 |
+
msgid "Poll Archive Link"
|
1220 |
+
msgstr ""
|
1221 |
+
|
1222 |
+
#: polls-templates.php:403
|
1223 |
+
msgid "Template For Displaying Poll Archive Link"
|
1224 |
+
msgstr ""
|
1225 |
+
|
1226 |
+
#: polls-templates.php:412
|
1227 |
+
msgid "Individual Poll Header"
|
1228 |
+
msgstr ""
|
1229 |
+
|
1230 |
+
#: polls-templates.php:412
|
1231 |
+
msgid "Displayed Before Each Poll In The Poll Archive"
|
1232 |
+
msgstr ""
|
1233 |
+
|
1234 |
+
#: polls-templates.php:414
|
1235 |
+
#: polls-templates.php:447
|
1236 |
+
#: polls-templates.php:456
|
1237 |
+
msgid "N/A"
|
1238 |
+
msgstr ""
|
1239 |
+
|
1240 |
+
#: polls-templates.php:421
|
1241 |
+
msgid "Individual Poll Footer"
|
1242 |
+
msgstr ""
|
1243 |
+
|
1244 |
+
#: polls-templates.php:421
|
1245 |
+
msgid "Displayed After Each Poll In The Poll Archive"
|
1246 |
+
msgstr ""
|
1247 |
+
|
1248 |
+
#: polls-templates.php:441
|
1249 |
msgid "Poll Misc Templates"
|
1250 |
msgstr ""
|
1251 |
|
1252 |
+
#: polls-templates.php:445
|
1253 |
msgid "Poll Disabled"
|
1254 |
msgstr ""
|
1255 |
|
1256 |
+
#: polls-templates.php:445
|
1257 |
+
msgid "Displayed When The Poll Is Disabled"
|
|
|
1258 |
msgstr ""
|
1259 |
|
1260 |
+
#: polls-templates.php:454
|
1261 |
msgid "Poll Error"
|
1262 |
msgstr ""
|
1263 |
|
1264 |
+
#: polls-templates.php:454
|
1265 |
+
msgid "Displayed When An Error Has Occured While Processing The Poll"
|
1266 |
+
msgstr ""
|
1267 |
+
|
1268 |
+
#: polls-templates.php:464
|
1269 |
+
msgid "Update Templates"
|
1270 |
+
msgstr ""
|
1271 |
+
|
1272 |
+
#: polls-uninstall.php:43
|
1273 |
+
#: polls-uninstall.php:135
|
1274 |
+
msgid "UNINSTALL WP-Polls"
|
1275 |
+
msgstr ""
|
1276 |
+
|
1277 |
+
#: polls-uninstall.php:50
|
1278 |
+
#, php-format
|
1279 |
+
msgid "Table '%s' has been deleted."
|
1280 |
+
msgstr ""
|
1281 |
+
|
1282 |
+
#: polls-uninstall.php:59
|
1283 |
+
#, php-format
|
1284 |
+
msgid "Setting Key '%s' has been deleted."
|
1285 |
+
msgstr ""
|
1286 |
+
|
1287 |
+
#: polls-uninstall.php:63
|
1288 |
+
#, php-format
|
1289 |
+
msgid "Error deleting Setting Key '%s'."
|
1290 |
+
msgstr ""
|
1291 |
+
|
1292 |
+
#: polls-uninstall.php:85
|
1293 |
+
#: polls-uninstall.php:95
|
1294 |
+
#: polls.php:59
|
1295 |
+
msgid "Uninstall WP-Polls"
|
1296 |
+
msgstr ""
|
1297 |
+
|
1298 |
+
#: polls-uninstall.php:86
|
1299 |
+
#, php-format
|
1300 |
+
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically."
|
1301 |
+
msgstr ""
|
1302 |
+
|
1303 |
+
#: polls-uninstall.php:97
|
1304 |
+
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."
|
1305 |
+
msgstr ""
|
1306 |
+
|
1307 |
+
#: polls-uninstall.php:100
|
1308 |
+
msgid "WARNING:"
|
1309 |
+
msgstr ""
|
1310 |
+
|
1311 |
+
#: polls-uninstall.php:101
|
1312 |
+
msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
|
1313 |
+
msgstr ""
|
1314 |
+
|
1315 |
+
#: polls-uninstall.php:104
|
1316 |
+
msgid "The following WordPress Options/Tables will be DELETED:"
|
1317 |
+
msgstr ""
|
1318 |
+
|
1319 |
+
#: polls-uninstall.php:108
|
1320 |
+
msgid "WordPress Options"
|
1321 |
+
msgstr ""
|
1322 |
+
|
1323 |
+
#: polls-uninstall.php:109
|
1324 |
+
msgid "WordPress Tables"
|
1325 |
+
msgstr ""
|
1326 |
+
|
1327 |
+
#: polls-uninstall.php:135
|
1328 |
+
msgid ""
|
1329 |
+
"You Are About To Uninstall WP-Polls From WordPress.\\n"
|
1330 |
+
"This Action Is Not Reversible.\\n"
|
1331 |
+
"\\n"
|
1332 |
+
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
1333 |
msgstr ""
|
1334 |
|
1335 |
#: polls-usage.php:26
|
1393 |
msgid " down for instructions on how to create a <b>Polls Archive</b>."
|
1394 |
msgstr ""
|
1395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1396 |
#: polls-usage.php:83
|
1397 |
msgid "Go to 'WP-Admin -> Write -> Write Page'"
|
1398 |
msgstr ""
|
1429 |
msgid "To Display Total Poll Votes"
|
1430 |
msgstr ""
|
1431 |
|
1432 |
+
#: polls-usage.php:122
|
1433 |
+
msgid "To Display Total Poll Voters"
|
1434 |
+
msgstr ""
|
1435 |
+
|
1436 |
+
#: polls-usage.php:130
|
1437 |
msgid "Note"
|
1438 |
msgstr ""
|
1439 |
|
1440 |
+
#: polls-usage.php:133
|
1441 |
msgid "In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,"
|
1442 |
msgstr ""
|
1443 |
|
1444 |
+
#: polls-usage.php:136
|
1445 |
msgid "Open <b>poll-css.css</b>"
|
1446 |
msgstr ""
|
1447 |
|
1448 |
+
#: polls-usage.php:139
|
1449 |
msgid "Find:"
|
1450 |
msgstr ""
|
1451 |
|
1452 |
+
#: polls-usage.php:143
|
1453 |
msgid "Replace:"
|
1454 |
msgstr ""
|
1455 |
|
1456 |
+
#: polls-usage.php:145
|
1457 |
msgid "Where <b>#ffffff</b> should be your background color for the poll."
|
1458 |
msgstr ""
|
1459 |
|
1460 |
+
#: polls-widget.php:64
|
1461 |
#: polls.php:51
|
1462 |
msgid "Polls"
|
1463 |
msgstr ""
|
1464 |
|
1465 |
+
#: polls-widget.php:96
|
1466 |
msgid "Title"
|
1467 |
msgstr ""
|
1468 |
|
1469 |
+
#: polls-widget.php:99
|
1470 |
+
msgid "Display Polls Archive Link Below Poll?"
|
1471 |
+
msgstr ""
|
1472 |
+
|
1473 |
+
#: polls-widget.php:159
|
1474 |
+
msgid "Select Multiple Polls"
|
1475 |
+
msgstr ""
|
1476 |
+
|
1477 |
+
#: polls.php:58
|
1478 |
msgid "Poll Usage"
|
1479 |
msgstr ""
|
1480 |
|
1481 |
+
#: polls.php:377
|
1482 |
+
#: polls.php:537
|
1483 |
msgid "Loading"
|
1484 |
msgstr ""
|
1485 |
|
1486 |
+
#: polls.php:579
|
1487 |
+
msgid "Note: There is a poll within this post, please visit the site to participate in this post's poll."
|
1488 |
msgstr ""
|
1489 |
|
1490 |
+
#: polls.php:922
|
1491 |
msgid "Previous Page"
|
1492 |
msgstr ""
|
1493 |
|
1494 |
+
#: polls.php:930
|
1495 |
msgid "Next Page"
|
1496 |
msgstr ""
|
1497 |
|
1498 |
+
#: polls.php:939
|
1499 |
msgid "Pages"
|
1500 |
msgstr ""
|
1501 |
|
1502 |
+
#: polls.php:941
|
1503 |
msgid "Go to First Page"
|
1504 |
msgstr ""
|
1505 |
|
1506 |
+
#: polls.php:941
|
1507 |
msgid "First"
|
1508 |
msgstr ""
|
1509 |
|
1510 |
+
#: polls.php:944
|
1511 |
+
#: polls.php:956
|
1512 |
msgid "Go to Page"
|
1513 |
msgstr ""
|
1514 |
|
1515 |
+
#: polls.php:951
|
1516 |
msgid "Page"
|
1517 |
msgstr ""
|
1518 |
|
1519 |
+
#: polls.php:959
|
1520 |
msgid "Go to Last Page"
|
1521 |
msgstr ""
|
1522 |
|
1523 |
+
#: polls.php:959
|
1524 |
msgid "Last"
|
1525 |
msgstr ""
|
1526 |
|
1527 |
+
#: polls.php:1123
|
1528 |
+
#, php-format
|
1529 |
+
msgid "Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1530 |
msgstr ""
|
1531 |
|
1532 |
+
#: polls.php:1127
|
1533 |
+
#, php-format
|
1534 |
+
msgid "You Had Already Voted For This Poll. Poll ID #%s"
|
1535 |
msgstr ""
|
1536 |
|
1537 |
+
#: polls.php:1131
|
1538 |
+
#, php-format
|
1539 |
+
msgid "Invalid Poll ID. Poll ID #%s"
|
1540 |
msgstr ""
|
1541 |
|
1542 |
+
#: polls.php:1187
|
1543 |
msgid "How Is My Site?"
|
1544 |
msgstr ""
|
1545 |
|
1546 |
+
#: polls.php:1190
|
1547 |
msgid "Good"
|
1548 |
msgstr ""
|
1549 |
|
1550 |
+
#: polls.php:1191
|
1551 |
msgid "Excellent"
|
1552 |
msgstr ""
|
1553 |
|
1554 |
+
#: polls.php:1192
|
1555 |
msgid "Bad"
|
1556 |
msgstr ""
|
1557 |
|
1558 |
+
#: polls.php:1193
|
1559 |
msgid "Can Be Improved"
|
1560 |
msgstr ""
|
1561 |
|
1562 |
+
#: polls.php:1194
|
1563 |
msgid "No Comments"
|
1564 |
msgstr ""
|
1565 |
|
readme.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
-
<title>WP-Polls 2.
|
6 |
<style type="text/css" media="screen">
|
7 |
/* Default Style */
|
8 |
BODY {
|
@@ -204,7 +204,7 @@
|
|
204 |
<body>
|
205 |
<div id="Container">
|
206 |
<!-- Title -->
|
207 |
-
<div id="Title">WP-Polls 2.
|
208 |
|
209 |
<!-- Tabs -->
|
210 |
<ul id="Tabs">
|
@@ -222,65 +222,66 @@
|
|
222 |
<div class="SubTitle">» Index</div>
|
223 |
<div class="SubSubTitle">Plugin Information</div>
|
224 |
<p>
|
225 |
-
<
|
226 |
<p>
|
227 |
-
<
|
228 |
<script type="text/javascript">
|
229 |
/* <![CDATA[*/
|
230 |
-
document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Polls%202.
|
231 |
/* ]]> */
|
232 |
</script>
|
233 |
</p>
|
234 |
<p>
|
235 |
-
<
|
236 |
-
<
|
237 |
</p>
|
238 |
<p>
|
239 |
-
<
|
240 |
-
<
|
241 |
</p>
|
242 |
<p>
|
243 |
-
<
|
244 |
-
<
|
245 |
-
<
|
246 |
-
<
|
247 |
</p>
|
248 |
<p>
|
249 |
-
<
|
250 |
-
<
|
251 |
</p>
|
252 |
<p>
|
253 |
-
<
|
254 |
-
<
|
255 |
</p>
|
256 |
<p>
|
257 |
-
<
|
258 |
-
<
|
259 |
</p>
|
260 |
<p>
|
261 |
-
<
|
262 |
-
<
|
263 |
</p>
|
264 |
<p>
|
265 |
-
<
|
266 |
-
<
|
267 |
-
<
|
268 |
</p>
|
269 |
<p>
|
270 |
-
<
|
271 |
-
<
|
272 |
</p>
|
273 |
<p>
|
274 |
-
<
|
275 |
-
<
|
276 |
-
<
|
|
|
277 |
</p>
|
278 |
<p>
|
279 |
-
<
|
280 |
-
<
|
281 |
<script type="text/javascript">
|
282 |
/* <![CDATA[*/
|
283 |
-
document.write(' <
|
284 |
/* ]]> */
|
285 |
</script>
|
286 |
</p>
|
@@ -291,7 +292,25 @@
|
|
291 |
<div class="SubTitle">» Changelog</div>
|
292 |
<ul>
|
293 |
<li>
|
294 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
<ul>
|
296 |
<li>NEW: Works For WordPress 2.1 Only</li>
|
297 |
<li>NEW: Renamed polls-js.js to polls-js.php To Enable PHP Parsing</li>
|
@@ -304,7 +323,7 @@
|
|
304 |
</ul>
|
305 |
</li>
|
306 |
<li>
|
307 |
-
<
|
308 |
<ul>
|
309 |
<li>NEW: polls.php Now Handles The AJAX Processing Instead Of index.php</li>
|
310 |
<li>NEW: Able To Modify The Style Of Poll Results Bar in 'Polls -> Poll Option'</li>
|
@@ -320,7 +339,7 @@
|
|
320 |
</ul>
|
321 |
</li>
|
322 |
<li>
|
323 |
-
<
|
324 |
<ul>
|
325 |
|
326 |
<li>NEW: Polls Archive Is Now Embedded Into A Page, And Hence No More Integrating Of Polls Archive</li>
|
@@ -332,7 +351,7 @@
|
|
332 |
</ul>
|
333 |
</li>
|
334 |
<li>
|
335 |
-
<
|
336 |
<ul>
|
337 |
<li>NEW: You Can Now Place The Poll On The Sidebar As A Widget</li>
|
338 |
<li>NEW: Moved wp-polls.php To wp-content/plugins/polls/ Folder</li>
|
@@ -341,7 +360,7 @@
|
|
341 |
</ul>
|
342 |
</li>
|
343 |
<li>
|
344 |
-
<
|
345 |
<ul>
|
346 |
<li>NEW: Poll Is Now Using AJAX</li>
|
347 |
<li>NEW: Ability To Close/Open Poll</li>
|
@@ -353,19 +372,19 @@
|
|
353 |
</ul>
|
354 |
</li>
|
355 |
<li>
|
356 |
-
<
|
357 |
<ul>
|
358 |
<li>FIXED: Bug In vote_poll();</li>
|
359 |
</ul>
|
360 |
</li>
|
361 |
<li>
|
362 |
-
<
|
363 |
<ul>
|
364 |
<li>FIXED: Random Poll Not Working Correctly</li>
|
365 |
</ul>
|
366 |
</li>
|
367 |
<li>
|
368 |
-
<
|
369 |
<ul>
|
370 |
<li>NEW: Poll Bar Is Slightly Nicer</li>
|
371 |
<li>NEW: Got Rid Of Tables, Now Using List</li>
|
@@ -375,7 +394,7 @@
|
|
375 |
</ul>
|
376 |
</li>
|
377 |
<li>
|
378 |
-
<
|
379 |
<ul>
|
380 |
<li>NEW: Improved On 'manage_polls' Capabilities</li>
|
381 |
<li>NEW: Neater Structure</li>
|
@@ -384,7 +403,7 @@
|
|
384 |
</ul>
|
385 |
</li>
|
386 |
<li>
|
387 |
-
<
|
388 |
<ul>
|
389 |
<li>NEW: Added 'manage_polls' Capabilities To Administrator Role</li>
|
390 |
<li>NEW: [poll=POLL_ID] Tag To Insert Poll Into A Post</li>
|
@@ -395,7 +414,7 @@
|
|
395 |
</ul>
|
396 |
</li>
|
397 |
<li>
|
398 |
-
<
|
399 |
<ul>
|
400 |
<li>NEW: Compatible With WordPress 2.0 Only</li>
|
401 |
<li>NEW: Poll Administration Menu Added Automatically Upon Activating The Plugin</li>
|
@@ -405,13 +424,13 @@
|
|
405 |
</ul>
|
406 |
</li>
|
407 |
<li>
|
408 |
-
<
|
409 |
<ul>
|
410 |
<li>FIXED: poll-install.php And poll-upgrade.php will Now Be Installed/Upgraded To 2.02 Instead Of 2.01</li>
|
411 |
</ul>
|
412 |
</li>
|
413 |
<li>
|
414 |
-
<
|
415 |
<ul>
|
416 |
<li>FIXED: Showing 0 Vote On Poll Edit Page</li>
|
417 |
<li>FIXED: Null Vote Being Counted As A Vote</li>
|
@@ -421,7 +440,7 @@
|
|
421 |
</ul>
|
422 |
</li>
|
423 |
<li>
|
424 |
-
<
|
425 |
<ul>
|
426 |
<li>FIXED: Upgrade Script To Insert Lastest Poll ID Of User's Current Polls, Instead Of Poll ID 1</li>
|
427 |
<li>FIXED: Replace All <?= With <?php</li>
|
@@ -430,7 +449,7 @@
|
|
430 |
</ul>
|
431 |
</li>
|
432 |
<li>
|
433 |
-
<
|
434 |
<ul>
|
435 |
<li>NEW: IP Logging</li>
|
436 |
<li>NEW: Poll Options: Sorting Of Answers In Voting Form</li>
|
@@ -451,17 +470,17 @@
|
|
451 |
<div class="SubTitle">» Installation Instructions</div>
|
452 |
<ol>
|
453 |
<li>
|
454 |
-
Open <
|
455 |
</li>
|
456 |
<li>
|
457 |
Put:
|
458 |
<blockquote>Folder: polls</blockquote>
|
459 |
</li>
|
460 |
<li>
|
461 |
-
<
|
462 |
</li>
|
463 |
<li>
|
464 |
-
Refer To <
|
465 |
</li>
|
466 |
</ol>
|
467 |
</div>
|
@@ -469,13 +488,13 @@
|
|
469 |
<!-- Upgrade Instructions -->
|
470 |
<div id="Upgrade" style="display: none;">
|
471 |
<div class="SubTitle">» Upgrade Instructions</div>
|
472 |
-
<div class="SubSubTitle">From v2.xx To v2.
|
473 |
<ol>
|
474 |
<li>
|
475 |
-
<
|
476 |
</li>
|
477 |
<li>
|
478 |
-
Open <
|
479 |
</li>
|
480 |
<li>
|
481 |
Put/Overwrite:
|
@@ -494,13 +513,13 @@
|
|
494 |
</blockquote>
|
495 |
</li>
|
496 |
<li>
|
497 |
-
<
|
498 |
</li>
|
499 |
<li>
|
500 |
-
Go to 'WP-Admin -> Polls -> Polls Options' and restore all the template variables to <
|
501 |
</li>
|
502 |
<li>
|
503 |
-
Refer To <
|
504 |
</li>
|
505 |
</ol>
|
506 |
</div>
|
@@ -511,12 +530,12 @@
|
|
511 |
<div class="SubSubTitle">General Usage (Without Widget)</div>
|
512 |
<ol>
|
513 |
<li>
|
514 |
-
Open <
|
515 |
</li>
|
516 |
<li>
|
517 |
Add:
|
518 |
<blockquote>
|
519 |
-
<?php if (function_exists('vote_poll') &&
|
520 |
<li><br />
|
521 |
<h2>Polls</h2><br />
|
522 |
<ul><br />
|
@@ -526,53 +545,53 @@
|
|
526 |
</li><br />
|
527 |
<?php endif; ?>
|
528 |
</blockquote>
|
529 |
-
<p>To show specific poll, use <?php get_poll(<
|
530 |
-
<p>To embed a specific poll in your post, use [poll=<
|
531 |
</li>
|
532 |
<li>
|
533 |
-
Scroll down for instructions on how to create a <
|
534 |
</li>
|
535 |
</ol>
|
536 |
<div class="SubSubTitle">General Usage (With Widget)</div>
|
537 |
<ol>
|
538 |
<li>
|
539 |
-
<
|
540 |
</li>
|
541 |
<li>
|
542 |
-
Go to 'WP-Admin -> Presentation ->
|
543 |
</li>
|
544 |
<li>
|
545 |
-
<
|
546 |
</li>
|
547 |
<li>
|
548 |
-
You can <
|
549 |
</li>
|
550 |
<li>
|
551 |
Click 'Save changes'
|
552 |
</li>
|
553 |
<li>
|
554 |
-
Scroll down for instructions on how to create a <
|
555 |
</li>
|
556 |
</ol>
|
557 |
<div class="SubSubTitle">Polls Archive</div>
|
558 |
<ol>
|
559 |
<li>
|
560 |
-
Go to 'WP-Admin -> Write -> Write Page'
|
561 |
</li>
|
562 |
<li>
|
563 |
Type any title you like in the post's title area
|
564 |
</li>
|
565 |
<li>
|
566 |
-
Type '<
|
567 |
</li>
|
568 |
<li>
|
569 |
-
Type '<
|
570 |
</li>
|
571 |
<li>
|
572 |
Click 'Publish'
|
573 |
</li>
|
574 |
<li>
|
575 |
-
If you <
|
576 |
</li>
|
577 |
</ol>
|
578 |
<div class="SubSubTitle">Note</div>
|
@@ -581,7 +600,7 @@
|
|
581 |
In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,
|
582 |
<ol>
|
583 |
<li>
|
584 |
-
Open <
|
585 |
</li>
|
586 |
<li>
|
587 |
Find:
|
@@ -594,7 +613,7 @@
|
|
594 |
<blockquote>
|
595 |
background-color: #ffffff;
|
596 |
</blockquote>
|
597 |
-
<p>Where <
|
598 |
</li>
|
599 |
</ol>
|
600 |
</li>
|
@@ -602,7 +621,7 @@
|
|
602 |
<div class="SubSubTitle">Polls Stats (Outside WP Loop)</div>
|
603 |
<ul>
|
604 |
<li>
|
605 |
-
To Display <
|
606 |
</li>
|
607 |
<li>
|
608 |
Use:
|
@@ -613,7 +632,7 @@
|
|
613 |
</blockquote>
|
614 |
</li>
|
615 |
<li>
|
616 |
-
To Display <
|
617 |
</li>
|
618 |
<li>
|
619 |
Use:
|
@@ -624,7 +643,7 @@
|
|
624 |
</blockquote>
|
625 |
</li>
|
626 |
<li>
|
627 |
-
To Display <
|
628 |
</li>
|
629 |
<li>
|
630 |
Use:
|
@@ -634,10 +653,21 @@
|
|
634 |
<?php endif; ?>
|
635 |
</blockquote>
|
636 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
</ul>
|
638 |
</div>
|
639 |
</div>
|
640 |
</div>
|
641 |
-
<p id="Copyright">WP-Polls 2.
|
642 |
</body>
|
643 |
</html>
|
2 |
<html>
|
3 |
<head>
|
4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-Polls 2.20 Readme</title>
|
6 |
<style type="text/css" media="screen">
|
7 |
/* Default Style */
|
8 |
BODY {
|
204 |
<body>
|
205 |
<div id="Container">
|
206 |
<!-- Title -->
|
207 |
+
<div id="Title">WP-Polls 2.20 <span style="color: #aaaaaa;">Readme</span></div>
|
208 |
|
209 |
<!-- Tabs -->
|
210 |
<ul id="Tabs">
|
222 |
<div class="SubTitle">» Index</div>
|
223 |
<div class="SubSubTitle">Plugin Information</div>
|
224 |
<p>
|
225 |
+
<strong>Author:</strong><br /><strong>»</strong> Lester 'GaMerZ' Chan</p>
|
226 |
<p>
|
227 |
+
<strong>EMail:</strong><br /><strong>»</strong>
|
228 |
<script type="text/javascript">
|
229 |
/* <![CDATA[*/
|
230 |
+
document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Polls%202.20%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
|
231 |
/* ]]> */
|
232 |
</script>
|
233 |
</p>
|
234 |
<p>
|
235 |
+
<strong>Website:</strong><br />
|
236 |
+
<strong>»</strong> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
|
237 |
</p>
|
238 |
<p>
|
239 |
+
<strong>Features:</strong><br />
|
240 |
+
<strong>»</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.
|
241 |
</p>
|
242 |
<p>
|
243 |
+
<strong>Download:</strong><br />
|
244 |
+
<strong>»</strong> <a href="http://www.lesterchan.net/others/downloads.php?id=10" title="http://www.lesterchan.net/others/downloads.php?id=10">WP-Polls 2.20 For WordPress 2.1.x And Above</a><br />
|
245 |
+
<strong>»</strong> <a href="http://www.lesterchan.net/others/downloads/wp-polls213.zip" title="http://www.lesterchan.net/others/downloads/wp-polls213.zip">WP-Polls 2.13 For WordPress 2.0.x</a><br />
|
246 |
+
<strong>»</strong> <a href="http://www.lesterchan.net/others/downloads/wp-polls202a.zip" title="http://www.lesterchan.net/others/downloads/wp-polls202a.zip">WP-Polls 2.02a For WordPress 1.5.2</a>
|
247 |
</p>
|
248 |
<p>
|
249 |
+
<strong>Demo:</strong><br />
|
250 |
+
<strong>»</strong> <a href="http://www.lesterchan.net/wordpress/" title="http://www.lesterchan.net/wordpress/">http://www.lesterchan.net/wordpress/</a>
|
251 |
</p>
|
252 |
<p>
|
253 |
+
<strong>Development:</strong><br />
|
254 |
+
<strong>»</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>
|
255 |
</p>
|
256 |
<p>
|
257 |
+
<strong>Translations:</strong><br />
|
258 |
+
<strong>»</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>
|
259 |
</p>
|
260 |
<p>
|
261 |
+
<strong>Support Forums:</strong><br />
|
262 |
+
<strong>»</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>
|
263 |
</p>
|
264 |
<p>
|
265 |
+
<strong>Credits:</strong><br />
|
266 |
+
<strong>»</strong> Localization By <a href="http://4visions.nl/" title="http://4visions.nl/">Ravan</a><br />
|
267 |
+
<strong>»</strong> Uninstaller By Philippe Corbes
|
268 |
</p>
|
269 |
<p>
|
270 |
+
<strong>Updated:</strong><br />
|
271 |
+
<strong>»</strong> 1st June 2007
|
272 |
</p>
|
273 |
<p>
|
274 |
+
<strong>Note:</strong><br />
|
275 |
+
<strong>»</strong> The <strong>Changelog</strong>, <strong>Installation</strong>, <strong>Upgrade</strong>, <strong>Usage</strong> Tab at the top of the page.<br />
|
276 |
+
<strong>»</strong> I have once again change some of the core code to make it work with the future/expired poll. Please post in the support forums if you encounter any bugs.<br />
|
277 |
+
<strong>»</strong> WP-Polls has undergo major changes to support multiple answers and AJAX for the backend. Please post in the support forums if you encounter any bugs.
|
278 |
</p>
|
279 |
<p>
|
280 |
+
<strong>Donations:</strong><br />
|
281 |
+
<strong>»</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
|
282 |
<script type="text/javascript">
|
283 |
/* <![CDATA[*/
|
284 |
+
document.write(' <strong>gamerz84@hotmail.com</strong>.');
|
285 |
/* ]]> */
|
286 |
</script>
|
287 |
</p>
|
292 |
<div class="SubTitle">» Changelog</div>
|
293 |
<ul>
|
294 |
<li>
|
295 |
+
<strong>Version 2.20 (01-06-2007)</strong>
|
296 |
+
<ul>
|
297 |
+
<li>NEW: Poll Archive Link, Individual Poll Header And Footer In Poll Archive Template</li>
|
298 |
+
<li>NEW: Poll Templates Has Now Its Own Page 'WP-Admin -> Polls -> Poll Templates'</li>
|
299 |
+
<li>NEW: Poll Widget Can Now Display Multiple Polls</li>
|
300 |
+
<li>NEW: Ability To Allow User To Select More Than 1 Poll Answer</li>
|
301 |
+
<li>NEW: Added AJAX Style Option: "Show Loading Image With Text"</li>
|
302 |
+
<li>NEW: Added AJAX Style Option: "Show Fading In And Fading Out Of Polls"</li>
|
303 |
+
<li>NEW: Major Changes To The Administration Panel For WP-Polls</li>
|
304 |
+
<li>NEW: AJAX Added To The Administration Panel For WP-Polls</li>
|
305 |
+
<li>NEW: Default Poll's Result Template Will Now Show Number Of Votes Beside The Percentage</li>
|
306 |
+
<li>NEW: Term "Total Votes" Changed To "Total Voters". <a href="http://www.lesterchan.net/wordpress/2007/02/09/total-voters-and-total-votes/">Refer To Here</a></li>
|
307 |
+
<li>NEW: Removed Polls From Feed If The Poll Is Embedded Into The Post Using [poll=ID]</li>
|
308 |
+
<li>NEW: Filtering Of Individual Poll Logs</li>
|
309 |
+
<li>FIXED: Poll Archive Will Now Show Only Polls Results</li>
|
310 |
+
</ul>
|
311 |
+
</li>
|
312 |
+
<li>
|
313 |
+
<strong>Version 2.14 (01-02-2007)</strong>
|
314 |
<ul>
|
315 |
<li>NEW: Works For WordPress 2.1 Only</li>
|
316 |
<li>NEW: Renamed polls-js.js to polls-js.php To Enable PHP Parsing</li>
|
323 |
</ul>
|
324 |
</li>
|
325 |
<li>
|
326 |
+
<strong>Version 2.13 (02-01-2007)</strong>
|
327 |
<ul>
|
328 |
<li>NEW: polls.php Now Handles The AJAX Processing Instead Of index.php</li>
|
329 |
<li>NEW: Able To Modify The Style Of Poll Results Bar in 'Polls -> Poll Option'</li>
|
339 |
</ul>
|
340 |
</li>
|
341 |
<li>
|
342 |
+
<strong>Version 2.12 (01-10-2006)</strong>
|
343 |
<ul>
|
344 |
|
345 |
<li>NEW: Polls Archive Is Now Embedded Into A Page, And Hence No More Integrating Of Polls Archive</li>
|
351 |
</ul>
|
352 |
</li>
|
353 |
<li>
|
354 |
+
<strong>Version 2.11 (08-06-2006)</strong>
|
355 |
<ul>
|
356 |
<li>NEW: You Can Now Place The Poll On The Sidebar As A Widget</li>
|
357 |
<li>NEW: Moved wp-polls.php To wp-content/plugins/polls/ Folder</li>
|
360 |
</ul>
|
361 |
</li>
|
362 |
<li>
|
363 |
+
<strong>Version 2.1 (01-06-2006)</strong>
|
364 |
<ul>
|
365 |
<li>NEW: Poll Is Now Using AJAX</li>
|
366 |
<li>NEW: Ability To Close/Open Poll</li>
|
372 |
</ul>
|
373 |
</li>
|
374 |
<li>
|
375 |
+
<strong>Version 2.06b (26-04-2006)</strong>
|
376 |
<ul>
|
377 |
<li>FIXED: Bug In vote_poll();</li>
|
378 |
</ul>
|
379 |
</li>
|
380 |
<li>
|
381 |
+
<strong>Version 2.06a (02-04-2006)</strong>
|
382 |
<ul>
|
383 |
<li>FIXED: Random Poll Not Working Correctly</li>
|
384 |
</ul>
|
385 |
</li>
|
386 |
<li>
|
387 |
+
<strong>Version 2.06 (01-04-2006)</strong>
|
388 |
<ul>
|
389 |
<li>NEW: Poll Bar Is Slightly Nicer</li>
|
390 |
<li>NEW: Got Rid Of Tables, Now Using List</li>
|
394 |
</ul>
|
395 |
</li>
|
396 |
<li>
|
397 |
+
<strong>Version 2.05 (01-03-2006)</strong>
|
398 |
<ul>
|
399 |
<li>NEW: Improved On 'manage_polls' Capabilities</li>
|
400 |
<li>NEW: Neater Structure</li>
|
403 |
</ul>
|
404 |
</li>
|
405 |
<li>
|
406 |
+
<strong>Version 2.04 (01-02-2006)</strong>
|
407 |
<ul>
|
408 |
<li>NEW: Added 'manage_polls' Capabilities To Administrator Role</li>
|
409 |
<li>NEW: [poll=POLL_ID] Tag To Insert Poll Into A Post</li>
|
414 |
</ul>
|
415 |
</li>
|
416 |
<li>
|
417 |
+
<strong>Version 2.03 (01-01-2006)</strong>
|
418 |
<ul>
|
419 |
<li>NEW: Compatible With WordPress 2.0 Only</li>
|
420 |
<li>NEW: Poll Administration Menu Added Automatically Upon Activating The Plugin</li>
|
424 |
</ul>
|
425 |
</li>
|
426 |
<li>
|
427 |
+
<strong>Version 2.02a (17-11-2005)</strong>
|
428 |
<ul>
|
429 |
<li>FIXED: poll-install.php And poll-upgrade.php will Now Be Installed/Upgraded To 2.02 Instead Of 2.01</li>
|
430 |
</ul>
|
431 |
</li>
|
432 |
<li>
|
433 |
+
<strong>Version 2.02 (05-11-2005)</strong>
|
434 |
<ul>
|
435 |
<li>FIXED: Showing 0 Vote On Poll Edit Page</li>
|
436 |
<li>FIXED: Null Vote Being Counted As A Vote</li>
|
440 |
</ul>
|
441 |
</li>
|
442 |
<li>
|
443 |
+
<strong>Version 2.01 (25-10-2005)</strong>
|
444 |
<ul>
|
445 |
<li>FIXED: Upgrade Script To Insert Lastest Poll ID Of User's Current Polls, Instead Of Poll ID 1</li>
|
446 |
<li>FIXED: Replace All <?= With <?php</li>
|
449 |
</ul>
|
450 |
</li>
|
451 |
<li>
|
452 |
+
<strong>Version 2.0 (20-10-2005)</strong>
|
453 |
<ul>
|
454 |
<li>NEW: IP Logging</li>
|
455 |
<li>NEW: Poll Options: Sorting Of Answers In Voting Form</li>
|
470 |
<div class="SubTitle">» Installation Instructions</div>
|
471 |
<ol>
|
472 |
<li>
|
473 |
+
Open <strong>wp-content/plugins</strong> Folder
|
474 |
</li>
|
475 |
<li>
|
476 |
Put:
|
477 |
<blockquote>Folder: polls</blockquote>
|
478 |
</li>
|
479 |
<li>
|
480 |
+
<strong>Activate</strong> WP-Polls Plugin
|
481 |
</li>
|
482 |
<li>
|
483 |
+
Refer To <strong>Usage</strong> For Further Instructions
|
484 |
</li>
|
485 |
</ol>
|
486 |
</div>
|
488 |
<!-- Upgrade Instructions -->
|
489 |
<div id="Upgrade" style="display: none;">
|
490 |
<div class="SubTitle">» Upgrade Instructions</div>
|
491 |
+
<div class="SubSubTitle">From v2.xx To v2.20</div>
|
492 |
<ol>
|
493 |
<li>
|
494 |
+
<strong>Deactivate</strong> WP-Polls Plugin
|
495 |
</li>
|
496 |
<li>
|
497 |
+
Open <strong>wp-content/plugins</strong> Folder
|
498 |
</li>
|
499 |
<li>
|
500 |
Put/Overwrite:
|
513 |
</blockquote>
|
514 |
</li>
|
515 |
<li>
|
516 |
+
<strong>Activate</strong> WP-Polls Plugin
|
517 |
</li>
|
518 |
<li>
|
519 |
+
Go to '<strong>WP-Admin -> Polls -> Polls Options</strong>' and restore all the template variables to <strong>Default</strong>
|
520 |
</li>
|
521 |
<li>
|
522 |
+
Refer To <strong>Usage</strong> For Further Instructions
|
523 |
</li>
|
524 |
</ol>
|
525 |
</div>
|
530 |
<div class="SubSubTitle">General Usage (Without Widget)</div>
|
531 |
<ol>
|
532 |
<li>
|
533 |
+
Open <strong>wp-content/themes/<YOUR THEME NAME>/sidebar.php</strong>
|
534 |
</li>
|
535 |
<li>
|
536 |
Add:
|
537 |
<blockquote>
|
538 |
+
<?php if (function_exists('vote_poll') && !in_pollarchive()): ?><br />
|
539 |
<li><br />
|
540 |
<h2>Polls</h2><br />
|
541 |
<ul><br />
|
545 |
</li><br />
|
546 |
<?php endif; ?>
|
547 |
</blockquote>
|
548 |
+
<p>To show specific poll, use <?php get_poll(<strong>2</strong>);?> where <strong>2</strong> is your poll id.</p>
|
549 |
+
<p>To embed a specific poll in your post, use [poll=<strong>2</strong>] where <strong>2</strong> is your poll id.</p>
|
550 |
</li>
|
551 |
<li>
|
552 |
+
Scroll down for instructions on how to create a <strong>Polls Archive</strong>.
|
553 |
</li>
|
554 |
</ol>
|
555 |
<div class="SubSubTitle">General Usage (With Widget)</div>
|
556 |
<ol>
|
557 |
<li>
|
558 |
+
<strong>Activate</strong> WP-Polls Widget Plugin
|
559 |
</li>
|
560 |
<li>
|
561 |
+
Go to '<strong>WP-Admin -> Presentation -> Widgets</strong>'
|
562 |
</li>
|
563 |
<li>
|
564 |
+
<strong>Drag</strong> the Polls Widget to your sidebar
|
565 |
</li>
|
566 |
<li>
|
567 |
+
You can <strong>configure</strong> the Polls Widget by clicking on the configure icon
|
568 |
</li>
|
569 |
<li>
|
570 |
Click 'Save changes'
|
571 |
</li>
|
572 |
<li>
|
573 |
+
Scroll down for instructions on how to create a <strong>Polls Archive</strong>.
|
574 |
</li>
|
575 |
</ol>
|
576 |
<div class="SubSubTitle">Polls Archive</div>
|
577 |
<ol>
|
578 |
<li>
|
579 |
+
Go to '<strong>WP-Admin -> Write -> Write Page</strong>'
|
580 |
</li>
|
581 |
<li>
|
582 |
Type any title you like in the post's title area
|
583 |
</li>
|
584 |
<li>
|
585 |
+
Type '<strong>[page_polls]</strong>' in the post's content area (without the quotes)
|
586 |
</li>
|
587 |
<li>
|
588 |
+
Type '<strong>pollsarchive</strong>' in the post's slug area (without the quotes)
|
589 |
</li>
|
590 |
<li>
|
591 |
Click 'Publish'
|
592 |
</li>
|
593 |
<li>
|
594 |
+
If you <strong>ARE NOT</strong> using nice permalinks, you need to go to 'WP-Admin -> Polls -> Poll Option' and under '<strong>Poll Archive -> Polls Archive URL</strong>', you need to fill in the URL to the Polls Archive Page you created above.
|
595 |
</li>
|
596 |
</ol>
|
597 |
<div class="SubSubTitle">Note</div>
|
600 |
In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,
|
601 |
<ol>
|
602 |
<li>
|
603 |
+
Open <strong>poll-css.css</strong>
|
604 |
</li>
|
605 |
<li>
|
606 |
Find:
|
613 |
<blockquote>
|
614 |
background-color: #ffffff;
|
615 |
</blockquote>
|
616 |
+
<p>Where <strong>#ffffff</strong> should be your background color for the poll.</p>
|
617 |
</li>
|
618 |
</ol>
|
619 |
</li>
|
621 |
<div class="SubSubTitle">Polls Stats (Outside WP Loop)</div>
|
622 |
<ul>
|
623 |
<li>
|
624 |
+
To Display <strong>Total Polls</strong>
|
625 |
</li>
|
626 |
<li>
|
627 |
Use:
|
632 |
</blockquote>
|
633 |
</li>
|
634 |
<li>
|
635 |
+
To Display <strong>Total Poll Answers</strong>
|
636 |
</li>
|
637 |
<li>
|
638 |
Use:
|
643 |
</blockquote>
|
644 |
</li>
|
645 |
<li>
|
646 |
+
To Display <strong>Total Poll Votes</strong>
|
647 |
</li>
|
648 |
<li>
|
649 |
Use:
|
653 |
<?php endif; ?>
|
654 |
</blockquote>
|
655 |
</li>
|
656 |
+
<li>
|
657 |
+
To Display <strong>Total Poll Voters</strong>
|
658 |
+
</li>
|
659 |
+
<li>
|
660 |
+
Use:
|
661 |
+
<blockquote>
|
662 |
+
<?php if (function_exists('get_pollvoters')): ?><br />
|
663 |
+
<?php get_pollvoters(); ?><br />
|
664 |
+
<?php endif; ?>
|
665 |
+
</blockquote>
|
666 |
+
</li>
|
667 |
</ul>
|
668 |
</div>
|
669 |
</div>
|
670 |
</div>
|
671 |
+
<p id="Copyright">WP-Polls 2.20<br />Copyright © 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
672 |
</body>
|
673 |
</html>
|
readme.txt
CHANGED
@@ -3,11 +3,12 @@ Contributors: GamerZ
|
|
3 |
Donate link: http://www.lesterchan.net/wordpress
|
4 |
Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
|
5 |
Requires at least: 2.1.0
|
6 |
-
Stable tag: 2.
|
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 |
|
12 |
All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-Polls Readme](http://www.lesterchan.net/wordpress/readme/wp-polls.html "WP-Polls Readme").
|
13 |
It is the exact same readme.html is included in the zip package.
|
3 |
Donate link: http://www.lesterchan.net/wordpress
|
4 |
Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
|
5 |
Requires at least: 2.1.0
|
6 |
+
Stable tag: 2.20
|
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://www.lesterchan.net/wordpress/readme/wp-polls.html "WP-Polls Readme").
|
14 |
It is the exact same readme.html is included in the zip package.
|