| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
if(!current_user_can('manage_polls')) { |
|---|
| 22 |
die('Access Denied'); |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
$base_name = plugin_basename('wp-polls/polls-options.php'); |
|---|
| 28 |
$base_page = 'admin.php?page='.$base_name; |
|---|
| 29 |
$id = intval($_GET['id']); |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
if($_POST['Submit']) { |
|---|
| 34 |
$poll_bar_style = strip_tags(trim($_POST['poll_bar_style'])); |
|---|
| 35 |
$poll_bar_background = strip_tags(trim($_POST['poll_bar_bg'])); |
|---|
| 36 |
$poll_bar_border = strip_tags(trim($_POST['poll_bar_border'])); |
|---|
| 37 |
$poll_bar_height = intval($_POST['poll_bar_height']); |
|---|
| 38 |
$poll_bar = array('style' => $poll_bar_style, 'background' => $poll_bar_background, 'border' => $poll_bar_border, 'height' => $poll_bar_height); |
|---|
| 39 |
$poll_ajax_style = array('loading' => intval($_POST['poll_ajax_style_loading']), 'fading' => intval($_POST['poll_ajax_style_fading'])); |
|---|
| 40 |
$poll_ans_sortby = strip_tags(trim($_POST['poll_ans_sortby'])); |
|---|
| 41 |
$poll_ans_sortorder = strip_tags(trim($_POST['poll_ans_sortorder'])); |
|---|
| 42 |
$poll_ans_result_sortby = strip_tags(trim($_POST['poll_ans_result_sortby'])); |
|---|
| 43 |
$poll_ans_result_sortorder = strip_tags(trim($_POST['poll_ans_result_sortorder'])); |
|---|
| 44 |
$poll_archive_perpage = intval($_POST['poll_archive_perpage']); |
|---|
| 45 |
$poll_archive_displaypoll = intval($_POST['poll_archive_displaypoll']); |
|---|
| 46 |
$poll_archive_url = strip_tags(trim($_POST['poll_archive_url'])); |
|---|
| 47 |
$poll_archive_show = intval($_POST['poll_archive_show']); |
|---|
| 48 |
$poll_currentpoll = intval($_POST['poll_currentpoll']); |
|---|
| 49 |
$poll_close = intval($_POST['poll_close']); |
|---|
| 50 |
$poll_logging_method = intval($_POST['poll_logging_method']); |
|---|
| 51 |
$poll_cookielog_expiry = intval($_POST['poll_cookielog_expiry']); |
|---|
| 52 |
$poll_allowtovote = intval($_POST['poll_allowtovote']); |
|---|
| 53 |
$update_poll_queries = array(); |
|---|
| 54 |
$update_poll_text = array(); |
|---|
| 55 |
$update_poll_queries[] = update_option('poll_bar', $poll_bar); |
|---|
| 56 |
$update_poll_queries[] = update_option('poll_ajax_style', $poll_ajax_style); |
|---|
| 57 |
$update_poll_queries[] = update_option('poll_ans_sortby', $poll_ans_sortby); |
|---|
| 58 |
$update_poll_queries[] = update_option('poll_ans_sortorder', $poll_ans_sortorder); |
|---|
| 59 |
$update_poll_queries[] = update_option('poll_ans_result_sortby', $poll_ans_result_sortby); |
|---|
| 60 |
$update_poll_queries[] = update_option('poll_ans_result_sortorder', $poll_ans_result_sortorder); |
|---|
| 61 |
$update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage); |
|---|
| 62 |
$update_poll_queries[] = update_option('poll_archive_displaypoll', $poll_archive_displaypoll); |
|---|
| 63 |
$update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url); |
|---|
| 64 |
$update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show); |
|---|
| 65 |
$update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll); |
|---|
| 66 |
$update_poll_queries[] = update_option('poll_close', $poll_close); |
|---|
| 67 |
$update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method); |
|---|
| 68 |
$update_poll_queries[] = update_option('poll_cookielog_expiry', $poll_cookielog_expiry); |
|---|
| 69 |
$update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote); |
|---|
| 70 |
$update_poll_text[] = __('Poll Bar Style', 'wp-polls'); |
|---|
| 71 |
$update_poll_text[] = __('Poll AJAX Style', 'wp-polls'); |
|---|
| 72 |
$update_poll_text[] = __('Sort Poll Answers By Option', 'wp-polls'); |
|---|
| 73 |
$update_poll_text[] = __('Sort Order Of Poll Answers Option', 'wp-polls'); |
|---|
| 74 |
$update_poll_text[] = __('Sort Poll Results By Option', 'wp-polls'); |
|---|
| 75 |
$update_poll_text[] = __('Sort Order Of Poll Results Option', 'wp-polls'); |
|---|
| 76 |
$update_poll_text[] = __('Number Of Polls Per Page To Display In Poll Archive Option', 'wp-polls'); |
|---|
| 77 |
$update_poll_text[] = __('Type Of Polls To Display In Poll Archive Option', 'wp-polls'); |
|---|
| 78 |
$update_poll_text[] = __('Poll Archive URL Option', 'wp-polls'); |
|---|
| 79 |
$update_poll_text[] = __('Show Poll Achive Link Option', 'wp-polls'); |
|---|
| 80 |
$update_poll_text[] = __('Current Active Poll Option', 'wp-polls'); |
|---|
| 81 |
$update_poll_text[] = __('Poll Close Option', 'wp-polls'); |
|---|
| 82 |
$update_poll_text[] = __('Logging Method', 'wp-polls'); |
|---|
| 83 |
$update_poll_text[] = __('Cookie And Log Expiry Option', 'wp-polls'); |
|---|
| 84 |
$update_poll_text[] = __('Allow To Vote Option', 'wp-polls'); |
|---|
| 85 |
$i=0; |
|---|
| 86 |
$text = ''; |
|---|
| 87 |
foreach($update_poll_queries as $update_poll_query) { |
|---|
| 88 |
if($update_poll_query) { |
|---|
| 89 |
$text .= '<font color="green">'.$update_poll_text[$i].' '.__('Updated', 'wp-polls').'</font><br />'; |
|---|
| 90 |
} |
|---|
| 91 |
$i++; |
|---|
| 92 |
} |
|---|
| 93 |
if(empty($text)) { |
|---|
| 94 |
$text = '<font color="red">'.__('No Poll Option Updated', 'wp-polls').'</font>'; |
|---|
| 95 |
} |
|---|
| 96 |
cron_polls_place(); |
|---|
| 97 |
} |
|---|
| 98 |
?> |
|---|
| 99 |
<script type="text/javascript"> |
|---|
| 100 |
/* <![CDATA[*/ |
|---|
| 101 |
function set_pollbar_height(height) { |
|---|
| 102 |
document.getElementById('poll_bar_height').value = height; |
|---|
| 103 |
} |
|---|
| 104 |
function update_pollbar(where) { |
|---|
| 105 |
pollbar_background = '#' + document.getElementById('poll_bar_bg').value; |
|---|
| 106 |
pollbar_border = '#' + document.getElementById('poll_bar_border').value; |
|---|
| 107 |
pollbar_height = document.getElementById('poll_bar_height').value + 'px'; |
|---|
| 108 |
if(where == 'background') { |
|---|
| 109 |
document.getElementById('wp-polls-pollbar-bg').style.backgroundColor = pollbar_background; |
|---|
| 110 |
} else if(where == 'border') { |
|---|
| 111 |
document.getElementById('wp-polls-pollbar-border').style.backgroundColor = pollbar_border; |
|---|
| 112 |
} else if(where == 'style') { |
|---|
| 113 |
pollbar_style_options = document.getElementById('poll_options_form').poll_bar_style; |
|---|
| 114 |
for(i = 0; i < pollbar_style_options.length; i++) { |
|---|
| 115 |
if(pollbar_style_options[i].checked) { |
|---|
| 116 |
pollbar_style = pollbar_style_options[i].value; |
|---|
| 117 |
} |
|---|
| 118 |
} |
|---|
| 119 |
if(pollbar_style == 'use_css') { |
|---|
| 120 |
document.getElementById('wp-polls-pollbar').style.backgroundImage = ""; |
|---|
| 121 |
} else { |
|---|
| 122 |
document.getElementById('wp-polls-pollbar').style.backgroundImage = "url('<?php echo WP_PLUGIN_URL; ?>/wp-polls/images/" + pollbar_style + "/pollbg.gif')"; |
|---|
| 123 |
} |
|---|
| 124 |
} |
|---|
| 125 |
document.getElementById('wp-polls-pollbar').style.backgroundColor = pollbar_background; |
|---|
| 126 |
document.getElementById('wp-polls-pollbar').style.border = '1px solid ' + pollbar_border; |
|---|
| 127 |
document.getElementById('wp-polls-pollbar').style.height = pollbar_height; |
|---|
| 128 |
} |
|---|
| 129 |
/* ]]> */ |
|---|
| 130 |
</script> |
|---|
| 131 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> |
|---|
| 132 |
<form id="poll_options_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> |
|---|
| 133 |
<div class="wrap"> |
|---|
| 134 |
<h2><?php _e('Poll Options', 'wp-polls'); ?></h2> |
|---|
| 135 |
<!-- Poll Bar Style --> |
|---|
| 136 |
<h3><?php _e('Poll Bar Style', 'wp-polls'); ?></h3> |
|---|
| 137 |
<table class="form-table"> |
|---|
| 138 |
<tr> |
|---|
| 139 |
<th scope="row" valign="top"><?php _e('Poll Bar Style', 'wp-polls'); ?></th> |
|---|
| 140 |
<td colspan="2"> |
|---|
| 141 |
<?php |
|---|
| 142 |
$pollbar = get_option('poll_bar'); |
|---|
| 143 |
$pollbar_url = WP_PLUGIN_URL.'/wp-polls/images'; |
|---|
| 144 |
$pollbar_path = WP_PLUGIN_DIR.'/wp-polls/images'; |
|---|
| 145 |
if($handle = @opendir($pollbar_path)) { |
|---|
| 146 |
while (false !== ($filename = readdir($handle))) { |
|---|
| 147 |
if ($filename != '.' && $filename != '..') { |
|---|
| 148 |
if(is_dir($pollbar_path.'/'.$filename)) { |
|---|
| 149 |
$pollbar_info = getimagesize($pollbar_path.'/'.$filename.'/pollbg.gif'); |
|---|
| 150 |
if($pollbar['style'] == $filename) { |
|---|
| 151 |
echo '<input type="radio" name="poll_bar_style" value="'.$filename.'" checked="checked" onblur="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />'; |
|---|
| 152 |
} else { |
|---|
| 153 |
echo '<input type="radio" name="poll_bar_style" value="'.$filename.'" onblur="set_pollbar_height('.$pollbar_info[1].'); update_pollbar(\'style\');" />'; |
|---|
| 154 |
} |
|---|
| 155 |
echo ' '; |
|---|
| 156 |
echo '<img src="'.$pollbar_url.'/'.$filename.'/pollbg.gif" height="'.$pollbar_info[1].'" width="100" alt="pollbg.gif" />'; |
|---|
| 157 |
echo ' ('.$filename.')'; |
|---|
| 158 |
echo '<br /><br />'."\n"; |
|---|
| 159 |
} |
|---|
| 160 |
} |
|---|
| 161 |
} |
|---|
| 162 |
closedir($handle); |
|---|
| 163 |
} |
|---|
| 164 |
?> |
|---|
| 165 |
<input type="radio" name="poll_bar_style" value="use_css"<?php checked('use_css', $pollbar['style']); ?> onblur="update_pollbar('style');" /> <?php _e('Use CSS Style', 'wp-polls'); ?> |
|---|
| 166 |
</td> |
|---|
| 167 |
</tr> |
|---|
| 168 |
<tr> |
|---|
| 169 |
<th scope="row" valign="top"><?php _e('Poll Bar Background', 'wp-polls'); ?></th> |
|---|
| 170 |
<td 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> |
|---|
| 171 |
<td><div id="wp-polls-pollbar-bg" style="background-color: #<?php echo $pollbar['background']; ?>;"></div></td> |
|---|
| 172 |
</tr> |
|---|
| 173 |
<tr> |
|---|
| 174 |
<th scope="row" valign="top"><?php _e('Poll Bar Border', 'wp-polls'); ?></th> |
|---|
| 175 |
<td 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> |
|---|
| 176 |
<td><div id="wp-polls-pollbar-border" style="background-color: #<?php echo $pollbar['border']; ?>;"></div></td> |
|---|
| 177 |
</tr> |
|---|
| 178 |
<tr> |
|---|
| 179 |
<th scope="row" valign="top"><?php _e('Poll Bar Height', 'wp-polls'); ?></th> |
|---|
| 180 |
<td 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> |
|---|
| 181 |
</tr> |
|---|
| 182 |
<tr> |
|---|
| 183 |
<th scope="row" valign="top"><?php _e('Your poll bar will look like this', 'wp-polls'); ?></th> |
|---|
| 184 |
<td colspan="2"> |
|---|
| 185 |
<?php |
|---|
| 186 |
if($pollbar['style'] == 'use_css') { |
|---|
| 187 |
echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'"></div>'."\n"; |
|---|
| 188 |
} else { |
|---|
| 189 |
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(\''.WP_PLUGIN_URL.'/wp-polls/images/'.$pollbar['style'].'/pollbg.gif\');"></div>'."\n"; |
|---|
| 190 |
} |
|---|
| 191 |
?> |
|---|
| 192 |
</td> |
|---|
| 193 |
</tr> |
|---|
| 194 |
</table> |
|---|
| 195 |
|
|---|
| 196 |
<!-- Polls AJAX Style --> |
|---|
| 197 |
<?php $poll_ajax_style = get_option('poll_ajax_style'); ?> |
|---|
| 198 |
<h3><?php _e('Polls AJAX Style', 'wp-polls'); ?></h3> |
|---|
| 199 |
<table class="form-table"> |
|---|
| 200 |
<tr> |
|---|
| 201 |
<th scope="row" valign="top"><?php _e('Show Loading Image With Text', 'wp-polls'); ?></th> |
|---|
| 202 |
<td> |
|---|
| 203 |
<select name="poll_ajax_style_loading" size="1"> |
|---|
| 204 |
<option value="0"<?php selected('0', $poll_ajax_style['loading']); ?>><?php _e('No', 'wp-polls'); ?></option> |
|---|
| 205 |
<option value="1"<?php selected('1', $poll_ajax_style['loading']); ?>><?php _e('Yes', 'wp-polls'); ?></option> |
|---|
| 206 |
</select> |
|---|
| 207 |
</td> |
|---|
| 208 |
</tr> |
|---|
| 209 |
<tr> |
|---|
| 210 |
<th scope="row" valign="top"><?php _e('Show Fading In And Fading Out Of Poll', 'wp-polls'); ?></th> |
|---|
| 211 |
<td> |
|---|
| 212 |
<select name="poll_ajax_style_fading" size="1"> |
|---|
| 213 |
<option value="0"<?php selected('0', $poll_ajax_style['fading']); ?>><?php _e('No', 'wp-polls'); ?></option> |
|---|
| 214 |
<option value="1"<?php selected('1', $poll_ajax_style['fading']); ?>><?php _e('Yes', 'wp-polls'); ?></option> |
|---|
| 215 |
</select> |
|---|
| 216 |
</td> |
|---|
| 217 |
</tr> |
|---|
| 218 |
</table> |
|---|
| 219 |
|
|---|
| 220 |
<!-- Sorting Of Poll Answers --> |
|---|
| 221 |
<h3><?php _e('Sorting Of Poll Answers', 'wp-polls'); ?></h3> |
|---|
| 222 |
<table class="form-table"> |
|---|
| 223 |
<tr> |
|---|
| 224 |
<th scope="row" valign="top"><?php _e('Sort Poll Answers By:', 'wp-polls'); ?></th> |
|---|
| 225 |
<td> |
|---|
| 226 |
<select name="poll_ans_sortby" size="1"> |
|---|
| 227 |
<option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option> |
|---|
| 228 |
<option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option> |
|---|
| 229 |
<option value="RAND()"<?php selected('RAND()', get_option('poll_ans_sortby')); ?>><?php _e('Random Order', 'wp-polls'); ?></option> |
|---|
| 230 |
</select> |
|---|
| 231 |
</td> |
|---|
| 232 |
</tr> |
|---|
| 233 |
<tr> |
|---|
| 234 |
<th scope="row" valign="top"><?php _e('Sort Order Of Poll Answers:', 'wp-polls'); ?></th> |
|---|
| 235 |
<td> |
|---|
| 236 |
<select name="poll_ans_sortorder" size="1"> |
|---|
| 237 |
<option value="asc"<?php selected('asc', get_option('poll_ans_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option> |
|---|
| 238 |
<option value="desc"<?php selected('desc', get_option('poll_ans_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option> |
|---|
| 239 |
</select> |
|---|
| 240 |
</td> |
|---|
| 241 |
</tr> |
|---|
| 242 |
</table> |
|---|
| 243 |
|
|---|
| 244 |
<!-- Sorting Of Poll Results --> |
|---|
| 245 |
<h3><?php _e('Sorting Of Poll Results', 'wp-polls'); ?></h3> |
|---|
| 246 |
<table class="form-table"> |
|---|
| 247 |
<tr> |
|---|
| 248 |
<th scope="row" valign="top"><?php _e('Sort Poll Results By:', 'wp-polls'); ?></th> |
|---|
| 249 |
<td> |
|---|
| 250 |
<select name="poll_ans_result_sortby" size="1"> |
|---|
| 251 |
<option value="polla_votes"<?php selected('polla_votes', get_option('poll_ans_result_sortby')); ?>><?php _e('Votes Casted', 'wp-polls'); ?></option> |
|---|
| 252 |
<option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_result_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option> |
|---|
| 253 |
<option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_result_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option> |
|---|
| 254 |
<option value="RAND()"<?php selected('RAND()', get_option('poll_ans_result_sortby')); ?>><?php _e('Random Order', 'wp-polls'); ?></option> |
|---|
| 255 |
</select> |
|---|
| 256 |
</td> |
|---|
| 257 |
</tr> |
|---|
| 258 |
<tr> |
|---|
| 259 |
<th scope="row" valign="top"><?php _e('Sort Order Of Poll Results:', 'wp-polls'); ?></th> |
|---|
| 260 |
<td> |
|---|
| 261 |
<select name="poll_ans_result_sortorder" size="1"> |
|---|
| 262 |
<option value="asc"<?php selected('asc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option> |
|---|
| 263 |
<option value="desc"<?php selected('desc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option> |
|---|
| 264 |
</select> |
|---|
| 265 |
</td> |
|---|
| 266 |
</tr> |
|---|
| 267 |
</table> |
|---|
| 268 |
|
|---|
| 269 |
<!-- Allow To Vote --> |
|---|
| 270 |
<h3><?php _e('Allow To Vote', 'wp-polls'); ?></h3> |
|---|
| 271 |
<table class="form-table"> |
|---|
| 272 |
<tr> |
|---|
| 273 |
<th scope="row" valign="top"><?php _e('Who Is Allowed To Vote?', 'wp-polls'); ?></th> |
|---|
| 274 |
<td> |
|---|
| 275 |
<select name="poll_allowtovote" size="1"> |
|---|
| 276 |
<option value="0"<?php selected('0', get_option('poll_allowtovote')); ?>><?php _e('Guests Only', 'wp-polls'); ?></option> |
|---|
| 277 |
<option value="1"<?php selected('1', get_option('poll_allowtovote')); ?>><?php _e('Registered Users Only', 'wp-polls'); ?></option> |
|---|
| 278 |
<option value="2"<?php selected('2', get_option('poll_allowtovote')); ?>><?php _e('Registered Users And Guests', 'wp-polls'); ?></option> |
|---|
| 279 |
</select> |
|---|
| 280 |
</td> |
|---|
| 281 |
</tr> |
|---|
| 282 |
</table> |
|---|
| 283 |
|
|---|
| 284 |
<!-- Logging Method --> |
|---|
| 285 |
<h3><?php _e('Logging Method', 'wp-polls'); ?></h3> |
|---|
| 286 |
<table class="form-table"> |
|---|
| 287 |
<tr valign="top"> |
|---|
| 288 |
<th scope="row" valign="top"><?php _e('Poll Logging Method:', 'wp-polls'); ?></th> |
|---|
| 289 |
<td> |
|---|
| 290 |
<select name="poll_logging_method" size="1"> |
|---|
| 291 |
<option value="0"<?php selected('0', get_option('poll_logging_method')); ?>><?php _e('Do Not Log', 'wp-polls'); ?></option> |
|---|
| 292 |
<option value="1"<?php selected('1', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie', 'wp-polls'); ?></option> |
|---|
| 293 |
<option value="2"<?php selected('2', get_option('poll_logging_method')); ?>><?php _e('Logged By IP', 'wp-polls'); ?></option> |
|---|
| 294 |
<option value="3"<?php selected('3', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie And IP', 'wp-polls'); ?></option> |
|---|
| 295 |
<option value="4"<?php selected('4', get_option('poll_logging_method')); ?>><?php _e('Logged By Username', 'wp-polls'); ?></option> |
|---|
| 296 |
</select> |
|---|
| 297 |
</td> |
|---|
| 298 |
</tr> |
|---|
| 299 |
<tr> |
|---|
| 300 |
<th scope="row" valign="top"><?php _e('Expiry Time For Cookie And Log:', 'wp-polls'); ?></th> |
|---|
| 301 |
<td><input type="text" name="poll_cookielog_expiry" value="<?php echo intval(get_option('poll_cookielog_expiry')); ?>" size="10" /> <?php _e('seconds (0 to disable)', 'wp-polls'); ?></td> |
|---|
| 302 |
</tr> |
|---|
| 303 |
</table> |
|---|
| 304 |
|
|---|
| 305 |
<!-- Poll Archive --> |
|---|
| 306 |
<h3><?php _e('Poll Archive', 'wp-polls'); ?></h3> |
|---|
| 307 |
<table class="form-table"> |
|---|
| 308 |
<tr> |
|---|
| 309 |
<th scope="row" valign="top"><?php _e('Number Of Polls Per Page:', 'wp-polls'); ?></th> |
|---|
| 310 |
<td><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_option('poll_archive_perpage')); ?>" size="2" /></td> |
|---|
| 311 |
</tr> |
|---|
| 312 |
<tr> |
|---|
| 313 |
<th scope="row" valign="top"><?php _e('Type Of Polls To Display In Poll Archive:', 'wp-polls'); ?></th> |
|---|
| 314 |
<td> |
|---|
| 315 |
<select name="poll_archive_displaypoll" size="1"> |
|---|
| 316 |
<option value="1"<?php selected('1', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed Polls Only', 'wp-polls'); ?></option> |
|---|
| 317 |
<option value="2"<?php selected('2', get_option('poll_archive_displaypoll')); ?>><?php _e('Opened Polls Only', 'wp-polls'); ?></option> |
|---|
| 318 |
<option value="3"<?php selected('3', get_option('poll_archive_displaypoll')); ?>><?php _e('Closed And Opened Polls', 'wp-polls'); ?></option> |
|---|
| 319 |
</select> |
|---|
| 320 |
</td> |
|---|
| 321 |
</tr> |
|---|
| 322 |
<tr> |
|---|
| 323 |
<th scope="row" valign="top"><?php _e('Poll Archive URL:', 'wp-polls'); ?></th> |
|---|
| 324 |
<td><input type="text" name="poll_archive_url" value="<?php echo get_option('poll_archive_url'); ?>" size="50" /></td> |
|---|
| 325 |
</tr> |
|---|
| 326 |
<tr> |
|---|
| 327 |
<th scope="row" valign="top"><?php _e('Display Poll Archive Link Below Poll?', 'wp-polls'); ?></th> |
|---|
| 328 |
<td> |
|---|
| 329 |
<select name="poll_archive_show" size="1"> |
|---|
| 330 |
<option value="0"<?php selected('0', get_option('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option> |
|---|
| 331 |
<option value="1"<?php selected('1', get_option('poll_archive_show')); ?>><?php _e('Yes', 'wp-polls'); ?></option> |
|---|
| 332 |
</select> |
|---|
| 333 |
</td> |
|---|
| 334 |
</tr> |
|---|
| 335 |
<tr> |
|---|
| 336 |
<th scope="row" valign="top"><?php _e('Note', 'wp-polls'); ?></th> |
|---|
| 337 |
<td><em><?php _e('Only polls\' results will be shown in the Poll Archive regardless of whether the poll is closed or opened.', 'wp-polls'); ?></em></td> |
|---|
| 338 |
</tr> |
|---|
| 339 |
</table> |
|---|
| 340 |
|
|---|
| 341 |
<!-- Current Active Poll --> |
|---|
| 342 |
<h3><?php _e('Current Active Poll', 'wp-polls'); ?></h3> |
|---|
| 343 |
<table class="form-table"> |
|---|
| 344 |
<tr> |
|---|
| 345 |
<th scope="row" valign="top"><?php _e('Current Active Poll', 'wp-polls'); ?>:</th> |
|---|
| 346 |
<td> |
|---|
| 347 |
<select name="poll_currentpoll" size="1"> |
|---|
| 348 |
<option value="-1"<?php selected(-1, get_option('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option> |
|---|
| 349 |
<option value="-2"<?php selected(-2, get_option('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option> |
|---|
| 350 |
<option value="0"<?php selected(0, get_option('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option> |
|---|
| 351 |
<?php if(function_exists('dynamic_sidebar')) { ?> |
|---|
| 352 |
<option value="-3"<?php selected(-3, get_option('poll_currentpoll')); ?>><?php _e('Display Multiple Polls', 'wp-polls'); ?></option> |
|---|
| 353 |
<?php } ?> |
|---|
| 354 |
<option value="0"> </option> |
|---|
| 355 |
<?php |
|---|
| 356 |
$polls = $wpdb->get_results("SELECT pollq_id, pollq_question FROM $wpdb->pollsq ORDER BY pollq_id DESC"); |
|---|
| 357 |
if($polls) { |
|---|
| 358 |
foreach($polls as $poll) { |
|---|
| 359 |
$poll_question = stripslashes($poll->pollq_question); |
|---|
| 360 |
$poll_id = intval($poll->pollq_id); |
|---|
| 361 |
if($poll_id == intval(get_option('poll_currentpoll'))) { |
|---|
| 362 |
echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n"; |
|---|
| 363 |
} else { |
|---|
| 364 |
echo "<option value=\"$poll_id\">$poll_question</option>\n"; |
|---|
| 365 |
} |
|---|
| 366 |
} |
|---|
| 367 |
} |
|---|
| 368 |
?> |
|---|
| 369 |
</select> |
|---|
| 370 |
</td> |
|---|
| 371 |
</tr> |
|---|
| 372 |
<?php if(function_exists('dynamic_sidebar')) { ?> |
|---|
| 373 |
<tr> |
|---|
| 374 |
<th scope="row"valign="top"><?php _e('Note', 'wp-polls'); ?></th> |
|---|
| 375 |
<td><em><?php _e('If you chose \'Display Multiple Polls\' for the above option, you need to configure it in Presentation -> Widgets -> Poll.', 'wp-polls'); ?></em></td> |
|---|
| 376 |
</tr> |
|---|
| 377 |
<?php } ?> |
|---|
| 378 |
<tr> |
|---|
| 379 |
<th scope="row" valign="top"><?php _e('When Poll Is Closed', 'wp-polls'); ?>:</th> |
|---|
| 380 |
<td> |
|---|
| 381 |
<select name="poll_close" size="1"> |
|---|
| 382 |
<option value="1"<?php selected(1, get_option('poll_close')); ?>><?php _e('Display Poll\'s Results', 'wp-polls'); ?></option> |
|---|
| 383 |
<option value="3"<?php selected(3, get_option('poll_close')); ?>><?php _e('Display Disabled Poll\'s Voting Form', 'wp-polls'); ?></option> |
|---|
| 384 |
<option value="2"<?php selected(2, get_option('poll_close')); ?>><?php _e('Do Not Display Poll In Post/Sidebar', 'wp-polls'); ?></option> |
|---|
| 385 |
</select> |
|---|
| 386 |
</td> |
|---|
| 387 |
</tr> |
|---|
| 388 |
</table> |
|---|
| 389 |
|
|---|
| 390 |
<!-- Submit Button --> |
|---|
| 391 |
<p class="submit"> |
|---|
| 392 |
<input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-polls'); ?>" /> |
|---|
| 393 |
</p> |
|---|
| 394 |
</div> |
|---|
| 395 |
</form> |
|---|