Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-Polls |
Version | 2.13 |
Comparing to | |
See all releases |
Version 2.13
- polls/images/default/pollbg.gif +0 -0
- polls/images/default_gradient/pollbg.gif +0 -0
- polls/images/loading.gif +0 -0
- polls/polls-css.css +67 -0
- polls/polls-js.js +196 -0
- polls/polls-manager.php +782 -0
- polls/polls-options.php +609 -0
- polls/polls-usage.php +163 -0
- polls/polls-widget.php +129 -0
- polls/polls.php +1032 -0
- polls/wp-polls.pot +1187 -0
- readme.html +618 -0
polls/images/default/pollbg.gif
ADDED
Binary file
|
polls/images/default_gradient/pollbg.gif
ADDED
Binary file
|
polls/images/loading.gif
ADDED
Binary file
|
polls/polls-css.css
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
+----------------------------------------------------------------+
|
3 |
+
| |
|
4 |
+
| WordPress 2.0 Plugin: WP-Polls 2.13 |
|
5 |
+
| Copyright (c) 2006 Lester "GaMerZ" Chan |
|
6 |
+
| |
|
7 |
+
| File Written By: |
|
8 |
+
| - Lester "GaMerZ" Chan |
|
9 |
+
| - http://www.lesterchan.net |
|
10 |
+
| |
|
11 |
+
| File Information: |
|
12 |
+
| - Polls CSS File |
|
13 |
+
| - wp-content/plugins/polls/polls-css.css |
|
14 |
+
| |
|
15 |
+
+----------------------------------------------------------------+
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
.wp-polls ul li, wp-polls-ul li, .wp-polls-ans ul li {
|
20 |
+
text-align: left;
|
21 |
+
list-style: none;
|
22 |
+
}
|
23 |
+
.wp-polls ul li:before, wp-polls-ul li, .wp-polls-ans ul li:before, #sidebar ul ul li:before {
|
24 |
+
content: '';
|
25 |
+
}
|
26 |
+
.wp-polls IMG, .wp-polls LABEL , .wp-polls INPUT, .wp-polls-loading IMG, .wp-polls-image IMG {
|
27 |
+
border: 0px;
|
28 |
+
padding: 0px;
|
29 |
+
margin: 0px;
|
30 |
+
}
|
31 |
+
.wp-polls-ans {
|
32 |
+
width:100%;
|
33 |
+
filter: alpha(opacity=100);
|
34 |
+
-moz-opacity: 1;
|
35 |
+
opacity: 1;
|
36 |
+
/* background-color: #ffffff; */
|
37 |
+
}
|
38 |
+
.wp-polls-loading {
|
39 |
+
display: none;
|
40 |
+
text-align: center;
|
41 |
+
height: 16px;
|
42 |
+
}
|
43 |
+
.wp-polls-image {
|
44 |
+
border: 0px;
|
45 |
+
}
|
46 |
+
.wp-polls .Buttons {
|
47 |
+
border:1px solid #c8c8c8;
|
48 |
+
background-color: #f3f6f8;
|
49 |
+
}
|
50 |
+
/* Styles Used In WP-Admin */
|
51 |
+
.wp-polls-usage-pre {
|
52 |
+
margin: 20px;
|
53 |
+
padding: 10px;
|
54 |
+
border: 1px solid #c8c8c8;
|
55 |
+
background-color: #f0f0f0;
|
56 |
+
overflow: auto;
|
57 |
+
}
|
58 |
+
#wp-polls-pollbar-bg {
|
59 |
+
width: 25px;
|
60 |
+
height: 25px;
|
61 |
+
border: 1px solid #000000;
|
62 |
+
}
|
63 |
+
#wp-polls-pollbar-border {
|
64 |
+
width: 25px;
|
65 |
+
height: 25px;
|
66 |
+
border: 1px solid #000000;
|
67 |
+
}
|
polls/polls-js.js
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
+----------------------------------------------------------------+
|
3 |
+
| |
|
4 |
+
| WordPress 2.0 Plugin: WP-Polls 2.13 |
|
5 |
+
| Copyright (c) 2006 Lester "GaMerZ" Chan |
|
6 |
+
| |
|
7 |
+
| File Written By: |
|
8 |
+
| - Lester "GaMerZ" Chan |
|
9 |
+
| - http://www.lesterchan.net |
|
10 |
+
| |
|
11 |
+
| File Information: |
|
12 |
+
| - Polls Javascript File |
|
13 |
+
| - wp-content/plugins/polls/polls-js.js |
|
14 |
+
| |
|
15 |
+
+----------------------------------------------------------------+
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
// Variables
|
20 |
+
var polls = new sack(polls_ajax_url);
|
21 |
+
var poll_id = 0;
|
22 |
+
var poll_answer_id = 0;
|
23 |
+
var poll_fadein_opacity = 0;
|
24 |
+
var poll_fadeout_opacity = 100;
|
25 |
+
var is_ie = (document.all && document.getElementById);
|
26 |
+
var is_moz = (!document.all && document.getElementById);
|
27 |
+
var is_opera = (navigator.userAgent.indexOf("Opera") > -1);
|
28 |
+
var is_being_voted = false;
|
29 |
+
|
30 |
+
|
31 |
+
// When User Vote For Poll
|
32 |
+
function poll_vote(current_poll_id) {
|
33 |
+
if(!is_being_voted) {
|
34 |
+
is_being_voted = true;
|
35 |
+
poll_id = current_poll_id;
|
36 |
+
poll_form = document.getElementById('polls_form_' + poll_id);
|
37 |
+
poll_answer = eval("poll_form.poll_" + poll_id);
|
38 |
+
poll_answer_id = 0;
|
39 |
+
if(poll_answer.length != null) {
|
40 |
+
for(i = 0; i < poll_answer.length; i++) {
|
41 |
+
if (poll_answer[i].checked) {
|
42 |
+
poll_answer_id = poll_answer[i].value;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
} else {
|
46 |
+
poll_answer_id = poll_answer.value;
|
47 |
+
}
|
48 |
+
if(poll_answer_id > 0) {
|
49 |
+
poll_loading_text();
|
50 |
+
poll_process();
|
51 |
+
} else {
|
52 |
+
is_being_voted = false;
|
53 |
+
alert(polls_text_valid);
|
54 |
+
}
|
55 |
+
} else {
|
56 |
+
alert(polls_text_wait);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
// When User View Poll's Result
|
62 |
+
function poll_result(current_poll_id) {
|
63 |
+
if(!is_being_voted) {
|
64 |
+
is_being_voted = true;
|
65 |
+
poll_id = current_poll_id;
|
66 |
+
poll_loading_text();
|
67 |
+
poll_process_result();
|
68 |
+
} else {
|
69 |
+
alert(polls_text_wait);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
// When User View Poll's Voting Booth
|
75 |
+
function poll_booth(current_poll_id) {
|
76 |
+
if(!is_being_voted) {
|
77 |
+
is_being_voted = true;
|
78 |
+
poll_id = current_poll_id;
|
79 |
+
poll_loading_text();
|
80 |
+
poll_process_booth();
|
81 |
+
} else {
|
82 |
+
alert(polls_text_wait);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
// Poll Fade In Text
|
88 |
+
function poll_fadein_text() {
|
89 |
+
if(poll_fadein_opacity == 90) {
|
90 |
+
poll_unloading_text();
|
91 |
+
}
|
92 |
+
if(poll_fadein_opacity < 100) {
|
93 |
+
poll_fadein_opacity += 10;
|
94 |
+
if(is_opera) {
|
95 |
+
poll_fadein_opacity = 100;
|
96 |
+
poll_unloading_text();
|
97 |
+
} else if(is_ie) {
|
98 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadein_opacity;
|
99 |
+
} else if(is_moz) {
|
100 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadein_opacity/100);
|
101 |
+
}
|
102 |
+
setTimeout("poll_fadein_text()", 100);
|
103 |
+
} else {
|
104 |
+
poll_fadein_opacity = 100;
|
105 |
+
is_being_voted = false;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
// Poll Loading Text
|
111 |
+
function poll_loading_text() {
|
112 |
+
document.getElementById('polls-' + poll_id + '-loading').style.display = 'block';
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
// Poll Finish Loading Text
|
117 |
+
function poll_unloading_text() {
|
118 |
+
document.getElementById('polls-' + poll_id + '-loading').style.display = 'none';
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
// Process The Poll
|
123 |
+
function poll_process() {
|
124 |
+
if(poll_fadeout_opacity > 0) {
|
125 |
+
poll_fadeout_opacity -= 10;
|
126 |
+
if(is_opera) {
|
127 |
+
poll_fadeout_opacity = 0;
|
128 |
+
} else if(is_ie) {
|
129 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadeout_opacity;
|
130 |
+
} else if(is_moz) {
|
131 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadeout_opacity/100);
|
132 |
+
}
|
133 |
+
setTimeout("poll_process()", 100);
|
134 |
+
} else {
|
135 |
+
poll_fadeout_opacity = 0;
|
136 |
+
polls.setVar("vote", true);
|
137 |
+
polls.setVar("poll_id", poll_id);
|
138 |
+
polls.setVar("poll_" + poll_id, poll_answer_id);
|
139 |
+
polls.method = 'POST';
|
140 |
+
polls.element = 'polls-' + poll_id + '-ans';
|
141 |
+
polls.onCompletion = poll_fadein_text;
|
142 |
+
polls.runAJAX();
|
143 |
+
poll_fadein_opacity = 0;
|
144 |
+
poll_fadeout_opacity = 100;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
// Process Poll's Result
|
150 |
+
function poll_process_result() {
|
151 |
+
if(poll_fadeout_opacity > 0) {
|
152 |
+
poll_fadeout_opacity -= 10;
|
153 |
+
if(is_opera) {
|
154 |
+
poll_fadeout_opacity = 0;
|
155 |
+
} else if(is_ie) {
|
156 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadeout_opacity;
|
157 |
+
} else if(is_moz) {
|
158 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadeout_opacity/100);
|
159 |
+
}
|
160 |
+
setTimeout("poll_process_result()", 100);
|
161 |
+
} else {
|
162 |
+
poll_fadeout_opacity = 0;
|
163 |
+
polls.setVar("pollresult", poll_id);
|
164 |
+
polls.method = 'GET';
|
165 |
+
polls.element = 'polls-' + poll_id + '-ans';
|
166 |
+
polls.onCompletion = poll_fadein_text;
|
167 |
+
polls.runAJAX();
|
168 |
+
poll_fadein_opacity = 0;
|
169 |
+
poll_fadeout_opacity = 100;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
// Process Poll's Voting Booth
|
175 |
+
function poll_process_booth() {
|
176 |
+
if(poll_fadeout_opacity > 0) {
|
177 |
+
poll_fadeout_opacity -= 10;
|
178 |
+
if(is_opera) {
|
179 |
+
poll_fadeout_opacity = 0;
|
180 |
+
} else if(is_ie) {
|
181 |
+
document.getElementById('polls-' + poll_id + '-ans').filters.alpha.opacity = poll_fadeout_opacity;
|
182 |
+
} else if(is_moz) {
|
183 |
+
document.getElementById('polls-' + poll_id + '-ans').style.MozOpacity = (poll_fadeout_opacity/100);
|
184 |
+
}
|
185 |
+
setTimeout("poll_process_booth()", 100);
|
186 |
+
} else {
|
187 |
+
poll_fadeout_opacity = 0;
|
188 |
+
polls.setVar("pollbooth", poll_id);
|
189 |
+
polls.method = 'GET';
|
190 |
+
polls.element = 'polls-' + poll_id + '-ans';
|
191 |
+
polls.onCompletion = poll_fadein_text;
|
192 |
+
polls.runAJAX();
|
193 |
+
poll_fadein_opacity = 0;
|
194 |
+
poll_fadeout_opacity = 100;
|
195 |
+
}
|
196 |
+
}
|
polls/polls-manager.php
ADDED
@@ -0,0 +1,782 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-Polls 2.13 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Manage Your Polls |
|
14 |
+
| - wp-content/plugins/polls/polls-manager.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Check Whether User Can Manage Polls
|
21 |
+
if(!current_user_can('manage_polls')) {
|
22 |
+
die('Access Denied');
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
### Variables Variables Variables
|
27 |
+
$base_name = plugin_basename('polls/polls-manager.php');
|
28 |
+
$base_page = 'admin.php?page='.$base_name;
|
29 |
+
$mode = trim($_GET['mode']);
|
30 |
+
$poll_id = intval($_GET['id']);
|
31 |
+
$poll_aid = intval($_GET['aid']);
|
32 |
+
|
33 |
+
|
34 |
+
### Form Processing
|
35 |
+
if(!empty($_POST['do'])) {
|
36 |
+
// Decide What To Do
|
37 |
+
switch($_POST['do']) {
|
38 |
+
// Add Poll
|
39 |
+
case __('Add Poll', 'wp-polls'):
|
40 |
+
// Add Poll Question
|
41 |
+
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
42 |
+
$pollq_timestamp = current_time('timestamp');
|
43 |
+
$add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (0, '$pollq_question', '$pollq_timestamp', 0, 1)");
|
44 |
+
if(!$add_poll_question) {
|
45 |
+
$text .= '<font color="red">'.sprintf(__('Error In Adding Poll \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</font>';
|
46 |
+
}
|
47 |
+
// Add Poll Answers
|
48 |
+
$polla_answers = $_POST['polla_answers'];
|
49 |
+
$polla_qid = intval($wpdb->insert_id);
|
50 |
+
foreach($polla_answers as $polla_answer) {
|
51 |
+
$polla_answer = addslashes(trim($polla_answer));
|
52 |
+
$add_poll_answers = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $polla_qid, '$polla_answer', 0)");
|
53 |
+
if(!$add_poll_answers) {
|
54 |
+
$text .= '<font color="red">'.sprintf(__('Error In Adding Poll\'s Answer \'%s\'', 'wp-polls'), stripslashes($polla_answer)).'</font>';
|
55 |
+
}
|
56 |
+
}
|
57 |
+
// Update Lastest Poll ID To Poll Options
|
58 |
+
$update_latestpoll = update_option('poll_latestpoll', $polla_qid);
|
59 |
+
if(!$update_latestpoll) {
|
60 |
+
$text .= "<font color=\"red\">".sprintf(__('There Is An Error Updating The Lastest Poll ID (%s) To The Poll Option', 'wp-polls'), $polla_qid)."</font>";
|
61 |
+
}
|
62 |
+
if(empty($text)) {
|
63 |
+
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Added Successfully', 'wp-polls').'</font>';
|
64 |
+
}
|
65 |
+
break;
|
66 |
+
// Edit Poll
|
67 |
+
case __('Edit Poll', 'wp-polls'):
|
68 |
+
// Update Poll's Question
|
69 |
+
$pollq_id = intval($_POST['pollq_id']);
|
70 |
+
$pollq_totalvotes = intval($_POST['pollq_totalvotes']);
|
71 |
+
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
72 |
+
$edit_polltimestamp = intval($_POST['edit_polltimestamp']);
|
73 |
+
$timestamp_sql = '';
|
74 |
+
if($edit_polltimestamp == 1) {
|
75 |
+
$pollq_timestamp_day = intval($_POST['pollq_timestamp_day']);
|
76 |
+
$pollq_timestamp_month = intval($_POST['pollq_timestamp_month']);
|
77 |
+
$pollq_timestamp_year = intval($_POST['pollq_timestamp_year']);
|
78 |
+
$pollq_timestamp_hour = intval($_POST['pollq_timestamp_hour']);
|
79 |
+
$pollq_timestamp_minute = intval($_POST['pollq_timestamp_minute']);
|
80 |
+
$pollq_timestamp_second = intval($_POST['pollq_timestamp_second']);
|
81 |
+
$timestamp_sql = ", pollq_timestamp = '".gmmktime($pollq_timestamp_hour, $pollq_timestamp_minute, $pollq_timestamp_second, $pollq_timestamp_month, $pollq_timestamp_day, $pollq_timestamp_year)."'";
|
82 |
+
}
|
83 |
+
|
84 |
+
$edit_poll_question = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_question = '$pollq_question', pollq_totalvotes = $pollq_totalvotes $timestamp_sql WHERE pollq_id = $pollq_id");
|
85 |
+
if(!$edit_poll_question) {
|
86 |
+
$text = '<font color="blue">'.__('No Changes Had Been Made To Poll\'s Title', 'wp-polls').' \''.stripslashes($pollq_question).'\'</font>';
|
87 |
+
}
|
88 |
+
// Update Polls' Answers
|
89 |
+
$polla_aids = array();
|
90 |
+
$get_polla_aids = $wpdb->get_results("SELECT polla_aid FROM $wpdb->pollsa WHERE polla_qid = $pollq_id ORDER BY polla_aid ASC");
|
91 |
+
if($get_polla_aids) {
|
92 |
+
foreach($get_polla_aids as $get_polla_aid) {
|
93 |
+
$polla_aids[] = intval($get_polla_aid->polla_aid);
|
94 |
+
}
|
95 |
+
foreach($polla_aids as $polla_aid) {
|
96 |
+
$polla_answers = addslashes(trim($_POST['polla_aid-'.$polla_aid]));
|
97 |
+
$polla_votes = intval($_POST['polla_votes-'.$polla_aid]);
|
98 |
+
$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");
|
99 |
+
if(!$edit_poll_answer) {
|
100 |
+
$text .= '<br /><font color="blue">'.__('No Changes Had Been Made To Poll\'s Answer', 'wp-polls').' \''.stripslashes($polla_answers).'\'</font>';
|
101 |
+
}
|
102 |
+
}
|
103 |
+
} else {
|
104 |
+
$text .= '<br /><font color="red">'.__('Invalid Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\'</font>';
|
105 |
+
}
|
106 |
+
if(empty($text)) {
|
107 |
+
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Edited Successfully', 'wp-polls').'</font>';
|
108 |
+
}
|
109 |
+
break;
|
110 |
+
// Open Poll
|
111 |
+
case __('Open Poll', 'wp-polls'):
|
112 |
+
$pollq_id = intval($_POST['pollq_id']);
|
113 |
+
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
114 |
+
$close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 1 WHERE pollq_id = $pollq_id;");
|
115 |
+
if($close_poll) {
|
116 |
+
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Is Now Opened', 'wp-polls').'</font>';
|
117 |
+
} else {
|
118 |
+
$text = '<font color="red">'.__('Error Opening Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\'</font>';
|
119 |
+
}
|
120 |
+
break;
|
121 |
+
// Close Poll
|
122 |
+
case __('Close Poll', 'wp-polls'):
|
123 |
+
$pollq_id = intval($_POST['pollq_id']);
|
124 |
+
$pollq_question = addslashes(trim($_POST['pollq_question']));
|
125 |
+
$close_poll = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_active = 0 WHERE pollq_id = $pollq_id;");
|
126 |
+
if($close_poll) {
|
127 |
+
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Is Now Closed', 'wp-polls').'</font>';
|
128 |
+
} else {
|
129 |
+
$text = '<font color="red">'.__('Error Closing Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\'</font>';
|
130 |
+
}
|
131 |
+
break;
|
132 |
+
// Delete Poll
|
133 |
+
case __('Delete Poll', 'wp-polls'):
|
134 |
+
$pollq_id = intval($_POST['pollq_id']);
|
135 |
+
$pollq_question = trim($_POST['pollq_question']);
|
136 |
+
$delete_poll_question = $wpdb->query("DELETE FROM $wpdb->pollsq WHERE pollq_id = $pollq_id");
|
137 |
+
$delete_poll_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_qid = $pollq_id");
|
138 |
+
$delete_poll_ip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
|
139 |
+
$poll_option_lastestpoll = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'poll_latestpoll'");
|
140 |
+
if(!$delete_poll_question) {
|
141 |
+
$text = '<font color="red">'.sprintf(__('Error In Deleting Poll \'%s\' Question', 'wp-polls'), stripslashes($pollq_question)).'</font>';
|
142 |
+
}
|
143 |
+
if(!$delete_poll_answers) {
|
144 |
+
$text .= '<br /><font color="blue">'.sprintf(__('No Poll Answers For \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</font>';
|
145 |
+
}
|
146 |
+
if(!$delete_poll_ip) {
|
147 |
+
$text .= '<br /><font color="blue">'.sprintf(__('No Voted IPs For \'%s\'', 'wp-polls'), stripslashes($pollq_question)).'</font>';
|
148 |
+
}
|
149 |
+
if(empty($text)) {
|
150 |
+
if($poll_option_lastestpoll == $pollq_id) {
|
151 |
+
$poll_lastestpoll = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq ORDER BY pollq_id DESC LIMIT 1");
|
152 |
+
if($poll_lastestpoll) {
|
153 |
+
$poll_lastestpoll = intval($poll_lastestpoll);
|
154 |
+
update_option('poll_latestpoll', $poll_lastestpoll);
|
155 |
+
}
|
156 |
+
}
|
157 |
+
$text = '<font color="green">'.__('Poll', 'wp-polls').' \''.stripslashes($pollq_question).'\' '.__('Deleted Successfully', 'wp-polls').'</font>';
|
158 |
+
}
|
159 |
+
break;
|
160 |
+
// Add Poll's Answer
|
161 |
+
case __('Add Answer', 'wp-polls'):
|
162 |
+
$polla_qid = intval($_POST['polla_qid']);
|
163 |
+
$polla_answers = addslashes(trim($_POST['polla_answers']));
|
164 |
+
$add_poll_question = $wpdb->query("INSERT INTO $wpdb->pollsa VALUES (0, $polla_qid, '$polla_answers', 0)");
|
165 |
+
if(!$add_poll_question) {
|
166 |
+
$text = '<font color="red">'.sprintf(__('Error In Adding Poll Answer \'%s\'', 'wp-polls'), stripslashes($polla_answers)).'</font>';
|
167 |
+
} else {
|
168 |
+
$text = '<font color="green">'.__('Poll Answer', 'wp-polls').' \''.stripslashes($polla_answers).'\' '.__('Added Successfully', 'wp-polls').'</font>';
|
169 |
+
}
|
170 |
+
break;
|
171 |
+
// Delete Polls Logs
|
172 |
+
case __('Delete All Logs', 'wp-polls'):
|
173 |
+
if(trim($_POST['delete_logs_yes']) == 'yes') {
|
174 |
+
$delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip");
|
175 |
+
if($delete_logs) {
|
176 |
+
$text = '<font color="green">'.__('All Polls Logs Have Been Deleted.', 'wp-polls').'</font>';
|
177 |
+
} else {
|
178 |
+
$text = '<font color="red">'.__('An Error Has Occured While Deleting All Polls Logs.', 'wp-polls').'</font>';
|
179 |
+
}
|
180 |
+
}
|
181 |
+
break;
|
182 |
+
// Delete Poll Logs For Individual Poll
|
183 |
+
case __('Delete Logs For This Poll Only', 'wp-polls'):
|
184 |
+
$pollq_id = intval($_POST['pollq_id']);
|
185 |
+
if(trim($_POST['delete_logs_yes']) == 'yes') {
|
186 |
+
$delete_logs = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $pollq_id");
|
187 |
+
if($delete_logs) {
|
188 |
+
$text = '<font color="green">'.__('All Logs For This Poll Have Been Deleted.', 'wp-polls').'</font>';
|
189 |
+
} else {
|
190 |
+
$text = '<font color="red">'.__('An Error Has Occured While Deleting All Logs For This Poll.', 'wp-polls').'</font>';
|
191 |
+
}
|
192 |
+
}
|
193 |
+
break;
|
194 |
+
// Uninstall WP-Polls (By: Philippe Corbes)
|
195 |
+
case __('UNINSTALL Polls', 'wp-polls') :
|
196 |
+
if(trim($_POST['uninstall_poll_yes']) == 'yes') {
|
197 |
+
echo '<div id="message" class="updated fade"><p>';
|
198 |
+
$polls_tables = array($wpdb->pollsq, $wpdb->pollsa, $wpdb->pollsip);
|
199 |
+
foreach($polls_tables as $table) {
|
200 |
+
$wpdb->query("DROP TABLE {$table}");
|
201 |
+
echo '<font color="green">';
|
202 |
+
printf(__('Table "%s" Has Been Dropped.', 'wp-polls'), "<strong><em>{$table}</em></strong>");
|
203 |
+
echo '</font><br />';
|
204 |
+
}
|
205 |
+
$polls_settings = array('poll_template_voteheader', 'poll_template_votebody', 'poll_template_votefooter', 'poll_template_resultheader',
|
206 |
+
'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2',
|
207 |
+
'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll',
|
208 |
+
'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby',
|
209 |
+
'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show',
|
210 |
+
'poll_archive_url', 'poll_bar');
|
211 |
+
foreach($polls_settings as $setting) {
|
212 |
+
$delete_setting = delete_option($setting);
|
213 |
+
if($delete_setting) {
|
214 |
+
echo '<font color="green">';
|
215 |
+
printf(__('Setting Key \'%s\' Has been Errased.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
|
216 |
+
} else {
|
217 |
+
echo '<font color="red">';
|
218 |
+
printf(__('Error Deleting Setting Key \'%s\'.', 'wp-polls'), "<strong><em>{$setting}</em></strong>");
|
219 |
+
}
|
220 |
+
echo '</font><br />';
|
221 |
+
}
|
222 |
+
echo '</p></div>';
|
223 |
+
$mode = 'end-UNINSTALL';
|
224 |
+
}
|
225 |
+
break;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
|
230 |
+
### Determines Which Mode It Is
|
231 |
+
switch($mode) {
|
232 |
+
// Add A Poll
|
233 |
+
case 'add':
|
234 |
+
?>
|
235 |
+
<div class="wrap">
|
236 |
+
<h2><?php _e('Add Poll', 'wp-polls'); ?></h2>
|
237 |
+
<?php
|
238 |
+
if(isset($_POST['addpollquestion'])) {
|
239 |
+
$poll_noquestion = intval($_POST['poll_noquestion']);
|
240 |
+
$pollq_question = stripslashes(trim($_POST['pollq_question']));
|
241 |
+
?>
|
242 |
+
<form action="<?php echo $base_page; ?>" method="post">
|
243 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
244 |
+
<tr>
|
245 |
+
<th align="left"><?php _e('Question', 'wp-polls') ?></th>
|
246 |
+
<td><input type="text" size="50" maxlength="200" name="pollq_question" value="<?php echo htmlspecialchars($pollq_question); ?>" /></td>
|
247 |
+
</tr>
|
248 |
+
<?php
|
249 |
+
for($i=1; $i<=$poll_noquestion; $i++) {
|
250 |
+
echo "<tr>\n";
|
251 |
+
echo "<th align=\"left\" scope=\"row\">Answers $i:</th>\n";
|
252 |
+
echo "<td><input type=\"text\" size=\"30\" maxlength=\"200\" name=\"polla_answers[]\" /></td>\n";
|
253 |
+
echo "</tr>\n";
|
254 |
+
}
|
255 |
+
?>
|
256 |
+
<tr>
|
257 |
+
<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'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
258 |
+
</tr>
|
259 |
+
</table>
|
260 |
+
</form>
|
261 |
+
<?php } else {?>
|
262 |
+
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>&mode=add" method="post">
|
263 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
264 |
+
<tr>
|
265 |
+
<th align="left"><?php _e('Question', 'wp-polls') ?></th>
|
266 |
+
<td><input type="text" size="50" maxlength="200" name="pollq_question" /></td>
|
267 |
+
</tr>
|
268 |
+
<th align="left"><?php _e('No. Of Answers:', 'wp-polls') ?></th>
|
269 |
+
<td>
|
270 |
+
<select size="1" name="poll_noquestion">
|
271 |
+
<?php
|
272 |
+
for($i=2; $i <= 20; $i++) {
|
273 |
+
echo "<option value=\"$i\">$i</option>";
|
274 |
+
}
|
275 |
+
?>
|
276 |
+
</select>
|
277 |
+
</td>
|
278 |
+
</tr>
|
279 |
+
<tr>
|
280 |
+
<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'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
281 |
+
</tr>
|
282 |
+
</table>
|
283 |
+
</form>
|
284 |
+
<?php } ?>
|
285 |
+
</div>
|
286 |
+
<?php
|
287 |
+
break;
|
288 |
+
// Edit A Poll
|
289 |
+
case 'edit':
|
290 |
+
$poll_question = $wpdb->get_row("SELECT pollq_question, pollq_timestamp, pollq_totalvotes, pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
291 |
+
$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");
|
292 |
+
$poll_question_text = stripslashes($poll_question->pollq_question);
|
293 |
+
$poll_totalvotes = intval($poll_question->pollq_totalvote);
|
294 |
+
$poll_timestamp = $poll_question->pollq_timestamp;
|
295 |
+
$poll_active = intval($poll_question->pollq_active);
|
296 |
+
|
297 |
+
// Edit Timestamp Options
|
298 |
+
function poll_timestamp($poll_timestamp) {
|
299 |
+
global $month;
|
300 |
+
$day = gmdate('j', $poll_timestamp);
|
301 |
+
echo '<select name="pollq_timestamp_day" size="1">'."\n";
|
302 |
+
for($i = 1; $i <=31; $i++) {
|
303 |
+
if($day == $i) {
|
304 |
+
echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
305 |
+
} else {
|
306 |
+
echo "<option value=\"$i\">$i</option>\n";
|
307 |
+
}
|
308 |
+
}
|
309 |
+
echo '</select> '."\n";
|
310 |
+
$month2 = gmdate('n', $poll_timestamp);
|
311 |
+
echo '<select name="pollq_timestamp_month" size="1">'."\n";
|
312 |
+
for($i = 1; $i <= 12; $i++) {
|
313 |
+
if ($i < 10) {
|
314 |
+
$ii = '0'.$i;
|
315 |
+
} else {
|
316 |
+
$ii = $i;
|
317 |
+
}
|
318 |
+
if($month2 == $i) {
|
319 |
+
echo "<option value=\"$i\" selected=\"selected\">$month[$ii]</option>\n";
|
320 |
+
} else {
|
321 |
+
echo "<option value=\"$i\">$month[$ii]</option>\n";
|
322 |
+
}
|
323 |
+
}
|
324 |
+
echo '</select> '."\n";
|
325 |
+
$year = gmdate('Y', $poll_timestamp);
|
326 |
+
echo '<select name="pollq_timestamp_year" size="1">'."\n";
|
327 |
+
for($i = 2000; $i <= gmdate('Y'); $i++) {
|
328 |
+
if($year == $i) {
|
329 |
+
echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
330 |
+
} else {
|
331 |
+
echo "<option value=\"$i\">$i</option>\n";
|
332 |
+
}
|
333 |
+
}
|
334 |
+
echo '</select> @'."\n";
|
335 |
+
$hour = gmdate('H', $poll_timestamp);
|
336 |
+
echo '<select name="pollq_timestamp_hour" size="1">'."\n";
|
337 |
+
for($i = 0; $i < 24; $i++) {
|
338 |
+
if($hour == $i) {
|
339 |
+
echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
340 |
+
} else {
|
341 |
+
echo "<option value=\"$i\">$i</option>\n";
|
342 |
+
}
|
343 |
+
}
|
344 |
+
echo '</select> :'."\n";
|
345 |
+
$minute = gmdate('i', $poll_timestamp);
|
346 |
+
echo '<select name="pollq_timestamp_minute" size="1">'."\n";
|
347 |
+
for($i = 0; $i < 60; $i++) {
|
348 |
+
if($minute == $i) {
|
349 |
+
echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
350 |
+
} else {
|
351 |
+
echo "<option value=\"$i\">$i</option>\n";
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
echo '</select> :'."\n";
|
356 |
+
$second = gmdate('s', $poll_timestamp);
|
357 |
+
echo '<select name="pollq_timestamp_second" size="1">'."\n";
|
358 |
+
for($i = 0; $i <= 60; $i++) {
|
359 |
+
if($second == $i) {
|
360 |
+
echo "<option value=\"$i\" selected=\"selected\">$i</option>\n";
|
361 |
+
} else {
|
362 |
+
echo "<option value=\"$i\">$i</option>\n";
|
363 |
+
}
|
364 |
+
}
|
365 |
+
echo '</select>'."\n";
|
366 |
+
}
|
367 |
+
?>
|
368 |
+
<script type="text/javascript">
|
369 |
+
function check_totalvotes() {
|
370 |
+
var total_votes = 0;
|
371 |
+
var temp_vote = 0;
|
372 |
+
<?php
|
373 |
+
foreach($poll_answers as $poll_answer) {
|
374 |
+
$polla_aid = intval($poll_answer->polla_aid);
|
375 |
+
echo "\t\t\t\ttemp_vote = parseInt(document.getElementById('polla_votes-$polla_aid').value);\n";
|
376 |
+
echo "\t\t\t\tif(isNaN(temp_vote)) {\n";
|
377 |
+
echo "\t\t\t\tdocument.getElementById('polla_votes-$polla_aid').value = 0;\n";
|
378 |
+
echo "\t\t\t\ttemp_vote = 0;\n";
|
379 |
+
echo "\t\t\t\t}\n";
|
380 |
+
echo "\t\t\t\ttotal_votes += temp_vote;\n";
|
381 |
+
}
|
382 |
+
?>
|
383 |
+
document.getElementById('pollq_totalvotes').value = parseInt(total_votes);
|
384 |
+
}
|
385 |
+
</script>
|
386 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.stripslashes($text).'</p></div>'; } ?>
|
387 |
+
<!-- Edit Poll -->
|
388 |
+
<div class="wrap">
|
389 |
+
<h2><?php _e('Edit Poll', 'wp-polls'); ?></h2>
|
390 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
391 |
+
<input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
|
392 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
393 |
+
<tr>
|
394 |
+
<th colspan="2"><?php _e('Question', 'wp-polls') ?></th>
|
395 |
+
</tr>
|
396 |
+
<tr>
|
397 |
+
<td align="center" colspan="2"><input type="text" size="70" maxlength="200" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" /></td>
|
398 |
+
</tr>
|
399 |
+
<tr>
|
400 |
+
<th align="left"><?php _e('Answers:', 'wp-polls') ?></th>
|
401 |
+
<th align="right"><?php _e('No. Of Votes', 'wp-polls') ?></th>
|
402 |
+
</tr>
|
403 |
+
<?php
|
404 |
+
$i=1;
|
405 |
+
$poll_actual_totalvotes = 0;
|
406 |
+
if($poll_answers) {
|
407 |
+
$pollip_answers = array();
|
408 |
+
$pollip_answers[0] = __('Null Votes', 'wp-polls');
|
409 |
+
foreach($poll_answers as $poll_answer) {
|
410 |
+
$polla_aid = intval($poll_answer->polla_aid);
|
411 |
+
$polla_answers = stripslashes($poll_answer->polla_answers);
|
412 |
+
$polla_votes = intval($poll_answer->polla_votes);
|
413 |
+
$pollip_answers[$polla_aid] = $polla_answers;
|
414 |
+
echo "<tr>\n";
|
415 |
+
echo "<td align=\"left\">".__('Answer', 'wp-polls')." $i: <input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_aid-$polla_aid\" value=\"".htmlspecialchars($polla_answers)."\" /> ";
|
416 |
+
echo "<a href=\"$base_page&mode=deleteans&id=$poll_id&aid=$polla_aid\" onclick=\"return confirm('".__('You Are About To Delete This Poll Answer:', 'wp-polls')." \'".addslashes(strip_tags($polla_answers))."\'\\n\\n".__('This Action Is Not Reversible. Are you sure?', 'wp-polls')."')\">".__('Delete')."</a></td>\n";
|
417 |
+
echo "<td align=\"right\">$polla_votes <input type=\"text\" size=\"4\" maxlength=\"6\" id=\"polla_votes-$polla_aid\" name=\"polla_votes-$polla_aid\" value=\"$polla_votes\" onblur=\"check_totalvotes();\" /></td>\n</tr>\n";
|
418 |
+
$poll_actual_totalvotes += $polla_votes;
|
419 |
+
$i++;
|
420 |
+
}
|
421 |
+
}
|
422 |
+
?>
|
423 |
+
<tr>
|
424 |
+
<td align="right" colspan="2"><strong><?php _e('Total Votes', 'wp-polls'); ?>: <?php echo $poll_actual_totalvotes; ?></strong> <input type="text" size="4" maxlength="4" id="pollq_totalvotes" name="pollq_totalvotes" value="<?php echo $poll_actual_totalvotes; ?>" onblur="check_totalvotes();" /></td>
|
425 |
+
</tr>
|
426 |
+
<tr>
|
427 |
+
<td colspan="2"><strong><?php _e('Timestamp', 'wp-polls'); ?></strong>:</td>
|
428 |
+
</tr>
|
429 |
+
<tr>
|
430 |
+
<td colspan="2"><input type="checkbox" name="edit_polltimestamp" value="1" /><?php _e('Edit Timestamp', 'wp-polls'); ?><br /><?php poll_timestamp($poll_timestamp); ?><br /><?php _e('Existing Timestamp:', 'wp-polls'); ?> <?php echo mysql2date(get_settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td>
|
431 |
+
</tr>
|
432 |
+
<tr>
|
433 |
+
<td align="center" colspan="2"><input type="submit" name="do" value="<?php _e('Edit Poll', 'wp-polls'); ?>" class="button" />
|
434 |
+
<?php if($poll_active == 1) { ?>
|
435 |
+
<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'); ?>.')" />
|
436 |
+
<?php } else { ?>
|
437 |
+
<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'); ?>.')" />
|
438 |
+
<?php } ?>
|
439 |
+
<input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
440 |
+
</tr>
|
441 |
+
</table>
|
442 |
+
</form>
|
443 |
+
</div>
|
444 |
+
<!-- Add Poll's Answer -->
|
445 |
+
<div class="wrap">
|
446 |
+
<h2><?php _e('Add Answer', 'wp-polls') ?></h2>
|
447 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>&mode=edit&id=<?php echo $poll_id; ?>" method="post">
|
448 |
+
<input type="hidden" name="polla_qid" value="<?php echo $poll_id; ?>" />
|
449 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
450 |
+
<tr>
|
451 |
+
<td><strong><?php _e('Add Answer', 'wp-polls') ?></strong></td>
|
452 |
+
<td><input type="text" size="50" maxlength="200" name="polla_answers" /></td>
|
453 |
+
</tr>
|
454 |
+
<tr>
|
455 |
+
<td colspan="2" align="center"><input type="submit" name="do" value="<?php _e('Add Answer', 'wp-polls'); ?>" class="button" /></td>
|
456 |
+
</tr>
|
457 |
+
</table>
|
458 |
+
</form>
|
459 |
+
</div>
|
460 |
+
<!-- Users Voted For This Poll -->
|
461 |
+
<?php
|
462 |
+
$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");
|
463 |
+
?>
|
464 |
+
<div class="wrap">
|
465 |
+
<h2><?php _e('Users Voted For This Poll', 'wp-polls') ?></h2>
|
466 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
467 |
+
<?php
|
468 |
+
if($poll_ips) {
|
469 |
+
$k = 1;
|
470 |
+
$poll_last_aid = -1;
|
471 |
+
foreach($poll_ips as $poll_ip) {
|
472 |
+
$pollip_aid = intval($poll_ip->pollip_aid);
|
473 |
+
$pollip_user = stripslashes($poll_ip->pollip_user);
|
474 |
+
$pollip_ip = $poll_ip->pollip_ip;
|
475 |
+
$pollip_host = $poll_ip->pollip_host;
|
476 |
+
$pollip_date = mysql2date(get_settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));
|
477 |
+
if($pollip_aid != $poll_last_aid) {
|
478 |
+
if($pollip_aid == 0) {
|
479 |
+
echo "<tr style='background-color: #b8d4ff'>\n<td colspan=\"4\"><strong>$pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
|
480 |
+
} else {
|
481 |
+
echo "<tr style='background-color: #b8d4ff'>\n<td colspan=\"4\"><strong>".__('Answer', 'wp-polls')." $k: $pollip_answers[$pollip_aid]</strong></td>\n</tr>\n";
|
482 |
+
$k++;
|
483 |
+
}
|
484 |
+
echo "<tr>\n";
|
485 |
+
echo "<th scope=\"row\">".__('No.', 'wp-polls')."</th>\n";
|
486 |
+
echo "<th scope=\"row\">".__('User', 'wp-polls')."</th>\n";
|
487 |
+
echo "<th scope=\"row\">".__('IP/Host', 'wp-polls')."</th>\n";
|
488 |
+
echo "<th scope=\"row\">".__('Date', 'wp-polls')."</th>\n";
|
489 |
+
echo "</tr>\n";
|
490 |
+
$i = 1;
|
491 |
+
}
|
492 |
+
if($i%2 == 0) {
|
493 |
+
$style = 'style=\'background-color: none\'';
|
494 |
+
} else {
|
495 |
+
$style = 'style=\'background-color: #eee\'';
|
496 |
+
}
|
497 |
+
echo "<tr $style>\n";
|
498 |
+
echo "<td>$i</td>\n";
|
499 |
+
echo "<td>$pollip_user</td>\n";
|
500 |
+
echo "<td>$pollip_ip / $pollip_host</td>\n";
|
501 |
+
echo "<td>$pollip_date</td>\n";
|
502 |
+
echo "</tr>\n";
|
503 |
+
$poll_last_aid = $pollip_aid;
|
504 |
+
$i++;
|
505 |
+
}
|
506 |
+
} else {
|
507 |
+
echo "<tr>\n<td colspan=\"4\" align=\"center\">".__('No IP Has Been Logged Yet.', 'wp-polls')."</td>\n</tr>\n";
|
508 |
+
}
|
509 |
+
?>
|
510 |
+
</table>
|
511 |
+
</div>
|
512 |
+
<!-- Delete Poll Logs -->
|
513 |
+
<div class="wrap">
|
514 |
+
<h2><?php _e('Poll Logs', 'wp-polls'); ?></h2>
|
515 |
+
<div align="center">
|
516 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
517 |
+
<input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
|
518 |
+
<strong><?php _e('Are You Sure You Want To Delete Logs For This Poll Only?', 'wp-polls'); ?></strong><br /><br />
|
519 |
+
<input type="checkbox" name="delete_logs_yes" value="yes" /> <?php _e('Yes'); ?><br /><br />
|
520 |
+
<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'); ?>')" />
|
521 |
+
</form>
|
522 |
+
</div>
|
523 |
+
<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>
|
524 |
+
</div>
|
525 |
+
<?php
|
526 |
+
break;
|
527 |
+
// Delete A Poll
|
528 |
+
case 'delete':
|
529 |
+
$poll_question = $wpdb->get_row("SELECT pollq_question, pollq_totalvotes, pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
530 |
+
$poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_id ORDER BY polla_answers");
|
531 |
+
$poll_question_text = stripslashes($poll_question->pollq_question);
|
532 |
+
$poll_totalvotes = intval($poll_question->pollq_totalvotes);
|
533 |
+
$poll_active = intval($poll_question->pollq_active);
|
534 |
+
?>
|
535 |
+
<!-- Delete Poll -->
|
536 |
+
<div class="wrap">
|
537 |
+
<h2><?php _e('Delete Poll', 'wp-polls') ?></h2>
|
538 |
+
<form action="<?php echo $base_page; ?>" method="post">
|
539 |
+
<input type="hidden" name="pollq_id" value="<?php echo $poll_id; ?>" />
|
540 |
+
<input type="hidden" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" />
|
541 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
542 |
+
<tr>
|
543 |
+
<th colspan="2"><?php _e('Question', 'wp-polls') ?></th>
|
544 |
+
</tr>
|
545 |
+
<tr>
|
546 |
+
<td colspan="2" align="center"><?php echo $poll_question_text; ?></td>
|
547 |
+
</tr>
|
548 |
+
<tr>
|
549 |
+
<th align="left"><?php _e('Answers', 'wp-polls') ?></th>
|
550 |
+
<th><?php _e('No. Of Votes', 'wp-polls') ?></th>
|
551 |
+
</tr>
|
552 |
+
<?php
|
553 |
+
$i=1;
|
554 |
+
if($poll_answers) {
|
555 |
+
foreach($poll_answers as $poll_answer) {
|
556 |
+
$polla_answers = stripslashes($poll_answer->polla_answers);
|
557 |
+
$polla_votes = intval($poll_answer->polla_votes);
|
558 |
+
echo "<tr>\n";
|
559 |
+
echo "<td>".__('Answer', 'wp-polls')." $i: $polla_answers</td>\n";
|
560 |
+
echo "<td align=\"center\">$polla_votes</td>\n</tr>\n";
|
561 |
+
$i++;
|
562 |
+
}
|
563 |
+
}
|
564 |
+
?>
|
565 |
+
<tr>
|
566 |
+
<th colspan="2"><?php _e('Total Votes', 'wp-polls'); ?>: <?php echo $poll_totalvotes; ?></th>
|
567 |
+
</tr>
|
568 |
+
<tr>
|
569 |
+
<th colspan="2"><?php _e('Status', 'wp-polls'); ?>: <?php if($poll_active == 1) { _e('Open', 'wp-polls'); } else { _e('Closed', 'wp-polls'); } ?></th>
|
570 |
+
</tr>
|
571 |
+
<tr>
|
572 |
+
<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>
|
573 |
+
<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'); ?>')" />
|
574 |
+
<input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
|
575 |
+
</tr>
|
576 |
+
</table>
|
577 |
+
</form>
|
578 |
+
</div>
|
579 |
+
<?php
|
580 |
+
break;
|
581 |
+
// Delete A Poll Answer
|
582 |
+
case 'deleteans':
|
583 |
+
$poll_answers = $wpdb->get_row("SELECT polla_votes, polla_answers FROM $wpdb->pollsa WHERE polla_aid = $poll_aid AND polla_qid = $poll_id");
|
584 |
+
$polla_votes = intval($poll_answers->polla_votes);
|
585 |
+
$polla_answers = stripslashes(trim($poll_answers->polla_answers));
|
586 |
+
$delete_polla_answers = $wpdb->query("DELETE FROM $wpdb->pollsa WHERE polla_aid = $poll_aid AND polla_qid = $poll_id");
|
587 |
+
$delete_pollip = $wpdb->query("DELETE FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_aid = $poll_aid");
|
588 |
+
$update_pollq_totalvotes = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes-$polla_votes) WHERE pollq_id=$poll_id");
|
589 |
+
?>
|
590 |
+
<!-- Delete Poll's Answer -->
|
591 |
+
<div class="wrap">
|
592 |
+
<h2><?php _e('Delete Poll\'s Answer', 'wp-polls') ?></h2>
|
593 |
+
<?php
|
594 |
+
if($delete_polla_answers) {
|
595 |
+
echo "<font color=\"green\">".__('Poll Answer', 'wp-polls')." '$polla_answers' ".__('Deleted Successfully', 'wp-polls')."</font>";
|
596 |
+
} else {
|
597 |
+
echo "<font color=\"red\">".__('Error In Deleting Poll Answer', 'wp-polls')." '$polla_answers'</font>";
|
598 |
+
}
|
599 |
+
if($update_pollq_totalvotes) {
|
600 |
+
echo "<br /><font color=\"green\">".__('Poll Question\'s Total Votes Updated Successfully', 'wp-polls')."</font>";
|
601 |
+
} else {
|
602 |
+
echo "<br /><font color=\"blue\">".__('No Changes Have Been Made To The Poll\'s Total Votes', 'wp-polls')."</font>";
|
603 |
+
}
|
604 |
+
if($delete_pollip) {
|
605 |
+
echo "<br /><font color=\"green\">".__('Poll IP Logs Updated Successfully', 'wp-polls')."</font>";
|
606 |
+
} else {
|
607 |
+
echo "<br /><font color=\"blue\">".__('No Changes Have Been Made To The Poll IP Logs', 'wp-polls')."</font>";
|
608 |
+
}
|
609 |
+
?>
|
610 |
+
<p><strong><a href="<?php echo $base_page; ?>&mode=edit&id=<?php echo $poll_id; ?>"><?php _e('Click here To Go Back To The Poll Edit Page', 'wp-polls'); ?></a>.</strong></p>
|
611 |
+
</div>
|
612 |
+
<?php
|
613 |
+
break;
|
614 |
+
// Deactivating WP-Polls (By: Philippe Corbes)
|
615 |
+
case 'end-UNINSTALL':
|
616 |
+
echo '<div class="wrap">';
|
617 |
+
echo '<h2>'; _e('Uninstall Polls', 'wp-polls'); echo'</h2>';
|
618 |
+
echo '<p><strong>';
|
619 |
+
$deactivate_url = "plugins.php?action=deactivate&plugin=polls/polls.php";
|
620 |
+
if(function_exists('wp_nonce_url')) {
|
621 |
+
$deactivate_url = wp_nonce_url($deactivate_url, 'deactivate-plugin_polls/polls.php');
|
622 |
+
}
|
623 |
+
printf(__('<a href="%s">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically.', 'wp-polls'), $deactivate_url);
|
624 |
+
echo '</a>';
|
625 |
+
echo '</strong></p>';
|
626 |
+
echo '</div>';
|
627 |
+
break;
|
628 |
+
// Main Page
|
629 |
+
default:
|
630 |
+
$polls = $wpdb->get_results("SELECT * FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
631 |
+
$total_ans = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->pollsa");
|
632 |
+
$total_votes = 0;
|
633 |
+
?>
|
634 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.stripslashes($text).'</p></div>'; } ?>
|
635 |
+
<!-- Manage Polls -->
|
636 |
+
<div class="wrap">
|
637 |
+
<h2><?php _e('Manage Polls', 'wp-polls'); ?></h2>
|
638 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
639 |
+
<tr>
|
640 |
+
<th scope="col"><?php _e('ID', 'wp-polls'); ?></th>
|
641 |
+
<th scope="col"><?php _e('Question', 'wp-polls'); ?></th>
|
642 |
+
<th scope="col"><?php _e('Total Votes', 'wp-polls'); ?></th>
|
643 |
+
<th scope="col"><?php _e('Date Added', 'wp-polls'); ?></th>
|
644 |
+
<th scope="col"><?php _e('Status', 'wp-polls'); ?></th>
|
645 |
+
<th scope="col" colspan="2"><?php _e('Action', 'wp-polls'); ?></th>
|
646 |
+
</tr>
|
647 |
+
<?php
|
648 |
+
if($polls) {
|
649 |
+
$i = 0;
|
650 |
+
$current_poll = intval(get_settings('poll_currentpoll'));
|
651 |
+
foreach($polls as $poll) {
|
652 |
+
$poll_id = intval($poll->pollq_id);
|
653 |
+
$poll_question = stripslashes($poll->pollq_question);
|
654 |
+
$poll_date = mysql2date(get_settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp));
|
655 |
+
$poll_totalvotes = intval($poll->pollq_totalvotes);
|
656 |
+
$poll_active = intval($poll->pollq_active);
|
657 |
+
if($i%2 == 0) {
|
658 |
+
$style = 'style=\'background-color: #eee\'';
|
659 |
+
} else {
|
660 |
+
$style = 'style=\'background-color: none\'';
|
661 |
+
}
|
662 |
+
if($current_poll > 0) {
|
663 |
+
if($current_poll == $poll_id) {
|
664 |
+
$style = 'style=\'background-color: #b8d4ff\'';
|
665 |
+
}
|
666 |
+
} else {
|
667 |
+
if($i == 0) {
|
668 |
+
$style = 'style=\'background-color: #b8d4ff\'';
|
669 |
+
}
|
670 |
+
}
|
671 |
+
echo "<tr $style>\n";
|
672 |
+
echo "<td><strong>$poll_id</strong></td>\n";
|
673 |
+
echo '<td>';
|
674 |
+
if($current_poll > 0) {
|
675 |
+
if($current_poll == $poll_id) {
|
676 |
+
echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
|
677 |
+
}
|
678 |
+
} elseif($current_poll != -1) {
|
679 |
+
if($i == 0) {
|
680 |
+
echo '<strong>'.__('Displayed:', 'wp-polls').'</strong> ';
|
681 |
+
}
|
682 |
+
}
|
683 |
+
echo "$poll_question</td>\n";
|
684 |
+
echo "<td>$poll_totalvotes</td>\n";
|
685 |
+
echo "<td>$poll_date</td>\n";
|
686 |
+
echo '<td>';
|
687 |
+
if($poll_active == 1) {
|
688 |
+
_e('Open', 'wp-polls');
|
689 |
+
} else {
|
690 |
+
_e('Closed', 'wp-polls');
|
691 |
+
}
|
692 |
+
echo "</td>\n";
|
693 |
+
echo "<td><a href=\"$base_page&mode=edit&id=$poll_id\" class=\"edit\">".__('Edit')."</a></td>\n";
|
694 |
+
echo "<td><a href=\"$base_page&mode=delete&id=$poll_id\" class=\"delete\">".__('Delete')."</a></td>\n";
|
695 |
+
echo '</tr>';
|
696 |
+
$i++;
|
697 |
+
$total_votes+= $poll_totalvotes;
|
698 |
+
|
699 |
+
}
|
700 |
+
} else {
|
701 |
+
echo '<tr><td colspan="7" align="center"><strong>'.__('No Polls Found', 'wp-polls').'</strong></td></tr>';
|
702 |
+
}
|
703 |
+
?>
|
704 |
+
</table>
|
705 |
+
</div>
|
706 |
+
<!-- Add A Poll -->
|
707 |
+
<div class="wrap">
|
708 |
+
<h2><?php _e('Add A Poll', 'wp-polls'); ?></h2>
|
709 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>&mode=add" method="post">
|
710 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
711 |
+
<tr>
|
712 |
+
<th align="left"><?php _e('Question', 'wp-polls') ?></th>
|
713 |
+
<td><input type="text" size="50" maxlength="200" name="pollq_question" /></td>
|
714 |
+
</tr>
|
715 |
+
<tr>
|
716 |
+
<th align="left"><?php _e('No. Of Answers:', 'wp-polls') ?></th>
|
717 |
+
<td>
|
718 |
+
<select size="1" name="poll_noquestion">
|
719 |
+
<?php
|
720 |
+
for($k=2; $k <= 20; $k++) {
|
721 |
+
echo "<option value=\"$k\">$k</option>";
|
722 |
+
}
|
723 |
+
?>
|
724 |
+
</select>
|
725 |
+
</td>
|
726 |
+
</tr>
|
727 |
+
<tr>
|
728 |
+
<td colspan="2" align="center"><input type="submit" name="addpollquestion" value="<?php _e('Add Question', 'wp-polls'); ?>" class="button" /></td>
|
729 |
+
</tr>
|
730 |
+
</table>
|
731 |
+
</form>
|
732 |
+
</div>
|
733 |
+
<!-- Polls Stats -->
|
734 |
+
<div class="wrap">
|
735 |
+
<h2><?php _e('Polls Stats', 'wp-polls'); ?></h2>
|
736 |
+
<table border="0" cellspacing="3" cellpadding="3">
|
737 |
+
<tr>
|
738 |
+
<th align="left"><?php _e('Total Polls:', 'wp-polls'); ?></th>
|
739 |
+
<td align="left"><?php echo $i; ?></td>
|
740 |
+
</tr>
|
741 |
+
<tr>
|
742 |
+
<th align="left"><?php _e('Total Polls\' Answers:', 'wp-polls'); ?></th>
|
743 |
+
<td align="left"><?php echo number_format($total_ans); ?></td>
|
744 |
+
</tr>
|
745 |
+
<tr>
|
746 |
+
<th align="left"><?php _e('Total Votes Casted:', 'wp-polls'); ?></th>
|
747 |
+
<td align="left"><?php echo number_format($total_votes); ?></td>
|
748 |
+
</tr>
|
749 |
+
</table>
|
750 |
+
</div>
|
751 |
+
<!-- Delete Polls Logs -->
|
752 |
+
<div class="wrap">
|
753 |
+
<h2><?php _e('Polls Logs', 'wp-polls'); ?></h2>
|
754 |
+
<div align="center">
|
755 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
756 |
+
<strong><?php _e('Are You Sure You Want To Delete All Polls Logs?', 'wp-polls'); ?></strong><br /><br />
|
757 |
+
<input type="checkbox" name="delete_logs_yes" value="yes" /> <?php _e('Yes'); ?><br /><br />
|
758 |
+
<input type="submit" name="do" value="<?php _e('Delete All Logs', 'wp-polls'); ?>" class="button" onclick="return confirm('<?php _e('You Are About To Delete All Poll Logs.', 'wp-polls'); ?>\n\n<?php _e('This Action Is Not Reversible. Are you sure?', 'wp-polls'); ?>')" />
|
759 |
+
</form>
|
760 |
+
</div>
|
761 |
+
<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>
|
762 |
+
</div>
|
763 |
+
<!-- Uninstall WP-Polls (By: Philippe Corbes) -->
|
764 |
+
<div class="wrap">
|
765 |
+
<h2><?php _e('Uninstall Polls', 'wp-polls'); ?></h2>
|
766 |
+
<div align="center">
|
767 |
+
<form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post">
|
768 |
+
<p style="text-align: left;">
|
769 |
+
<?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'); ?>
|
770 |
+
</p>
|
771 |
+
<p style="text-align: left; color: red">
|
772 |
+
<?php
|
773 |
+
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>")); ?>
|
774 |
+
</p>
|
775 |
+
<input type="checkbox" name="uninstall_poll_yes" value="yes" /> <?php _e('Yes'); ?><br /><br />
|
776 |
+
<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'); ?>')" />
|
777 |
+
</form>
|
778 |
+
</div>
|
779 |
+
</div>
|
780 |
+
<?php
|
781 |
+
} // End switch($mode)
|
782 |
+
?>
|
polls/polls-options.php
ADDED
@@ -0,0 +1,609 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-Polls 2.13 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Configure Poll Options |
|
14 |
+
| - wp-content/plugins/polls/polls-options.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Check Whether User Can Manage Polls
|
21 |
+
if(!current_user_can('manage_polls')) {
|
22 |
+
die('Access Denied');
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
### Variables Variables Variables
|
27 |
+
$base_name = plugin_basename('polls/polls-options.php');
|
28 |
+
$base_page = 'admin.php?page='.$base_name;
|
29 |
+
$id = intval($_GET['id']);
|
30 |
+
|
31 |
+
|
32 |
+
### If Form Is Submitted
|
33 |
+
if($_POST['Submit']) {
|
34 |
+
$poll_bar_style = strip_tags(trim($_POST['poll_bar_style']));
|
35 |
+
$poll_bar_background = strip_tags(trim($_POST['poll_bar_bg']));
|
36 |
+
$poll_bar_border = strip_tags(trim($_POST['poll_bar_border']));
|
37 |
+
$poll_bar_height = intval($_POST['poll_bar_height']);
|
38 |
+
$poll_bar = array('style' => $poll_bar_style, 'background' => $poll_bar_background, 'border' => $poll_bar_border, 'height' => $poll_bar_height);
|
39 |
+
$poll_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']);
|
57 |
+
$poll_logging_method = intval($_POST['poll_logging_method']);
|
58 |
+
$poll_allowtovote = intval($_POST['poll_allowtovote']);
|
59 |
+
$update_poll_queries = array();
|
60 |
+
$update_poll_text = array();
|
61 |
+
$update_poll_queries[] = update_option('poll_bar', $poll_bar);
|
62 |
+
$update_poll_queries[] = update_option('poll_ans_sortby', $poll_ans_sortby);
|
63 |
+
$update_poll_queries[] = update_option('poll_ans_sortorder', $poll_ans_sortorder);
|
64 |
+
$update_poll_queries[] = update_option('poll_ans_result_sortby', $poll_ans_result_sortby);
|
65 |
+
$update_poll_queries[] = update_option('poll_ans_result_sortorder', $poll_ans_result_sortorder);
|
66 |
+
$update_poll_queries[] = update_option('poll_template_voteheader', $poll_template_voteheader);
|
67 |
+
$update_poll_queries[] = update_option('poll_template_votebody', $poll_template_votebody);
|
68 |
+
$update_poll_queries[] = update_option('poll_template_votefooter', $poll_template_votefooter);
|
69 |
+
$update_poll_queries[] = update_option('poll_template_resultheader', $poll_template_resultheader);
|
70 |
+
$update_poll_queries[] = update_option('poll_template_resultbody', $poll_template_resultbody);
|
71 |
+
$update_poll_queries[] = update_option('poll_template_resultbody2', $poll_template_resultbody2);
|
72 |
+
$update_poll_queries[] = update_option('poll_template_resultfooter', $poll_template_resultfooter);
|
73 |
+
$update_poll_queries[] = update_option('poll_template_resultfooter2', $poll_template_resultfooter2);
|
74 |
+
$update_poll_queries[] = update_option('poll_template_disable', $poll_template_disable);
|
75 |
+
$update_poll_queries[] = update_option('poll_template_error', $poll_template_error);
|
76 |
+
$update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage);
|
77 |
+
$update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url);
|
78 |
+
$update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show);
|
79 |
+
$update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll);
|
80 |
+
$update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method);
|
81 |
+
$update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote);
|
82 |
+
$update_poll_text[] = __('Poll Bar Style', 'wp-polls');
|
83 |
+
$update_poll_text[] = __('Sort Poll Answers By Option', 'wp-polls');
|
84 |
+
$update_poll_text[] = __('Sort Order Of Poll Answers Option', 'wp-polls');
|
85 |
+
$update_poll_text[] = __('Sort Poll Results By Option', 'wp-polls');
|
86 |
+
$update_poll_text[] = __('Sort Order Of Poll Results Option', 'wp-polls');
|
87 |
+
$update_poll_text[] = __('Voting Form Header Template', 'wp-polls');
|
88 |
+
$update_poll_text[] = __('Voting Form Body Template', 'wp-polls');
|
89 |
+
$update_poll_text[] = __('Voting Form Footer Template', 'wp-polls');
|
90 |
+
$update_poll_text[] = __('Result Header Template', 'wp-polls');
|
91 |
+
$update_poll_text[] = __('Result Body Template', 'wp-polls');
|
92 |
+
$update_poll_text[] = __('Result Body2 Template', 'wp-polls');
|
93 |
+
$update_poll_text[] = __('Result Footer Template', 'wp-polls');
|
94 |
+
$update_poll_text[] = __('Result Footer2 Template', 'wp-polls');
|
95 |
+
$update_poll_text[] = __('Poll Disabled Template', 'wp-polls');
|
96 |
+
$update_poll_text[] = __('Poll Error Template', 'wp-polls');
|
97 |
+
$update_poll_text[] = __('Archive Polls Per Page Option', 'wp-polls');
|
98 |
+
$update_poll_text[] = __('Polls Archive URL Option', 'wp-polls');
|
99 |
+
$update_poll_text[] = __('Show Polls Achive Link Option', 'wp-polls');
|
100 |
+
$update_poll_text[] = __('Current Active Poll Option', 'wp-polls');
|
101 |
+
$update_poll_text[] = __('Logging Method', 'wp-polls');
|
102 |
+
$update_poll_text[] = __('Allow To Vote Option', 'wp-polls');
|
103 |
+
$i=0;
|
104 |
+
$text = '';
|
105 |
+
foreach($update_poll_queries as $update_poll_query) {
|
106 |
+
if($update_poll_query) {
|
107 |
+
$text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />';
|
108 |
+
}
|
109 |
+
$i++;
|
110 |
+
}
|
111 |
+
if(empty($text)) {
|
112 |
+
$text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>';
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
?>
|
117 |
+
<script type="text/javascript">
|
118 |
+
/* <![CDATA[*/
|
119 |
+
function poll_default_templates(template) {
|
120 |
+
var default_template;
|
121 |
+
switch(template) {
|
122 |
+
case "voteheader":
|
123 |
+
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\">";
|
124 |
+
break;
|
125 |
+
case "votebody":
|
126 |
+
default_template = "<li><label for=\"poll-answer-%POLL_ANSWER_ID%\"><input type=\"radio\" id=\"poll-answer-%POLL_ANSWER_ID%\" name=\"poll_%POLL_ID%\" value=\"%POLL_ANSWER_ID%\" /> %POLL_ANSWER%</label></li>";
|
127 |
+
break;
|
128 |
+
case "votefooter":
|
129 |
+
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>";
|
130 |
+
break;
|
131 |
+
case "resultheader":
|
132 |
+
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\">";
|
133 |
+
break;
|
134 |
+
case "resultbody":
|
135 |
+
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>";
|
136 |
+
break;
|
137 |
+
case "resultbody2":
|
138 |
+
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>";
|
139 |
+
break;
|
140 |
+
case "resultfooter":
|
141 |
+
default_template = "</ul>\n<p style=\"text-align: center;\"><?php _e('Total Votes', 'wp-polls'); ?>: <strong>%POLL_TOTALVOTES%</strong></p>\n</div>";
|
142 |
+
break;
|
143 |
+
case "resultfooter2":
|
144 |
+
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>";
|
145 |
+
break;
|
146 |
+
case "disable":
|
147 |
+
default_template = "<?php _e('Sorry, there are no polls available at the moment.', 'wp-polls'); ?>";
|
148 |
+
break;
|
149 |
+
case "error":
|
150 |
+
default_template = "<?php _e('An error has occurred when processing your poll.', 'wp-polls'); ?>";
|
151 |
+
break;
|
152 |
+
}
|
153 |
+
document.getElementById("poll_template_" + template).value = default_template;
|
154 |
+
}
|
155 |
+
function set_pollbar_height(height) {
|
156 |
+
document.getElementById('poll_bar_height').value = height;
|
157 |
+
}
|
158 |
+
function update_pollbar(where) {
|
159 |
+
pollbar_background = '#' + document.getElementById('poll_bar_bg').value;
|
160 |
+
pollbar_border = '#' + document.getElementById('poll_bar_border').value;
|
161 |
+
pollbar_height = document.getElementById('poll_bar_height').value + 'px';
|
162 |
+
if(where == 'background') {
|
163 |
+
document.getElementById('wp-polls-pollbar-bg').style.backgroundColor = pollbar_background;
|
164 |
+
} else if(where == 'border') {
|
165 |
+
document.getElementById('wp-polls-pollbar-border').style.backgroundColor = pollbar_border;
|
166 |
+
} else if(where == 'style') {
|
167 |
+
pollbar_style_options = document.getElementById('poll_options_form').poll_bar_style;
|
168 |
+
for(i = 0; i < pollbar_style_options.length; i++) {
|
169 |
+
if(pollbar_style_options[i].checked) {
|
170 |
+
pollbar_style = pollbar_style_options[i].value;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
if(pollbar_style == 'use_css') {
|
174 |
+
document.getElementById('wp-polls-pollbar').style.backgroundImage = "";
|
175 |
+
} else {
|
176 |
+
document.getElementById('wp-polls-pollbar').style.backgroundImage = "url('<?php echo get_settings('siteurl'); ?>/wp-content/plugins/polls/images/" + pollbar_style + "/pollbg.gif')";
|
177 |
+
}
|
178 |
+
}
|
179 |
+
document.getElementById('wp-polls-pollbar').style.backgroundColor = pollbar_background;
|
180 |
+
document.getElementById('wp-polls-pollbar').style.border = '1px solid ' + pollbar_border;
|
181 |
+
document.getElementById('wp-polls-pollbar').style.height = pollbar_height;
|
182 |
+
}
|
183 |
+
/* ]]> */
|
184 |
+
</script>
|
185 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
186 |
+
<div class="wrap">
|
187 |
+
<h2><?php _e('Poll Options', 'wp-polls'); ?></h2>
|
188 |
+
<form id="poll_options_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
189 |
+
<fieldset class="options">
|
190 |
+
<legend><?php _e('Poll Bar Style', 'wp-polls'); ?></legend>
|
191 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
192 |
+
<tr valign="top">
|
193 |
+
<th align="left" width="20%"><?php _e('Poll Bar Style', 'wp-polls'); ?></th>
|
194 |
+
<td align="left" colspan="2">
|
195 |
+
<?php
|
196 |
+
$pollbar = get_settings('poll_bar');
|
197 |
+
$pollbar_url = get_settings('siteurl').'/wp-content/plugins/polls/images';
|
198 |
+
$pollbar_path = ABSPATH.'/wp-content/plugins/polls/images';
|
199 |
+
if($handle = @opendir($pollbar_path)) {
|
200 |
+
while (false !== ($filename = readdir($handle))) {
|
201 |
+
if ($filename != '.' && $filename != '..') {
|
202 |
+
if(is_dir($pollbar_path.'/'.$filename)) {
|
203 |
+
$pollbar_info = getimagesize($pollbar_path.'/'.$filename.'/pollbg.gif');
|
204 |
+
if($pollbar['style'] == $filename) {
|
205 |
+
echo '<input type="radio" name="poll_bar_style" value="'.$filename.'" checked="checked" onblur="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />';
|
206 |
+
} else {
|
207 |
+
echo '<input type="radio" name="poll_bar_style" value="'.$filename.'" onblur="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />';
|
208 |
+
}
|
209 |
+
echo ' ';
|
210 |
+
echo '<img src="'.$pollbar_url.'/'.$filename.'/pollbg.gif" height="'.$pollbar_info[1].'" width="100" alt="pollbg.gif" />';
|
211 |
+
echo ' ('.$filename.')';
|
212 |
+
echo '<br /><br />'."\n";
|
213 |
+
}
|
214 |
+
}
|
215 |
+
}
|
216 |
+
closedir($handle);
|
217 |
+
}
|
218 |
+
?>
|
219 |
+
<input type="radio" name="poll_bar_style" value="use_css"<?php checked('use_css', $pollbar['style']); ?> onblur="update_pollbar('style');" /> Use CSS Style
|
220 |
+
</td>
|
221 |
+
</tr>
|
222 |
+
<tr valign="top">
|
223 |
+
<th align="left" width="20%"><?php _e('Poll Bar Background', 'wp-polls'); ?></th>
|
224 |
+
<td align="left" width="10%">#<input type="text" id="poll_bar_bg" name="poll_bar_bg" value="<?php echo $pollbar['background']; ?>" size="6" maxlength="6" onblur="update_pollbar('background');" /></td>
|
225 |
+
<td align="left"><div id="wp-polls-pollbar-bg" style="background-color: #<?php echo $pollbar['background']; ?>;"></div></td>
|
226 |
+
</tr>
|
227 |
+
<tr valign="top">
|
228 |
+
<th align="left" width="20%"><?php _e('Poll Bar Border', 'wp-polls'); ?></th>
|
229 |
+
<td align="left" width="10%">#<input type="text" id="poll_bar_border" name="poll_bar_border" value="<?php echo $pollbar['border']; ?>" size="6" maxlength="6" onblur="update_pollbar('border');" /></td>
|
230 |
+
<td align="left"><div id="wp-polls-pollbar-border" style="background-color: #<?php echo $pollbar['border']; ?>;"></div></td>
|
231 |
+
</tr>
|
232 |
+
<tr valign="top">
|
233 |
+
<th align="left" width="20%"><?php _e('Poll Bar Height', 'wp-polls'); ?></th>
|
234 |
+
<td align="left" colspan="2"><input type="text" id="poll_bar_height" name="poll_bar_height" value="<?php echo $pollbar['height']; ?>" size="2" maxlength="2" onblur="update_pollbar('height');" />px</td>
|
235 |
+
</tr>
|
236 |
+
<tr valign="top">
|
237 |
+
<th align="left" width="20%"><?php _e('Your poll bar will look like this', 'wp-polls'); ?></th>
|
238 |
+
<td align="left" >
|
239 |
+
<?php
|
240 |
+
if($pollbar['style'] == 'use_css') {
|
241 |
+
echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'"></div>'."\n";
|
242 |
+
} else {
|
243 |
+
echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'; background-image: url(\''.get_settings('siteurl').'/wp-content/plugins/polls/images/'.$pollbar['style'].'/pollbg.gif\');"></div>'."\n";
|
244 |
+
}
|
245 |
+
?>
|
246 |
+
</td>
|
247 |
+
</tr>
|
248 |
+
</table>
|
249 |
+
</fieldset>
|
250 |
+
<fieldset class="options">
|
251 |
+
<legend><?php _e('Sorting Of Poll Answers', 'wp-polls'); ?></legend>
|
252 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
253 |
+
<tr valign="top">
|
254 |
+
<th align="left" width="30%"><?php _e('Sort Poll Answers By:', 'wp-polls'); ?></th>
|
255 |
+
<td align="left">
|
256 |
+
<select name="poll_ans_sortby" size="1">
|
257 |
+
<option value="polla_aid"<?php selected('polla_aid', get_settings('poll_ans_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>
|
258 |
+
<option value="polla_answers"<?php selected('polla_answers', get_settings('poll_ans_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>
|
259 |
+
</select>
|
260 |
+
</td>
|
261 |
+
</tr>
|
262 |
+
<tr valign="top">
|
263 |
+
<th align="left" width="30%"><?php _e('Sort Order Of Poll Answers:', 'wp-polls'); ?></th>
|
264 |
+
<td align="left">
|
265 |
+
<select name="poll_ans_sortorder" size="1">
|
266 |
+
<option value="asc"<?php selected('asc', get_settings('poll_ans_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>
|
267 |
+
<option value="desc"<?php selected('desc', get_settings('poll_ans_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>
|
268 |
+
</select>
|
269 |
+
</td>
|
270 |
+
</tr>
|
271 |
+
</table>
|
272 |
+
</fieldset>
|
273 |
+
<fieldset class="options">
|
274 |
+
<legend><?php _e('Sorting Of Poll Results', 'wp-polls'); ?></legend>
|
275 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
276 |
+
<tr valign="top">
|
277 |
+
<th align="left" width="30%"><?php _e('Sort Poll Results By:', 'wp-polls'); ?></th>
|
278 |
+
<td align="left">
|
279 |
+
<select name="poll_ans_result_sortby" size="1">
|
280 |
+
<option value="polla_votes"<?php selected('polla_votes', get_settings('poll_ans_result_sortby')); ?>><?php _e('Votes', 'wp-polls'); ?></option>
|
281 |
+
<option value="polla_aid"<?php selected('polla_aid', get_settings('poll_ans_result_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>
|
282 |
+
<option value="polla_answers"<?php selected('polla_answers', get_settings('poll_ans_result_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>
|
283 |
+
</select>
|
284 |
+
</td>
|
285 |
+
</tr>
|
286 |
+
<tr valign="top">
|
287 |
+
<th align="left" width="30%"><?php _e('Sort Order Of Poll Results:', 'wp-polls'); ?></th>
|
288 |
+
<td align="left">
|
289 |
+
<select name="poll_ans_result_sortorder" size="1">
|
290 |
+
<option value="asc"<?php selected('asc', get_settings('poll_ans_result_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>
|
291 |
+
<option value="desc"<?php selected('desc', get_settings('poll_ans_result_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>
|
292 |
+
</select>
|
293 |
+
</td>
|
294 |
+
</tr>
|
295 |
+
</table>
|
296 |
+
</fieldset>
|
297 |
+
<fieldset class="options">
|
298 |
+
<legend><?php _e('Allow To Vote', 'wp-polls'); ?></legend>
|
299 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
300 |
+
<tr valign="top">
|
301 |
+
<th align="left" width="30%"><?php _e('Who Is Allowed To Vote?', 'wp-polls'); ?></th>
|
302 |
+
<td align="left">
|
303 |
+
<select name="poll_allowtovote" size="1">
|
304 |
+
<option value="0"<?php selected('0', get_settings('poll_allowtovote')); ?>><?php _e('Guests Only', 'wp-polls'); ?></option>
|
305 |
+
<option value="1"<?php selected('1', get_settings('poll_allowtovote')); ?>><?php _e('Registered Users Only', 'wp-polls'); ?></option>
|
306 |
+
<option value="2"<?php selected('2', get_settings('poll_allowtovote')); ?>><?php _e('Registered Users And Guests', 'wp-polls'); ?></option>
|
307 |
+
</select>
|
308 |
+
</td>
|
309 |
+
</tr>
|
310 |
+
</table>
|
311 |
+
</fieldset>
|
312 |
+
<fieldset class="options">
|
313 |
+
<legend><?php _e('Logging Method', 'wp-polls'); ?></legend>
|
314 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
315 |
+
<tr valign="top">
|
316 |
+
<th align="left" width="30%"><?php _e('Poll Logging Method:', 'wp-polls'); ?></th>
|
317 |
+
<td align="left">
|
318 |
+
<select name="poll_logging_method" size="1">
|
319 |
+
<option value="0"<?php selected('0', get_settings('poll_logging_method')); ?>><?php _e('Do Not Log', 'wp-polls'); ?></option>
|
320 |
+
<option value="1"<?php selected('1', get_settings('poll_logging_method')); ?>><?php _e('Logged By Cookie', 'wp-polls'); ?></option>
|
321 |
+
<option value="2"<?php selected('2', get_settings('poll_logging_method')); ?>><?php _e('Logged By IP', 'wp-polls'); ?></option>
|
322 |
+
<option value="3"<?php selected('3', get_settings('poll_logging_method')); ?>><?php _e('Logged By Cookie And IP', 'wp-polls'); ?></option>
|
323 |
+
<option value="4"<?php selected('4', get_settings('poll_logging_method')); ?>><?php _e('Logged By Username', 'wp-polls'); ?></option>
|
324 |
+
</select>
|
325 |
+
</td>
|
326 |
+
</tr>
|
327 |
+
</table>
|
328 |
+
</fieldset>
|
329 |
+
<fieldset class="options">
|
330 |
+
<legend><?php _e('Poll Archive', 'wp-polls'); ?></legend>
|
331 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
332 |
+
<tr valign="top">
|
333 |
+
<th align="left" width="30%"><?php _e('Polls Per Page:', 'wp-polls'); ?></th>
|
334 |
+
<td align="left"><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_settings('poll_archive_perpage')); ?>" size="2" /></td>
|
335 |
+
</tr>
|
336 |
+
<tr valign="top">
|
337 |
+
<th align="left" width="30%"><?php _e('Polls Archive URL:', 'wp-polls'); ?></th>
|
338 |
+
<td align="left"><input type="text" name="poll_archive_url" value="<?php echo get_settings('poll_archive_url'); ?>" size="50" /></td>
|
339 |
+
</tr>
|
340 |
+
<tr valign="top">
|
341 |
+
<th align="left" width="30%"><?php _e('Display Polls Archive Link Below Poll?', 'wp-polls'); ?></th>
|
342 |
+
<td align="left">
|
343 |
+
<select name="poll_archive_show" size="1">
|
344 |
+
<option value="0"<?php selected('0', get_settings('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option>
|
345 |
+
<option value="1"<?php selected('1', get_settings('poll_archive_show')); ?>><?php _e('Yes', 'wp-polls'); ?></option>
|
346 |
+
</select>
|
347 |
+
</td>
|
348 |
+
</tr>
|
349 |
+
</table>
|
350 |
+
</fieldset>
|
351 |
+
<fieldset class="options">
|
352 |
+
<legend><?php _e('Current Active Poll', 'wp-polls'); ?></legend>
|
353 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
354 |
+
<tr valign="top">
|
355 |
+
<th align="left" width="30%"><?php _e('Current Active Poll', 'wp-polls'); ?>:</th>
|
356 |
+
<td align="left">
|
357 |
+
<select name="poll_currentpoll" size="1">
|
358 |
+
<option value="-1"<?php selected(-1, get_settings('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>
|
359 |
+
<option value="-2"<?php selected(-2, get_settings('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>
|
360 |
+
<option value="0"<?php selected(0, get_settings('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>
|
361 |
+
<option value="0"> </option>
|
362 |
+
<?php
|
363 |
+
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
364 |
+
if($polls) {
|
365 |
+
foreach($polls as $poll) {
|
366 |
+
$poll_question = stripslashes($poll->pollq_question);
|
367 |
+
$poll_id = intval($poll->pollq_id);
|
368 |
+
if($poll_id == intval(get_settings('poll_currentpoll'))) {
|
369 |
+
echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n";
|
370 |
+
} else {
|
371 |
+
echo "<option value=\"$poll_id\">$poll_question</option>\n";
|
372 |
+
}
|
373 |
+
}
|
374 |
+
}
|
375 |
+
?>
|
376 |
+
</select>
|
377 |
+
</td>
|
378 |
+
</tr>
|
379 |
+
</table>
|
380 |
+
</fieldset>
|
381 |
+
<fieldset class="options">
|
382 |
+
<legend><?php _e('Template Variables', 'wp-polls'); ?></legend>
|
383 |
+
<table width="100%" border="0" cellspacing="0" cellpadding="5">
|
384 |
+
<tr>
|
385 |
+
<td>
|
386 |
+
<strong>%POLL_ID%</strong><br />
|
387 |
+
<?php _e('Display the poll\'s ID', 'wp-polls'); ?>
|
388 |
+
</td>
|
389 |
+
<td>
|
390 |
+
<strong>%POLL_ANSWER_ID%</strong><br />
|
391 |
+
<?php _e('Display the poll\'s answer ID', 'wp-polls'); ?>
|
392 |
+
</td>
|
393 |
+
</tr>
|
394 |
+
<tr>
|
395 |
+
<td>
|
396 |
+
<strong>%POLL_QUESTION%</strong><br />
|
397 |
+
<?php _e('Display the poll\'s question', 'wp-polls'); ?>
|
398 |
+
</td>
|
399 |
+
<td>
|
400 |
+
<strong>%POLL_ANSWER%</strong><br />
|
401 |
+
<?php _e('Display the poll\'s answer', 'wp-polls'); ?>
|
402 |
+
</td>
|
403 |
+
</tr>
|
404 |
+
<tr>
|
405 |
+
<td>
|
406 |
+
<strong>%POLL_TOTALVOTES%</strong><br />
|
407 |
+
<?php _e('Display the poll\'s total votes', 'wp-polls'); ?>
|
408 |
+
</td>
|
409 |
+
<td>
|
410 |
+
<strong>%POLL_ANSWER_TEXT%</strong><br />
|
411 |
+
<?php _e('Display the poll\'s answer without HTML formatting.', 'wp-polls'); ?>
|
412 |
+
</td>
|
413 |
+
</tr>
|
414 |
+
<tr>
|
415 |
+
<td>
|
416 |
+
<strong>%POLL_RESULT_URL%</strong><br />
|
417 |
+
<?php _e('Displays URL to poll\'s result', 'wp-polls'); ?>
|
418 |
+
</td>
|
419 |
+
<td>
|
420 |
+
<strong>%POLL_ANSWER_VOTES%</strong><br />
|
421 |
+
<?php _e('Display the poll\'s answer votes', 'wp-polls'); ?>
|
422 |
+
</td>
|
423 |
+
</tr>
|
424 |
+
<tr>
|
425 |
+
<td>
|
426 |
+
<strong>%POLL_MOST_ANSWER%</strong><br />
|
427 |
+
<?php _e('Display the poll\'s most voted answer', 'wp-polls'); ?>
|
428 |
+
</td>
|
429 |
+
<td>
|
430 |
+
<strong>%POLL_ANSWER_PERCENTAGE%</strong><br />
|
431 |
+
<?php _e('Display the poll\'s answer percentage', 'wp-polls'); ?>
|
432 |
+
</td>
|
433 |
+
</tr>
|
434 |
+
<tr>
|
435 |
+
<td>
|
436 |
+
<strong>%POLL_MOST_VOTES%</strong><br />
|
437 |
+
<?php _e('Display the poll\'s answer votes for the most voted answer', 'wp-polls'); ?>
|
438 |
+
</td>
|
439 |
+
<td>
|
440 |
+
<strong>%POLL_ANSWER_IMAGEWIDTH%</strong><br />
|
441 |
+
<?php _e('Display the poll\'s answer image width', 'wp-polls'); ?>
|
442 |
+
</td>
|
443 |
+
</tr>
|
444 |
+
<tr>
|
445 |
+
<td>
|
446 |
+
<strong>%POLL_MOST_PERCENTAGE%</strong><br />
|
447 |
+
<?php _e('Display the poll\'s answer percentage for the most voted answer', 'wp-polls'); ?>
|
448 |
+
</td>
|
449 |
+
<td>
|
450 |
+
<strong>%POLL_LEAST_ANSWER%</strong><br />
|
451 |
+
<?php _e('Display the poll\'s least voted answer', 'wp-polls'); ?>
|
452 |
+
</td>
|
453 |
+
</tr>
|
454 |
+
<tr>
|
455 |
+
<td> </td>
|
456 |
+
<td><strong>%POLL_LEAST_VOTES%</strong><br />
|
457 |
+
<?php _e('Display the poll\'s answer votes for the least voted answer', 'wp-polls'); ?>
|
458 |
+
</td>
|
459 |
+
</tr>
|
460 |
+
<tr>
|
461 |
+
<td> </td>
|
462 |
+
<td>
|
463 |
+
<strong>%POLL_LEAST_PERCENTAGE%</strong><br />
|
464 |
+
<?php _e('Display the poll\'s answer percentage for the least voted answer', 'wp-polls'); ?>
|
465 |
+
</td>
|
466 |
+
</tr>
|
467 |
+
</table>
|
468 |
+
</fieldset>
|
469 |
+
<fieldset class="options">
|
470 |
+
<legend><?php _e('Poll Voting Form Templates', 'wp-polls'); ?></legend>
|
471 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
472 |
+
<tr valign="top">
|
473 |
+
<td width="30%" align="left">
|
474 |
+
<strong><?php _e('Voting Form Header:', 'wp-polls'); ?></strong><br /><br /><br />
|
475 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
476 |
+
- %POLL_ID%<br />
|
477 |
+
- %POLL_QUESTION%<br />
|
478 |
+
- %POLL_TOTALVOTES%<br /><br />
|
479 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('voteheader');" class="button" />
|
480 |
+
</td>
|
481 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_voteheader'))); ?></textarea></td>
|
482 |
+
</tr>
|
483 |
+
<tr valign="top">
|
484 |
+
<td width="30%" align="left">
|
485 |
+
<strong><?php _e('Voting Form Body:', 'wp-polls'); ?></strong><br /><br /><br />
|
486 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
487 |
+
- %POLL_ID%<br />
|
488 |
+
- %POLL_ANSWER_ID%<br />
|
489 |
+
- %POLL_ANSWER%<br />
|
490 |
+
- %POLL_ANSWER_VOTES%<br /><br />
|
491 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votebody');" class="button" />
|
492 |
+
</td>
|
493 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_votebody" name="poll_template_votebody"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_votebody'))); ?></textarea></td>
|
494 |
+
</tr>
|
495 |
+
<tr valign="top">
|
496 |
+
<td width="30%" align="left">
|
497 |
+
<strong><?php _e('Voting Form Footer:', 'wp-polls'); ?></strong><br /><br /><br />
|
498 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
499 |
+
- %POLL_ID%<br />
|
500 |
+
- %POLL_RESULT_URL%<br /><br />
|
501 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votefooter');" class="button" />
|
502 |
+
</td>
|
503 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_votefooter'))); ?></textarea></td>
|
504 |
+
</tr>
|
505 |
+
</table>
|
506 |
+
</fieldset>
|
507 |
+
<fieldset class="options">
|
508 |
+
<legend><?php _e('Poll Result Templates', 'wp-polls'); ?></legend>
|
509 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
510 |
+
<tr valign="top">
|
511 |
+
<td width="30%" align="left">
|
512 |
+
<strong><?php _e('Result Header:', 'wp-polls'); ?></strong><br /><br /><br />
|
513 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
514 |
+
- %POLL_ID%<br />
|
515 |
+
- %POLL_QUESTION%<br />
|
516 |
+
- %POLL_TOTALVOTES%<br /><br />
|
517 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultheader');" class="button" />
|
518 |
+
</td>
|
519 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_resultheader'))); ?></textarea></td>
|
520 |
+
</tr>
|
521 |
+
<tr valign="top">
|
522 |
+
<td width="30%" align="left">
|
523 |
+
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Normal', 'wp-polls'); ?><br /><br />
|
524 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
525 |
+
- %POLL_ANSWER_ID%<br />
|
526 |
+
- %POLL_ANSWER%<br />
|
527 |
+
- %POLL_ANSWER_TEXT%<br />
|
528 |
+
- %POLL_ANSWER_VOTES%<br />
|
529 |
+
- %POLL_ANSWER_PERCENTAGE%<br />
|
530 |
+
- %POLL_ANSWER_IMAGEWIDTH%<br /><br />
|
531 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody');" class="button" />
|
532 |
+
</td>
|
533 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_resultbody'))); ?></textarea></td>
|
534 |
+
</tr>
|
535 |
+
<tr valign="top">
|
536 |
+
<td width="30%" align="left">
|
537 |
+
<strong><?php _e('Result Body:', 'wp-polls'); ?></strong><br /><?php _e('Displaying Of User\'s Voted Answer', 'wp-polls'); ?><br /><br />
|
538 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
539 |
+
- %POLL_ANSWER_ID%<br />
|
540 |
+
- %POLL_ANSWER%<br />
|
541 |
+
- %POLL_ANSWER_TEXT%<br />
|
542 |
+
- %POLL_ANSWER_VOTES%<br />
|
543 |
+
- %POLL_ANSWER_PERCENTAGE%<br />
|
544 |
+
- %POLL_ANSWER_IMAGEWIDTH%<br /><br />
|
545 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody2');" class="button" />
|
546 |
+
</td>
|
547 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_resultbody2'))); ?></textarea></td>
|
548 |
+
</tr>
|
549 |
+
<tr valign="top">
|
550 |
+
<td width="30%" align="left">
|
551 |
+
<strong><?php _e('Result Footer:', 'wp-polls'); ?></strong><br /><?php _e('Normal', 'wp-polls'); ?><br /><br />
|
552 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
553 |
+
- %POLL_TOTALVOTES%<br />
|
554 |
+
- %POLL_MOST_ANSWER%<br />
|
555 |
+
- %POLL_MOST_VOTES%<br />
|
556 |
+
- %POLL_MOST_PERCENTAGE%<br />
|
557 |
+
- %POLL_LEAST_ANSWER%<br />
|
558 |
+
- %POLL_LEAST_VOTES%<br />
|
559 |
+
- %POLL_LEAST_PERCENTAGE%<br /><br />
|
560 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter');" class="button" />
|
561 |
+
</td>
|
562 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_resultfooter'))); ?></textarea></td>
|
563 |
+
</tr>
|
564 |
+
<tr valign="top">
|
565 |
+
<td width="30%" align="left">
|
566 |
+
<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 />
|
567 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
568 |
+
- %POLL_ID%<br />
|
569 |
+
- %POLL_TOTALVOTES%<br />
|
570 |
+
- %POLL_MOST_ANSWER%<br />
|
571 |
+
- %POLL_MOST_VOTES%<br />
|
572 |
+
- %POLL_MOST_PERCENTAGE%<br />
|
573 |
+
- %POLL_LEAST_ANSWER%<br />
|
574 |
+
- %POLL_LEAST_VOTES%<br />
|
575 |
+
- %POLL_LEAST_PERCENTAGE%<br /><br />
|
576 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter2');" class="button" />
|
577 |
+
</td>
|
578 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_resultfooter2'))); ?></textarea></td>
|
579 |
+
</tr>
|
580 |
+
</table>
|
581 |
+
</fieldset>
|
582 |
+
<fieldset class="options">
|
583 |
+
<legend><?php _e('Poll Misc Templates', 'wp-polls'); ?></legend>
|
584 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
585 |
+
<tr valign="top">
|
586 |
+
<td width="30%" align="left">
|
587 |
+
<strong><?php _e('Poll Disabled', 'wp-polls'); ?></strong><br /><br /><br />
|
588 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
589 |
+
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
590 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('disable');" class="button" />
|
591 |
+
</td>
|
592 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_disable" name="poll_template_disable"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_disable'))); ?></textarea></td>
|
593 |
+
</tr>
|
594 |
+
<tr valign="top">
|
595 |
+
<td width="30%" align="left">
|
596 |
+
<strong><?php _e('Poll Error', 'wp-polls'); ?></strong><br /><br /><br />
|
597 |
+
<?php _e('Allowed Variables:', 'wp-polls'); ?><br />
|
598 |
+
- <?php _e('N/A', 'wp-polls'); ?><br /><br />
|
599 |
+
<input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('error');" class="button" />
|
600 |
+
</td>
|
601 |
+
<td align="left"><textarea cols="80" rows="10" id="poll_template_error" name="poll_template_error"><?php echo htmlspecialchars(stripslashes(get_settings('poll_template_error'))); ?></textarea></td>
|
602 |
+
</tr>
|
603 |
+
</table>
|
604 |
+
</fieldset>
|
605 |
+
<div align="center">
|
606 |
+
<input type="submit" name="Submit" class="button" value="<?php _e('Update Options'); ?>" /> <input type="button" name="cancel" value="<?php _e('Cancel'); ?>" class="button" onclick="javascript:history.go(-1)" />
|
607 |
+
</div>
|
608 |
+
</form>
|
609 |
+
</div>
|
polls/polls-usage.php
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.0 Plugin: WP-Polls 2.13 |
|
6 |
+
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - How To Use WP-Polls |
|
14 |
+
| - wp-content/plugins/polls/polls-usage.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 |
+
<div class="wrap">
|
26 |
+
<h2><?php _e("General Usage (Without Widget)", 'wp-polls'); ?></h2>
|
27 |
+
<ol>
|
28 |
+
<li>
|
29 |
+
<?php _e("Open ", 'wp-polls'); ?><b>wp-content/themes/<<?php _e("YOUR THEME NAME", 'wp-polls'); ?>>/sidebar.php</b>
|
30 |
+
</li>
|
31 |
+
<li>
|
32 |
+
<?php _e("Add:", 'wp-polls'); ?>
|
33 |
+
<blockquote>
|
34 |
+
<pre class="wp-polls-usage-pre"><?php if (function_exists('vote_poll') && !$in_pollsarchive): ?>
|
35 |
+
<li>
|
36 |
+
<h2>Polls</h2>
|
37 |
+
<ul>
|
38 |
+
<li><?php get_poll();?></li>
|
39 |
+
</ul>
|
40 |
+
<?php display_polls_archive_link(); ?>
|
41 |
+
</li>
|
42 |
+
<?php endif; ?> </pre>
|
43 |
+
</blockquote>
|
44 |
+
<?php _e("To show specific poll, use :", 'wp-polls'); ?>
|
45 |
+
<blockquote><pre class="wp-polls-usage-pre"><?php get_poll(<b>2</b>);?></pre></blockquote>
|
46 |
+
<?php _e("where <b>2</b> is your poll id.", 'wp-polls'); ?>
|
47 |
+
<?php _e("To embed a specific poll in your post, use :", 'wp-polls'); ?>
|
48 |
+
<blockquote><pre class="wp-polls-usage-pre">[poll=<b>2</b>]</pre></blockquote>
|
49 |
+
<?php _e("where <b>2</b> is your poll id.", 'wp-polls'); ?>
|
50 |
+
</li>
|
51 |
+
<li>
|
52 |
+
<?php _e("Scroll down for instructions on how to create <b>Polls Archive</b>.", 'wp-polls'); ?>
|
53 |
+
</li>
|
54 |
+
</ol>
|
55 |
+
</div>
|
56 |
+
<div class="wrap">
|
57 |
+
<h2><?php _e("General Usage (With Widget)", 'wp-polls'); ?></h2>
|
58 |
+
<ol>
|
59 |
+
<li>
|
60 |
+
<?php _e("<b>Activate</b> WP-Polls Widget Plugin", 'wp-polls'); ?>
|
61 |
+
</li>
|
62 |
+
<li>
|
63 |
+
<?php _e("Go to 'WP-Admin -> Presentation -> Sidebar Widgets'", 'wp-polls'); ?>
|
64 |
+
</li>
|
65 |
+
<li>
|
66 |
+
<?php _e("<b>Drag</b> the Polls Widget to your sidebar", 'wp-polls'); ?>
|
67 |
+
</li>
|
68 |
+
<li>
|
69 |
+
<?php _e("You can <b>configure</b> the Polls Widget by clicking on the configure icon", 'wp-polls'); ?>
|
70 |
+
</li>
|
71 |
+
<li>
|
72 |
+
<?php _e("Click 'Save changes'", 'wp-polls'); ?>
|
73 |
+
</li>
|
74 |
+
<li>
|
75 |
+
<?php _e(" down for instructions on how to create a <b>Polls Archive</b>.", 'wp-polls'); ?>
|
76 |
+
</li>
|
77 |
+
</ol>
|
78 |
+
</div>
|
79 |
+
<div class="wrap">
|
80 |
+
<h2><?php _e("Polls Archive", 'wp-polls'); ?></h2>
|
81 |
+
<ol>
|
82 |
+
<li>
|
83 |
+
<?php _e("Go to 'WP-Admin -> Write -> Write Page'", 'wp-polls'); ?>
|
84 |
+
</li>
|
85 |
+
<li>
|
86 |
+
<?php _e("Type any title you like in the post's title area", 'wp-polls'); ?>
|
87 |
+
</li>
|
88 |
+
<li>
|
89 |
+
<?php _e("Type '<b>[page_polls]</b>' in the post's content area (without the quotes)", 'wp-polls'); ?>
|
90 |
+
</li>
|
91 |
+
<li>
|
92 |
+
<?php _e("Type '<b>pollsarchive</b>' in the post's slug area (without the quotes)", 'wp-polls'); ?>
|
93 |
+
</li>
|
94 |
+
<li>
|
95 |
+
<?php _e("Click 'Publish'", 'wp-polls'); ?>
|
96 |
+
</li>
|
97 |
+
<li>
|
98 |
+
<?php _e("If you <b>ARE NOT</b> using nice permalinks, you need to go to 'WP-Admin -> Polls -> Poll Option' and under '<b>Poll Archive -> Polls Archive URL</b>', you need to fill in the URL to the Polls Archive Page you created above.", 'wp-polls'); ?>
|
99 |
+
</li>
|
100 |
+
</ol>
|
101 |
+
</div>
|
102 |
+
<div class="wrap">
|
103 |
+
<h2><?php _e('Polls Stats', 'wp-polls'); ?></h2>
|
104 |
+
<h3><?php _e("To Display Total Polls", 'wp-polls'); ?></h3>
|
105 |
+
<blockquote>
|
106 |
+
<pre class="wp-polls-usage-pre"><?php if (function_exists('get_pollquestions')): ?>
|
107 |
+
<?php get_pollquestions(); ?>
|
108 |
+
<?php endif; ?> </pre>
|
109 |
+
</blockquote>
|
110 |
+
<h3><?php _e("To Display Total Poll Answers", 'wp-polls'); ?></h3>
|
111 |
+
<blockquote>
|
112 |
+
<pre class="wp-polls-usage-pre"><?php if (function_exists('get_pollanswers')): ?>
|
113 |
+
<?php get_pollanswers(); ?>
|
114 |
+
<?php endif; ?> </pre>
|
115 |
+
</blockquote>
|
116 |
+
<h3><?php _e("To Display Total Poll Votes", 'wp-polls'); ?></h3>
|
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>
|
123 |
+
<div class="wrap">
|
124 |
+
<h2><?php _e("Note", 'wp-polls'); ?></h2>
|
125 |
+
<ul>
|
126 |
+
<li>
|
127 |
+
<?php _e("In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,", 'wp-polls'); ?>
|
128 |
+
<ol>
|
129 |
+
<li>
|
130 |
+
<?php _e("Open <b>poll-css.css</b>", 'wp-polls'); ?>
|
131 |
+
</li>
|
132 |
+
<li>
|
133 |
+
<?php _e("Find:", 'wp-polls'); ?>
|
134 |
+
<blockquote><pre class="wp-polls-usage-pre">/* background-color: #ffffff; */</pre></blockquote>
|
135 |
+
</li>
|
136 |
+
<li>
|
137 |
+
<?php _e("Replace:", 'wp-polls'); ?>
|
138 |
+
<blockquote><pre class="wp-polls-usage-pre">background-color: #ffffff;</pre></blockquote>
|
139 |
+
<?php _e("Where <b>#ffffff</b> should be your background color for the poll.", 'wp-polls'); ?>
|
140 |
+
</li>
|
141 |
+
</ol>
|
142 |
+
</li>
|
143 |
+
</ul>
|
144 |
+
<ul>
|
145 |
+
<li>
|
146 |
+
<?php _e("The AJAX feature might not work if your blog homepage directory is different from the directory you installed WordPress in. To solve this issue,"); ?>
|
147 |
+
<ol>
|
148 |
+
<li>
|
149 |
+
<?php _e("Open <b>polls.php</b>", 'wp-polls'); ?>
|
150 |
+
</li>
|
151 |
+
<li>
|
152 |
+
<?php _e("Find:", 'wp-polls'); ?>
|
153 |
+
<blockquote><pre class="wp-polls-usage-pre">echo "\t".'var polls_ajax_url = \''.$polls_ajax_url.'/wp-content/plugins/polls/polls.php\';'."\n";</pre></blockquote>
|
154 |
+
</li>
|
155 |
+
<li>
|
156 |
+
<?php _e("Replace:", 'wp-polls'); ?>
|
157 |
+
<blockquote><pre class="wp-polls-usage-pre">echo "\t".'var polls_ajax_url = \''.$polls_ajax_url.'/WORDPRESS_DIRECTORY/wp-content/plugins/polls/polls.php\';'."\n";</pre></blockquote>
|
158 |
+
<?php _e("Where <b>WORDPRESS_DIRECTORY</b> should be the directory name which you installed WordPress in. Note the backslash after your WordPress Directory, you need that.", 'wp-polls'); ?>
|
159 |
+
</li>
|
160 |
+
</ol>
|
161 |
+
</li>
|
162 |
+
</ul>
|
163 |
+
</div>
|
polls/polls-widget.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP-Polls Widget
|
4 |
+
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
+
Description: Adds a Sidebar Widget To Display Poll From WP-Polls Plugin. You Need To Activate WP-Polls First.
|
6 |
+
Version: 2.13
|
7 |
+
Author: GaMerZ
|
8 |
+
Author URI: http://www.lesterchan.net
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/* Copyright 2006 Lester Chan (email : gamerz84@hotmail.com)
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License as published by
|
16 |
+
the Free Software Foundation; either version 2 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
+
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
+
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
|
30 |
+
### Function: Init WP-Polls Widget
|
31 |
+
function widget_polls_init() {
|
32 |
+
if (!function_exists('register_sidebar_widget')) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
### Function: WP-Polls Widget
|
37 |
+
function widget_polls($args) {
|
38 |
+
global $in_pollsarchive;
|
39 |
+
extract($args);
|
40 |
+
$options = get_option('widget_polls');
|
41 |
+
$title = htmlspecialchars($options['title']);
|
42 |
+
if (function_exists('vote_poll') && !$in_pollsarchive) {
|
43 |
+
echo $before_widget.$before_title.$title.$after_title;
|
44 |
+
get_poll();
|
45 |
+
display_polls_archive_link();
|
46 |
+
echo $after_widget;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
### Function: WP-Polls Widget Options
|
51 |
+
function widget_polls_options() {
|
52 |
+
global $wpdb;
|
53 |
+
$options = get_option('widget_polls');
|
54 |
+
$current_poll = get_settings('poll_currentpoll');
|
55 |
+
if (!is_array($options)) {
|
56 |
+
$options = array('title' => __('Polls', 'wp-polls'));
|
57 |
+
}
|
58 |
+
if ($_POST['polls-submit']) {
|
59 |
+
$poll_currentpoll = intval($_POST['poll_currentpoll']);
|
60 |
+
$poll_archive_show = intval($_POST['poll_archive_show']);
|
61 |
+
$options['title'] = strip_tags(stripslashes($_POST['polls-title']));
|
62 |
+
update_option('widget_polls', $options);
|
63 |
+
update_option('poll_currentpoll', $poll_currentpoll);
|
64 |
+
update_option('poll_archive_show', $poll_archive_show);
|
65 |
+
}
|
66 |
+
echo '<p style="text-align: left;"><label for="polls-title">';
|
67 |
+
_e('Title');
|
68 |
+
echo ': </label><input type="text" id="polls-title" name="polls-title" value="'.htmlspecialchars($options['title']).'" />'."\n";
|
69 |
+
echo '<p style="text-align: left;"><label for="polls-displayarchive">';
|
70 |
+
_e('Display Polls Archive Link Below Poll?', 'wp-polls');
|
71 |
+
echo ' </label>'."\n";
|
72 |
+
echo '<select id="polls-displayarchive" name="poll_archive_show" size="1">'."\n";
|
73 |
+
echo '<option value="0"';
|
74 |
+
selected('0', get_settings('poll_archive_show'));
|
75 |
+
echo '>';
|
76 |
+
_e('No');
|
77 |
+
echo '</option>'."\n";
|
78 |
+
echo '<option value="1"';
|
79 |
+
selected('1', get_settings('poll_archive_show'));
|
80 |
+
echo '>';
|
81 |
+
_e('Yes');
|
82 |
+
echo '</option>'."\n";
|
83 |
+
echo '</select></p>'."\n";
|
84 |
+
echo '<p style="text-align: left;"><label for="poll_currentpoll">';
|
85 |
+
_e('Current Active Poll', 'wp-polls');
|
86 |
+
echo ': </label>'."\n";
|
87 |
+
echo '<select id="poll_currentpoll" name="poll_currentpoll" size="1">'."\n";
|
88 |
+
echo '<option value="-1"';
|
89 |
+
selected(-1, $current_poll);
|
90 |
+
echo '>';
|
91 |
+
_e('Do NOT Display Poll (Disable)', 'wp-polls');
|
92 |
+
echo '</option>'."\n";
|
93 |
+
echo '<option value="-2"';
|
94 |
+
selected(-2, $current_poll);
|
95 |
+
echo '>';
|
96 |
+
_e('Display Random Poll', 'wp-polls');
|
97 |
+
echo '</option>'."\n";
|
98 |
+
echo '<option value="0"';
|
99 |
+
selected(0, $current_poll);
|
100 |
+
echo '>';
|
101 |
+
_e('Display Latest Poll', 'wp-polls');
|
102 |
+
echo '</option>'."\n";
|
103 |
+
echo '<option value="0"> </option>'."\n";
|
104 |
+
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC");
|
105 |
+
if($polls) {
|
106 |
+
foreach($polls as $poll) {
|
107 |
+
$poll_question = stripslashes($poll->pollq_question);
|
108 |
+
$poll_id = intval($poll->pollq_id);
|
109 |
+
if($poll_id == intval($current_poll)) {
|
110 |
+
echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n";
|
111 |
+
} else {
|
112 |
+
echo "<option value=\"$poll_id\">$poll_question</option>\n";
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
echo '</select>'."\n";
|
117 |
+
echo '</p>'."\n";
|
118 |
+
echo '<input type="hidden" id="polls-submit" name="polls-submit" value="1" />'."\n";
|
119 |
+
}
|
120 |
+
|
121 |
+
// Register Widgets
|
122 |
+
register_sidebar_widget(array('Polls', 'wp-polls'), 'widget_polls');
|
123 |
+
register_widget_control(array('Polls', 'wp-polls'), 'widget_polls_options', 400, 150);
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
### Function: Load The WP-Polls Widget
|
128 |
+
add_action('plugins_loaded', 'widget_polls_init');
|
129 |
+
?>
|
polls/polls.php
ADDED
@@ -0,0 +1,1032 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP-Polls
|
4 |
+
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
+
Description: Adds A Poll Feature To WordPress
|
6 |
+
Version: 2.13
|
7 |
+
Author: GaMerZ
|
8 |
+
Author URI: http://www.lesterchan.net
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/* Copyright 2006 Lester Chan (email : gamerz84@hotmail.com)
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License as published by
|
16 |
+
the Free Software Foundation; either version 2 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
+
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
+
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
|
30 |
+
### Load WP-Config File If This File Is Called Directly
|
31 |
+
if (!function_exists('add_action')) {
|
32 |
+
require_once('../../../wp-config.php');
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
### Create Text Domain For Translations
|
37 |
+
load_plugin_textdomain('wp-polls', 'wp-content/plugins/polls');
|
38 |
+
|
39 |
+
|
40 |
+
### Polls Table Name
|
41 |
+
$wpdb->pollsq = $table_prefix.'pollsq';
|
42 |
+
$wpdb->pollsa = $table_prefix.'pollsa';
|
43 |
+
$wpdb->pollsip = $table_prefix.'pollsip';
|
44 |
+
|
45 |
+
|
46 |
+
### Function: Poll Administration Menu
|
47 |
+
add_action('admin_menu', 'poll_menu');
|
48 |
+
function poll_menu() {
|
49 |
+
if (function_exists('add_menu_page')) {
|
50 |
+
add_menu_page(__('Polls', 'wp-polls'), __('Polls', 'wp-polls'), 'manage_polls', 'polls/polls-manager.php');
|
51 |
+
}
|
52 |
+
if (function_exists('add_submenu_page')) {
|
53 |
+
add_submenu_page('polls/polls-manager.php', __('Manage Polls', 'wp-polls'), __('Manage Polls', 'wp-polls'), 'manage_polls', 'polls/polls-manager.php');
|
54 |
+
add_submenu_page('polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'polls/polls-options.php');
|
55 |
+
add_submenu_page('polls/polls-manager.php', __('Poll Usage', 'wp-polls'), __('Poll Usage', 'wp-polls'), 'manage_polls', 'polls/polls-usage.php');
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
### Function: Get Poll
|
61 |
+
function get_poll($temp_poll_id = 0, $display = true) {
|
62 |
+
global $wpdb, $polls_loaded;
|
63 |
+
// Poll Result Link
|
64 |
+
$pollresult_id = intval($_GET['pollresult']);
|
65 |
+
// Check Whether Poll Is Disabled
|
66 |
+
if(intval(get_settings('poll_currentpoll')) == -1) {
|
67 |
+
if($display) {
|
68 |
+
echo stripslashes(get_settings('poll_template_disable'));
|
69 |
+
return;
|
70 |
+
} else {
|
71 |
+
return stripslashes(get_settings('poll_template_disable'));
|
72 |
+
}
|
73 |
+
// Poll Is Enabled
|
74 |
+
} else {
|
75 |
+
// Hardcoded Poll ID Is Not Specified
|
76 |
+
if(intval($temp_poll_id) == 0) {
|
77 |
+
// Random Poll
|
78 |
+
if(intval(get_settings('poll_currentpoll')) == -2) {
|
79 |
+
$random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq ORDER BY RAND() LIMIT 1");
|
80 |
+
$poll_id = intval($random_poll_id);
|
81 |
+
if($pollresult_id > 0) {
|
82 |
+
$poll_id = $pollresult_id;
|
83 |
+
} elseif(intval($_POST['poll_id']) > 0) {
|
84 |
+
$poll_id = intval($_POST['poll_id']);
|
85 |
+
}
|
86 |
+
// Current Poll ID Is Not Specified
|
87 |
+
} elseif(intval(get_settings('poll_currentpoll')) == 0) {
|
88 |
+
// Get Lastest Poll ID
|
89 |
+
$poll_id = intval(get_settings('poll_latestpoll'));
|
90 |
+
} else {
|
91 |
+
// Get Current Poll ID
|
92 |
+
$poll_id = intval(get_settings('poll_currentpoll'));
|
93 |
+
}
|
94 |
+
// Get Hardcoded Poll ID
|
95 |
+
} else {
|
96 |
+
$poll_id = intval($temp_poll_id);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
// Assign All Loaded Poll To $polls_loaded
|
101 |
+
if(empty($polls_loaded)) {
|
102 |
+
$polls_loaded = array();
|
103 |
+
}
|
104 |
+
if(!in_array($poll_id, $polls_loaded)) {
|
105 |
+
$polls_loaded[] = $poll_id;
|
106 |
+
}
|
107 |
+
|
108 |
+
// User Click on View Results Link
|
109 |
+
if($pollresult_id == $poll_id) {
|
110 |
+
if($display) {
|
111 |
+
echo display_pollresult($poll_id);
|
112 |
+
return;
|
113 |
+
} else {
|
114 |
+
return display_pollresult($poll_id);
|
115 |
+
}
|
116 |
+
// Check Whether User Has Voted
|
117 |
+
} else {
|
118 |
+
$poll_active = $wpdb->get_var("SELECT pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
119 |
+
$poll_active = intval($poll_active);
|
120 |
+
$check_voted = check_voted($poll_id);
|
121 |
+
if($check_voted > 0 || $poll_active == 0 || !check_allowtovote()) {
|
122 |
+
if($display) {
|
123 |
+
echo display_pollresult($poll_id, $check_voted);
|
124 |
+
return;
|
125 |
+
} else {
|
126 |
+
return display_pollresult($poll_id, $check_voted);
|
127 |
+
}
|
128 |
+
} else {
|
129 |
+
if($display) {
|
130 |
+
echo display_pollvote($poll_id);
|
131 |
+
return;
|
132 |
+
} else {
|
133 |
+
return display_pollvote($poll_id);
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
### Function: Displays Polls Header
|
141 |
+
add_action('wp_head', 'poll_header');
|
142 |
+
function poll_header() {
|
143 |
+
if(strpos($_SERVER['SCRIPT_NAME'], 'cgi') === false) {
|
144 |
+
$polls_ajax_url = dirname($_SERVER['SCRIPT_NAME']);
|
145 |
+
} else {
|
146 |
+
$polls_ajax_url = dirname($_SERVER['PHP_SELF']);
|
147 |
+
}
|
148 |
+
if(substr($polls_ajax_url, -1) == '/') {
|
149 |
+
$polls_ajax_url = substr($polls_ajax_url, 0, -1);
|
150 |
+
}
|
151 |
+
echo "\n".'<!-- Start Of Script Generated By WP-Polls 2.13 -->'."\n";
|
152 |
+
echo '<script type="text/javascript">'."\n";
|
153 |
+
echo '/* <![CDATA[ */'."\n";
|
154 |
+
echo "\t".'var polls_ajax_url = \''.$polls_ajax_url.'/wp-content/plugins/polls/polls.php\';'."\n";
|
155 |
+
echo "\t".'var polls_text_wait = \''.__('Your last request is still being processed. Please wait a while ...', 'wp-polls').'\';'."\n";
|
156 |
+
echo "\t".'var polls_text_valid = \''.__('Please choose a valid poll answer.', 'wp-polls').'\';'."\n";
|
157 |
+
echo '/* ]]> */'."\n";
|
158 |
+
echo '</script>'."\n";
|
159 |
+
echo '<script src="'.get_settings('siteurl').'/wp-includes/js/tw-sack.js" type="text/javascript"></script>'."\n";
|
160 |
+
echo '<script src="'.get_settings('siteurl').'/wp-content/plugins/polls/polls-js.js" type="text/javascript"></script>'."\n";
|
161 |
+
echo '<link rel="stylesheet" href="'.get_settings('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";
|
162 |
+
echo '<style type="text/css">'."\n";
|
163 |
+
$pollbar = get_settings('poll_bar');
|
164 |
+
if($pollbar['style'] == 'use_css') {
|
165 |
+
echo '.wp-polls .pollbar {'."\n";
|
166 |
+
echo "\t".'margin: 1px;'."\n";
|
167 |
+
echo "\t".'font-size: '.($pollbar['height']-2).';'."\n";
|
168 |
+
echo "\t".'line-height: '.$pollbar['height'].'px;'."\n";
|
169 |
+
echo "\t".'height: '.$pollbar['height'].'px;'."\n";
|
170 |
+
echo "\t".'background: #'.$pollbar['background'].';'."\n";
|
171 |
+
echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n";
|
172 |
+
echo '}'."\n";
|
173 |
+
} else {
|
174 |
+
echo '.wp-polls .pollbar {'."\n";
|
175 |
+
echo "\t".'margin: 1px;'."\n";
|
176 |
+
echo "\t".'font-size: '.($pollbar['height']-2).';'."\n";
|
177 |
+
echo "\t".'line-height: '.$pollbar['height'].'px;'."\n";
|
178 |
+
echo "\t".'height: '.$pollbar['height'].'px;'."\n";
|
179 |
+
echo "\t".'background-image: url(\''.get_settings('siteurl').'/wp-content/plugins/polls/images/'.$pollbar['style'].'/pollbg.gif\');'."\n";
|
180 |
+
echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n";
|
181 |
+
echo '}'."\n";
|
182 |
+
}
|
183 |
+
echo '</style>'."\n";
|
184 |
+
echo '<!-- End Of Script Generated By WP-Polls 2.13 -->'."\n";
|
185 |
+
}
|
186 |
+
|
187 |
+
|
188 |
+
### Function: Displays Polls Header In WP-Admin
|
189 |
+
add_action('admin_head', 'poll_header_admin');
|
190 |
+
function poll_header_admin() {
|
191 |
+
echo '<link rel="stylesheet" href="'.get_settings('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
### Function: Check Who Is Allow To Vote
|
196 |
+
function check_allowtovote() {
|
197 |
+
global $user_ID;
|
198 |
+
$user_ID = intval($user_ID);
|
199 |
+
$allow_to_vote = intval(get_settings('poll_allowtovote'));
|
200 |
+
switch($allow_to_vote) {
|
201 |
+
// Guests Only
|
202 |
+
case 0:
|
203 |
+
if($user_ID > 0) {
|
204 |
+
return false;
|
205 |
+
}
|
206 |
+
return true;
|
207 |
+
break;
|
208 |
+
// Registered Users Only
|
209 |
+
case 1:
|
210 |
+
if($user_ID == 0) {
|
211 |
+
return false;
|
212 |
+
}
|
213 |
+
return true;
|
214 |
+
break;
|
215 |
+
// Registered Users And Guests
|
216 |
+
case 2:
|
217 |
+
default:
|
218 |
+
return true;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
|
223 |
+
### Funcrion: Check Voted By Cookie Or IP
|
224 |
+
function check_voted($poll_id) {
|
225 |
+
$poll_logging_method = intval(get_settings('poll_logging_method'));
|
226 |
+
switch($poll_logging_method) {
|
227 |
+
// Do Not Log
|
228 |
+
case 0:
|
229 |
+
return 0;
|
230 |
+
break;
|
231 |
+
// Logged By Cookie
|
232 |
+
case 1:
|
233 |
+
return check_voted_cookie($poll_id);
|
234 |
+
break;
|
235 |
+
// Logged By IP
|
236 |
+
case 2:
|
237 |
+
return check_voted_ip($poll_id);
|
238 |
+
break;
|
239 |
+
// Logged By Cookie And IP
|
240 |
+
case 3:
|
241 |
+
$check_voted_cookie = check_voted_cookie($poll_id);
|
242 |
+
if($check_voted_cookie > 0) {
|
243 |
+
return $check_voted_cookie;
|
244 |
+
} else {
|
245 |
+
return check_voted_ip($poll_id);
|
246 |
+
}
|
247 |
+
break;
|
248 |
+
// Logged By Username
|
249 |
+
case 4:
|
250 |
+
return check_voted_username($poll_id);
|
251 |
+
break;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
|
256 |
+
### Function: Check Voted By Cookie
|
257 |
+
function check_voted_cookie($poll_id) {
|
258 |
+
// 0: False | > 0: True
|
259 |
+
return intval($_COOKIE["voted_$poll_id"]);
|
260 |
+
}
|
261 |
+
|
262 |
+
|
263 |
+
### Function: Check Voted By IP
|
264 |
+
function check_voted_ip($poll_id) {
|
265 |
+
global $wpdb;
|
266 |
+
// Check IP From IP Logging Database
|
267 |
+
$get_voted_aid = $wpdb->get_var("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."'");
|
268 |
+
// 0: False | > 0: True
|
269 |
+
return intval($get_voted_aid);
|
270 |
+
}
|
271 |
+
|
272 |
+
|
273 |
+
### Function: Check Voted By Username
|
274 |
+
function check_voted_username($poll_id) {
|
275 |
+
global $wpdb, $user_ID;
|
276 |
+
// Check IP If User Is Guest
|
277 |
+
if ($user_ID == 0) {
|
278 |
+
return check_voted_ip($poll_id);
|
279 |
+
}
|
280 |
+
$pollsip_userid = intval($user_ID);
|
281 |
+
// Check User ID From IP Logging Database
|
282 |
+
$get_voted_aid = $wpdb->get_var("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid = $pollsip_userid");
|
283 |
+
// 0: False | > 0: True
|
284 |
+
return intval($get_voted_aid);
|
285 |
+
}
|
286 |
+
|
287 |
+
|
288 |
+
### Function: Display Voting Form
|
289 |
+
function display_pollvote($poll_id, $without_poll_title = false) {
|
290 |
+
global $wpdb;
|
291 |
+
// Temp Poll Result
|
292 |
+
$temp_pollvote = '';
|
293 |
+
// Get Poll Question Data
|
294 |
+
$poll_question = $wpdb->get_row("SELECT pollq_id, pollq_question, pollq_totalvotes FROM $wpdb->pollsq WHERE pollq_id = $poll_id LIMIT 1");
|
295 |
+
// Poll Question Variables
|
296 |
+
$poll_question_text = stripslashes($poll_question->pollq_question);
|
297 |
+
$poll_question_id = intval($poll_question->pollq_id);
|
298 |
+
$poll_question_totalvotes = intval($poll_question->pollq_totalvotes);
|
299 |
+
$template_question = stripslashes(get_settings('poll_template_voteheader'));
|
300 |
+
$template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
|
301 |
+
$template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
|
302 |
+
$template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
|
303 |
+
// Get Poll Answers Data
|
304 |
+
$poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_settings('poll_ans_sortby').' '.get_settings('poll_ans_sortorder'));
|
305 |
+
// If There Is Poll Question With Answers
|
306 |
+
if($poll_question && $poll_answers) {
|
307 |
+
// Display Poll Voting Form
|
308 |
+
if(!$without_poll_title) {
|
309 |
+
$temp_pollvote .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
|
310 |
+
$temp_pollvote .= "\t<form id=\"polls_form_$poll_question_id\" action=\"$_SERVER[REQUEST_URI]\" method=\"post\">\n";
|
311 |
+
$temp_pollvote .= "\t\t<p><input type=\"hidden\" name=\"poll_id\" value=\"$poll_question_id\" /></p>\n";
|
312 |
+
// Print Out Voting Form Header Template
|
313 |
+
$temp_pollvote .= "\t\t$template_question\n";
|
314 |
+
}
|
315 |
+
foreach($poll_answers as $poll_answer) {
|
316 |
+
// Poll Answer Variables
|
317 |
+
$poll_answer_id = intval($poll_answer->polla_aid);
|
318 |
+
$poll_answer_text = stripslashes($poll_answer->polla_answers);
|
319 |
+
$poll_answer_votes = intval($poll_answer->polla_votes);
|
320 |
+
$template_answer = stripslashes(get_settings('poll_template_votebody'));
|
321 |
+
$template_answer = str_replace("%POLL_ID%", $poll_question_id, $template_answer);
|
322 |
+
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
323 |
+
$template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
|
324 |
+
$template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format($poll_answer_votes), $template_answer);
|
325 |
+
// Print Out Voting Form Body Template
|
326 |
+
$temp_pollvote .= "\t\t$template_answer\n";
|
327 |
+
}
|
328 |
+
// Determine Poll Result URL
|
329 |
+
$poll_result_url = $_SERVER['REQUEST_URI'];
|
330 |
+
$poll_result_url = preg_replace('/pollresult=(\d+)/i', 'pollresult='.$poll_question_id, $poll_result_url);
|
331 |
+
if(intval($_GET['pollresult']) == 0) {
|
332 |
+
if(strpos($poll_result_url, '?') !== false) {
|
333 |
+
$poll_result_url = "$poll_result_url&pollresult=$poll_question_id";
|
334 |
+
} else {
|
335 |
+
$poll_result_url = "$poll_result_url?pollresult=$poll_question_id";
|
336 |
+
}
|
337 |
+
}
|
338 |
+
// Voting Form Footer Variables
|
339 |
+
$template_footer = stripslashes(get_settings('poll_template_votefooter'));
|
340 |
+
$template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
|
341 |
+
$template_footer = str_replace("%POLL_RESULT_URL%", $poll_result_url, $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 |
+
$temp_pollvote .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".get_settings('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";
|
348 |
+
}
|
349 |
+
} else {
|
350 |
+
$temp_pollvote .= stripslashes(get_settings('poll_template_disable'));
|
351 |
+
}
|
352 |
+
// Return Poll Vote Template
|
353 |
+
return $temp_pollvote;
|
354 |
+
}
|
355 |
+
|
356 |
+
|
357 |
+
### Function: Display Results Form
|
358 |
+
function display_pollresult($poll_id, $user_voted = 0, $without_poll_title = false) {
|
359 |
+
global $wpdb;
|
360 |
+
// Temp Poll Result
|
361 |
+
$temp_pollresult = '';
|
362 |
+
// Most/Least Variables
|
363 |
+
$poll_most_answer = '';
|
364 |
+
$poll_most_votes = 0;
|
365 |
+
$poll_most_percentage = 0;
|
366 |
+
$poll_least_answer = '';
|
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 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 |
+
$template_question = stripslashes(get_settings('poll_template_resultheader'));
|
377 |
+
$template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question);
|
378 |
+
$template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question);
|
379 |
+
$template_question = str_replace("%POLL_TOTALVOTES%", $poll_question_totalvotes, $template_question);
|
380 |
+
// Get Poll Answers Data
|
381 |
+
$poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_settings('poll_ans_result_sortby').' '.get_settings('poll_ans_result_sortorder'));
|
382 |
+
// If There Is Poll Question With Answers
|
383 |
+
if($poll_question && $poll_answers) {
|
384 |
+
// Is The Poll Total Votes 0?
|
385 |
+
$poll_totalvotes_zero = true;
|
386 |
+
if($poll_question_totalvotes > 0) {
|
387 |
+
$poll_totalvotes_zero = false;
|
388 |
+
}
|
389 |
+
// Print Out Result Header Template
|
390 |
+
if(!$without_poll_title) {
|
391 |
+
$temp_pollresult .= "<div id=\"polls-$poll_question_id\" class=\"wp-polls\">\n";
|
392 |
+
$temp_pollresult .= "\t\t$template_question\n";
|
393 |
+
}
|
394 |
+
foreach($poll_answers as $poll_answer) {
|
395 |
+
// Poll Answer Variables
|
396 |
+
$poll_answer_id = intval($poll_answer->polla_aid);
|
397 |
+
$poll_answer_text = stripslashes($poll_answer->polla_answers);
|
398 |
+
$poll_answer_votes = intval($poll_answer->polla_votes);
|
399 |
+
$poll_answer_percentage = 0;
|
400 |
+
$poll_answer_imagewidth = 0;
|
401 |
+
// Calculate Percentage And Image Bar Width
|
402 |
+
if(!$poll_totalvotes_zero) {
|
403 |
+
if($poll_answer_votes > 0) {
|
404 |
+
$poll_answer_percentage = round((($poll_answer_votes/$poll_question_totalvotes)*100));
|
405 |
+
$poll_answer_imagewidth = round($poll_answer_percentage);
|
406 |
+
if($poll_answer_imagewidth == 100) {
|
407 |
+
$poll_answer_imagewidth = 99;
|
408 |
+
}
|
409 |
+
} else {
|
410 |
+
$poll_answer_percentage = 0;
|
411 |
+
$poll_answer_imagewidth = 1;
|
412 |
+
}
|
413 |
+
} else {
|
414 |
+
$poll_answer_percentage = 0;
|
415 |
+
$poll_answer_imagewidth = 1;
|
416 |
+
}
|
417 |
+
// Let User See What Options They Voted
|
418 |
+
if($user_voted == $poll_answer_id) {
|
419 |
+
// Results Body Variables
|
420 |
+
$template_answer = stripslashes(get_settings('poll_template_resultbody2'));
|
421 |
+
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
422 |
+
$template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
|
423 |
+
$template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($poll_answer_text)), $template_answer);
|
424 |
+
$template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format($poll_answer_votes), $template_answer);
|
425 |
+
$template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
|
426 |
+
$template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
|
427 |
+
// Print Out Results Body Template
|
428 |
+
$temp_pollresult .= "\t\t$template_answer\n";
|
429 |
+
} else {
|
430 |
+
// Results Body Variables
|
431 |
+
$template_answer = stripslashes(get_settings('poll_template_resultbody'));
|
432 |
+
$template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer);
|
433 |
+
$template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer);
|
434 |
+
$template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($poll_answer_text)), $template_answer);
|
435 |
+
$template_answer = str_replace("%POLL_ANSWER_VOTES%", number_format($poll_answer_votes), $template_answer);
|
436 |
+
$template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
|
437 |
+
$template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
|
438 |
+
// Print Out Results Body Template
|
439 |
+
$temp_pollresult .= "\t\t$template_answer\n";
|
440 |
+
}
|
441 |
+
// Get Most Voted Data
|
442 |
+
if($poll_answer_votes > $poll_most_votes) {
|
443 |
+
$poll_most_answer = $poll_answer_text;
|
444 |
+
$poll_most_votes = $poll_answer_votes;
|
445 |
+
$poll_most_percentage = $poll_answer_percentage;
|
446 |
+
}
|
447 |
+
// Get Least Voted Data
|
448 |
+
if($poll_least_votes == 0) {
|
449 |
+
$poll_least_votes = $poll_answer_votes;
|
450 |
+
}
|
451 |
+
if($poll_answer_votes <= $poll_least_votes) {
|
452 |
+
$poll_least_answer = $poll_answer_text;
|
453 |
+
$poll_least_votes = $poll_answer_votes;
|
454 |
+
$poll_least_percentage = $poll_answer_percentage;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
// Results Footer Variables
|
458 |
+
if($user_voted > 0 || $poll_question_active == 0 || !check_allowtovote()) {
|
459 |
+
$template_footer = stripslashes(get_settings('poll_template_resultfooter'));
|
460 |
+
} else {
|
461 |
+
$template_footer = stripslashes(get_settings('poll_template_resultfooter2'));
|
462 |
+
}
|
463 |
+
$template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer);
|
464 |
+
$template_footer = str_replace("%POLL_TOTALVOTES%", number_format($poll_question_totalvotes), $template_footer);
|
465 |
+
$template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
|
466 |
+
$template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer);
|
467 |
+
$template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
|
468 |
+
$template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
|
469 |
+
$template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer);
|
470 |
+
$template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
|
471 |
+
// Print Out Results Footer Template
|
472 |
+
$temp_pollresult .= "\t\t$template_footer\n";
|
473 |
+
if(!$without_poll_title) {
|
474 |
+
$temp_pollresult .= "</div>\n";
|
475 |
+
$temp_pollresult .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".get_settings('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";
|
476 |
+
}
|
477 |
+
} else {
|
478 |
+
$temp_pollresult .= stripslashes(get_settings('poll_template_disable'));
|
479 |
+
}
|
480 |
+
// Return Poll Result
|
481 |
+
return $temp_pollresult;
|
482 |
+
}
|
483 |
+
|
484 |
+
|
485 |
+
### Function: Get IP Address
|
486 |
+
if(!function_exists('get_ipaddress')) {
|
487 |
+
function get_ipaddress() {
|
488 |
+
if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
|
489 |
+
$ip_address = $_SERVER["REMOTE_ADDR"];
|
490 |
+
} else {
|
491 |
+
$ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
|
492 |
+
}
|
493 |
+
if(strpos($ip_address, ',') !== false) {
|
494 |
+
$ip_address = explode(',', $ip_address);
|
495 |
+
$ip_address = $ip_address[0];
|
496 |
+
}
|
497 |
+
return $ip_address;
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
+
|
502 |
+
### Function: Place Polls Archive In Content
|
503 |
+
add_filter('the_content', 'place_pollsarchive', '7');
|
504 |
+
function place_pollsarchive($content){
|
505 |
+
$content = preg_replace( "/\[page_polls\]/ise", "polls_archive()", $content);
|
506 |
+
return $content;
|
507 |
+
}
|
508 |
+
|
509 |
+
|
510 |
+
### Function: Place Poll In Content (By: Robert Accettura Of http://robert.accettura.com/)
|
511 |
+
add_filter('the_content', 'place_poll', '7');
|
512 |
+
function place_poll($content){
|
513 |
+
$content = preg_replace( "/\[poll=(\d+)\]/ise", "display_poll('\\1')", $content);
|
514 |
+
return $content;
|
515 |
+
}
|
516 |
+
|
517 |
+
|
518 |
+
### Function: Display The Poll In Content (By: Robert Accettura Of http://robert.accettura.com/)
|
519 |
+
function display_poll($poll_id){
|
520 |
+
return get_poll($poll_id, false);
|
521 |
+
}
|
522 |
+
|
523 |
+
|
524 |
+
### Function: Get Poll Total Questions
|
525 |
+
if(!function_exists('get_pollquestions')) {
|
526 |
+
function get_pollquestions($display = true) {
|
527 |
+
global $wpdb;
|
528 |
+
$totalpollq = $wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq");
|
529 |
+
if($display) {
|
530 |
+
echo number_format($totalpollq);
|
531 |
+
} else {
|
532 |
+
return number_format($totalpollq);
|
533 |
+
}
|
534 |
+
}
|
535 |
+
}
|
536 |
+
|
537 |
+
|
538 |
+
### Function: Get Poll Total Answers
|
539 |
+
if(!function_exists('get_pollanswers')) {
|
540 |
+
function get_pollanswers($display = true) {
|
541 |
+
global $wpdb;
|
542 |
+
$totalpolla = $wpdb->get_var("SELECT COUNT(polla_aid) FROM $wpdb->pollsa");
|
543 |
+
if($display) {
|
544 |
+
echo number_format($totalpolla);
|
545 |
+
} else {
|
546 |
+
return number_format($totalpolla);
|
547 |
+
}
|
548 |
+
}
|
549 |
+
}
|
550 |
+
|
551 |
+
|
552 |
+
### Function: Get Poll Total Votes
|
553 |
+
if(!function_exists('get_pollvotes')) {
|
554 |
+
function get_pollvotes($display = true) {
|
555 |
+
global $wpdb;
|
556 |
+
$totalpollip = $wpdb->get_var("SELECT COUNT(pollip_id) FROM $wpdb->pollsip");
|
557 |
+
if($display) {
|
558 |
+
echo number_format($totalpollip);
|
559 |
+
} else {
|
560 |
+
return number_format($totalpollip);
|
561 |
+
}
|
562 |
+
}
|
563 |
+
}
|
564 |
+
|
565 |
+
|
566 |
+
### Function: Check Voted To Get Voted Answer
|
567 |
+
function check_voted_multiple($poll_id) {
|
568 |
+
global $polls_ips;
|
569 |
+
$temp_voted_aid = 0;
|
570 |
+
if(intval($_COOKIE["voted_$poll_id"]) > 0) {
|
571 |
+
$temp_voted_aid = intval($_COOKIE["voted_$poll_id"]);
|
572 |
+
} else {
|
573 |
+
if($polls_ips) {
|
574 |
+
foreach($polls_ips as $polls_ip) {
|
575 |
+
if($polls_ip['qid'] == $poll_id) {
|
576 |
+
$temp_voted_aid = $polls_ip['aid'];
|
577 |
+
}
|
578 |
+
}
|
579 |
+
}
|
580 |
+
}
|
581 |
+
return $temp_voted_aid;
|
582 |
+
}
|
583 |
+
|
584 |
+
|
585 |
+
### Function: Polls Archive Link
|
586 |
+
function polls_archive_link($page) {
|
587 |
+
$current_url = $_SERVER['REQUEST_URI'];
|
588 |
+
$curren_pollpage = intval($_GET['poll_page']);
|
589 |
+
$polls_archive_url = preg_replace('/poll_page=(\d+)/i', 'poll_page='.$page, $current_url);
|
590 |
+
if($curren_pollpage == 0) {
|
591 |
+
if(strpos($current_url, '?') !== false) {
|
592 |
+
$polls_archive_url = "$polls_archive_url&poll_page=$page";
|
593 |
+
} else {
|
594 |
+
$polls_archive_url = "$polls_archive_url?poll_page=$page";
|
595 |
+
}
|
596 |
+
}
|
597 |
+
return $polls_archive_url;
|
598 |
+
}
|
599 |
+
|
600 |
+
|
601 |
+
### Function: Displays Polls Archive Link
|
602 |
+
function display_polls_archive_link($display = true) {
|
603 |
+
if(intval(get_settings('poll_archive_show')) == 1) {
|
604 |
+
if($display) {
|
605 |
+
echo "<ul>\n<li><a href=\"".get_settings('poll_archive_url')."\">".__('Polls Archive', 'wp-polls')."</a></li></ul>\n";
|
606 |
+
} else{
|
607 |
+
return "<ul>\n<li><a href=\"".get_settings('poll_archive_url')."\">".__('Polls Archive', 'wp-polls')."</a></li></ul>\n";
|
608 |
+
}
|
609 |
+
}
|
610 |
+
}
|
611 |
+
|
612 |
+
|
613 |
+
### Function: Display Polls Archive
|
614 |
+
function polls_archive() {
|
615 |
+
global $wpdb, $polls_ips, $in_pollsarchive;
|
616 |
+
// Polls Variables
|
617 |
+
$in_pollsarchive = true;
|
618 |
+
$page = intval($_GET['poll_page']);
|
619 |
+
$polls_questions = array();
|
620 |
+
$polls_answers = array();
|
621 |
+
$polls_ip = array();
|
622 |
+
$polls_perpage = intval(get_settings('poll_archive_perpage'));
|
623 |
+
$poll_questions_ids = '0';
|
624 |
+
$poll_voted = false;
|
625 |
+
$poll_voted_aid = 0;
|
626 |
+
$poll_id = 0;
|
627 |
+
$pollsarchive_output = '';
|
628 |
+
|
629 |
+
// Get Total Polls
|
630 |
+
$total_polls = $wpdb->get_var("SELECT COUNT(pollq_id) FROM $wpdb->pollsq");
|
631 |
+
|
632 |
+
// Checking $page and $offset
|
633 |
+
if (empty($page) || $page == 0) { $page = 1; }
|
634 |
+
if (empty($offset)) { $offset = 0; }
|
635 |
+
|
636 |
+
// Determin $offset
|
637 |
+
$offset = ($page-1) * $polls_perpage;
|
638 |
+
|
639 |
+
// Determine Max Number Of Polls To Display On Page
|
640 |
+
if(($offset + $polls_perpage) > $total_polls) {
|
641 |
+
$max_on_page = $total_polls;
|
642 |
+
} else {
|
643 |
+
$max_on_page = ($offset + $polls_perpage);
|
644 |
+
}
|
645 |
+
|
646 |
+
// Determine Number Of Polls To Display On Page
|
647 |
+
if (($offset + 1) > ($total_polls)) {
|
648 |
+
$display_on_page = $total_polls;
|
649 |
+
} else {
|
650 |
+
$display_on_page = ($offset + 1);
|
651 |
+
}
|
652 |
+
|
653 |
+
// Determing Total Amount Of Pages
|
654 |
+
$total_pages = ceil($total_polls / $polls_perpage);
|
655 |
+
|
656 |
+
// Make Sure Poll Is Not Disabled
|
657 |
+
if(intval(get_settings('poll_currentpoll')) != -1 && $page < 2) {
|
658 |
+
// Hardcoded Poll ID Is Not Specified
|
659 |
+
if(intval($temp_poll_id) == 0) {
|
660 |
+
// Random Poll
|
661 |
+
if(intval(get_settings('poll_currentpoll')) == -2) {
|
662 |
+
$random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq ORDER BY RAND() LIMIT 1");
|
663 |
+
$poll_id = intval($random_poll_id);
|
664 |
+
// Current Poll ID Is Not Specified
|
665 |
+
} else if(intval(get_settings('poll_currentpoll')) == 0) {
|
666 |
+
// Get Lastest Poll ID
|
667 |
+
$poll_id = intval(get_settings('poll_latestpoll'));
|
668 |
+
} else {
|
669 |
+
// Get Current Poll ID
|
670 |
+
$poll_id = intval(get_settings('poll_currentpoll'));
|
671 |
+
}
|
672 |
+
// Get Hardcoded Poll ID
|
673 |
+
} else {
|
674 |
+
$poll_id = intval($temp_poll_id);
|
675 |
+
}
|
676 |
+
}
|
677 |
+
|
678 |
+
// Get Poll Questions
|
679 |
+
$questions = $wpdb->get_results("SELECT * FROM $wpdb->pollsq WHERE pollq_id != $poll_id ORDER BY pollq_id DESC LIMIT $offset, $polls_perpage");
|
680 |
+
if($questions) {
|
681 |
+
foreach($questions as $question) {
|
682 |
+
$polls_questions[] = array('id' => intval($question->pollq_id), 'question' => stripslashes($question->pollq_question), 'timestamp' => $question->pollq_timestamp, 'totalvotes' => intval($question->pollq_totalvotes));
|
683 |
+
$poll_questions_ids .= intval($question->pollq_id).', ';
|
684 |
+
}
|
685 |
+
$poll_questions_ids = substr($poll_questions_ids, 0, -2);
|
686 |
+
}
|
687 |
+
|
688 |
+
// Get Poll Answers
|
689 |
+
$answers = $wpdb->get_results("SELECT polla_aid, polla_qid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid IN ($poll_questions_ids) ORDER BY ".get_settings('poll_ans_result_sortby').' '.get_settings('poll_ans_result_sortorder'));
|
690 |
+
if($answers) {
|
691 |
+
foreach($answers as $answer) {
|
692 |
+
$polls_answers[] = array('aid' => intval($answer->polla_aid), 'qid' => intval($answer->polla_qid), 'answers' => stripslashes($answer->polla_answers), 'votes' => intval($answer->polla_votes));
|
693 |
+
}
|
694 |
+
}
|
695 |
+
|
696 |
+
// Get Poll IPs
|
697 |
+
$ips = $wpdb->get_results("SELECT pollip_qid, pollip_aid FROM $wpdb->pollsip WHERE pollip_qid IN ($poll_questions_ids) AND pollip_ip = '".get_ipaddress()."'");
|
698 |
+
if($ips) {
|
699 |
+
foreach($ips as $ip) {
|
700 |
+
$polls_ips[] = array('qid' => intval($ip->pollip_qid), 'aid' => intval($ip->pollip_aid));
|
701 |
+
}
|
702 |
+
}
|
703 |
+
|
704 |
+
// Current Poll
|
705 |
+
if($page < 2) {
|
706 |
+
$pollsarchive_output .= '<h2>'.__('Current Poll', 'wp-polls').'</h2>'."\n";
|
707 |
+
// Current Poll
|
708 |
+
if(intval(get_settings('poll_currentpoll')) == -1) {
|
709 |
+
$pollsarchive_output .= get_settings('poll_template_disable');
|
710 |
+
} else {
|
711 |
+
// User Click on View Results Link
|
712 |
+
if(intval($_GET['pollresult']) == $poll_id) {
|
713 |
+
$pollsarchive_output .= display_pollresult($poll_id);
|
714 |
+
// Check Whether User Has Voted
|
715 |
+
} else {
|
716 |
+
$poll_active = $wpdb->get_var("SELECT pollq_active FROM $wpdb->pollsq WHERE pollq_id = $poll_id");
|
717 |
+
$poll_active = intval($poll_active);
|
718 |
+
$check_voted = check_voted($poll_id);
|
719 |
+
if($check_voted > 0 || $poll_active == 0) {
|
720 |
+
$pollsarchive_output .= display_pollresult($poll_id, $check_voted);
|
721 |
+
} else {
|
722 |
+
$pollsarchive_output .= display_pollvote($poll_id);
|
723 |
+
}
|
724 |
+
}
|
725 |
+
}
|
726 |
+
}
|
727 |
+
// Poll Archives
|
728 |
+
$pollsarchive_output .= "<h2>".__('Polls Archive', 'wp-polls')."</h2>\n";
|
729 |
+
$pollsarchive_output .= "<div class=\"wp-polls\">\n";
|
730 |
+
foreach($polls_questions as $polls_question) {
|
731 |
+
// Most/Least Variables
|
732 |
+
$poll_most_answer = '';
|
733 |
+
$poll_most_votes = 0;
|
734 |
+
$poll_most_percentage = 0;
|
735 |
+
$poll_least_answer = '';
|
736 |
+
$poll_least_votes = 0;
|
737 |
+
$poll_least_percentage = 0;
|
738 |
+
// Is The Poll Total Votes 0?
|
739 |
+
$poll_totalvotes_zero = true;
|
740 |
+
if($polls_question['totalvotes'] > 0) {
|
741 |
+
$poll_totalvotes_zero = false;
|
742 |
+
}
|
743 |
+
// Poll Question Variables
|
744 |
+
$template_question = stripslashes(get_settings('poll_template_resultheader'));
|
745 |
+
$template_question = str_replace("%POLL_QUESTION%", $polls_question['question'], $template_question);
|
746 |
+
$template_question = str_replace("%POLL_ID%", $polls_question['id'], $template_question);
|
747 |
+
$template_question = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_question);
|
748 |
+
// Print Out Result Header Template
|
749 |
+
$pollsarchive_output .= $template_question;
|
750 |
+
foreach($polls_answers as $polls_answer) {
|
751 |
+
if($polls_question['id'] == $polls_answer['qid']) {
|
752 |
+
// Calculate Percentage And Image Bar Width
|
753 |
+
if(!$poll_totalvotes_zero) {
|
754 |
+
if($polls_answer['votes'] > 0) {
|
755 |
+
$poll_answer_percentage = round((($polls_answer['votes']/$polls_question['totalvotes'])*100));
|
756 |
+
$poll_answer_imagewidth = round($poll_answer_percentage*0.9);
|
757 |
+
} else {
|
758 |
+
$poll_answer_percentage = 0;
|
759 |
+
$poll_answer_imagewidth = 1;
|
760 |
+
}
|
761 |
+
} else {
|
762 |
+
$poll_answer_percentage = 0;
|
763 |
+
$poll_answer_imagewidth = 1;
|
764 |
+
}
|
765 |
+
// Let User See What Options They Voted
|
766 |
+
if(check_voted_multiple($polls_question['id']) == $polls_answer['aid']) {
|
767 |
+
// Results Body Variables
|
768 |
+
$template_answer = stripslashes(get_settings('poll_template_resultbody2'));
|
769 |
+
$template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
|
770 |
+
$template_answer = str_replace("%POLL_ANSWER%", $polls_answer['answers'], $template_answer);
|
771 |
+
$template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($polls_answer['answers'])), $template_answer);
|
772 |
+
$template_answer = str_replace("%POLL_ANSWER_VOTES%", $polls_answer['votes'], $template_answer);
|
773 |
+
$template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
|
774 |
+
$template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
|
775 |
+
// Print Out Results Body Template
|
776 |
+
$pollsarchive_output .= $template_answer;
|
777 |
+
} else {
|
778 |
+
// Results Body Variables
|
779 |
+
$template_answer = stripslashes(get_settings('poll_template_resultbody'));
|
780 |
+
$template_answer = str_replace("%POLL_ANSWER_ID%", $polls_answer['aid'], $template_answer);
|
781 |
+
$template_answer = str_replace("%POLL_ANSWER%", $polls_answer['answers'], $template_answer);
|
782 |
+
$template_answer = str_replace("%POLL_ANSWER_TEXT%", htmlspecialchars(strip_tags($polls_answer['answers'])), $template_answer);
|
783 |
+
$template_answer = str_replace("%POLL_ANSWER_VOTES%", $polls_answer['votes'], $template_answer);
|
784 |
+
$template_answer = str_replace("%POLL_ANSWER_PERCENTAGE%", $poll_answer_percentage, $template_answer);
|
785 |
+
$template_answer = str_replace("%POLL_ANSWER_IMAGEWIDTH%", $poll_answer_imagewidth, $template_answer);
|
786 |
+
// Print Out Results Body Template
|
787 |
+
$pollsarchive_output .= $template_answer;
|
788 |
+
}
|
789 |
+
// Get Most Voted Data
|
790 |
+
if($polls_answer['votes'] > $poll_most_votes) {
|
791 |
+
$poll_most_answer = $polls_answer['answers'];
|
792 |
+
$poll_most_votes = $polls_answer['votes'];
|
793 |
+
$poll_most_percentage = $poll_answer_percentage;
|
794 |
+
}
|
795 |
+
// Get Least Voted Data
|
796 |
+
if($poll_least_votes == 0) {
|
797 |
+
$poll_least_votes = $polls_answer['votes'];
|
798 |
+
}
|
799 |
+
if($polls_answer['votes'] <= $poll_least_votes) {
|
800 |
+
$poll_least_answer = $polls_answer['answers'];
|
801 |
+
$poll_least_votes = $polls_answer['votes'];
|
802 |
+
$poll_least_percentage = $poll_answer_percentage;
|
803 |
+
}
|
804 |
+
// Delete Away From Array
|
805 |
+
unset($polls_answer['answers']);
|
806 |
+
}
|
807 |
+
}
|
808 |
+
// Results Footer Variables
|
809 |
+
$template_footer = stripslashes(get_settings('poll_template_resultfooter'));
|
810 |
+
$template_footer = str_replace("%POLL_TOTALVOTES%", $polls_question['totalvotes'], $template_footer);
|
811 |
+
$template_footer = str_replace("%POLL_MOST_ANSWER%", $poll_most_answer, $template_footer);
|
812 |
+
$template_footer = str_replace("%POLL_MOST_VOTES%", number_format($poll_most_votes), $template_footer);
|
813 |
+
$template_footer = str_replace("%POLL_MOST_PERCENTAGE%", $poll_most_percentage, $template_footer);
|
814 |
+
$template_footer = str_replace("%POLL_LEAST_ANSWER%", $poll_least_answer, $template_footer);
|
815 |
+
$template_footer = str_replace("%POLL_LEAST_VOTES%", number_format($poll_least_votes), $template_footer);
|
816 |
+
$template_footer = str_replace("%POLL_LEAST_PERCENTAGE%", $poll_least_percentage, $template_footer);
|
817 |
+
// Print Out Results Footer Template
|
818 |
+
$pollsarchive_output .= $template_footer;
|
819 |
+
}
|
820 |
+
$pollsarchive_output .= "</div>\n";
|
821 |
+
|
822 |
+
// Polls Archive Paging
|
823 |
+
if($total_pages > 1) {
|
824 |
+
// Output Previous Page
|
825 |
+
$pollsarchive_output .= "<p>\n";
|
826 |
+
$pollsarchive_output .= "<span style=\"float: left;\">\n";
|
827 |
+
if($page > 1 && ((($page*$polls_perpage)-($polls_perpage-1)) <= $total_polls)) {
|
828 |
+
$pollsarchive_output .= '<strong>«</strong> <a href="'.polls_archive_link($page-1).'" title="« '.__('Previous Page', 'wp-polls').'">'.__('Previous Page', 'wp-polls').'</a>';
|
829 |
+
} else {
|
830 |
+
$pollsarchive_output .= ' ';
|
831 |
+
}
|
832 |
+
$pollsarchive_output .= "</span>\n";
|
833 |
+
// Output Next Page
|
834 |
+
$pollsarchive_output .= "<span style=\"float: right;\">\n";
|
835 |
+
if($page >= 1 && ((($page*$polls_perpage)+1) <= $total_polls)) {
|
836 |
+
$pollsarchive_output .= '<a href="'.polls_archive_link($page+1).'" title="'.__('Next Page', 'wp-polls').' »">'.__('Next Page', 'wp-polls').'</a> <strong>»</strong>';
|
837 |
+
} else {
|
838 |
+
$pollsarchive_output .= ' ';
|
839 |
+
}
|
840 |
+
$pollsarchive_output .= "</span>\n";
|
841 |
+
// Output Pages
|
842 |
+
$pollsarchive_output .= "</p>\n";
|
843 |
+
$pollsarchive_output .= "<br style=\"clear: both;\" />\n";
|
844 |
+
$pollsarchive_output .= "<p style=\"text-align: center;\">\n";
|
845 |
+
$pollsarchive_output .= __('Pages', 'wp-polls')." ($total_pages) : ";
|
846 |
+
if ($page >= 4) {
|
847 |
+
$pollsarchive_output .= '<strong><a href="'.polls_archive_link(1).'" title="'.__('Go to First Page', 'wp-polls').'">« '.__('First', 'wp-polls').'</a></strong> ... ';
|
848 |
+
}
|
849 |
+
if($page > 1) {
|
850 |
+
$pollsarchive_output .= ' <strong><a href="'.polls_archive_link($page-1).'" title="« '.__('Go to Page', 'wp-polls').' '.($page-1).'">«</a></strong> ';
|
851 |
+
}
|
852 |
+
for($i = $page - 2 ; $i <= $page +2; $i++) {
|
853 |
+
if ($i >= 1 && $i <= $total_pages) {
|
854 |
+
if($i == $page) {
|
855 |
+
$pollsarchive_output .= "<strong>[$i]</strong> ";
|
856 |
+
} else {
|
857 |
+
$pollsarchive_output .= '<a href="'.polls_archive_link($i).'" title="'.__('Page', 'wp-polls').' '.$i.'">'.$i.'</a> ';
|
858 |
+
}
|
859 |
+
}
|
860 |
+
}
|
861 |
+
if($page < $total_pages) {
|
862 |
+
$pollsarchive_output .= ' <strong><a href="'.polls_archive_link($page+1).'" title="'.__('Go to Page', 'wp-polls').' '.($page+1).' »">»</a></strong> ';
|
863 |
+
}
|
864 |
+
if (($page+2) < $total_pages) {
|
865 |
+
$pollsarchive_output .= ' ... <strong><a href="'.polls_archive_link($total_pages).'" title="'.__('Go to Last Page', 'wp-polls').'">'.__('Last', 'wp-polls').' »</a></strong>';
|
866 |
+
}
|
867 |
+
$pollsarchive_output .= "</p>\n";
|
868 |
+
}
|
869 |
+
|
870 |
+
// Output Polls Archive Page
|
871 |
+
return $pollsarchive_output;
|
872 |
+
}
|
873 |
+
|
874 |
+
|
875 |
+
### Function: Vote Poll
|
876 |
+
vote_poll();
|
877 |
+
function vote_poll() {
|
878 |
+
global $wpdb, $user_identity, $user_ID;
|
879 |
+
if(!empty($_POST['vote'])) {
|
880 |
+
header('Content-Type: text/html; charset='.get_option('blog_charset'));
|
881 |
+
$poll_id = intval($_POST['poll_id']);
|
882 |
+
$poll_aid = intval($_POST["poll_$poll_id"]);
|
883 |
+
if($poll_id > 0 && $poll_aid > 0 && check_allowtovote()) {
|
884 |
+
$check_voted = check_voted($poll_id);
|
885 |
+
if($check_voted == 0) {
|
886 |
+
if(!empty($user_identity)) {
|
887 |
+
$pollip_user = addslashes($user_identity);
|
888 |
+
} elseif(!empty($_COOKIE['comment_author_'.COOKIEHASH])) {
|
889 |
+
$pollip_user = addslashes($_COOKIE['comment_author_'.COOKIEHASH]);
|
890 |
+
} else {
|
891 |
+
$pollip_user = 'Guest';
|
892 |
+
}
|
893 |
+
$pollip_userid = intval($user_ID);
|
894 |
+
$pollip_ip = get_ipaddress();
|
895 |
+
$pollip_host = gethostbyaddr($pollip_ip);
|
896 |
+
$pollip_timestamp = current_time('timestamp');
|
897 |
+
// Only Create Cookie If User Choose Logging Method 1 Or 2
|
898 |
+
$poll_logging_method = intval(get_settings('poll_logging_method'));
|
899 |
+
if($poll_logging_method == 1 || $poll_logging_method == 3) {
|
900 |
+
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH);
|
901 |
+
}
|
902 |
+
// Log Ratings No Matter What
|
903 |
+
$vote_ip = $wpdb->query("INSERT INTO $wpdb->pollsip VALUES (0, $poll_id, $poll_aid, '$pollip_ip', '$pollip_host', '$pollip_timestamp', '$pollip_user', $pollip_userid)");
|
904 |
+
$vote_a = $wpdb->query("UPDATE $wpdb->pollsa SET polla_votes = (polla_votes+1) WHERE polla_qid = $poll_id AND polla_aid = $poll_aid");
|
905 |
+
if($vote_a) {
|
906 |
+
$vote_q = $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = (pollq_totalvotes+1) WHERE pollq_id = $poll_id");
|
907 |
+
if($vote_q) {
|
908 |
+
echo "<ul class=\"wp-polls-ul\">\n".display_pollresult($poll_id,$poll_aid, 1);
|
909 |
+
exit();
|
910 |
+
} else {
|
911 |
+
echo __('Unable To Update Poll Total Votes.', 'wp-polls')." ".__('Poll ID', 'wp-polls')." #".$poll_id.".";
|
912 |
+
exit();
|
913 |
+
} // End if($vote_q)
|
914 |
+
} else {
|
915 |
+
echo __('Unable To Update Poll Answer Votes.', 'wp-polls')." ".__('Poll ID', 'wp-polls')." #".$poll_id.", ".__('Poll Answer ID', 'wp-polls')." #".$poll_aid.".";
|
916 |
+
exit();
|
917 |
+
} // End if($vote_a)
|
918 |
+
} else {
|
919 |
+
echo __('You Had Already Voted For This Poll.', 'wp-polls')." ".__('Poll ID', 'wp-polls')." #".$poll_id.".";
|
920 |
+
exit();
|
921 |
+
}// End if($check_voted)
|
922 |
+
} else {
|
923 |
+
echo __('Invalid Poll ID Or Poll Answer ID.', 'wp-polls')." ".__('Poll ID', 'wp-polls')." #".$poll_id.", ".__('Poll Answer ID', 'wp-polls')." #".$poll_aid.".";
|
924 |
+
exit();
|
925 |
+
} // End if($poll_id > 0 && $poll_aid > 0)
|
926 |
+
} elseif (intval($_GET['pollresult']) > 0) {
|
927 |
+
$poll_id = intval($_GET['pollresult']);
|
928 |
+
echo "<ul class=\"wp-polls-ul\">\n".display_pollresult($poll_id, 0, true);
|
929 |
+
exit();
|
930 |
+
} elseif (intval($_GET['pollbooth']) > 0) {
|
931 |
+
$poll_id = intval($_GET['pollbooth']);
|
932 |
+
echo "<ul class=\"wp-polls-ul\">\n".display_pollvote($poll_id, true);
|
933 |
+
exit();
|
934 |
+
} // End if(!empty($_POST['vote']))
|
935 |
+
}
|
936 |
+
|
937 |
+
|
938 |
+
### Function: Create Poll Tables
|
939 |
+
add_action('activate_polls/polls.php', 'create_poll_table');
|
940 |
+
function create_poll_table() {
|
941 |
+
global $wpdb;
|
942 |
+
include_once(ABSPATH.'/wp-admin/upgrade-functions.php');
|
943 |
+
// Create Poll Tables (3 Tables)
|
944 |
+
$create_table = array();
|
945 |
+
$create_table['pollsq'] = "CREATE TABLE $wpdb->pollsq (".
|
946 |
+
"pollq_id int(10) NOT NULL auto_increment,".
|
947 |
+
"pollq_question varchar(200) NOT NULL default '',".
|
948 |
+
"pollq_timestamp varchar(20) NOT NULL default '',".
|
949 |
+
"pollq_totalvotes int(10) NOT NULL default '0',".
|
950 |
+
"pollq_active tinyint(1) NOT NULL default '1',".
|
951 |
+
"PRIMARY KEY (pollq_id))";
|
952 |
+
$create_table['pollsa'] = "CREATE TABLE $wpdb->pollsa (".
|
953 |
+
"polla_aid int(10) NOT NULL auto_increment,".
|
954 |
+
"polla_qid int(10) NOT NULL default '0',".
|
955 |
+
"polla_answers varchar(200) NOT NULL default '',".
|
956 |
+
"polla_votes int(10) NOT NULL default '0',".
|
957 |
+
"PRIMARY KEY (polla_aid))";
|
958 |
+
$create_table['pollsip'] = "CREATE TABLE $wpdb->pollsip (".
|
959 |
+
"pollip_id int(10) NOT NULL auto_increment,".
|
960 |
+
"pollip_qid varchar(10) NOT NULL default '',".
|
961 |
+
"pollip_aid varchar(10) NOT NULL default '',".
|
962 |
+
"pollip_ip varchar(100) NOT NULL default '',".
|
963 |
+
"pollip_host VARCHAR(200) NOT NULL default '',".
|
964 |
+
"pollip_timestamp varchar(20) NOT NULL default '0000-00-00 00:00:00',".
|
965 |
+
"pollip_user tinytext NOT NULL,".
|
966 |
+
"pollip_userid int(10) NOT NULL default '0',".
|
967 |
+
"PRIMARY KEY (pollip_id))";
|
968 |
+
maybe_create_table($wpdb->pollsq, $create_table['pollsq']);
|
969 |
+
maybe_create_table($wpdb->pollsa, $create_table['pollsa']);
|
970 |
+
maybe_create_table($wpdb->pollsip, $create_table['pollsip']);
|
971 |
+
// Check Whether It is Install Or Upgrade
|
972 |
+
$first_poll = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq LIMIT 1");
|
973 |
+
// If Install, Insert 1st Poll Question With 5 Poll Answers
|
974 |
+
if(empty($first_poll)) {
|
975 |
+
// Insert Poll Question (1 Record)
|
976 |
+
$insert_pollq = $wpdb->query("INSERT INTO $wpdb->pollsq VALUES (1, '".__('How Is My Site?', 'wp-polls')."', '".current_time('timestamp')."', 0, 1);");
|
977 |
+
if($insert_pollq) {
|
978 |
+
// Insert Poll Answers (5 Records)
|
979 |
+
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (1, 1, '".__('Good', 'wp-polls')."', 0);");
|
980 |
+
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (2, 1, '".__('Excellent', 'wp-polls')."', 0);");
|
981 |
+
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (3, 1, '".__('Bad', 'wp-polls')."', 0);");
|
982 |
+
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (4, 1, '".__('Can Be Improved', 'wp-polls')."', 0);");
|
983 |
+
$wpdb->query("INSERT INTO $wpdb->pollsa VALUES (5, 1, '".__('No Comments', 'wp-polls')."', 0);");
|
984 |
+
}
|
985 |
+
}
|
986 |
+
// Add In Options (16 Records)
|
987 |
+
add_option('poll_template_voteheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
|
988 |
+
'<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
|
989 |
+
'<ul class="wp-polls-ul">', 'Template For Poll\'s Question');
|
990 |
+
add_option('poll_template_votebody', '<li><label for="poll-answer-%POLL_ANSWER_ID%"><input type="radio" id="poll-answer-%POLL_ANSWER_ID%" name="poll_%POLL_ID%" value="%POLL_ANSWER_ID%" /> %POLL_ANSWER%</label></li>', 'Template For Poll\'s Answers');
|
991 |
+
add_option('poll_template_votefooter', '</ul>'.
|
992 |
+
'<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>'.
|
993 |
+
'<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>'.
|
994 |
+
'</div>', 'Template For Poll\'s Voting Footer');
|
995 |
+
add_option('poll_template_resultheader', '<p style="text-align: center;"><strong>%POLL_QUESTION%</strong></p>'.
|
996 |
+
'<div id="polls-%POLL_ID%-ans" class="wp-polls-ans">'.
|
997 |
+
'<ul class="wp-polls-ul">', 'Template For Poll Header');
|
998 |
+
add_option('poll_template_resultbody', '<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% '.__('Votes', 'wp-polls').')"></div></li>', 'Template For Poll Results');
|
999 |
+
add_option('poll_template_resultbody2', '<li><strong><i>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%)</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)');
|
1000 |
+
add_option('poll_template_resultfooter', '</ul>'.
|
1001 |
+
'<p style="text-align: center;">'.__('Total Votes', 'wp-polls').': <strong>%POLL_TOTALVOTES%</strong></p>'.
|
1002 |
+
'</div>', 'Template For Poll Result Footer');
|
1003 |
+
add_option('poll_template_resultfooter2', '</ul>'.
|
1004 |
+
'<p style="text-align: center;">'.__('Total Votes', 'wp-polls').': <strong>%POLL_TOTALVOTES%</strong></p>'.
|
1005 |
+
'<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>'.
|
1006 |
+
'</div>', 'Template For Poll Result Footer');
|
1007 |
+
add_option('poll_template_disable', __('Sorry, there are no polls available at the moment.', 'wp-polls'), 'Template For Poll When It Is Disabled');
|
1008 |
+
add_option('poll_template_error', __('An error has occurred when processing your poll.', 'wp-polls'), 'Template For Poll When An Error Has Occured');
|
1009 |
+
add_option('poll_currentpoll', 0, 'Current Displayed Poll');
|
1010 |
+
add_option('poll_latestpoll', 1, 'The Lastest Poll');
|
1011 |
+
add_option('poll_archive_perpage', 5, 'Number Of Polls To Display Per Page On The Poll\'s Archive', 'no');
|
1012 |
+
add_option('poll_ans_sortby', 'polla_aid', 'Sorting Of Poll\'s Answers');
|
1013 |
+
add_option('poll_ans_sortorder', 'asc', 'Sort Order Of Poll\'s Answers');
|
1014 |
+
add_option('poll_ans_result_sortby', 'polla_votes', 'Sorting Of Poll\'s Answers Result');
|
1015 |
+
add_option('poll_ans_result_sortorder', 'desc', 'Sorting Order Of Poll\'s Answers Result');
|
1016 |
+
// Database Upgrade For WP-Polls 2.1
|
1017 |
+
add_option('poll_logging_method', '3', 'Logging Method Of User Poll\'s Answer');
|
1018 |
+
add_option('poll_allowtovote', '2', 'Who Is Allowed To Vote');
|
1019 |
+
maybe_add_column($wpdb->pollsq, 'pollq_active', "ALTER TABLE $wpdb->pollsq ADD pollq_active TINYINT( 1 ) NOT NULL DEFAULT '1';");
|
1020 |
+
// Database Upgrade For WP-Polls 2.12
|
1021 |
+
maybe_add_column($wpdb->pollsip, 'pollip_userid', "ALTER TABLE $wpdb->pollsip ADD pollip_userid INT( 10 ) NOT NULL DEFAULT '0';");
|
1022 |
+
add_option('poll_archive_url', get_settings('siteurl').'/pollsarchive/', 'Polls Archive URL');
|
1023 |
+
add_option('poll_archive_show', 1, 'Show Polls Archive?');
|
1024 |
+
// Database Upgrade For WP-Polls 2.13
|
1025 |
+
add_option('poll_bar', array('style' => 'default', 'background' => 'd8e1eb', 'border' => 'c8c8c8', 'height' => 8), 'Poll Bar Style');
|
1026 |
+
// Set 'manage_polls' Capabilities To Administrator
|
1027 |
+
$role = get_role('administrator');
|
1028 |
+
if(!$role->has_cap('manage_polls')) {
|
1029 |
+
$role->add_cap('manage_polls');
|
1030 |
+
}
|
1031 |
+
}
|
1032 |
+
?>
|
polls/wp-polls.pot
ADDED
@@ -0,0 +1,1187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WP-Polls 2.13\n"
|
4 |
+
"POT-Creation-Date: \n"
|
5 |
+
"PO-Revision-Date: 2007-01-02 01:09+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"
|
9 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Poedit-Country: SINGAPORE\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-SearchPath-0: .\n"
|
15 |
+
|
16 |
+
#: polls-manager.php:39
|
17 |
+
#: polls-manager.php:236
|
18 |
+
#: polls-manager.php:257
|
19 |
+
msgid "Add Poll"
|
20 |
+
msgstr ""
|
21 |
+
|
22 |
+
#: polls-manager.php:45
|
23 |
+
#, php-format
|
24 |
+
msgid "Error In Adding Poll '%s'"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: polls-manager.php:54
|
28 |
+
#, php-format
|
29 |
+
msgid "Error In Adding Poll's Answer '%s'"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: polls-manager.php:60
|
33 |
+
#, php-format
|
34 |
+
msgid "There Is An Error Updating The Lastest Poll ID (%s) To The Poll Option"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: polls-manager.php:63
|
38 |
+
#: polls-manager.php:107
|
39 |
+
#: polls-manager.php:116
|
40 |
+
#: polls-manager.php:127
|
41 |
+
#: polls-manager.php:157
|
42 |
+
msgid "Poll"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: polls-manager.php:63
|
46 |
+
#: polls-manager.php:168
|
47 |
+
msgid "Added Successfully"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: polls-manager.php:67
|
51 |
+
#: polls-manager.php:389
|
52 |
+
#: polls-manager.php:433
|
53 |
+
msgid "Edit Poll"
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: polls-manager.php:86
|
57 |
+
msgid "No Changes Had Been Made To Poll's Title"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: polls-manager.php:100
|
61 |
+
msgid "No Changes Had Been Made To Poll's Answer"
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: polls-manager.php:104
|
65 |
+
msgid "Invalid Poll"
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: polls-manager.php:107
|
69 |
+
msgid "Edited Successfully"
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: polls-manager.php:111
|
73 |
+
#: polls-manager.php:437
|
74 |
+
msgid "Open Poll"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: polls-manager.php:116
|
78 |
+
msgid "Is Now Opened"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: polls-manager.php:118
|
82 |
+
msgid "Error Opening Poll"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: polls-manager.php:122
|
86 |
+
#: polls-manager.php:435
|
87 |
+
msgid "Close Poll"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: polls-manager.php:127
|
91 |
+
msgid "Is Now Closed"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: polls-manager.php:129
|
95 |
+
msgid "Error Closing Poll"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: polls-manager.php:133
|
99 |
+
#: polls-manager.php:537
|
100 |
+
#: polls-manager.php:573
|
101 |
+
msgid "Delete Poll"
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#: polls-manager.php:141
|
105 |
+
#, php-format
|
106 |
+
msgid "Error In Deleting Poll '%s' Question"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: polls-manager.php:144
|
110 |
+
#, php-format
|
111 |
+
msgid "No Poll Answers For '%s'"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: polls-manager.php:147
|
115 |
+
#, php-format
|
116 |
+
msgid "No Voted IPs For '%s'"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: polls-manager.php:157
|
120 |
+
#: polls-manager.php:595
|
121 |
+
msgid "Deleted Successfully"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: polls-manager.php:161
|
125 |
+
#: polls-manager.php:446
|
126 |
+
#: polls-manager.php:451
|
127 |
+
#: polls-manager.php:455
|
128 |
+
msgid "Add Answer"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: polls-manager.php:166
|
132 |
+
#, php-format
|
133 |
+
msgid "Error In Adding Poll Answer '%s'"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: polls-manager.php:168
|
137 |
+
#: polls-manager.php:595
|
138 |
+
msgid "Poll Answer"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: polls-manager.php:172
|
142 |
+
#: polls-manager.php:758
|
143 |
+
msgid "Delete All Logs"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: polls-manager.php:176
|
147 |
+
msgid "All Polls Logs Have Been Deleted."
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: polls-manager.php:178
|
151 |
+
msgid "An Error Has Occured While Deleting All Polls Logs."
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: polls-manager.php:183
|
155 |
+
#: polls-manager.php:520
|
156 |
+
msgid "Delete Logs For This Poll Only"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: polls-manager.php:188
|
160 |
+
msgid "All Logs For This Poll Have Been Deleted."
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: polls-manager.php:190
|
164 |
+
msgid "An Error Has Occured While Deleting All Logs For This Poll."
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: polls-manager.php:195
|
168 |
+
#: polls-manager.php:776
|
169 |
+
msgid "UNINSTALL Polls"
|
170 |
+
msgstr ""
|
171 |
+
|
172 |
+
#: polls-manager.php:202
|
173 |
+
#, php-format
|
174 |
+
msgid "Table \"%s\" Has Been Dropped."
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: polls-manager.php:215
|
178 |
+
#, php-format
|
179 |
+
msgid "Setting Key '%s' Has been Errased."
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: polls-manager.php:218
|
183 |
+
#, php-format
|
184 |
+
msgid "Error Deleting Setting Key '%s'."
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: polls-manager.php:245
|
188 |
+
#: polls-manager.php:265
|
189 |
+
#: polls-manager.php:394
|
190 |
+
#: polls-manager.php:543
|
191 |
+
#: polls-manager.php:641
|
192 |
+
#: polls-manager.php:712
|
193 |
+
msgid "Question"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: polls-manager.php:257
|
197 |
+
#: polls-manager.php:280
|
198 |
+
#: polls-manager.php:439
|
199 |
+
#: polls-manager.php:574
|
200 |
+
#: polls-options.php:606
|
201 |
+
msgid "Cancel"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
#: polls-manager.php:268
|
205 |
+
#: polls-manager.php:716
|
206 |
+
msgid "No. Of Answers:"
|
207 |
+
msgstr ""
|
208 |
+
|
209 |
+
#: polls-manager.php:280
|
210 |
+
#: polls-manager.php:728
|
211 |
+
msgid "Add Question"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: polls-manager.php:400
|
215 |
+
msgid "Answers:"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: polls-manager.php:401
|
219 |
+
#: polls-manager.php:550
|
220 |
+
msgid "No. Of Votes"
|
221 |
+
msgstr ""
|
222 |
+
|
223 |
+
#: polls-manager.php:408
|
224 |
+
msgid "Null Votes"
|
225 |
+
msgstr ""
|
226 |
+
|
227 |
+
#: polls-manager.php:415
|
228 |
+
#: polls-manager.php:481
|
229 |
+
#: polls-manager.php:559
|
230 |
+
msgid "Answer"
|
231 |
+
msgstr ""
|
232 |
+
|
233 |
+
#: polls-manager.php:416
|
234 |
+
msgid "You Are About To Delete This Poll Answer:"
|
235 |
+
msgstr ""
|
236 |
+
|
237 |
+
#: polls-manager.php:416
|
238 |
+
#: polls-manager.php:520
|
239 |
+
#: polls-manager.php:573
|
240 |
+
#: polls-manager.php:758
|
241 |
+
msgid "This Action Is Not Reversible. Are you sure?"
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: polls-manager.php:416
|
245 |
+
#: polls-manager.php:694
|
246 |
+
msgid "Delete"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: polls-manager.php:424
|
250 |
+
#: polls-manager.php:566
|
251 |
+
#: polls-manager.php:642
|
252 |
+
#: polls-options.php:141
|
253 |
+
#: polls-options.php:144
|
254 |
+
#: polls.php:1001
|
255 |
+
#: polls.php:1004
|
256 |
+
msgid "Total Votes"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: polls-manager.php:427
|
260 |
+
msgid "Timestamp"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: polls-manager.php:430
|
264 |
+
msgid "Edit Timestamp"
|
265 |
+
msgstr ""
|
266 |
+
|
267 |
+
#: polls-manager.php:430
|
268 |
+
msgid "Existing Timestamp:"
|
269 |
+
msgstr ""
|
270 |
+
|
271 |
+
#: polls-manager.php:435
|
272 |
+
msgid "You Are About To Close This Poll"
|
273 |
+
msgstr ""
|
274 |
+
|
275 |
+
#: polls-manager.php:437
|
276 |
+
msgid "You Are About To Open This Poll"
|
277 |
+
msgstr ""
|
278 |
+
|
279 |
+
#: polls-manager.php:465
|
280 |
+
msgid "Users Voted For This Poll"
|
281 |
+
msgstr ""
|
282 |
+
|
283 |
+
#: polls-manager.php:485
|
284 |
+
msgid "No."
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#: polls-manager.php:486
|
288 |
+
msgid "User"
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
#: polls-manager.php:487
|
292 |
+
msgid "IP/Host"
|
293 |
+
msgstr ""
|
294 |
+
|
295 |
+
#: polls-manager.php:488
|
296 |
+
msgid "Date"
|
297 |
+
msgstr ""
|
298 |
+
|
299 |
+
#: polls-manager.php:507
|
300 |
+
msgid "No IP Has Been Logged Yet."
|
301 |
+
msgstr ""
|
302 |
+
|
303 |
+
#: polls-manager.php:514
|
304 |
+
msgid "Poll Logs"
|
305 |
+
msgstr ""
|
306 |
+
|
307 |
+
#: polls-manager.php:518
|
308 |
+
msgid "Are You Sure You Want To Delete Logs For This Poll Only?"
|
309 |
+
msgstr ""
|
310 |
+
|
311 |
+
#: polls-manager.php:519
|
312 |
+
#: polls-manager.php:757
|
313 |
+
#: polls-manager.php:775
|
314 |
+
#: polls-options.php:345
|
315 |
+
#: polls-widget.php:81
|
316 |
+
msgid "Yes"
|
317 |
+
msgstr ""
|
318 |
+
|
319 |
+
#: polls-manager.php:520
|
320 |
+
msgid "You Are About To Delete Logs For This Poll Only."
|
321 |
+
msgstr ""
|
322 |
+
|
323 |
+
#: polls-manager.php:523
|
324 |
+
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."
|
325 |
+
msgstr ""
|
326 |
+
|
327 |
+
#: polls-manager.php:549
|
328 |
+
msgid "Answers"
|
329 |
+
msgstr ""
|
330 |
+
|
331 |
+
#: polls-manager.php:569
|
332 |
+
#: polls-manager.php:644
|
333 |
+
msgid "Status"
|
334 |
+
msgstr ""
|
335 |
+
|
336 |
+
#: polls-manager.php:569
|
337 |
+
#: polls-manager.php:688
|
338 |
+
msgid "Open"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: polls-manager.php:569
|
342 |
+
#: polls-manager.php:690
|
343 |
+
msgid "Closed"
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: polls-manager.php:572
|
347 |
+
#: polls-manager.php:573
|
348 |
+
msgid "You Are About To Delete This Poll"
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: polls-manager.php:592
|
352 |
+
msgid "Delete Poll's Answer"
|
353 |
+
msgstr ""
|
354 |
+
|
355 |
+
#: polls-manager.php:597
|
356 |
+
msgid "Error In Deleting Poll Answer"
|
357 |
+
msgstr ""
|
358 |
+
|
359 |
+
#: polls-manager.php:600
|
360 |
+
msgid "Poll Question's Total Votes Updated Successfully"
|
361 |
+
msgstr ""
|
362 |
+
|
363 |
+
#: polls-manager.php:602
|
364 |
+
msgid "No Changes Have Been Made To The Poll's Total Votes"
|
365 |
+
msgstr ""
|
366 |
+
|
367 |
+
#: polls-manager.php:605
|
368 |
+
msgid "Poll IP Logs Updated Successfully"
|
369 |
+
msgstr ""
|
370 |
+
|
371 |
+
#: polls-manager.php:607
|
372 |
+
msgid "No Changes Have Been Made To The Poll IP Logs"
|
373 |
+
msgstr ""
|
374 |
+
|
375 |
+
#: polls-manager.php:610
|
376 |
+
msgid "Click here To Go Back To The Poll Edit Page"
|
377 |
+
msgstr ""
|
378 |
+
|
379 |
+
#: polls-manager.php:617
|
380 |
+
#: polls-manager.php:765
|
381 |
+
msgid "Uninstall Polls"
|
382 |
+
msgstr ""
|
383 |
+
|
384 |
+
#: polls-manager.php:623
|
385 |
+
#, php-format
|
386 |
+
msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-Polls Will Be Deactivated Automatically."
|
387 |
+
msgstr ""
|
388 |
+
|
389 |
+
#: polls-manager.php:637
|
390 |
+
#: polls.php:53
|
391 |
+
msgid "Manage Polls"
|
392 |
+
msgstr ""
|
393 |
+
|
394 |
+
#: polls-manager.php:640
|
395 |
+
msgid "ID"
|
396 |
+
msgstr ""
|
397 |
+
|
398 |
+
#: polls-manager.php:643
|
399 |
+
msgid "Date Added"
|
400 |
+
msgstr ""
|
401 |
+
|
402 |
+
#: polls-manager.php:645
|
403 |
+
msgid "Action"
|
404 |
+
msgstr ""
|
405 |
+
|
406 |
+
#: polls-manager.php:676
|
407 |
+
#: polls-manager.php:680
|
408 |
+
msgid "Displayed:"
|
409 |
+
msgstr ""
|
410 |
+
|
411 |
+
#: polls-manager.php:693
|
412 |
+
msgid "Edit"
|
413 |
+
msgstr ""
|
414 |
+
|
415 |
+
#: polls-manager.php:701
|
416 |
+
msgid "No Polls Found"
|
417 |
+
msgstr ""
|
418 |
+
|
419 |
+
#: polls-manager.php:708
|
420 |
+
msgid "Add A Poll"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: polls-manager.php:735
|
424 |
+
#: polls-usage.php:103
|
425 |
+
msgid "Polls Stats"
|
426 |
+
msgstr ""
|
427 |
+
|
428 |
+
#: polls-manager.php:738
|
429 |
+
msgid "Total Polls:"
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
#: polls-manager.php:742
|
433 |
+
msgid "Total Polls' Answers:"
|
434 |
+
msgstr ""
|
435 |
+
|
436 |
+
#: polls-manager.php:746
|
437 |
+
msgid "Total Votes Casted:"
|
438 |
+
msgstr ""
|
439 |
+
|
440 |
+
#: polls-manager.php:753
|
441 |
+
msgid "Polls Logs"
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
#: polls-manager.php:756
|
445 |
+
msgid "Are You Sure You Want To Delete All Polls Logs?"
|
446 |
+
msgstr ""
|
447 |
+
|
448 |
+
#: polls-manager.php:758
|
449 |
+
msgid "You Are About To Delete All Poll Logs."
|
450 |
+
msgstr ""
|
451 |
+
|
452 |
+
#: polls-manager.php:761
|
453 |
+
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."
|
454 |
+
msgstr ""
|
455 |
+
|
456 |
+
#: polls-manager.php:769
|
457 |
+
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."
|
458 |
+
msgstr ""
|
459 |
+
|
460 |
+
#: polls-manager.php:773
|
461 |
+
#, php-format
|
462 |
+
msgid "<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."
|
463 |
+
msgstr ""
|
464 |
+
|
465 |
+
#: polls-manager.php:776
|
466 |
+
msgid ""
|
467 |
+
"You Are About To Uninstall WP-Polls From WordPress.\\n"
|
468 |
+
"This Action Is Not Reversible.\\n"
|
469 |
+
"\\n"
|
470 |
+
" Choose [Cancel] To Stop, [OK] To Uninstall."
|
471 |
+
msgstr ""
|
472 |
+
|
473 |
+
#: polls-options.php:82
|
474 |
+
#: polls-options.php:190
|
475 |
+
#: polls-options.php:193
|
476 |
+
msgid "Poll Bar Style"
|
477 |
+
msgstr ""
|
478 |
+
|
479 |
+
#: polls-options.php:83
|
480 |
+
msgid "Sort Poll Answers By Option"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
#: polls-options.php:84
|
484 |
+
msgid "Sort Order Of Poll Answers Option"
|
485 |
+
msgstr ""
|
486 |
+
|
487 |
+
#: polls-options.php:85
|
488 |
+
msgid "Sort Poll Results By Option"
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: polls-options.php:86
|
492 |
+
msgid "Sort Order Of Poll Results Option"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
#: polls-options.php:87
|
496 |
+
msgid "Voting Form Header Template"
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
+
#: polls-options.php:88
|
500 |
+
msgid "Voting Form Body Template"
|
501 |
+
msgstr ""
|
502 |
+
|
503 |
+
#: polls-options.php:89
|
504 |
+
msgid "Voting Form Footer Template"
|
505 |
+
msgstr ""
|
506 |
+
|
507 |
+
#: polls-options.php:90
|
508 |
+
msgid "Result Header Template"
|
509 |
+
msgstr ""
|
510 |
+
|
511 |
+
#: polls-options.php:91
|
512 |
+
msgid "Result Body Template"
|
513 |
+
msgstr ""
|
514 |
+
|
515 |
+
#: polls-options.php:92
|
516 |
+
msgid "Result Body2 Template"
|
517 |
+
msgstr ""
|
518 |
+
|
519 |
+
#: polls-options.php:93
|
520 |
+
msgid "Result Footer Template"
|
521 |
+
msgstr ""
|
522 |
+
|
523 |
+
#: polls-options.php:94
|
524 |
+
msgid "Result Footer2 Template"
|
525 |
+
msgstr ""
|
526 |
+
|
527 |
+
#: polls-options.php:95
|
528 |
+
msgid "Poll Disabled Template"
|
529 |
+
msgstr ""
|
530 |
+
|
531 |
+
#: polls-options.php:96
|
532 |
+
msgid "Poll Error Template"
|
533 |
+
msgstr ""
|
534 |
+
|
535 |
+
#: polls-options.php:97
|
536 |
+
msgid "Archive Polls Per Page Option"
|
537 |
+
msgstr ""
|
538 |
+
|
539 |
+
#: polls-options.php:98
|
540 |
+
msgid "Polls Archive URL Option"
|
541 |
+
msgstr ""
|
542 |
+
|
543 |
+
#: polls-options.php:99
|
544 |
+
msgid "Show Polls Achive Link Option"
|
545 |
+
msgstr ""
|
546 |
+
|
547 |
+
#: polls-options.php:100
|
548 |
+
msgid "Current Active Poll Option"
|
549 |
+
msgstr ""
|
550 |
+
|
551 |
+
#: polls-options.php:101
|
552 |
+
#: polls-options.php:313
|
553 |
+
msgid "Logging Method"
|
554 |
+
msgstr ""
|
555 |
+
|
556 |
+
#: polls-options.php:102
|
557 |
+
msgid "Allow To Vote Option"
|
558 |
+
msgstr ""
|
559 |
+
|
560 |
+
#: polls-options.php:107
|
561 |
+
msgid "Updated"
|
562 |
+
msgstr ""
|
563 |
+
|
564 |
+
#: polls-options.php:112
|
565 |
+
msgid "No Poll Option Updated"
|
566 |
+
msgstr ""
|
567 |
+
|
568 |
+
#: polls-options.php:129
|
569 |
+
#: polls-options.php:144
|
570 |
+
#: polls.php:992
|
571 |
+
#: polls.php:1005
|
572 |
+
msgid "Vote"
|
573 |
+
msgstr ""
|
574 |
+
|
575 |
+
#: polls-options.php:129
|
576 |
+
#: polls.php:993
|
577 |
+
msgid "View Results Of This Poll"
|
578 |
+
msgstr ""
|
579 |
+
|
580 |
+
#: polls-options.php:129
|
581 |
+
#: polls.php:993
|
582 |
+
msgid "View Results"
|
583 |
+
msgstr ""
|
584 |
+
|
585 |
+
#: polls-options.php:135
|
586 |
+
#: polls-options.php:138
|
587 |
+
#: polls-options.php:280
|
588 |
+
#: polls.php:998
|
589 |
+
#: polls.php:999
|
590 |
+
msgid "Votes"
|
591 |
+
msgstr ""
|
592 |
+
|
593 |
+
#: polls-options.php:138
|
594 |
+
#: polls.php:999
|
595 |
+
msgid "You Have Voted For This Choice"
|
596 |
+
msgstr ""
|
597 |
+
|
598 |
+
#: polls-options.php:144
|
599 |
+
#: polls.php:1005
|
600 |
+
msgid "Vote For This Poll"
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: polls-options.php:147
|
604 |
+
#: polls.php:1007
|
605 |
+
msgid "Sorry, there are no polls available at the moment."
|
606 |
+
msgstr ""
|
607 |
+
|
608 |
+
#: polls-options.php:150
|
609 |
+
#: polls.php:1008
|
610 |
+
msgid "An error has occurred when processing your poll."
|
611 |
+
msgstr ""
|
612 |
+
|
613 |
+
#: polls-options.php:187
|
614 |
+
#: polls.php:54
|
615 |
+
msgid "Poll Options"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
#: polls-options.php:223
|
619 |
+
msgid "Poll Bar Background"
|
620 |
+
msgstr ""
|
621 |
+
|
622 |
+
#: polls-options.php:228
|
623 |
+
msgid "Poll Bar Border"
|
624 |
+
msgstr ""
|
625 |
+
|
626 |
+
#: polls-options.php:233
|
627 |
+
msgid "Poll Bar Height"
|
628 |
+
msgstr ""
|
629 |
+
|
630 |
+
#: polls-options.php:237
|
631 |
+
msgid "Your poll bar will look like this"
|
632 |
+
msgstr ""
|
633 |
+
|
634 |
+
#: polls-options.php:251
|
635 |
+
msgid "Sorting Of Poll Answers"
|
636 |
+
msgstr ""
|
637 |
+
|
638 |
+
#: polls-options.php:254
|
639 |
+
msgid "Sort Poll Answers By:"
|
640 |
+
msgstr ""
|
641 |
+
|
642 |
+
#: polls-options.php:257
|
643 |
+
#: polls-options.php:281
|
644 |
+
msgid "Exact Order"
|
645 |
+
msgstr ""
|
646 |
+
|
647 |
+
#: polls-options.php:258
|
648 |
+
#: polls-options.php:282
|
649 |
+
msgid "Alphabetical Order"
|
650 |
+
msgstr ""
|
651 |
+
|
652 |
+
#: polls-options.php:263
|
653 |
+
msgid "Sort Order Of Poll Answers:"
|
654 |
+
msgstr ""
|
655 |
+
|
656 |
+
#: polls-options.php:266
|
657 |
+
#: polls-options.php:290
|
658 |
+
msgid "Ascending"
|
659 |
+
msgstr ""
|
660 |
+
|
661 |
+
#: polls-options.php:267
|
662 |
+
#: polls-options.php:291
|
663 |
+
msgid "Descending"
|
664 |
+
msgstr ""
|
665 |
+
|
666 |
+
#: polls-options.php:274
|
667 |
+
msgid "Sorting Of Poll Results"
|
668 |
+
msgstr ""
|
669 |
+
|
670 |
+
#: polls-options.php:277
|
671 |
+
msgid "Sort Poll Results By:"
|
672 |
+
msgstr ""
|
673 |
+
|
674 |
+
#: polls-options.php:287
|
675 |
+
msgid "Sort Order Of Poll Results:"
|
676 |
+
msgstr ""
|
677 |
+
|
678 |
+
#: polls-options.php:298
|
679 |
+
msgid "Allow To Vote"
|
680 |
+
msgstr ""
|
681 |
+
|
682 |
+
#: polls-options.php:301
|
683 |
+
msgid "Who Is Allowed To Vote?"
|
684 |
+
msgstr ""
|
685 |
+
|
686 |
+
#: polls-options.php:304
|
687 |
+
msgid "Guests Only"
|
688 |
+
msgstr ""
|
689 |
+
|
690 |
+
#: polls-options.php:305
|
691 |
+
msgid "Registered Users Only"
|
692 |
+
msgstr ""
|
693 |
+
|
694 |
+
#: polls-options.php:306
|
695 |
+
msgid "Registered Users And Guests"
|
696 |
+
msgstr ""
|
697 |
+
|
698 |
+
#: polls-options.php:316
|
699 |
+
msgid "Poll Logging Method:"
|
700 |
+
msgstr ""
|
701 |
+
|
702 |
+
#: polls-options.php:319
|
703 |
+
msgid "Do Not Log"
|
704 |
+
msgstr ""
|
705 |
+
|
706 |
+
#: polls-options.php:320
|
707 |
+
msgid "Logged By Cookie"
|
708 |
+
msgstr ""
|
709 |
+
|
710 |
+
#: polls-options.php:321
|
711 |
+
msgid "Logged By IP"
|
712 |
+
msgstr ""
|
713 |
+
|
714 |
+
#: polls-options.php:322
|
715 |
+
msgid "Logged By Cookie And IP"
|
716 |
+
msgstr ""
|
717 |
+
|
718 |
+
#: polls-options.php:323
|
719 |
+
msgid "Logged By Username"
|
720 |
+
msgstr ""
|
721 |
+
|
722 |
+
#: polls-options.php:330
|
723 |
+
msgid "Poll Archive"
|
724 |
+
msgstr ""
|
725 |
+
|
726 |
+
#: polls-options.php:333
|
727 |
+
msgid "Polls Per Page:"
|
728 |
+
msgstr ""
|
729 |
+
|
730 |
+
#: polls-options.php:337
|
731 |
+
msgid "Polls Archive URL:"
|
732 |
+
msgstr ""
|
733 |
+
|
734 |
+
#: polls-options.php:341
|
735 |
+
#: polls-widget.php:70
|
736 |
+
msgid "Display Polls Archive Link Below Poll?"
|
737 |
+
msgstr ""
|
738 |
+
|
739 |
+
#: polls-options.php:344
|
740 |
+
#: polls-widget.php:76
|
741 |
+
msgid "No"
|
742 |
+
msgstr ""
|
743 |
+
|
744 |
+
#: polls-options.php:352
|
745 |
+
#: polls-options.php:355
|
746 |
+
#: polls-widget.php:85
|
747 |
+
msgid "Current Active Poll"
|
748 |
+
msgstr ""
|
749 |
+
|
750 |
+
#: polls-options.php:358
|
751 |
+
#: polls-widget.php:91
|
752 |
+
msgid "Do NOT Display Poll (Disable)"
|
753 |
+
msgstr ""
|
754 |
+
|
755 |
+
#: polls-options.php:359
|
756 |
+
#: polls-widget.php:96
|
757 |
+
msgid "Display Random Poll"
|
758 |
+
msgstr ""
|
759 |
+
|
760 |
+
#: polls-options.php:360
|
761 |
+
#: polls-widget.php:101
|
762 |
+
msgid "Display Latest Poll"
|
763 |
+
msgstr ""
|
764 |
+
|
765 |
+
#: polls-options.php:382
|
766 |
+
msgid "Template Variables"
|
767 |
+
msgstr ""
|
768 |
+
|
769 |
+
#: polls-options.php:387
|
770 |
+
msgid "Display the poll's ID"
|
771 |
+
msgstr ""
|
772 |
+
|
773 |
+
#: polls-options.php:391
|
774 |
+
msgid "Display the poll's answer ID"
|
775 |
+
msgstr ""
|
776 |
+
|
777 |
+
#: polls-options.php:397
|
778 |
+
msgid "Display the poll's question"
|
779 |
+
msgstr ""
|
780 |
+
|
781 |
+
#: polls-options.php:401
|
782 |
+
msgid "Display the poll's answer"
|
783 |
+
msgstr ""
|
784 |
+
|
785 |
+
#: polls-options.php:407
|
786 |
+
msgid "Display the poll's total votes"
|
787 |
+
msgstr ""
|
788 |
+
|
789 |
+
#: polls-options.php:411
|
790 |
+
msgid "Display the poll's answer without HTML formatting."
|
791 |
+
msgstr ""
|
792 |
+
|
793 |
+
#: polls-options.php:417
|
794 |
+
msgid "Displays URL to poll's result"
|
795 |
+
msgstr ""
|
796 |
+
|
797 |
+
#: polls-options.php:421
|
798 |
+
msgid "Display the poll's answer votes"
|
799 |
+
msgstr ""
|
800 |
+
|
801 |
+
#: polls-options.php:427
|
802 |
+
msgid "Display the poll's most voted answer"
|
803 |
+
msgstr ""
|
804 |
+
|
805 |
+
#: polls-options.php:431
|
806 |
+
msgid "Display the poll's answer percentage"
|
807 |
+
msgstr ""
|
808 |
+
|
809 |
+
#: polls-options.php:437
|
810 |
+
msgid "Display the poll's answer votes for the most voted answer"
|
811 |
+
msgstr ""
|
812 |
+
|
813 |
+
#: polls-options.php:441
|
814 |
+
msgid "Display the poll's answer image width"
|
815 |
+
msgstr ""
|
816 |
+
|
817 |
+
#: polls-options.php:447
|
818 |
+
msgid "Display the poll's answer percentage for the most voted answer"
|
819 |
+
msgstr ""
|
820 |
+
|
821 |
+
#: polls-options.php:451
|
822 |
+
msgid "Display the poll's least voted answer"
|
823 |
+
msgstr ""
|
824 |
+
|
825 |
+
#: polls-options.php:457
|
826 |
+
msgid "Display the poll's answer votes for the least voted answer"
|
827 |
+
msgstr ""
|
828 |
+
|
829 |
+
#: polls-options.php:464
|
830 |
+
msgid "Display the poll's answer percentage for the least voted answer"
|
831 |
+
msgstr ""
|
832 |
+
|
833 |
+
#: polls-options.php:470
|
834 |
+
msgid "Poll Voting Form Templates"
|
835 |
+
msgstr ""
|
836 |
+
|
837 |
+
#: polls-options.php:474
|
838 |
+
msgid "Voting Form Header:"
|
839 |
+
msgstr ""
|
840 |
+
|
841 |
+
#: polls-options.php:475
|
842 |
+
#: polls-options.php:486
|
843 |
+
#: polls-options.php:498
|
844 |
+
#: polls-options.php:513
|
845 |
+
#: polls-options.php:524
|
846 |
+
#: polls-options.php:538
|
847 |
+
#: polls-options.php:552
|
848 |
+
#: polls-options.php:567
|
849 |
+
#: polls-options.php:588
|
850 |
+
#: polls-options.php:597
|
851 |
+
msgid "Allowed Variables:"
|
852 |
+
msgstr ""
|
853 |
+
|
854 |
+
#: polls-options.php:479
|
855 |
+
#: polls-options.php:491
|
856 |
+
#: polls-options.php:501
|
857 |
+
#: polls-options.php:517
|
858 |
+
#: polls-options.php:531
|
859 |
+
#: polls-options.php:545
|
860 |
+
#: polls-options.php:560
|
861 |
+
#: polls-options.php:576
|
862 |
+
#: polls-options.php:590
|
863 |
+
#: polls-options.php:599
|
864 |
+
msgid "Restore Default Template"
|
865 |
+
msgstr ""
|
866 |
+
|
867 |
+
#: polls-options.php:485
|
868 |
+
msgid "Voting Form Body:"
|
869 |
+
msgstr ""
|
870 |
+
|
871 |
+
#: polls-options.php:497
|
872 |
+
msgid "Voting Form Footer:"
|
873 |
+
msgstr ""
|
874 |
+
|
875 |
+
#: polls-options.php:508
|
876 |
+
msgid "Poll Result Templates"
|
877 |
+
msgstr ""
|
878 |
+
|
879 |
+
#: polls-options.php:512
|
880 |
+
msgid "Result Header:"
|
881 |
+
msgstr ""
|
882 |
+
|
883 |
+
#: polls-options.php:523
|
884 |
+
#: polls-options.php:537
|
885 |
+
msgid "Result Body:"
|
886 |
+
msgstr ""
|
887 |
+
|
888 |
+
#: polls-options.php:523
|
889 |
+
#: polls-options.php:551
|
890 |
+
msgid "Normal"
|
891 |
+
msgstr ""
|
892 |
+
|
893 |
+
#: polls-options.php:537
|
894 |
+
msgid "Displaying Of User's Voted Answer"
|
895 |
+
msgstr ""
|
896 |
+
|
897 |
+
#: polls-options.php:551
|
898 |
+
#: polls-options.php:566
|
899 |
+
msgid "Result Footer:"
|
900 |
+
msgstr ""
|
901 |
+
|
902 |
+
#: polls-options.php:566
|
903 |
+
msgid "Displaying Of Vote Poll Link If User Has Not Voted"
|
904 |
+
msgstr ""
|
905 |
+
|
906 |
+
#: polls-options.php:583
|
907 |
+
msgid "Poll Misc Templates"
|
908 |
+
msgstr ""
|
909 |
+
|
910 |
+
#: polls-options.php:587
|
911 |
+
msgid "Poll Disabled"
|
912 |
+
msgstr ""
|
913 |
+
|
914 |
+
#: polls-options.php:589
|
915 |
+
#: polls-options.php:598
|
916 |
+
msgid "N/A"
|
917 |
+
msgstr ""
|
918 |
+
|
919 |
+
#: polls-options.php:596
|
920 |
+
msgid "Poll Error"
|
921 |
+
msgstr ""
|
922 |
+
|
923 |
+
#: polls-options.php:606
|
924 |
+
msgid "Update Options"
|
925 |
+
msgstr ""
|
926 |
+
|
927 |
+
#: polls-usage.php:26
|
928 |
+
msgid "General Usage (Without Widget)"
|
929 |
+
msgstr ""
|
930 |
+
|
931 |
+
#: polls-usage.php:29
|
932 |
+
msgid "Open "
|
933 |
+
msgstr ""
|
934 |
+
|
935 |
+
#: polls-usage.php:29
|
936 |
+
msgid "YOUR THEME NAME"
|
937 |
+
msgstr ""
|
938 |
+
|
939 |
+
#: polls-usage.php:32
|
940 |
+
msgid "Add:"
|
941 |
+
msgstr ""
|
942 |
+
|
943 |
+
#: polls-usage.php:44
|
944 |
+
msgid "To show specific poll, use :"
|
945 |
+
msgstr ""
|
946 |
+
|
947 |
+
#: polls-usage.php:46
|
948 |
+
#: polls-usage.php:49
|
949 |
+
msgid "where <b>2</b> is your poll id."
|
950 |
+
msgstr ""
|
951 |
+
|
952 |
+
#: polls-usage.php:47
|
953 |
+
msgid "To embed a specific poll in your post, use :"
|
954 |
+
msgstr ""
|
955 |
+
|
956 |
+
#: polls-usage.php:52
|
957 |
+
msgid "Scroll down for instructions on how to create <b>Polls Archive</b>."
|
958 |
+
msgstr ""
|
959 |
+
|
960 |
+
#: polls-usage.php:57
|
961 |
+
msgid "General Usage (With Widget)"
|
962 |
+
msgstr ""
|
963 |
+
|
964 |
+
#: polls-usage.php:60
|
965 |
+
msgid "<b>Activate</b> WP-Polls Widget Plugin"
|
966 |
+
msgstr ""
|
967 |
+
|
968 |
+
#: polls-usage.php:63
|
969 |
+
msgid "Go to 'WP-Admin -> Presentation -> Sidebar Widgets'"
|
970 |
+
msgstr ""
|
971 |
+
|
972 |
+
#: polls-usage.php:66
|
973 |
+
msgid "<b>Drag</b> the Polls Widget to your sidebar"
|
974 |
+
msgstr ""
|
975 |
+
|
976 |
+
#: polls-usage.php:69
|
977 |
+
msgid "You can <b>configure</b> the Polls Widget by clicking on the configure icon"
|
978 |
+
msgstr ""
|
979 |
+
|
980 |
+
#: polls-usage.php:72
|
981 |
+
msgid "Click 'Save changes'"
|
982 |
+
msgstr ""
|
983 |
+
|
984 |
+
#: polls-usage.php:75
|
985 |
+
msgid " down for instructions on how to create a <b>Polls Archive</b>."
|
986 |
+
msgstr ""
|
987 |
+
|
988 |
+
#: polls-usage.php:80
|
989 |
+
#: polls.php:605
|
990 |
+
#: polls.php:607
|
991 |
+
#: polls.php:728
|
992 |
+
msgid "Polls Archive"
|
993 |
+
msgstr ""
|
994 |
+
|
995 |
+
#: polls-usage.php:83
|
996 |
+
msgid "Go to 'WP-Admin -> Write -> Write Page'"
|
997 |
+
msgstr ""
|
998 |
+
|
999 |
+
#: polls-usage.php:86
|
1000 |
+
msgid "Type any title you like in the post's title area"
|
1001 |
+
msgstr ""
|
1002 |
+
|
1003 |
+
#: polls-usage.php:89
|
1004 |
+
msgid "Type '<b>[page_polls]</b>' in the post's content area (without the quotes)"
|
1005 |
+
msgstr ""
|
1006 |
+
|
1007 |
+
#: polls-usage.php:92
|
1008 |
+
msgid "Type '<b>pollsarchive</b>' in the post's slug area (without the quotes)"
|
1009 |
+
msgstr ""
|
1010 |
+
|
1011 |
+
#: polls-usage.php:95
|
1012 |
+
msgid "Click 'Publish'"
|
1013 |
+
msgstr ""
|
1014 |
+
|
1015 |
+
#: polls-usage.php:98
|
1016 |
+
msgid "If you <b>ARE NOT</b> using nice permalinks, you need to go to 'WP-Admin -> Polls -> Poll Option' and under '<b>Poll Archive -> Polls Archive URL</b>', you need to fill in the URL to the Polls Archive Page you created above."
|
1017 |
+
msgstr ""
|
1018 |
+
|
1019 |
+
#: polls-usage.php:104
|
1020 |
+
msgid "To Display Total Polls"
|
1021 |
+
msgstr ""
|
1022 |
+
|
1023 |
+
#: polls-usage.php:110
|
1024 |
+
msgid "To Display Total Poll Answers"
|
1025 |
+
msgstr ""
|
1026 |
+
|
1027 |
+
#: polls-usage.php:116
|
1028 |
+
msgid "To Display Total Poll Votes"
|
1029 |
+
msgstr ""
|
1030 |
+
|
1031 |
+
#: polls-usage.php:124
|
1032 |
+
msgid "Note"
|
1033 |
+
msgstr ""
|
1034 |
+
|
1035 |
+
#: polls-usage.php:127
|
1036 |
+
msgid "In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,"
|
1037 |
+
msgstr ""
|
1038 |
+
|
1039 |
+
#: polls-usage.php:130
|
1040 |
+
msgid "Open <b>poll-css.css</b>"
|
1041 |
+
msgstr ""
|
1042 |
+
|
1043 |
+
#: polls-usage.php:133
|
1044 |
+
#: polls-usage.php:152
|
1045 |
+
msgid "Find:"
|
1046 |
+
msgstr ""
|
1047 |
+
|
1048 |
+
#: polls-usage.php:137
|
1049 |
+
#: polls-usage.php:156
|
1050 |
+
msgid "Replace:"
|
1051 |
+
msgstr ""
|
1052 |
+
|
1053 |
+
#: polls-usage.php:139
|
1054 |
+
msgid "Where <b>#ffffff</b> should be your background color for the poll."
|
1055 |
+
msgstr ""
|
1056 |
+
|
1057 |
+
#: polls-usage.php:146
|
1058 |
+
msgid "The AJAX feature might not work if your blog homepage directory is different from the directory you installed WordPress in. To solve this issue,"
|
1059 |
+
msgstr ""
|
1060 |
+
|
1061 |
+
#: polls-usage.php:149
|
1062 |
+
msgid "Open <b>polls.php</b>"
|
1063 |
+
msgstr ""
|
1064 |
+
|
1065 |
+
#: polls-usage.php:158
|
1066 |
+
msgid "Where <b>WORDPRESS_DIRECTORY</b> should be the directory name which you installed WordPress in. Note the backslash after your WordPress Directory, you need that."
|
1067 |
+
msgstr ""
|
1068 |
+
|
1069 |
+
#: polls-widget.php:56
|
1070 |
+
#: polls.php:50
|
1071 |
+
msgid "Polls"
|
1072 |
+
msgstr ""
|
1073 |
+
|
1074 |
+
#: polls-widget.php:67
|
1075 |
+
msgid "Title"
|
1076 |
+
msgstr ""
|
1077 |
+
|
1078 |
+
#: polls.php:55
|
1079 |
+
msgid "Poll Usage"
|
1080 |
+
msgstr ""
|
1081 |
+
|
1082 |
+
#: polls.php:155
|
1083 |
+
msgid "Your last request is still being processed. Please wait a while ..."
|
1084 |
+
msgstr ""
|
1085 |
+
|
1086 |
+
#: polls.php:156
|
1087 |
+
msgid "Please choose a valid poll answer."
|
1088 |
+
msgstr ""
|
1089 |
+
|
1090 |
+
#: polls.php:347
|
1091 |
+
#: polls.php:475
|
1092 |
+
msgid "Loading"
|
1093 |
+
msgstr ""
|
1094 |
+
|
1095 |
+
#: polls.php:706
|
1096 |
+
msgid "Current Poll"
|
1097 |
+
msgstr ""
|
1098 |
+
|
1099 |
+
#: polls.php:828
|
1100 |
+
msgid "Previous Page"
|
1101 |
+
msgstr ""
|
1102 |
+
|
1103 |
+
#: polls.php:836
|
1104 |
+
msgid "Next Page"
|
1105 |
+
msgstr ""
|
1106 |
+
|
1107 |
+
#: polls.php:845
|
1108 |
+
msgid "Pages"
|
1109 |
+
msgstr ""
|
1110 |
+
|
1111 |
+
#: polls.php:847
|
1112 |
+
msgid "Go to First Page"
|
1113 |
+
msgstr ""
|
1114 |
+
|
1115 |
+
#: polls.php:847
|
1116 |
+
msgid "First"
|
1117 |
+
msgstr ""
|
1118 |
+
|
1119 |
+
#: polls.php:850
|
1120 |
+
#: polls.php:862
|
1121 |
+
msgid "Go to Page"
|
1122 |
+
msgstr ""
|
1123 |
+
|
1124 |
+
#: polls.php:857
|
1125 |
+
msgid "Page"
|
1126 |
+
msgstr ""
|
1127 |
+
|
1128 |
+
#: polls.php:865
|
1129 |
+
msgid "Go to Last Page"
|
1130 |
+
msgstr ""
|
1131 |
+
|
1132 |
+
#: polls.php:865
|
1133 |
+
msgid "Last"
|
1134 |
+
msgstr ""
|
1135 |
+
|
1136 |
+
#: polls.php:911
|
1137 |
+
msgid "Unable To Update Poll Total Votes."
|
1138 |
+
msgstr ""
|
1139 |
+
|
1140 |
+
#: polls.php:911
|
1141 |
+
#: polls.php:915
|
1142 |
+
#: polls.php:919
|
1143 |
+
#: polls.php:923
|
1144 |
+
msgid "Poll ID"
|
1145 |
+
msgstr ""
|
1146 |
+
|
1147 |
+
#: polls.php:915
|
1148 |
+
msgid "Unable To Update Poll Answer Votes."
|
1149 |
+
msgstr ""
|
1150 |
+
|
1151 |
+
#: polls.php:915
|
1152 |
+
#: polls.php:923
|
1153 |
+
msgid "Poll Answer ID"
|
1154 |
+
msgstr ""
|
1155 |
+
|
1156 |
+
#: polls.php:919
|
1157 |
+
msgid "You Had Already Voted For This Poll."
|
1158 |
+
msgstr ""
|
1159 |
+
|
1160 |
+
#: polls.php:923
|
1161 |
+
msgid "Invalid Poll ID Or Poll Answer ID."
|
1162 |
+
msgstr ""
|
1163 |
+
|
1164 |
+
#: polls.php:976
|
1165 |
+
msgid "How Is My Site?"
|
1166 |
+
msgstr ""
|
1167 |
+
|
1168 |
+
#: polls.php:979
|
1169 |
+
msgid "Good"
|
1170 |
+
msgstr ""
|
1171 |
+
|
1172 |
+
#: polls.php:980
|
1173 |
+
msgid "Excellent"
|
1174 |
+
msgstr ""
|
1175 |
+
|
1176 |
+
#: polls.php:981
|
1177 |
+
msgid "Bad"
|
1178 |
+
msgstr ""
|
1179 |
+
|
1180 |
+
#: polls.php:982
|
1181 |
+
msgid "Can Be Improved"
|
1182 |
+
msgstr ""
|
1183 |
+
|
1184 |
+
#: polls.php:983
|
1185 |
+
msgid "No Comments"
|
1186 |
+
msgstr ""
|
1187 |
+
|
readme.html
ADDED
@@ -0,0 +1,618 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-Polls 2.13 Readme</title>
|
6 |
+
<style type="text/css" media="screen">
|
7 |
+
/* Default Style */
|
8 |
+
BODY {
|
9 |
+
font-family: Verdana, Arial;
|
10 |
+
font-size: 12px;
|
11 |
+
color: #000000;
|
12 |
+
background: #FFFFFF;
|
13 |
+
}
|
14 |
+
P {
|
15 |
+
padding-left: 10px;
|
16 |
+
}
|
17 |
+
BLOCKQUOTE {
|
18 |
+
margin: 10px 20px 0px 20px;
|
19 |
+
padding: 10px;
|
20 |
+
border: 1px solid #8d8d8d;
|
21 |
+
background-color: #f5f5f5;
|
22 |
+
overflow: auto;
|
23 |
+
}
|
24 |
+
LI {
|
25 |
+
margin-top: 20px;
|
26 |
+
}
|
27 |
+
UL LI UL LI {
|
28 |
+
margin-top: 10px;
|
29 |
+
}
|
30 |
+
A, A:active, A:link, A:visited {
|
31 |
+
color: #2d3a4c;
|
32 |
+
text-decoration: none;
|
33 |
+
}
|
34 |
+
A:hover {
|
35 |
+
color: #5577a5;
|
36 |
+
text-decoration: underline;
|
37 |
+
}
|
38 |
+
/* Place Holder Style */
|
39 |
+
#Container {
|
40 |
+
width: 780px;
|
41 |
+
margin-left: auto;
|
42 |
+
margin-right: auto;
|
43 |
+
}
|
44 |
+
#Content {
|
45 |
+
background-color: #fafafa;
|
46 |
+
border: 1px solid #a2b6cb;
|
47 |
+
padding: 10px;
|
48 |
+
margin-top: -13px;
|
49 |
+
}
|
50 |
+
/* Title Style */
|
51 |
+
#Title {
|
52 |
+
font-family: Verdana, Arial;
|
53 |
+
font-size: 22px;
|
54 |
+
font-weight: bold;
|
55 |
+
color: #389aff;
|
56 |
+
border-bottom: 1px solid #389aff;
|
57 |
+
margin-bottom: 10px;
|
58 |
+
}
|
59 |
+
.SubTitle {
|
60 |
+
font-family: Verdana, Arial;
|
61 |
+
font-size: 18px;
|
62 |
+
font-weight: bold;
|
63 |
+
color: #5b87b4;
|
64 |
+
}
|
65 |
+
.SubSubTitle {
|
66 |
+
font-family: Verdana, Arial;
|
67 |
+
font-size: 14px;
|
68 |
+
font-weight: bold;
|
69 |
+
color: #73a4d6;
|
70 |
+
}
|
71 |
+
/* Tabs */
|
72 |
+
UL#Tabs {
|
73 |
+
font-family: Verdana, Arial;
|
74 |
+
font-size: 12px;
|
75 |
+
font-weight: bold;
|
76 |
+
list-style-type: none;
|
77 |
+
padding-bottom: 28px;
|
78 |
+
border-bottom: 1px solid #a2b6cb;
|
79 |
+
margin-bottom: 12px;
|
80 |
+
z-index: 1;
|
81 |
+
}
|
82 |
+
#Tabs LI.Tab {
|
83 |
+
float: right;
|
84 |
+
height: 25px;
|
85 |
+
background-color: #deedfb;
|
86 |
+
margin: 2px 0px 0px 5px;
|
87 |
+
border: 1px solid #a2b6cb;
|
88 |
+
}
|
89 |
+
#Tabs LI.Tab A {
|
90 |
+
float: left;
|
91 |
+
display: block;
|
92 |
+
color: #666666;
|
93 |
+
text-decoration: none;
|
94 |
+
padding: 5px;
|
95 |
+
}
|
96 |
+
#Tabs LI.Tab A:hover {
|
97 |
+
background-color: #bfe0fe;
|
98 |
+
border-bottom: 1px solid #bfe0fe;
|
99 |
+
}
|
100 |
+
/* Selected Tab */
|
101 |
+
#Tabs LI.SelectedTab {
|
102 |
+
float: right;
|
103 |
+
height: 25px;
|
104 |
+
background-color: #fafafa;
|
105 |
+
margin: 2px 0px 0px 5px;
|
106 |
+
border-top: 1px solid #a2b6cb;
|
107 |
+
border-right: 1px solid #a2b6cb;
|
108 |
+
border-bottom: 1px solid #fafafa;
|
109 |
+
border-left: 1px solid #a2b6cb;
|
110 |
+
}
|
111 |
+
#Tabs LI.SelectedTab A {
|
112 |
+
float: left;
|
113 |
+
display: block;
|
114 |
+
color: #666666;
|
115 |
+
text-decoration: none;
|
116 |
+
padding: 5px;
|
117 |
+
cursor: default;
|
118 |
+
}
|
119 |
+
/* Copyright */
|
120 |
+
#Copyright {
|
121 |
+
text-align: center;
|
122 |
+
}
|
123 |
+
</style>
|
124 |
+
<script type="text/javascript">
|
125 |
+
// Index Page
|
126 |
+
function index() {
|
127 |
+
// Tab
|
128 |
+
document.getElementById('IndexTab').className = 'SelectedTab';
|
129 |
+
document.getElementById('InstallTab').className = 'Tab';
|
130 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
131 |
+
document.getElementById('UsageTab').className = 'Tab';
|
132 |
+
// Page
|
133 |
+
document.getElementById('Index').style.display= 'block';
|
134 |
+
document.getElementById('IndexTab').className = 'SelectedTab';
|
135 |
+
document.getElementById('Install').style.display = 'none';
|
136 |
+
document.getElementById('Upgrade').style.display = 'none';
|
137 |
+
document.getElementById('Usage').style.display = 'none';
|
138 |
+
}
|
139 |
+
// Installation Page
|
140 |
+
function install() {
|
141 |
+
// Tab
|
142 |
+
document.getElementById('IndexTab').className = 'Tab';
|
143 |
+
document.getElementById('InstallTab').className = 'SelectedTab';
|
144 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
145 |
+
document.getElementById('UsageTab').className = 'Tab';
|
146 |
+
// Page
|
147 |
+
document.getElementById('Index').style.display= 'none';
|
148 |
+
document.getElementById('Install').style.display = 'block';
|
149 |
+
document.getElementById('Upgrade').style.display = 'none';
|
150 |
+
document.getElementById('Usage').style.display = 'none';
|
151 |
+
}
|
152 |
+
// Upgrade Page
|
153 |
+
function upgrade() {
|
154 |
+
// Tab
|
155 |
+
document.getElementById('IndexTab').className = 'Tab';
|
156 |
+
document.getElementById('InstallTab').className = 'Tab';
|
157 |
+
document.getElementById('UpgradeTab').className = 'SelectedTab';
|
158 |
+
document.getElementById('UpgradeTab').href = 'Tab';
|
159 |
+
document.getElementById('UsageTab').className = 'Tab';
|
160 |
+
// Page
|
161 |
+
document.getElementById('Index').style.display= 'none';
|
162 |
+
document.getElementById('Install').style.display = 'none';
|
163 |
+
document.getElementById('Upgrade').style.display = 'block';
|
164 |
+
document.getElementById('Usage').style.display = 'none';
|
165 |
+
}
|
166 |
+
// Usage Page
|
167 |
+
function usage() {
|
168 |
+
// Tab
|
169 |
+
document.getElementById('IndexTab').className = 'Tab';
|
170 |
+
document.getElementById('InstallTab').className = 'Tab';
|
171 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
172 |
+
document.getElementById('UsageTab').className = 'SelectedTab';
|
173 |
+
// Page
|
174 |
+
document.getElementById('Index').style.display= 'none';
|
175 |
+
document.getElementById('Install').style.display = 'none';
|
176 |
+
document.getElementById('Upgrade').style.display = 'none';
|
177 |
+
document.getElementById('Usage').style.display = 'block';
|
178 |
+
}
|
179 |
+
</script>
|
180 |
+
</head>
|
181 |
+
<body>
|
182 |
+
<div id="Container">
|
183 |
+
<!-- Title -->
|
184 |
+
<div id="Title">WP-Polls 2.13 <span style="color: #aaaaaa;">Readme</span></div>
|
185 |
+
|
186 |
+
<!-- Tabs -->
|
187 |
+
<ul id="Tabs">
|
188 |
+
<li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
|
189 |
+
<li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
|
190 |
+
<li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
|
191 |
+
<li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
|
192 |
+
</ul>
|
193 |
+
|
194 |
+
<!-- Content -->
|
195 |
+
<div id="Content">
|
196 |
+
<!-- Index -->
|
197 |
+
<div id="Index">
|
198 |
+
<div class="SubTitle">» Index</div>
|
199 |
+
<div class="SubSubTitle">Plugin Information</div>
|
200 |
+
<p><b>Author</b><br /><b>»</b> Lester 'GaMerZ' Chan</p>
|
201 |
+
<p>
|
202 |
+
<b>EMail:</b><br /><b>»</b>
|
203 |
+
<script type="text/javascript">
|
204 |
+
/* <![CDATA[*/
|
205 |
+
document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Polls%202.13%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
|
206 |
+
/* ]]> */
|
207 |
+
</script>
|
208 |
+
</p>
|
209 |
+
<p><b>Website:</b><br /><b>»</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a></p>
|
210 |
+
<p><b>Demo:</b><br /><b>»</b> <a href="http://www.lesterchan.net/wordpress/" title="http://www.lesterchan.net/wordpress/">http://www.lesterchan.net/wordpress/</a></p>
|
211 |
+
<p><b>Documentation:</b><br /><b>»</b> <a href="http://dev.wp-plugins.org/wiki/wp-polls" title="http://dev.wp-plugins.org/wiki/wp-polls">http://dev.wp-plugins.org/wiki/wp-polls</a></p>
|
212 |
+
<p><b>Development:</b><br /><b>»</b> <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></p>
|
213 |
+
<p><b>Support Forums:</b><br /><b>»</b> <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></p>
|
214 |
+
<p><b>Credits:</b><br />
|
215 |
+
<b>»</b> Localization By <a href="http://4visions.nl/" title="http://4visions.nl/">Ravan</a><br />
|
216 |
+
<b>»</b> Uninstaller By Philippe Corbes</a>
|
217 |
+
</p>
|
218 |
+
<p><b>Updated:</b><br /><b>»</b> 2nd January 2007</p>
|
219 |
+
<div class="SubSubTitle">Changelog</div>
|
220 |
+
<ul>
|
221 |
+
<li>
|
222 |
+
<b>Version 2.13 (02-01-2007)</b>
|
223 |
+
<ul>
|
224 |
+
<li>NEW: polls.php Now Handles The AJAX Processing Instead Of index.php</li>
|
225 |
+
<li>NEW: Able To Modify The Style Of Poll Results Bar in 'Polls -> Poll Option'</li>
|
226 |
+
<li>NEW: Usage Instructions Is Also Included Within The Plugin Itself</li>
|
227 |
+
<li>NEW: Uninstaller Done By Philippe Corbes</li>
|
228 |
+
<li>NEW: Localization Done By <a href="http://4visions.nl/" title="http://4visions.nl/">Ravan</a></li>
|
229 |
+
<li>NEW: Ability To Add HTML Into Poll Question and Answers</li>
|
230 |
+
<li>FIXED: AJAX Not Working On Servers Running On PHP CGI</li>
|
231 |
+
<li>FIXED: Added Some Default Styles To polls-css.css To Ensure That WP-Polls Does Not Break</li>
|
232 |
+
<li>FIXED: Other Languages Not Appearing Properly</li>
|
233 |
+
<li>FIXED: Poll IP Logs Of Deleted Poll's Answer Did Not Get Deleted</li>
|
234 |
+
<li>FIXED: There Is An Error In Voting If There Is Only 1 Poll's Answer</li>
|
235 |
+
</ul>
|
236 |
+
</li>
|
237 |
+
<li>
|
238 |
+
<b>Version 2.12 (01-10-2006)</b>
|
239 |
+
<ul>
|
240 |
+
|
241 |
+
<li>NEW: Polls Archive Is Now Embedded Into A Page, And Hence No More Integrating Of Polls Archive</li>
|
242 |
+
<li>NEW: WP-Polls Is Now Using DIV To Display The Poll's Results Instead Of The Image Bar</li>
|
243 |
+
<li>NEW: Added Widget Title Option To WP-Polls Widget</li>
|
244 |
+
<li>NEW: Ability To Logged By UserName</li>
|
245 |
+
<li>NEW: Added CSS Class 'wp-polls-image' To All IMG Tags</li>
|
246 |
+
<li>FIXED: If Site URL Doesn't Match WP Option's Site URL, WP-Polls Will Not Work</li>
|
247 |
+
</ul>
|
248 |
+
</li>
|
249 |
+
<li>
|
250 |
+
<b>Version 2.11 (08-06-2006)</b>
|
251 |
+
<ul>
|
252 |
+
<li>NEW: You Can Now Place The Poll On The Sidebar As A Widget</li>
|
253 |
+
<li>NEW: Moved wp-polls.php To wp-content/plugins/polls/ Folder</li>
|
254 |
+
<li>FIXED: AJAX Not Working In Opera Browser</li>
|
255 |
+
<li>FIXED: Poll Not Working On Physical Pages That Is Integrated Into WordPress</li>
|
256 |
+
</ul>
|
257 |
+
</li>
|
258 |
+
<li>
|
259 |
+
<b>Version 2.1 (01-06-2006)</b>
|
260 |
+
<ul>
|
261 |
+
<li>NEW: Poll Is Now Using AJAX</li>
|
262 |
+
<li>NEW: Ability To Close/Open Poll</li>
|
263 |
+
<li>NEW: Added Poll Option For Logging Method</li>
|
264 |
+
<li>NEW: Added Poll Option For Who Can Vote</li>
|
265 |
+
<li>NEW: Added Poll Results Footer Template Variable (Used When User Click "View Results")</li>
|
266 |
+
<li>NEW: Added The Ability To Delete All Poll Logs Or Logs From A Specific Poll</li>
|
267 |
+
<li>NEW: Poll Administration Panel And The Code That WP-Polls Generated Is XHTML 1.0 Transitional</li>
|
268 |
+
</ul>
|
269 |
+
</li>
|
270 |
+
<li>
|
271 |
+
<b>Version 2.06b (26-04-2006)</b>
|
272 |
+
<ul>
|
273 |
+
<li>FIXED: Bug In vote_poll();</li>
|
274 |
+
</ul>
|
275 |
+
</li>
|
276 |
+
<li>
|
277 |
+
<b>Version 2.06a (02-04-2006)</b>
|
278 |
+
<ul>
|
279 |
+
<li>FIXED: Random Poll Not Working Correctly</li>
|
280 |
+
</ul>
|
281 |
+
</li>
|
282 |
+
<li>
|
283 |
+
<b>Version 2.06 (01-04-2006)</b>
|
284 |
+
<ul>
|
285 |
+
<li>NEW: Poll Bar Is Slightly Nicer</li>
|
286 |
+
<li>NEW: Got Rid Of Tables, Now Using List</li>
|
287 |
+
<li>NEW: Added In Most Voted And Least Voted Answer/Votes/Percentage For Individual Poll As Template Variables</li>
|
288 |
+
<li>NEW: Display Random Poll Option Under Poll -> Poll Options -> Current Poll</li>
|
289 |
+
<li>FIXED: Totally Removed Tables In wp-polls.php</li>
|
290 |
+
</ul>
|
291 |
+
</li>
|
292 |
+
<li>
|
293 |
+
<b>Version 2.05 (01-03-2006)</b>
|
294 |
+
<ul>
|
295 |
+
<li>NEW: Improved On 'manage_polls' Capabilities</li>
|
296 |
+
<li>NEW: Neater Structure</li>
|
297 |
+
<li>NEW: No More Install/Upgrade File, It Will Install/Upgrade When You Activate The Plugin</li>
|
298 |
+
<li>NEW: Added Poll Stats Function</li>
|
299 |
+
</ul>
|
300 |
+
</li>
|
301 |
+
<li>
|
302 |
+
<b>Version 2.04 (01-02-2006)</b>
|
303 |
+
<ul>
|
304 |
+
<li>NEW: Added 'manage_polls' Capabilities To Administrator Role</li>
|
305 |
+
<li>NEW: [poll=POLL_ID] Tag To Insert Poll Into A Post</li>
|
306 |
+
<li>NEW: Ability To Edit Poll's Timestamp</li>
|
307 |
+
<li>NEW: Ability To Edit Individual Poll's Answer Votes</li>
|
308 |
+
<li>NEW: %POLL_RESULT_URL% To Display Poll's Result URL</li>
|
309 |
+
<li>FIXED: Cannot Sent Header Error</li>
|
310 |
+
</ul>
|
311 |
+
</li>
|
312 |
+
<li>
|
313 |
+
<b>Version 2.03 (01-01-2006)</b>
|
314 |
+
<ul>
|
315 |
+
<li>NEW: Compatible With WordPress 2.0 Only</li>
|
316 |
+
<li>NEW: Poll Administration Menu Added Automatically Upon Activating The Plugin</li>
|
317 |
+
<li>NEW: Removed Add Poll Link From The Administration Menu</li>
|
318 |
+
<li>NEW: GPL License Added</li>
|
319 |
+
<li>NEW: Page Title Added To wp-polls.php</li>
|
320 |
+
</ul>
|
321 |
+
</li>
|
322 |
+
<li>
|
323 |
+
<b>Version 2.02a (17-11-2005)</b>
|
324 |
+
<ul>
|
325 |
+
<li>FIXED: poll-install.php And poll-upgrade.php will Now Be Installed/Upgraded To 2.02 Instead Of 2.01</li>
|
326 |
+
</ul>
|
327 |
+
</li>
|
328 |
+
<li>
|
329 |
+
<b>Version 2.02 (05-11-2005)</b>
|
330 |
+
<ul>
|
331 |
+
<li>FIXED: Showing 0 Vote On Poll Edit Page</li>
|
332 |
+
<li>FIXED: Null Vote Being Counted As A Vote</li>
|
333 |
+
<li>FIXED: Auto Loading Of Poll Option: Polls Per Page In Poll Archive Page Is Now "No"</li>
|
334 |
+
<li>NEW: Host Column In Poll IP Table To Prevent Network Lagging When Resolving IP</li>
|
335 |
+
<li>NEW: New Poll Error Template</li>
|
336 |
+
</ul>
|
337 |
+
</li>
|
338 |
+
<li>
|
339 |
+
<b>Version 2.01 (25-10-2005)</b>
|
340 |
+
<ul>
|
341 |
+
<li>FIXED: Upgrade Script To Insert Lastest Poll ID Of User's Current Polls, Instead Of Poll ID 1</li>
|
342 |
+
<li>FIXED: Replace All <?= With <?php</li>
|
343 |
+
<li>FIXED: Added addalshes() To $pollip_user</li>
|
344 |
+
<li>FIXED: Better Localization Support (80% Done, Will Leave It In The Mean Time)</li>
|
345 |
+
</ul>
|
346 |
+
</li>
|
347 |
+
<li>
|
348 |
+
<b>Version 2.0 (20-10-2005)</b>
|
349 |
+
<ul>
|
350 |
+
<li>NEW: IP Logging</li>
|
351 |
+
<li>NEW: Poll Options: Sorting Of Answers In Voting Form</li>
|
352 |
+
<li>NEW: Poll Options: Sorting Of Answers In Results View</li>
|
353 |
+
<li>NEW: Poll Options: Number Of Polls Per Page In Poll Archive</li>
|
354 |
+
<li>NEW: Poll Options: Choose Poll To Display On Index Page</li>
|
355 |
+
<li>NEW: Poll Options: Able To Disable Poll With Custom Message</li>
|
356 |
+
<li>NEW: Poll Options: Poll Templates</li>
|
357 |
+
<li>NEW: Display User's Voted Choice</li>
|
358 |
+
<li>FIXED: Better Install/Upgrade Script</li>
|
359 |
+
</ul>
|
360 |
+
</li>
|
361 |
+
</ul>
|
362 |
+
</div>
|
363 |
+
|
364 |
+
<!-- Installation Instructions -->
|
365 |
+
<div id="Install" style="display: none;">
|
366 |
+
<div class="SubTitle">» Installation Instructions</div>
|
367 |
+
<ol>
|
368 |
+
<li>
|
369 |
+
Open <b>wp-content/plugins</b> Folder
|
370 |
+
</li>
|
371 |
+
<li>
|
372 |
+
Put:
|
373 |
+
<blockquote>Folder: polls</blockquote>
|
374 |
+
</li>
|
375 |
+
<li>
|
376 |
+
<b>Activate</b> WP-Polls Plugin
|
377 |
+
</li>
|
378 |
+
<li>
|
379 |
+
Refer To <b>Usage</b> For Further Instructions
|
380 |
+
</li>
|
381 |
+
</ol>
|
382 |
+
</div>
|
383 |
+
|
384 |
+
<!-- Upgrade Instructions -->
|
385 |
+
<div id="Upgrade" style="display: none;">
|
386 |
+
<div class="SubTitle">» Upgrade Instructions</div>
|
387 |
+
<div class="SubSubTitle">From v2.1x To v2.13</div>
|
388 |
+
<ol>
|
389 |
+
<li>
|
390 |
+
<b>Deactivate</b> WP-Polls Plugin
|
391 |
+
</li>
|
392 |
+
<li>
|
393 |
+
Open <b>wp-content/plugins</b> Folder
|
394 |
+
</li>
|
395 |
+
<li>
|
396 |
+
Overwrite:
|
397 |
+
<blockquote>Folder: polls</blockquote>
|
398 |
+
</li>
|
399 |
+
<li>
|
400 |
+
Open <b>wp-content/plugins/polls</b> Folder
|
401 |
+
</li>
|
402 |
+
<li>
|
403 |
+
Delete file if exists:
|
404 |
+
<blockquote>
|
405 |
+
File: wp-polls.php<br />
|
406 |
+
File: images/pollbar.gif<br />
|
407 |
+
File: images/pollend.gif<br />
|
408 |
+
File: images/pollstart.gif<br />
|
409 |
+
File: images/pollbar.gif
|
410 |
+
</blockquote>
|
411 |
+
</li>
|
412 |
+
<li>
|
413 |
+
Open <b>Root WordPress</b> Folder
|
414 |
+
</li>
|
415 |
+
<li>
|
416 |
+
Delete file if exists:
|
417 |
+
<blockquote>File: wp-polls.php</blockquote>
|
418 |
+
</li>
|
419 |
+
<li>
|
420 |
+
<b>Activate</b> WP-Polls Plugin
|
421 |
+
</li>
|
422 |
+
<li>
|
423 |
+
Go to 'WP-Admin -> Polls -> Polls Options' and restore all the template variables to <b>Default</b>
|
424 |
+
</li>
|
425 |
+
<li>
|
426 |
+
Refer To <b>Usage</b> For Further Instructions
|
427 |
+
</li>
|
428 |
+
</ol>
|
429 |
+
<div class="SubSubTitle">From v2.06 To v2.13</div>
|
430 |
+
<ol>
|
431 |
+
<li>
|
432 |
+
<b>Deactivate</b> WP-Polls Plugin
|
433 |
+
</li>
|
434 |
+
<li>
|
435 |
+
Open <b>wp-content/plugins</b> Folder
|
436 |
+
</li>
|
437 |
+
<li>
|
438 |
+
Overwrite:
|
439 |
+
<blockquote>Folder: polls</blockquote>
|
440 |
+
</li>
|
441 |
+
<li>
|
442 |
+
Open <b>Root WordPress</b> Folder
|
443 |
+
</li>
|
444 |
+
<li>
|
445 |
+
Delete file if exists:
|
446 |
+
<blockquote>File: wp-polls.php</blockquote>
|
447 |
+
</li>
|
448 |
+
<li>
|
449 |
+
<b>Activate</b> WP-Polls Plugin
|
450 |
+
</li>
|
451 |
+
<li>
|
452 |
+
Go to 'WP-Admin -> Polls -> Polls Options' and restore all the template variables to <b>Default</b>
|
453 |
+
</li>
|
454 |
+
<li>
|
455 |
+
Refer To <b>Usage</b> For Further Instructions
|
456 |
+
</li>
|
457 |
+
</ol>
|
458 |
+
</div>
|
459 |
+
|
460 |
+
<!-- Usage Instructions -->
|
461 |
+
<div id="Usage" style="display: none;">
|
462 |
+
<div class="SubTitle">» Usage Instructions</div>
|
463 |
+
<div class="SubSubTitle">General Usage (Without Widget)</div>
|
464 |
+
<ol>
|
465 |
+
<li>
|
466 |
+
Open <b>wp-content/themes/<YOUR THEME NAME>/sidebar.php</b>
|
467 |
+
</li>
|
468 |
+
<li>
|
469 |
+
Add:
|
470 |
+
<blockquote>
|
471 |
+
<?php if (function_exists('vote_poll') && !$in_pollsarchive): ?><br />
|
472 |
+
<li><br />
|
473 |
+
<h2>Polls</h2><br />
|
474 |
+
<ul><br />
|
475 |
+
<li><?php get_poll();?></li><br />
|
476 |
+
</ul><br />
|
477 |
+
<?php display_polls_archive_link(); ?><br />
|
478 |
+
</li><br />
|
479 |
+
<?php endif; ?>
|
480 |
+
</blockquote>
|
481 |
+
<p>To show specific poll, use <?php get_poll(<b>2</b>);?> where <b>2</b> is your poll id.</p>
|
482 |
+
<p>To embed a specific poll in your post, use [poll=<b>2</b>] where <b>2</b> is your poll id.</p>
|
483 |
+
</li>
|
484 |
+
<li>
|
485 |
+
Scroll down for instructions on how to create a <b>Polls Archive</b>.
|
486 |
+
</li>
|
487 |
+
</ol>
|
488 |
+
<div class="SubSubTitle">General Usage (With Widget)</div>
|
489 |
+
<ol>
|
490 |
+
<li>
|
491 |
+
<b>Activate</b> WP-Polls Widget Plugin
|
492 |
+
</li>
|
493 |
+
<li>
|
494 |
+
Go to 'WP-Admin -> Presentation -> Sidebar Widgets'
|
495 |
+
</li>
|
496 |
+
<li>
|
497 |
+
<b>Drag</b> the Polls Widget to your sidebar
|
498 |
+
</li>
|
499 |
+
<li>
|
500 |
+
You can <b>configure</b> the Polls Widget by clicking on the configure icon
|
501 |
+
</li>
|
502 |
+
<li>
|
503 |
+
Click 'Save changes'
|
504 |
+
</li>
|
505 |
+
<li>
|
506 |
+
Scroll down for instructions on how to create a <b>Polls Archive</b>.
|
507 |
+
</li>
|
508 |
+
</ol>
|
509 |
+
<div class="SubSubTitle">Polls Archive</div>
|
510 |
+
<ol>
|
511 |
+
<li>
|
512 |
+
Go to 'WP-Admin -> Write -> Write Page'
|
513 |
+
</li>
|
514 |
+
<li>
|
515 |
+
Type any title you like in the post's title area
|
516 |
+
</li>
|
517 |
+
<li>
|
518 |
+
Type '<b>[page_polls]</b>' in the post's content area (without the quotes)
|
519 |
+
</li>
|
520 |
+
<li>
|
521 |
+
Type '<b>pollsarchive</b>' in the post's slug area (without the quotes)
|
522 |
+
</li>
|
523 |
+
<li>
|
524 |
+
Click 'Publish'
|
525 |
+
</li>
|
526 |
+
<li>
|
527 |
+
If you <b>ARE NOT</b> using nice permalinks, you need to go to 'WP-Admin -> Polls -> Poll Option' and under '<b>Poll Archive -> Polls Archive URL</b>', you need to fill in the URL to the Polls Archive Page you created above.
|
528 |
+
</li>
|
529 |
+
</ol>
|
530 |
+
<div class="SubSubTitle">Note</div>
|
531 |
+
<ul>
|
532 |
+
<li>
|
533 |
+
In IE, some of the poll's text may appear jagged (this is normal in IE). To solve this issue,
|
534 |
+
<ol>
|
535 |
+
<li>
|
536 |
+
Open <b>poll-css.css</b>
|
537 |
+
</li>
|
538 |
+
<li>
|
539 |
+
Find:
|
540 |
+
<blockquote>
|
541 |
+
/* background-color: #ffffff; */
|
542 |
+
</blockquote>
|
543 |
+
</li>
|
544 |
+
<li>
|
545 |
+
Replace:
|
546 |
+
<blockquote>
|
547 |
+
background-color: #ffffff;
|
548 |
+
</blockquote>
|
549 |
+
<p>Where <b>#ffffff</b> should be your background color for the poll.</p>
|
550 |
+
</li>
|
551 |
+
</ol>
|
552 |
+
</li>
|
553 |
+
</ul>
|
554 |
+
<ul>
|
555 |
+
<li>
|
556 |
+
The AJAX feature might not work if your blog homepage directory is different from the directory you installed WordPress in. To solve this issue,
|
557 |
+
<ol>
|
558 |
+
<li>
|
559 |
+
Open <b>polls.php</b>
|
560 |
+
</li>
|
561 |
+
<li>
|
562 |
+
Find:
|
563 |
+
<blockquote>
|
564 |
+
echo "\t".'var polls_ajax_url = \''.$polls_ajax_url.'/wp-content/plugins/polls/polls.php\';'."\n";
|
565 |
+
</blockquote>
|
566 |
+
</li>
|
567 |
+
<li>
|
568 |
+
Replace:
|
569 |
+
<blockquote>
|
570 |
+
echo "\t".'var polls_ajax_url = \''.$polls_ajax_url.'/WORDPRESS_DIRECTORY/wp-content/plugins/polls/polls.php\';'."\n";
|
571 |
+
</blockquote>
|
572 |
+
<p>Where <b>WORDPRESS_DIRECTORY</b> should be the directory name which you installed WordPress in. Note the backslash after your WordPress Directory, you need that.</p>
|
573 |
+
</li>
|
574 |
+
</ol>
|
575 |
+
</li>
|
576 |
+
</ul>
|
577 |
+
<div class="SubSubTitle">Polls Stats (Outside WP Loop)</div>
|
578 |
+
<ul>
|
579 |
+
<li>
|
580 |
+
To Display <b>Total Polls</b>
|
581 |
+
</li>
|
582 |
+
<li>
|
583 |
+
Use:
|
584 |
+
<blockquote>
|
585 |
+
<?php if (function_exists('get_pollquestions')): ?><br />
|
586 |
+
<?php get_pollquestions(); ?><br />
|
587 |
+
<?php endif; ?>
|
588 |
+
</blockquote>
|
589 |
+
</li>
|
590 |
+
<li>
|
591 |
+
To Display <b>Total Poll Answers</b>
|
592 |
+
</li>
|
593 |
+
<li>
|
594 |
+
Use:
|
595 |
+
<blockquote>
|
596 |
+
<?php if (function_exists('get_pollanswers')): ?><br />
|
597 |
+
<?php get_pollanswers(); ?><br />
|
598 |
+
<?php endif; ?>
|
599 |
+
</blockquote>
|
600 |
+
</li>
|
601 |
+
<li>
|
602 |
+
To Display <b>Total Poll Votes</b>
|
603 |
+
</li>
|
604 |
+
<li>
|
605 |
+
Use:
|
606 |
+
<blockquote>
|
607 |
+
<?php if (function_exists('get_pollvotes')): ?><br />
|
608 |
+
<?php get_pollvotes(); ?><br />
|
609 |
+
<?php endif; ?>
|
610 |
+
</blockquote>
|
611 |
+
</li>
|
612 |
+
</ul>
|
613 |
+
</div>
|
614 |
+
</div>
|
615 |
+
</div>
|
616 |
+
<p id="Copyright">WP-Polls 2.13<br />Copyright © 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
617 |
+
</body>
|
618 |
+
</html>
|