forked from lesterchan/wp-polls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolls-templates.php
669 lines (660 loc) · 37.8 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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
<?php
/*
+----------------------------------------------------------------+
| |
| WordPress Plugin: WP-Polls |
| Copyright (c) 2012 Lester "GaMerZ" Chan |
| |
| File Written By: |
| - Lester "GaMerZ" Chan |
| - http://lesterchan.net |
| |
| File Information: |
| - Configure Poll Templates |
| - wp-content/plugins/fair-polls/polls-templates.php |
| |
+----------------------------------------------------------------+
*/
### Check Whether User Can Manage Polls
if(!current_user_can('manage_polls')) {
die('Access Denied');
}
### Variables Variables Variables
$base_name = plugin_basename('fair-polls/polls-templates.php');
$base_page = 'admin.php?page='.$base_name;
$id = (isset($_GET['id']) ? intval($_GET['id']) : 0);
### If Form Is Submitted
if( isset($_POST['Submit']) && $_POST['Submit'] ) {
check_admin_referer('fair-polls_templates');
$poll_template_voteheader = trim($_POST['poll_template_voteheader']);
$poll_template_votebody = trim($_POST['poll_template_votebody']);
$poll_template_votebody2 = trim($_POST['poll_template_votebody2']); // bumbum
$poll_template_votefooter = trim($_POST['poll_template_votefooter']);
$poll_template_votefooter2 = trim($_POST['poll_template_votefooter2']); // bumbum
$poll_template_resultheader = trim($_POST['poll_template_resultheader']);
$poll_template_resultbody = trim($_POST['poll_template_resultbody']);
$poll_template_resultbody2 = trim($_POST['poll_template_resultbody2']);
$poll_template_resultfooter = trim($_POST['poll_template_resultfooter']);
$poll_template_resultfooter2 = trim($_POST['poll_template_resultfooter2']);
$poll_template_resultfooter3 = trim($_POST['poll_template_resultfooter3']); // bumbum
$poll_template_pollarchivelink = trim($_POST['poll_template_pollarchivelink']);
$poll_template_pollarchiveheader = trim($_POST['poll_template_pollarchiveheader']);
$poll_template_pollarchivefooter = trim($_POST['poll_template_pollarchivefooter']);
$poll_template_pollarchivepagingheader = trim($_POST['poll_template_pollarchivepagingheader']);
$poll_template_pollarchivepagingfooter = trim($_POST['poll_template_pollarchivepagingfooter']);
$poll_template_disable = trim($_POST['poll_template_disable']);
$poll_template_error = trim($_POST['poll_template_error']);
$poll_template_clickanswer = trim($_POST['poll_template_clickanswer']); // bumbum
$poll_template_clickreqanswer = trim($_POST['poll_template_clickreqanswer']); // bumbum
$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_votebody2', $poll_template_votebody2); // bumbum
$update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
$update_poll_queries[] = update_option('poll_template_votefooter2', $poll_template_votefooter2); // bumbum
$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_resultfooter3', $poll_template_resultfooter3); // bumbum
$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_queries[] = update_option('poll_template_clickanswer', $poll_template_clickanswer); // bumbum
$update_poll_queries[] = update_option('poll_template_clickreqanswer', $poll_template_clickreqanswer); // bumbum
$update_poll_text[] = __('Voting Form Header Template', 'fair-polls');
$update_poll_text[] = __('Voting Form Body Template', 'fair-polls');
$update_poll_text[] = __('Voting Form Body2 Template', 'fair-polls'); // bumbum
$update_poll_text[] = __('Voting Form Footer Template', 'fair-polls');
$update_poll_text[] = __('Voting Form Footer2 Template', 'fair-polls'); // bumbum
$update_poll_text[] = __('Result Header Template', 'fair-polls');
$update_poll_text[] = __('Result Body Template', 'fair-polls');
$update_poll_text[] = __('Result Body2 Template', 'fair-polls');
$update_poll_text[] = __('Result Footer Template', 'fair-polls');
$update_poll_text[] = __('Result Footer2 Template', 'fair-polls');
$update_poll_text[] = __('Result Footer3 Template', 'fair-polls'); // bumbum
$update_poll_text[] = __('Poll Archive Link Template', 'fair-polls');
$update_poll_text[] = __('Poll Archive Poll Header Template', 'fair-polls');
$update_poll_text[] = __('Poll Archive Poll Footer Template', 'fair-polls');
$update_poll_text[] = __('Poll Archive Paging Header Template', 'fair-polls');
$update_poll_text[] = __('Poll Archive Paging Footer Template', 'fair-polls');
$update_poll_text[] = __('Poll Disabled Template', 'fair-polls');
$update_poll_text[] = __('Poll Error Template', 'fair-polls');
$update_poll_text[] = __('Click Answer Footer Template', 'fair-polls'); // bumbum
$update_poll_text[] = __('Click Req.Arg Answer Footer Template', 'fair-polls'); // bumbum
$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', 'fair-polls').'</p>';
}
$i++;
}
if(empty($text)) {
$text = '<p style="color: red;">'.__('No Poll Option Updated', 'fair-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=\"fair-polls-ans\">\n<ul class=\"fair-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%\" onclick=\"check_vote_msg(this);\" reqarg=\"%POLL_ANSWER_REQARG%\" /> <label for=\"poll-answer-%POLL_ANSWER_ID%\">%POLL_ANSWER%</label></li>";
break;
case "votebody2": // bumbum
default_template = "<li><input type=\"%POLL_CHECKBOX_RADIO%\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" checked=\"checked\" onclick=\"check_vote_msg(this, 1);\" reqarg=\"%POLL_ANSWER_REQARG%\" /> <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', 'fair-polls'); ?> \" class=\"button submit\" 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', 'fair-polls'); ?>\"><?php _e('View Results', 'fair-polls'); ?></a></p>\n</div>";
break;
case "votefooter2": // bumbum
default_template = "</ul>\n<p style=\"text-align: center;\"><input type=\"button\" name=\"vote\" value=\" <?php _e('Change Vote', 'fair-polls'); ?> \" class=\"button submit\" onclick=\"poll_vote(%POLL_ID%, 1);\" /></p>\n<p style=\"text-align: center;\"><a href=\"#ViewPollResults\" onclick=\"poll_result(%POLL_ID%, 1); return false;\" title=\"<?php _e('View Results Of This Poll', 'fair-polls'); ?>\"><?php _e('View Results', 'fair-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=\"fair-polls-ans\">\n<ul class=\"fair-polls-ul\">";
break;
case "resultbody":
default_template = "<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'fair-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'fair-polls'); ?>)</small><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'fair-polls'); ?>)\"></div></li>";
break;
case "resultbody2":
default_template = "<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%<?php _e(',', 'fair-polls'); ?> %POLL_ANSWER_VOTES% <?php _e('Votes', 'fair-polls'); ?>)</small></i></strong><div class=\"pollbar\" style=\"width: %POLL_ANSWER_IMAGEWIDTH%%;\" title=\"<?php _e('You Have Voted For This Choice', 'fair-polls'); ?> - %POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% <?php _e('Votes', 'fair-polls'); ?>)\"></div></li>";
break;
case "resultfooter":
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'fair-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n</div>";
break;
case "resultfooter2":
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'fair-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', 'fair-polls'); ?>\"><?php _e('Vote', 'fair-polls'); ?></a></p>\n</div>";
break;
case "resultfooter3": // bumbum
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Voters', 'fair-polls'); ?>: <strong>%POLL_TOTALVOTERS%</strong></p>\n<p style=\"text-align: center;\"><a href=\"#VotePoll\" onclick=\"poll_booth(%POLL_ID%, 1); return false;\" title=\"<?php _e('Change Vote For This Poll', 'fair-polls'); ?>\"><?php _e('Change Vote', 'fair-polls'); ?></a></p>\n</div>";
break; //
case "pollarchivelink":
default_template = "<ul>\n<li><a href=\"%POLL_ARCHIVE_URL%\"><?php _e('Polls Archive', 'fair-polls'); ?></a></li>\n</ul>";
break;
case "pollarchiveheader":
default_template = "";
break;
case "pollarchivefooter":
default_template = "<p><?php _e('Start Date:', 'fair-polls'); ?> %POLL_START_DATE%<br /><?php _e('End Date:', 'fair-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.', 'fair-polls'); ?>";
break;
case "error":
default_template = "<?php _e('An error has occurred when processing your poll.', 'fair-polls'); ?>";
break;
case "clickanswer":
default_template = "<?php _e('You can share your voting arguments in this <a href="%POST_LINK%" target="_blank">related thread</a>, where the debate is taking place.', 'fair-polls'); ?>";
break;
case "clickreqanswer":
default_template = "<?php _e('For this vote to be valid, please share your arguments clearly in <a href="%POST_LINK%" target="_blank">this related thread</a> within the next 24 hours or before the voting deadline.', 'fair-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('fair-polls_templates'); ?>
<div class="wrap">
<h2><?php _e('Poll Templates', 'fair-polls'); ?></h2>
<!-- Template Variables -->
<h3><?php _e('Template Variables', 'fair-polls'); ?></h3>
<table class="widefat">
<tr>
<td>
<strong>%POLL_ID%</strong><br />
<?php _e('Display the poll\'s ID', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_ID%</strong><br />
<?php _e('Display the poll\'s answer ID', 'fair-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_QUESTION%</strong><br />
<?php _e('Display the poll\'s question', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER%</strong><br />
<?php _e('Display the poll\'s answer', 'fair-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', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_TEXT%</strong><br />
<?php _e('Display the poll\'s answer without HTML formatting.', 'fair-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_RESULT_URL%</strong><br />
<?php _e('Displays URL to poll\'s result', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_VOTES%</strong><br />
<?php _e('Display the poll\'s answer votes', 'fair-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_MOST_ANSWER%</strong><br />
<?php _e('Display the poll\'s most voted answer', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s answer percentage', 'fair-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', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
<?php _e('Display the poll\'s answer image width', 'fair-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_MOST_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s answer percentage for the most voted answer', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_LEAST_ANSWER%</strong><br />
<?php _e('Display the poll\'s least voted answer', 'fair-polls'); ?>
</td>
</tr>
<tr class="alternate">
<td>
<strong>%POLL_START_DATE%</strong><br />
<?php _e('Display the poll\'s start date/time', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_LEAST_VOTES%</strong><br />
<?php _e('Display the poll\'s answer votes for the least voted answer', 'fair-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POLL_END_DATE%</strong><br />
<?php _e('Display the poll\'s end date/time', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_LEAST_PERCENTAGE%</strong><br />
<?php _e('Display the poll\'s answer percentage for the least voted answer', 'fair-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', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_CHECKBOX_RADIO%</strong><br />
<?php _e('Display "checkbox" or "radio" input types depending on the poll type', 'fair-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', 'fair-polls'); ?>
</td>
<td>
<strong>%POLL_ARCHIVE_URL%</strong><br />
<?php _e('Display the poll archive URL', 'fair-polls'); ?>
</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.', 'fair-polls'); ?>
</td>
</tr>
<!-- // bumbum -->
<tr>
<td>
<strong>%USER_ROLE%</strong><br />
<?php _e('Display the User role', 'fair-polls'); ?>
</td>
<td>
<strong>%POST_ID%</strong><br />
<?php _e('Display the related Post ID', 'fair-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POST_NAME%</strong><br />
<?php _e('Display the related Post Name', 'fair-polls'); ?>
</td>
<td>
<strong>%POST_LINK%</strong><br />
<?php _e('Display the related Post Link', 'fair-polls'); ?>
</td>
</tr>
<tr>
<td>
<strong>%POST_LABEL%</strong><br />
<?php _e('Display a \'related thread\' label', 'fair-polls'); ?>
</td>
<td>
</td>
</tr>
<!-- // bumbum -->
</table>
<!-- Poll Voting Form Templates -->
<h3><?php _e('Poll Voting Form Templates', 'fair-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Header:', 'fair-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_voteheader'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Body:', 'fair-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %POLL_ANSWER_REQARG%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_votebody'))); ?></textarea></td>
</tr>
<!-- bumbum -->
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Body2 (change):', 'fair-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %POLL_ANSWER_REQARG%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-polls'); ?>" onclick="poll_default_templates('votebody2');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_votebody2" name="poll_template_votebody2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votebody2'))); ?></textarea></td>
</tr>
<!-- bumbum -->
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Footer:', 'fair-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_votefooter'))); ?></textarea></td>
</tr>
<!-- bumbum -->
<tr>
<td width="30%" valign="top">
<strong><?php _e('Voting Form Footer2:', 'fair-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-polls'); ?>" onclick="poll_default_templates('votefooter2');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_votefooter2" name="poll_template_votefooter2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votefooter2'))); ?></textarea></td>
</tr>
</table>
<!-- Poll Result Templates -->
<h3><?php _e('Poll Result Templates', 'fair-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Header:', 'fair-polls'); ?></strong><br /><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_resultheader'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Body:', 'fair-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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_ANSWER_IMAGEWIDTH%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_REQARG%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_resultbody'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Body:', 'fair-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
- %POLL_ANSWER_PERCENTAGE%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_IMAGEWIDTH%</p>
<p style="margin: 2px 0">- %POLL_ANSWER_REQARG%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_resultbody2'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Footer:', 'fair-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_resultfooter'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Footer:', 'fair-polls'); ?></strong><br /><?php _e('Displayed When The User HAS NOT Voted', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_resultfooter2'))); ?></textarea></td>
</tr>
<!-- bumbum -->
<tr>
<td width="30%" valign="top">
<strong><?php _e('Result Footer:', 'fair-polls'); ?></strong><br /><?php _e('Displayed When The User HAS Voted, to Change her/his Vote', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); // bumbum adds ?><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>
<p style="margin: 2px 0">- %USER_ROLE%</p>
<p style="margin: 2px 0">- %POST_ID%</p>
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<p style="margin: 2px 0">- %POST_LABEL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-polls'); ?>" onclick="poll_default_templates('resultfooter3');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_resultfooter3" name="poll_template_resultfooter3"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter3'))); ?></textarea></td>
</tr>
<!-- bumbum -->
</table>
<!-- Poll Archive Templates -->
<h3><?php _e('Poll Archive Templates', 'fair-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Poll Archive Link', 'fair-polls'); ?></strong><br /><?php _e('Template For Displaying Poll Archive Link', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- %POLL_ARCHIVE_URL%</p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_pollarchivelink'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Individual Poll Header', 'fair-polls'); ?></strong><br /><?php _e('Displayed Before Each Poll In The Poll Archive', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'fair-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_pollarchiveheader'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Individual Poll Footer', 'fair-polls'); ?></strong><br /><?php _e('Displayed After Each Poll In The Poll Archive', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-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', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_pollarchivefooter'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Paging Header', 'fair-polls'); ?></strong><br /><?php _e('Displayed Before Paging In The Poll Archive', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'fair-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_pollarchivepagingheader'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Paging Footer', 'fair-polls'); ?></strong><br /><?php _e('Displayed After Paging In The Poll Archive', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'fair-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_pollarchivepagingfooter'))); ?></textarea></td>
</tr>
</table>
<!-- Poll Misc Templates -->
<h3><?php _e('Poll Misc Templates', 'fair-polls'); ?></h3>
<table class="form-table">
<tr>
<td width="30%" valign="top">
<strong><?php _e('Poll Disabled', 'fair-polls'); ?></strong><br /><?php _e('Displayed When The Poll Is Disabled', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'fair-polls'); ?></p><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_disable'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Poll Error', 'fair-polls'); ?></strong><br /><?php _e('Displayed When An Error Has Occured While Processing The Poll', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- <?php _e('N/A', 'fair-polls'); ?><br /><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-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 htmlspecialchars(stripslashes(get_option('poll_template_error'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Click Answer Message', 'fair-polls'); ?></strong><br /><?php _e('Displayed When User Clicks An Answer', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<br /><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-polls'); ?>" onclick="poll_default_templates('clickanswer');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_clickanswer" name="poll_template_clickanswer"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_clickanswer'))); ?></textarea></td>
</tr>
<tr>
<td width="30%" valign="top">
<strong><?php _e('Click Req.Arg. Answer Message', 'fair-polls'); ?></strong><br /><?php _e('Displayed When User Clicks An Answer Requiring Arguments', 'fair-polls'); ?><br /><br />
<?php _e('Allowed Variables:', 'fair-polls'); ?><br />
<p style="margin: 2px 0">- %POST_NAME%</p>
<p style="margin: 2px 0">- %POST_LINK%</p>
<br /><br />
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'fair-polls'); ?>" onclick="poll_default_templates('clickreqanswer');" class="button" />
</td>
<td valign="top"><textarea cols="80" rows="15" id="poll_template_clickreqanswer" name="poll_template_clickreqanswer"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_clickreqanswer'))); ?></textarea></td>
</tr>
</table>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'fair-polls'); ?>" />
</p>
</div>
</form>