forked from lesterchan/wp-polls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
polls-templates.php
502 lines (495 loc) · 27.6 KB
/
polls-templates.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<?php
### Check Whether User Can Manage Polls
if(!current_user_can('manage_polls')) {
die('Access Denied');
}
# Allow HTML
$allowed_tags = wp_kses_allowed_html( 'post' );
$allowed_tags['input'] = array(
'type' => true,
'id' => true,
'name' => true,
'value' => true,
'class' => true,
'onclick' => true,
);
$allowed_tags['a']['onclick'] = true;
### Variables Variables Variables
$base_name = plugin_basename('wp-polls/polls-templates.php');
$base_page = 'admin.php?page='.$base_name;
$id = ( isset($_GET['id'] ) ? (int) sanitize_key( $_GET['id'] ) : 0 );
### If Form Is Submitted
if( isset($_POST['Submit']) && $_POST['Submit'] ) {
check_admin_referer('wp-polls_templates');
$poll_template_voteheader = wp_kses_post( trim( $_POST['poll_template_voteheader'] ) );
$poll_template_votebody = wp_kses( $_POST['poll_template_votebody'], $allowed_tags );
$poll_template_votefooter = wp_kses( $_POST['poll_template_votefooter'], $allowed_tags );
$poll_template_resultheader = wp_kses_post( trim($_POST['poll_template_resultheader'] ) );
$poll_template_resultbody = wp_kses_post( trim($_POST['poll_template_resultbody'] ) );
$poll_template_resultbody2 = wp_kses_post( trim($_POST['poll_template_resultbody2'] ) );
$poll_template_resultfooter = wp_kses( trim($_POST['poll_template_resultfooter'] ), $allowed_tags );
$poll_template_resultfooter2 = wp_kses( trim($_POST['poll_template_resultfooter2'] ), $allowed_tags );
$poll_template_pollarchivelink = wp_kses_post( trim($_POST['poll_template_pollarchivelink'] ) );
$poll_template_pollarchiveheader = wp_kses_post( trim($_POST['poll_template_pollarchiveheader'] ) );
$poll_template_pollarchivefooter = wp_kses_post( trim($_POST['poll_template_pollarchivefooter'] ) );
$poll_template_pollarchivepagingheader = wp_kses_post( trim($_POST['poll_template_pollarchivepagingheader'] ) );
$poll_template_pollarchivepagingfooter = wp_kses_post( trim($_POST['poll_template_pollarchivepagingfooter'] ) );
$poll_template_disable = wp_kses_post( trim($_POST['poll_template_disable'] ) );
$poll_template_error = wp_kses_post( trim($_POST['poll_template_error'] ) );
$update_poll_queries = array();
$update_poll_text = array();
$update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
$update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
$update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
$update_poll_queries[] = update_option('poll_template_resultheader', $poll_template_resultheader);
$update_poll_queries[] = update_option('poll_template_resultbody', $poll_template_resultbody);
$update_poll_queries[] = update_option('poll_template_resultbody2', $poll_template_resultbody2);
$update_poll_queries[] = update_option('poll_template_resultfooter', $poll_template_resultfooter);
$update_poll_queries[] = update_option('poll_template_resultfooter2', $poll_template_resultfooter2);
$update_poll_queries[] = update_option('poll_template_pollarchivelink', $poll_template_pollarchivelink);
$update_poll_queries[] = update_option('poll_template_pollarchiveheader', $poll_template_pollarchiveheader);
$update_poll_queries[] = update_option('poll_template_pollarchivefooter', $poll_template_pollarchivefooter);
$update_poll_queries[] = update_option('poll_template_pollarchivepagingheader', $poll_template_pollarchivepagingheader);
$update_poll_queries[] = update_option('poll_template_pollarchivepagingfooter', $poll_template_pollarchivepagingfooter);
$update_poll_queries[] = update_option('poll_template_disable', $poll_template_disable);
$update_poll_queries[] = update_option('poll_template_error', $poll_template_error);
$update_poll_text[] = __('Voting Form Header Template', 'wp-polls');
$update_poll_text[] = __('Voting Form Body Template', 'wp-polls');
$update_poll_text[] = __('Voting Form Footer Template', 'wp-polls');
$update_poll_text[] = __('Result Header Template', 'wp-polls');
$update_poll_text[] = __('Result Body Template', 'wp-polls');
$update_poll_text[] = __('Result Body2 Template', 'wp-polls');
$update_poll_text[] = __('Result Footer Template', 'wp-polls');
$update_poll_text[] = __('Result Footer2 Template', 'wp-polls');
$update_poll_text[] = __('Poll Archive Link Template', 'wp-polls');
$update_poll_text[] = __('Poll Archive Poll Header Template', 'wp-polls');
$update_poll_text[] = __('Poll Archive Poll Footer Template', 'wp-polls');
$update_poll_text[] = __('Poll Archive Paging Header Template', 'wp-polls');
$update_poll_text[] = __('Poll Archive Paging Footer Template', 'wp-polls');
$update_poll_text[] = __('Poll Disabled Template', 'wp-polls');
$update_poll_text[] = __('Poll Error Template', 'wp-polls');
$i=0;
$text = '';
foreach($update_poll_queries as $update_poll_query) {
if($update_poll_query) {
$text .= '<p style="color: green;">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</p>';
}
$i++;
}
if(empty($text)) {
$text = '<p style="color: red;">'.__('No Poll Option Updated', 'wp-polls').'</p>';
}
wp_clear_scheduled_hook('polls_cron');
if (!wp_next_scheduled('polls_cron')) {
wp_schedule_event(time(), 'daily', 'polls_cron');
}
}
?>
<script type="text/javascript">
/* <![CDATA[*/
function poll_default_templates(template) {
var default_template;
switch(template) {
case "voteheader":
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\">";
break;
case "votebody":
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>";
break;
case "votefooter":
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>";
break;
case "resultheader":
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\">";
break;
case "resultbody":
default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'wp-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
break;
case "resultbody2":
default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'wp-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'wp-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'wp-polls'); ?>)\"></div></li>";
break;
case "resultfooter":
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n</div>";
break;
case "resultfooter2":
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>";
break;
case "pollarchivelink":
default_template = "<ul>\n<li><a href=\"%POLL_ARCHIVE_URL%\"><?php _e('Polls Archive', 'wp-polls'); ?></a></li>\n</ul>";
break;
case "pollarchiveheader":
default_template = "";
break;
case "pollarchivefooter":
default_template = "<p><?php _e('Start Date:', 'wp-polls'); ?> %POLL_START_DATE%<br /><?php _e('End Date:', 'wp-polls'); ?> %POLL_END_DATE%</p>";
break;
case "pollarchivepagingheader":
default_template = "";
break;
case "pollarchivepagingfooter":
default_template = "";
break;
case "disable":
default_template = "<?php _e('Sorry, there are no polls available at the moment.', 'wp-polls'); ?>";
break;
case "error":
default_template = "<?php _e('An error has occurred when processing your poll.', 'wp-polls'); ?>";
break;
}
jQuery("#poll_template_" + template).val(default_template);
}
/* ]]> */
</script>
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
<form id="poll_template_form" method="post" action="<?php echo admin_url('admin.php?page='.plugin_basename(__FILE__)); ?>">
<?php wp_nonce_field('wp-polls_templates'); ?>
<div class="wrap">
<h2><?php _e('Poll Templates', 'wp-polls'); ?></h2>
<!-- Template Variables -->
<h3><?php _e('Template Variables', 'wp-polls'); ?></h3>
<table class="widefat">
<tr>
<td>
<strong>%POLL_ID%</strong><br />
<?php _e('Display the poll\'s ID', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_ID%</strong><br />
<?php _e('Display the poll\'s answer ID', 'wp-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_QUESTION%</strong><br />
<?php _e('Display the poll\'s question', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER%</strong><br />
<?php _e('Display the poll\'s answer', 'wp-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_TOTALVOTES%</strong><br />
<?php _e('Display the poll\'s total votes NOT the number of people who voted for the poll', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_TEXT%</strong><br />
<?php _e('Display the poll\'s answer without HTML formatting.', 'wp-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_RESULT_URL%</strong><br />
<?php _e('Displays URL to poll\'s result', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_VOTES%</strong><br />
<?php _e('Display the poll\'s answer votes', 'wp-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_MOST_ANSWER%</strong><br />
<?php _e('Display the poll\'s most voted answer', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s answer percentage', 'wp-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_MOST_VOTES%</strong><br />
<?php _e('Display the poll\'s answer votes for the most voted answer', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
<?php _e('Display the poll\'s answer image width', 'wp-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_MOST_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s answer percentage for the most voted answer', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_LEAST_ANSWER%</strong><br />
<?php _e('Display the poll\'s least voted answer', 'wp-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_START_DATE%</strong><br />
<?php _e('Display the poll\'s start date/time', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_LEAST_VOTES%</strong><br />
<?php _e('Display the poll\'s answer votes for the least voted answer', 'wp-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_END_DATE%</strong><br />
<?php _e('Display the poll\'s end date/time', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_LEAST_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s answer percentage for the least voted answer', 'wp-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_MULTIPLE_ANS_MAX%</strong><br />
<?php _e('Display the the maximum number of answers the user can choose if the poll supports multiple answers', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_CHECKBOX_RADIO%</strong><br />
<?php _e('Display "checkbox" or "radio" input types depending on the poll type', 'wp-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_TOTALVOTERS%</strong><br />
<?php _e('Display the number of people who voted for the poll NOT the total votes of the poll', 'wp-polls'); ?>
</td>
<td>
<strong>%POLL_ARCHIVE_URL%</strong><br />
<?php _e('Display the poll archive URL', 'wp-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_MULTIPLE_ANSWER_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s mutiple answer percentage. This is total votes divided by total voters.', 'wp-polls'); ?>
</td>
<td>
</td>
</tr>
<tr class="alternate">
<td colspan="2">
<?php _e('Note: <strong>%POLL_TOTALVOTES%</strong> and <strong>%POLL_TOTALVOTERS%</strong> will be different if your poll supports multiple answers. If your poll allows only single answer, both value will be the same.', 'wp-polls'); ?>
</td>
</tr>
</table>
<!-- Poll Voting Form Templates -->
<h3><?php _e('Poll Voting Form Templates', 'wp-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Header:', 'wp-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_QUESTION%</p>
<p style="margin: 2px 0">- %POLL_START_DATE%</p>
<p style="margin: 2px 0">- %POLL_END_DATE%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('voteheader');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_voteheader' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Body:', 'wp-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
<p style="margin: 2px 0">- %POLL_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
<p style="margin: 2px 0">- %POLL_CHECKBOX_RADIO%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('votebody');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_votebody" name="poll_template_votebody"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_votebody' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Footer:', 'wp-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_RESULT_URL%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('votefooter');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_votefooter' ) ) ); ?></textarea></td>
</tr>
</table>
<!-- Poll Result Templates -->
<h3><?php _e('Poll Result Templates', 'wp-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Header:', 'wp-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_QUESTION%</p>
<p style="margin: 2px 0">- %POLL_START_DATE%</p>
<p style="margin: 2px 0">- %POLL_END_DATE%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultheader');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_resultheader' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
<p style="margin: 2px 0">- %POLL_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_TEXT%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANSWER_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_resultbody' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_ID%</p>
<p style="margin: 2px 0">- %POLL_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_TEXT%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_VOTES%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANSWER_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultbody2');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_resultbody2' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_START_DATE%</p>
<p style="margin: 2px 0">- %POLL_END_DATE%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
<p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
<p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
<p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_resultfooter' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ID%</p>
<p style="margin: 2px 0">- %POLL_START_DATE%</p>
<p style="margin: 2px 0">- %POLL_END_DATE%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
<p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
<p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
<p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('resultfooter2');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_resultfooter2' ) ) ); ?></textarea></td>
</tr>
</table>
<!-- Poll Archive Templates -->
<h3><?php _e('Poll Archive Templates', 'wp-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Poll Archive Link', 'wp-polls'); ?></strong><br /><?php _e('Template For Displaying Poll Archive Link', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ARCHIVE_URL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivelink');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivelink" name="poll_template_pollarchivelink"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_pollarchivelink' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Individual Poll Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchiveheader');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchiveheader" name="poll_template_pollarchiveheader"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_pollarchiveheader' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Individual Poll Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Each Poll In The Poll Archive', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_START_DATE%</p>
<p style="margin: 2px 0">- %POLL_END_DATE%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTES%</p>
<p style="margin: 2px 0">- %POLL_TOTALVOTERS%</p>
<p style="margin: 2px 0">- %POLL_MOST_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_MOST_VOTES%</p>
<p style="margin: 2px 0">- %POLL_MOST_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_LEAST_ANSWER%</p>
<p style="margin: 2px 0">- %POLL_LEAST_VOTES%</p>
<p style="margin: 2px 0">- %POLL_LEAST_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_MULTIPLE_ANS_MAX%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivefooter');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivefooter" name="poll_template_pollarchivefooter"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_pollarchivefooter' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Paging Header', 'wp-polls'); ?></strong><br /><?php _e('Displayed Before Paging In The Poll Archive', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivepagingheader');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivepagingheader" name="poll_template_pollarchivepagingheader"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_pollarchivepagingheader' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Paging Footer', 'wp-polls'); ?></strong><br /><?php _e('Displayed After Paging In The Poll Archive', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('pollarchivepagingfooter');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_pollarchivepagingfooter" name="poll_template_pollarchivepagingfooter"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_pollarchivepagingfooter' ) ) ); ?></textarea></td>
</tr>
</table>
<!-- Poll Misc Templates -->
<h3><?php _e('Poll Misc Templates', 'wp-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><?php _e('Displayed When The Poll Is Disabled', 'wp-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('disable');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_disable" name="poll_template_disable"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_disable' ) ) ); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<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 />
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'wp-polls'); ?><br /><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="poll_default_templates('error');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_error" name="poll_template_error"><?php echo esc_textarea( removeslashes( get_option( 'poll_template_error' ) ) ); ?></textarea></td>
</tr>
</table>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'wp-polls'); ?>" />
</p>
</div>
</form>