Changeset 7633
- Timestamp:
- 01/27/07 07:04:09 (1 year ago)
- Files:
-
- wp-polls/trunk/polls/polls-manager.php (modified) (7 diffs)
- wp-polls/trunk/polls/polls-options.php (modified) (24 diffs)
- wp-polls/trunk/polls/polls-widget.php (modified) (2 diffs)
- wp-polls/trunk/polls/polls.php (modified) (31 diffs)
- wp-polls/trunk/polls/wp-polls.pot (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-polls/trunk/polls/polls-manager.php
r7513 r7633 450 450 </tr> 451 451 <tr> 452 <td><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>: <?php echo mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td>452 <td><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>: <?php echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td> 453 453 </tr> 454 454 <tr> … … 462 462 _e('This Poll Will Not Expire', 'wp-polls'); 463 463 } else { 464 echo mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));464 echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry)); 465 465 } 466 466 ?> … … 525 525 $pollip_ip = $poll_ip->pollip_ip; 526 526 $pollip_host = $poll_ip->pollip_host; 527 $pollip_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp));527 $pollip_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_ip->pollip_timestamp)); 528 528 if($pollip_aid != $poll_last_aid) { 529 529 if($pollip_aid == 0) { … … 634 634 </tr> 635 635 <tr> 636 <td colspan="2"><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>: <?php echo mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td>636 <td colspan="2"><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>: <?php echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_timestamp)); ?></td> 637 637 </tr> 638 638 <tr> … … 642 642 _e('This Poll Will Not Expire', 'wp-polls'); 643 643 } else { 644 echo mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));644 echo mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry)); 645 645 } 646 646 ?> … … 727 727 if($polls) { 728 728 $i = 0; 729 $current_poll = intval(get_ settings('poll_currentpoll'));730 $latest_poll = intval(get_ settings('poll_latestpoll'));729 $current_poll = intval(get_option('poll_currentpoll')); 730 $latest_poll = intval(get_option('poll_latestpoll')); 731 731 foreach($polls as $poll) { 732 732 $poll_id = intval($poll->pollq_id); 733 733 $poll_question = stripslashes($poll->pollq_question); 734 $poll_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp));734 $poll_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll->pollq_timestamp)); 735 735 $poll_totalvotes = intval($poll->pollq_totalvotes); 736 736 $poll_active = intval($poll->pollq_active); … … 739 739 $poll_expiry_text = __('No Expiry', 'wp-polls'); 740 740 } else { 741 $poll_expiry_text = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));741 $poll_expiry_text = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry)); 742 742 } 743 743 if($i%2 == 0) { wp-polls/trunk/polls/polls-options.php
r7530 r7633 180 180 document.getElementById('wp-polls-pollbar').style.backgroundImage = ""; 181 181 } else { 182 document.getElementById('wp-polls-pollbar').style.backgroundImage = "url('<?php echo get_ settings('siteurl'); ?>/wp-content/plugins/polls/images/" + pollbar_style + "/pollbg.gif')";182 document.getElementById('wp-polls-pollbar').style.backgroundImage = "url('<?php echo get_option('siteurl'); ?>/wp-content/plugins/polls/images/" + pollbar_style + "/pollbg.gif')"; 183 183 } 184 184 } … … 200 200 <td align="left" colspan="2"> 201 201 <?php 202 $pollbar = get_ settings('poll_bar');203 $pollbar_url = get_ settings('siteurl').'/wp-content/plugins/polls/images';202 $pollbar = get_option('poll_bar'); 203 $pollbar_url = get_option('siteurl').'/wp-content/plugins/polls/images'; 204 204 $pollbar_path = ABSPATH.'/wp-content/plugins/polls/images'; 205 205 if($handle = @opendir($pollbar_path)) { … … 247 247 echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'"></div>'."\n"; 248 248 } else { 249 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";249 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_option('siteurl').'/wp-content/plugins/polls/images/'.$pollbar['style'].'/pollbg.gif\');"></div>'."\n"; 250 250 } 251 251 ?> … … 261 261 <td align="left"> 262 262 <select name="poll_ans_sortby" size="1"> 263 <option value="polla_aid"<?php selected('polla_aid', get_ settings('poll_ans_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>264 <option value="polla_answers"<?php selected('polla_answers', get_ settings('poll_ans_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>263 <option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option> 264 <option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option> 265 265 </select> 266 266 </td> … … 270 270 <td align="left"> 271 271 <select name="poll_ans_sortorder" size="1"> 272 <option value="asc"<?php selected('asc', get_ settings('poll_ans_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>273 <option value="desc"<?php selected('desc', get_ settings('poll_ans_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>272 <option value="asc"<?php selected('asc', get_option('poll_ans_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option> 273 <option value="desc"<?php selected('desc', get_option('poll_ans_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option> 274 274 </select> 275 275 </td> … … 284 284 <td align="left"> 285 285 <select name="poll_ans_result_sortby" size="1"> 286 <option value="polla_votes"<?php selected('polla_votes', get_ settings('poll_ans_result_sortby')); ?>><?php _e('Votes', 'wp-polls'); ?></option>287 <option value="polla_aid"<?php selected('polla_aid', get_ settings('poll_ans_result_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option>288 <option value="polla_answers"<?php selected('polla_answers', get_ settings('poll_ans_result_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option>286 <option value="polla_votes"<?php selected('polla_votes', get_option('poll_ans_result_sortby')); ?>><?php _e('Votes', 'wp-polls'); ?></option> 287 <option value="polla_aid"<?php selected('polla_aid', get_option('poll_ans_result_sortby')); ?>><?php _e('Exact Order', 'wp-polls'); ?></option> 288 <option value="polla_answers"<?php selected('polla_answers', get_option('poll_ans_result_sortby')); ?>><?php _e('Alphabetical Order', 'wp-polls'); ?></option> 289 289 </select> 290 290 </td> … … 294 294 <td align="left"> 295 295 <select name="poll_ans_result_sortorder" size="1"> 296 <option value="asc"<?php selected('asc', get_ settings('poll_ans_result_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option>297 <option value="desc"<?php selected('desc', get_ settings('poll_ans_result_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option>296 <option value="asc"<?php selected('asc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Ascending', 'wp-polls'); ?></option> 297 <option value="desc"<?php selected('desc', get_option('poll_ans_result_sortorder')); ?>><?php _e('Descending', 'wp-polls'); ?></option> 298 298 </select> 299 299 </td> … … 308 308 <td align="left"> 309 309 <select name="poll_allowtovote" size="1"> 310 <option value="0"<?php selected('0', get_ settings('poll_allowtovote')); ?>><?php _e('Guests Only', 'wp-polls'); ?></option>311 <option value="1"<?php selected('1', get_ settings('poll_allowtovote')); ?>><?php _e('Registered Users Only', 'wp-polls'); ?></option>312 <option value="2"<?php selected('2', get_ settings('poll_allowtovote')); ?>><?php _e('Registered Users And Guests', 'wp-polls'); ?></option>310 <option value="0"<?php selected('0', get_option('poll_allowtovote')); ?>><?php _e('Guests Only', 'wp-polls'); ?></option> 311 <option value="1"<?php selected('1', get_option('poll_allowtovote')); ?>><?php _e('Registered Users Only', 'wp-polls'); ?></option> 312 <option value="2"<?php selected('2', get_option('poll_allowtovote')); ?>><?php _e('Registered Users And Guests', 'wp-polls'); ?></option> 313 313 </select> 314 314 </td> … … 323 323 <td align="left"> 324 324 <select name="poll_logging_method" size="1"> 325 <option value="0"<?php selected('0', get_ settings('poll_logging_method')); ?>><?php _e('Do Not Log', 'wp-polls'); ?></option>326 <option value="1"<?php selected('1', get_ settings('poll_logging_method')); ?>><?php _e('Logged By Cookie', 'wp-polls'); ?></option>327 <option value="2"<?php selected('2', get_ settings('poll_logging_method')); ?>><?php _e('Logged By IP', 'wp-polls'); ?></option>328 <option value="3"<?php selected('3', get_ settings('poll_logging_method')); ?>><?php _e('Logged By Cookie And IP', 'wp-polls'); ?></option>329 <option value="4"<?php selected('4', get_ settings('poll_logging_method')); ?>><?php _e('Logged By Username', 'wp-polls'); ?></option>325 <option value="0"<?php selected('0', get_option('poll_logging_method')); ?>><?php _e('Do Not Log', 'wp-polls'); ?></option> 326 <option value="1"<?php selected('1', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie', 'wp-polls'); ?></option> 327 <option value="2"<?php selected('2', get_option('poll_logging_method')); ?>><?php _e('Logged By IP', 'wp-polls'); ?></option> 328 <option value="3"<?php selected('3', get_option('poll_logging_method')); ?>><?php _e('Logged By Cookie And IP', 'wp-polls'); ?></option> 329 <option value="4"<?php selected('4', get_option('poll_logging_method')); ?>><?php _e('Logged By Username', 'wp-polls'); ?></option> 330 330 </select> 331 331 </td> … … 338 338 <tr valign="top"> 339 339 <th align="left" width="30%"><?php _e('Polls Per Page:', 'wp-polls'); ?></th> 340 <td align="left"><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_ settings('poll_archive_perpage')); ?>" size="2" /></td>340 <td align="left"><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_option('poll_archive_perpage')); ?>" size="2" /></td> 341 341 </tr> 342 342 <tr valign="top"> 343 343 <th align="left" width="30%"><?php _e('Polls Archive URL:', 'wp-polls'); ?></th> 344 <td align="left"><input type="text" name="poll_archive_url" value="<?php echo get_ settings('poll_archive_url'); ?>" size="50" /></td>344 <td align="left"><input type="text" name="poll_archive_url" value="<?php echo get_option('poll_archive_url'); ?>" size="50" /></td> 345 345 </tr> 346 346 <tr valign="top"> … … 348 348 <td align="left"> 349 349 <select name="poll_archive_show" size="1"> 350 <option value="0"<?php selected('0', get_ settings('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option>351 <option value="1"<?php selected('1', get_ settings('poll_archive_show')); ?>><?php _e('Yes', 'wp-polls'); ?></option>350 <option value="0"<?php selected('0', get_option('poll_archive_show')); ?>><?php _e('No', 'wp-polls'); ?></option> 351 <option value="1"<?php selected('1', get_option('poll_archive_show')); ?>><?php _e('Yes', 'wp-polls'); ?></option> 352 352 </select> 353 353 </td> … … 362 362 <td align="left"> 363 363 <select name="poll_currentpoll" size="1"> 364 <option value="-1"<?php selected(-1, get_ settings('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option>365 <option value="-2"<?php selected(-2, get_ settings('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option>366 <option value="0"<?php selected(0, get_ settings('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option>364 <option value="-1"<?php selected(-1, get_option('poll_currentpoll')); ?>><?php _e('Do NOT Display Poll (Disable)', 'wp-polls'); ?></option> 365 <option value="-2"<?php selected(-2, get_option('poll_currentpoll')); ?>><?php _e('Display Random Poll', 'wp-polls'); ?></option> 366 <option value="0"<?php selected(0, get_option('poll_currentpoll')); ?>><?php _e('Display Latest Poll', 'wp-polls'); ?></option> 367 367 <option value="0"> </option> 368 368 <?php … … 372 372 $poll_question = stripslashes($poll->pollq_question); 373 373 $poll_id = intval($poll->pollq_id); 374 if($poll_id == intval(get_ settings('poll_currentpoll'))) {374 if($poll_id == intval(get_option('poll_currentpoll'))) { 375 375 echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n"; 376 376 } else { … … 387 387 <td align="left"> 388 388 <select name="poll_close" size="1"> 389 <option value="1"<?php selected(1, get_ settings('poll_close')); ?>><?php _e('Display Poll\'s Results', 'wp-polls'); ?></option>390 <option value="2"<?php selected(2, get_ settings('poll_close')); ?>><?php _e('Do Not Display Poll In Post/Sidebar', 'wp-polls'); ?></option>389 <option value="1"<?php selected(1, get_option('poll_close')); ?>><?php _e('Display Poll\'s Results', 'wp-polls'); ?></option> 390 <option value="2"<?php selected(2, get_option('poll_close')); ?>><?php _e('Do Not Display Poll In Post/Sidebar', 'wp-polls'); ?></option> 391 391 </select> 392 392 </td> … … 498 498 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('voteheader');" class="button" /> 499 499 </td> 500 <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>500 <td align="left"><textarea cols="80" rows="10" id="poll_template_voteheader" name="poll_template_voteheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_voteheader'))); ?></textarea></td> 501 501 </tr> 502 502 <tr valign="top"> … … 510 510 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votebody');" class="button" /> 511 511 </td> 512 <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>512 <td align="left"><textarea cols="80" rows="10" id="poll_template_votebody" name="poll_template_votebody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votebody'))); ?></textarea></td> 513 513 </tr> 514 514 <tr valign="top"> … … 520 520 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votefooter');" class="button" /> 521 521 </td> 522 <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>522 <td align="left"><textarea cols="80" rows="10" id="poll_template_votefooter" name="poll_template_votefooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_votefooter'))); ?></textarea></td> 523 523 </tr> 524 524 </table> … … 538 538 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultheader');" class="button" /> 539 539 </td> 540 <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>540 <td align="left"><textarea cols="80" rows="10" id="poll_template_resultheader" name="poll_template_resultheader"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultheader'))); ?></textarea></td> 541 541 </tr> 542 542 <tr valign="top"> … … 552 552 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody');" class="button" /> 553 553 </td> 554 <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>554 <td align="left"><textarea cols="80" rows="10" id="poll_template_resultbody" name="poll_template_resultbody"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody'))); ?></textarea></td> 555 555 </tr> 556 556 <tr valign="top"> … … 566 566 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody2');" class="button" /> 567 567 </td> 568 <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>568 <td align="left"><textarea cols="80" rows="10" id="poll_template_resultbody2" name="poll_template_resultbody2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultbody2'))); ?></textarea></td> 569 569 </tr> 570 570 <tr valign="top"> … … 584 584 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter');" class="button" /> 585 585 </td> 586 <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>586 <td align="left"><textarea cols="80" rows="10" id="poll_template_resultfooter" name="poll_template_resultfooter"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter'))); ?></textarea></td> 587 587 </tr> 588 588 <tr valign="top"> … … 602 602 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter2');" class="button" /> 603 603 </td> 604 <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>604 <td align="left"><textarea cols="80" rows="10" id="poll_template_resultfooter2" name="poll_template_resultfooter2"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_resultfooter2'))); ?></textarea></td> 605 605 </tr> 606 606 </table> … … 616 616 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('disable');" class="button" /> 617 617 </td> 618 <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>618 <td align="left"><textarea cols="80" rows="10" id="poll_template_disable" name="poll_template_disable"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_disable'))); ?></textarea></td> 619 619 </tr> 620 620 <tr valign="top"> … … 625 625 <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('error');" class="button" /> 626 626 </td> 627 <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>627 <td align="left"><textarea cols="80" rows="10" id="poll_template_error" name="poll_template_error"><?php echo htmlspecialchars(stripslashes(get_option('poll_template_error'))); ?></textarea></td> 628 628 </tr> 629 629 </table> wp-polls/trunk/polls/polls-widget.php
r7431 r7633 53 53 global $wpdb; 54 54 $options = get_option('widget_polls'); 55 $current_poll = get_ settings('poll_currentpoll');55 $current_poll = get_option('poll_currentpoll'); 56 56 if (!is_array($options)) { 57 57 $options = array('title' => __('Polls', 'wp-polls')); … … 73 73 echo '<select id="polls-displayarchive" name="poll_archive_show" size="1">'."\n"; 74 74 echo '<option value="0"'; 75 selected('0', get_ settings('poll_archive_show'));75 selected('0', get_option('poll_archive_show')); 76 76 echo '>'; 77 77 _e('No'); 78 78 echo '</option>'."\n"; 79 79 echo '<option value="1"'; 80 selected('1', get_ settings('poll_archive_show'));80 selected('1', get_option('poll_archive_show')); 81 81 echo '>'; 82 82 _e('Yes'); wp-polls/trunk/polls/polls.php
r7612 r7633 65 65 $pollresult_id = intval($_GET['pollresult']); 66 66 // Check Whether Poll Is Disabled 67 if(intval(get_ settings('poll_currentpoll')) == -1) {67 if(intval(get_option('poll_currentpoll')) == -1) { 68 68 if($display) { 69 echo stripslashes(get_ settings('poll_template_disable'));69 echo stripslashes(get_option('poll_template_disable')); 70 70 return; 71 71 } else { 72 return stripslashes(get_ settings('poll_template_disable'));72 return stripslashes(get_option('poll_template_disable')); 73 73 } 74 74 // Poll Is Enabled … … 77 77 if(intval($temp_poll_id) == 0) { 78 78 // Random Poll 79 if(intval(get_ settings('poll_currentpoll')) == -2) {79 if(intval(get_option('poll_currentpoll')) == -2) { 80 80 $random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1"); 81 81 $poll_id = intval($random_poll_id); … … 86 86 } 87 87 // Current Poll ID Is Not Specified 88 } elseif(intval(get_ settings('poll_currentpoll')) == 0) {88 } elseif(intval(get_option('poll_currentpoll')) == 0) { 89 89 // Get Lastest Poll ID 90 $poll_id = intval(get_ settings('poll_latestpoll'));90 $poll_id = intval(get_option('poll_latestpoll')); 91 91 } else { 92 92 // Get Current Poll ID 93 $poll_id = intval(get_ settings('poll_currentpoll'));93 $poll_id = intval(get_option('poll_currentpoll')); 94 94 } 95 95 // Get Hardcoded Poll ID … … 121 121 $check_voted = check_voted($poll_id); 122 122 if($poll_active == 0) { 123 $poll_close = intval(get_ settings('poll_close'));123 $poll_close = intval(get_option('poll_close')); 124 124 } 125 125 if($check_voted > 0 || ($poll_active == 0 && $poll_close == 1) || !check_allowtovote()) { … … 148 148 wp_register_script('wp-polls', '/wp-content/plugins/polls/polls-js.php', false, '2.14'); 149 149 wp_print_scripts(array('sack', 'wp-polls')); 150 echo '<link rel="stylesheet" href="'.get_ settings('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";150 echo '<link rel="stylesheet" href="'.get_option('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n"; 151 151 echo '<style type="text/css">'."\n"; 152 $pollbar = get_ settings('poll_bar');152 $pollbar = get_option('poll_bar'); 153 153 if($pollbar['style'] == 'use_css') { 154 154 echo '.wp-polls .pollbar {'."\n"; … … 166 166 echo "\t".'line-height: '.$pollbar['height'].'px;'."\n"; 167 167 echo "\t".'height: '.$pollbar['height'].'px;'."\n"; 168 echo "\t".'background-image: url(\''.get_ settings('siteurl').'/wp-content/plugins/polls/images/'.$pollbar['style'].'/pollbg.gif\');'."\n";168 echo "\t".'background-image: url(\''.get_option('siteurl').'/wp-content/plugins/polls/images/'.$pollbar['style'].'/pollbg.gif\');'."\n"; 169 169 echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n"; 170 170 echo '}'."\n"; … … 178 178 add_action('admin_head', 'poll_header_admin'); 179 179 function poll_header_admin() { 180 echo '<link rel="stylesheet" href="'.get_ settings('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n";180 echo '<link rel="stylesheet" href="'.get_option('siteurl').'/wp-content/plugins/polls/polls-css.css" type="text/css" media="screen" />'."\n"; 181 181 } 182 182 … … 186 186 global $user_ID; 187 187 $user_ID = intval($user_ID); 188 $allow_to_vote = intval(get_ settings('poll_allowtovote'));188 $allow_to_vote = intval(get_option('poll_allowtovote')); 189 189 switch($allow_to_vote) { 190 190 // Guests Only … … 212 212 ### Funcrion: Check Voted By Cookie Or IP 213 213 function check_voted($poll_id) { 214 $poll_logging_method = intval(get_ settings('poll_logging_method'));214 $poll_logging_method = intval(get_option('poll_logging_method')); 215 215 switch($poll_logging_method) { 216 216 // Do Not Log … … 286 286 $poll_question_id = intval($poll_question->pollq_id); 287 287 $poll_question_totalvotes = intval($poll_question->pollq_totalvotes); 288 $poll_start_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));288 $poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp)); 289 289 $poll_expiry = trim($poll_question->pollq_expiry); 290 290 if(empty($poll_expiry)) { 291 291 $poll_end_date = __('No Expiry', 'wp-polls'); 292 292 } else { 293 $poll_end_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));294 } 295 $template_question = stripslashes(get_ settings('poll_template_voteheader'));293 $poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry)); 294 } 295 $template_question = stripslashes(get_option('poll_template_voteheader')); 296 296 $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question); 297 297 $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question); … … 300 300 $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 301 301 // Get Poll Answers Data 302 $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_ settings('poll_ans_sortby').' '.get_settings('poll_ans_sortorder'));302 $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_sortby').' '.get_option('poll_ans_sortorder')); 303 303 // If There Is Poll Question With Answers 304 304 if($poll_question && $poll_answers) { … … 316 316 $poll_answer_text = stripslashes($poll_answer->polla_answers); 317 317 $poll_answer_votes = intval($poll_answer->polla_votes); 318 $template_answer = stripslashes(get_ settings('poll_template_votebody'));318 $template_answer = stripslashes(get_option('poll_template_votebody')); 319 319 $template_answer = str_replace("%POLL_ID%", $poll_question_id, $template_answer); 320 320 $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer); … … 335 335 } 336 336 // Voting Form Footer Variables 337 $template_footer = stripslashes(get_ settings('poll_template_votefooter'));337 $template_footer = stripslashes(get_option('poll_template_votefooter')); 338 338 $template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer); 339 339 $template_footer = str_replace("%POLL_RESULT_URL%", $poll_result_url, $template_footer); … … 345 345 $temp_pollvote .= "\t</form>\n"; 346 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";347 $temp_pollvote .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".get_option('siteurl')."/wp-content/plugins/polls/images/loading.gif\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" /> ".__('Loading', 'wp-polls')." ...</div>\n"; 348 348 } 349 349 } else { 350 $temp_pollvote .= stripslashes(get_ settings('poll_template_disable'));350 $temp_pollvote .= stripslashes(get_option('poll_template_disable')); 351 351 } 352 352 // Return Poll Vote Template … … 374 374 $poll_question_totalvotes = intval($poll_question->pollq_totalvotes); 375 375 $poll_question_active = intval($poll_question->pollq_active); 376 $poll_start_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp));376 $poll_start_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_question->pollq_timestamp)); 377 377 $poll_expiry = trim($poll_question->pollq_expiry); 378 378 if(empty($poll_expiry)) { 379 379 $poll_end_date = __('No Expiry', 'wp-polls'); 380 380 } else { 381 $poll_end_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry));382 } 383 $template_question = stripslashes(get_ settings('poll_template_resultheader'));381 $poll_end_date = mysql2date(get_option('date_format').' @ '.get_option('time_format'), gmdate('Y-m-d H:i:s', $poll_expiry)); 382 } 383 $template_question = stripslashes(get_option('poll_template_resultheader')); 384 384 $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question); 385 385 $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question); … … 388 388 $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 389 389 // Get Poll Answers Data 390 $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_ settings('poll_ans_result_sortby').' '.get_settings('poll_ans_result_sortorder'));390 $poll_answers = $wpdb->get_results("SELECT polla_aid, polla_answers, polla_votes FROM $wpdb->pollsa WHERE polla_qid = $poll_question_id ORDER BY ".get_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder')); 391 391 // If There Is Poll Question With Answers 392 392 if($poll_question && $poll_answers) { … … 427 427 if($user_voted == $poll_answer_id) { 428 428 // Results Body Variables 429 $template_answer = stripslashes(get_ settings('poll_template_resultbody2'));429 $template_answer = stripslashes(get_option('poll_template_resultbody2')); 430 430 $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer); 431 431 $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer); … … 438 438 } else { 439 439 // Results Body Variables 440 $template_answer = stripslashes(get_ settings('poll_template_resultbody'));440 $template_answer = stripslashes(get_option('poll_template_resultbody')); 441 441 $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer); 442 442 $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer); … … 466 466 // Results Footer Variables 467 467 if($user_voted > 0 || $poll_question_active == 0 || !check_allowtovote()) { 468 $template_footer = stripslashes(get_ settings('poll_template_resultfooter'));469 } else { 470 $template_footer = stripslashes(get_ settings('poll_template_resultfooter2'));468 $template_footer = stripslashes(get_option('poll_template_resultfooter')); 469 } else { 470 $template_footer = stripslashes(get_option('poll_template_resultfooter2')); 471 471 } 472 472 $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer); … … 484 484 if(!$without_poll_title) { 485 485 $temp_pollresult .= "</div>\n"; 486 $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";486 $temp_pollresult .= "<div id=\"polls-$poll_question_id-loading\" class=\"wp-polls-loading\"><img src=\"".get_option('siteurl')."/wp-content/plugins/polls/images/loading.gif\" width=\"16\" height=\"16\" alt=\"".__('Loading', 'wp-polls')." ...\" title=\"".__('Loading', 'wp-polls')." ...\" class=\"wp-polls-image\" /> ".__('Loading', 'wp-polls')." ...</div>\n"; 487 487 } 488 488 } else { 489 $temp_pollresult .= stripslashes(get_ settings('poll_template_disable'));489 $temp_pollresult .= stripslashes(get_option('poll_template_disable')); 490 490 } 491 491 // Return Poll Result … … 612 612 ### Function: Displays Polls Archive Link 613 613 function display_polls_archive_link($display = true) { 614 if(intval(get_ settings('poll_archive_show')) == 1) {614 if(intval(get_option('poll_archive_show')) == 1) { 615 615 if($display) { 616 echo "<ul>\n<li><a href=\"".get_ settings('poll_archive_url')."\">".__('Polls Archive', 'wp-polls')."</a></li></ul>\n";616 echo "<ul>\n<li><a href=\"".get_option('poll_archive_url')."\">".__('Polls Archive', 'wp-polls')."</a></li></ul>\n"; 617 617 } else{ 618 return "<ul>\n<li><a href=\"".get_ settings('poll_archive_url')."\">".__('Polls Archive', 'wp-polls')."</a></li></ul>\n";618 return "<ul>\n<li><a href=\"".get_option('poll_archive_url')."\">".__('Polls Archive', 'wp-polls')."</a></li></ul>\n"; 619 619 } 620 620 } … … 631 631 $polls_answers = array(); 632 632 $polls_ip = array(); 633 $polls_perpage = intval(get_ settings('poll_archive_perpage'));633 $polls_perpage = intval(get_option('poll_archive_perpage')); 634 634 $poll_questions_ids = '0'; 635 635 $poll_voted = false; … … 669 669 670 670 // Make Sure Poll Is Not Disabled 671 if(intval(get_ settings('poll_currentpoll')) != -1 && $page < 2) {671 if(intval(get_option('poll_currentpoll')) != -1 && $page < 2) { 672 672 // Hardcoded Poll ID Is Not Specified 673 673 if(intval($temp_poll_id) == 0) { 674 674 // Random Poll 675 if(intval(get_ settings('poll_currentpoll')) == -2) {675 if(intval(get_option('poll_currentpoll')) == -2) { 676 676 $random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1"); 677 677 $poll_id = intval($random_poll_id); 678 678 // Current Poll ID Is Not Specified 679 } else if(intval(get_ settings('poll_currentpoll')) == 0) {679 } else if(intval(get_option('poll_currentpoll')) == 0) { 680 680 // Get Lastest Poll ID 681 $poll_id = intval(get_ settings('poll_latestpoll'));681 $poll_id = intval(get_option('poll_latestpoll')); 682 682 } else { 683 683 // Get Current Poll ID 684 $poll_id = intval(get_ settings('poll_currentpoll'));684 $poll_id = intval(get_option('poll_currentpoll')); 685 685 } 686 686 // Get Hardcoded Poll ID … … 701 701 702 702 // Get Poll Answers 703 $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'));703 $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_option('poll_ans_result_sortby').' '.get_option('poll_ans_result_sortorder')); 704 704 if($answers) { 705 705 foreach($answers as $answer) { … … 720 720 $pollsarchive_output_current_title = '<h2>'.__('Current Poll', 'wp-polls').'</h2>'."\n"; 721 721 // Current Poll 722 if(intval(get_ settings('poll_currentpoll')) == -1) {723 $pollsarchive_output_current .= get_ settings('poll_template_disable');722 if(intval(get_option('poll_currentpoll')) == -1) { 723 $pollsarchive_output_current .= get_option('poll_template_disable'); 724 724 } else { 725 725 // User Click on View Results Link … … 755 755 $poll_totalvotes_zero = false; 756 756 } 757 $poll_start_date = mysql2date(get_ settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $polls_question['start']));757
