Changeset 7633

Show
Ignore:
Timestamp:
01/27/07 07:04:09 (1 year ago)
Author:
GamerZ
Message:

Replace get_settings() With get_options()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-polls/trunk/polls/polls-manager.php

    r7513 r7633  
    450450                              </tr> 
    451451                              <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> 
    453453                              </tr> 
    454454                              <tr> 
     
    462462                                                      _e('This Poll Will Not Expire', 'wp-polls'); 
    463463                                                } 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)); 
    465465                                                } 
    466466                                          ?> 
     
    525525                                                $pollip_ip = $poll_ip->pollip_ip; 
    526526                                                $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)); 
    528528                                                if($pollip_aid != $poll_last_aid) { 
    529529                                                      if($pollip_aid == 0) { 
     
    634634                              </tr> 
    635635                              <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> 
    637637                              </tr> 
    638638                                    <tr> 
     
    642642                                                      _e('This Poll Will Not Expire', 'wp-polls'); 
    643643                                                } 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)); 
    645645                                                } 
    646646                                          ?> 
     
    727727                        if($polls) { 
    728728                              $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')); 
    731731                              foreach($polls as $poll) { 
    732732                                    $poll_id = intval($poll->pollq_id); 
    733733                                    $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)); 
    735735                                    $poll_totalvotes = intval($poll->pollq_totalvotes); 
    736736                                    $poll_active = intval($poll->pollq_active); 
     
    739739                                          $poll_expiry_text  = __('No Expiry', 'wp-polls'); 
    740740                                    } 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)); 
    742742                                    } 
    743743                                    if($i%2 == 0) { 
  • wp-polls/trunk/polls/polls-options.php

    r7530 r7633  
    180180                        document.getElementById('wp-polls-pollbar').style.backgroundImage = ""; 
    181181                  } 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')"; 
    183183                  } 
    184184            } 
     
    200200                              <td align="left" colspan="2"> 
    201201                                    <?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'; 
    204204                                          $pollbar_path = ABSPATH.'/wp-content/plugins/polls/images'; 
    205205                                          if($handle = @opendir($pollbar_path)) {      
     
    247247                                                echo '<div id="wp-polls-pollbar" style="width: 100px; height: '.$pollbar['height'].'px; background-color: #'.$pollbar['background'].'; border: 1px solid #'.$pollbar['border'].'"></div>'."\n"; 
    248248                                          } 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"; 
    250250                                          } 
    251251                                    ?> 
     
    261261                              <td align="left"> 
    262262                                    <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> 
    265265                                    </select> 
    266266                              </td> 
     
    270270                              <td align="left"> 
    271271                                    <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> 
    274274                                    </select> 
    275275                              </td>  
     
    284284                              <td align="left"> 
    285285                                    <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> 
    289289                                    </select> 
    290290                              </td> 
     
    294294                              <td align="left"> 
    295295                                    <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> 
    298298                                    </select> 
    299299                              </td>  
     
    308308                              <td align="left"> 
    309309                                    <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> 
    313313                                    </select> 
    314314                              </td> 
     
    323323                              <td align="left"> 
    324324                                    <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> 
    330330                                    </select> 
    331331                              </td> 
     
    338338                         <tr valign="top"> 
    339339                              <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> 
    341341                        </tr> 
    342342                        <tr valign="top"> 
    343343                              <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> 
    345345                        </tr> 
    346346                        <tr valign="top"> 
     
    348348                              <td align="left"> 
    349349                                    <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> 
    352352                                    </select> 
    353353                              </td> 
     
    362362                              <td align="left"> 
    363363                                    <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> 
    367367                                          <option value="0">&nbsp;</option> 
    368368                                          <?php 
     
    372372                                                            $poll_question = stripslashes($poll->pollq_question); 
    373373                                                            $poll_id = intval($poll->pollq_id); 
    374                                                             if($poll_id == intval(get_settings('poll_currentpoll'))) { 
     374                                                            if($poll_id == intval(get_option('poll_currentpoll'))) { 
    375375                                                                  echo "<option value=\"$poll_id\" selected=\"selected\">$poll_question</option>\n"; 
    376376                                                            } else { 
     
    387387                              <td align="left"> 
    388388                                    <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> 
    391391                                    </select> 
    392392                              </td> 
     
    498498                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('voteheader');" class="button" /> 
    499499                              </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> 
    501501                        </tr> 
    502502                        <tr valign="top">  
     
    510510                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votebody');" class="button" /> 
    511511                              </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>  
    513513                        </tr> 
    514514                        <tr valign="top">  
     
    520520                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('votefooter');" class="button" /> 
    521521                              </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>  
    523523                        </tr> 
    524524                  </table> 
     
    538538                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultheader');" class="button" /> 
    539539                              </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> 
    541541                        </tr> 
    542542                        <tr valign="top">  
     
    552552                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody');" class="button" /> 
    553553                              </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>  
    555555                        </tr> 
    556556                        <tr valign="top">  
     
    566566                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultbody2');" class="button" /> 
    567567                              </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>  
    569569                        </tr> 
    570570                        <tr valign="top">  
     
    584584                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter');" class="button" /> 
    585585                              </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>  
    587587                        </tr> 
    588588                        <tr valign="top">  
     
    602602                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('resultfooter2');" class="button" /> 
    603603                              </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>  
    605605                        </tr> 
    606606                  </table> 
     
    616616                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('disable');" class="button" /> 
    617617                              </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> 
    619619                        </tr> 
    620620                        <tr valign="top"> 
     
    625625                                    <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-polls'); ?>" onclick="javascript: poll_default_templates('error');" class="button" /> 
    626626                              </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> 
    628628                        </tr> 
    629629                  </table> 
  • wp-polls/trunk/polls/polls-widget.php

    r7431 r7633  
    5353            global $wpdb; 
    5454            $options = get_option('widget_polls'); 
    55             $current_poll = get_settings('poll_currentpoll'); 
     55            $current_poll = get_option('poll_currentpoll'); 
    5656            if (!is_array($options)) { 
    5757                  $options = array('title' => __('Polls', 'wp-polls')); 
     
    7373            echo '<select id="polls-displayarchive" name="poll_archive_show" size="1">'."\n"; 
    7474            echo '<option value="0"'; 
    75             selected('0', get_settings('poll_archive_show')); 
     75            selected('0', get_option('poll_archive_show')); 
    7676            echo '>'; 
    7777            _e('No'); 
    7878            echo '</option>'."\n"; 
    7979            echo '<option value="1"'; 
    80             selected('1', get_settings('poll_archive_show')); 
     80            selected('1', get_option('poll_archive_show')); 
    8181            echo '>'; 
    8282            _e('Yes'); 
  • wp-polls/trunk/polls/polls.php

    r7612 r7633  
    6565      $pollresult_id = intval($_GET['pollresult']); 
    6666      // Check Whether Poll Is Disabled 
    67       if(intval(get_settings('poll_currentpoll')) == -1) { 
     67      if(intval(get_option('poll_currentpoll')) == -1) { 
    6868            if($display) { 
    69                   echo stripslashes(get_settings('poll_template_disable')); 
     69                  echo stripslashes(get_option('poll_template_disable')); 
    7070                  return; 
    7171            } else { 
    72                   return stripslashes(get_settings('poll_template_disable')); 
     72                  return stripslashes(get_option('poll_template_disable')); 
    7373            }            
    7474      // Poll Is Enabled 
     
    7777            if(intval($temp_poll_id) == 0) { 
    7878                  // Random Poll 
    79                   if(intval(get_settings('poll_currentpoll')) == -2) { 
     79                  if(intval(get_option('poll_currentpoll')) == -2) { 
    8080                        $random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1"); 
    8181                        $poll_id = intval($random_poll_id); 
     
    8686                        } 
    8787                  // Current Poll ID Is Not Specified 
    88                   } elseif(intval(get_settings('poll_currentpoll')) == 0) { 
     88                  } elseif(intval(get_option('poll_currentpoll')) == 0) { 
    8989                        // Get Lastest Poll ID 
    90                         $poll_id = intval(get_settings('poll_latestpoll')); 
     90                        $poll_id = intval(get_option('poll_latestpoll')); 
    9191                  } else { 
    9292                        // Get Current Poll ID 
    93                         $poll_id = intval(get_settings('poll_currentpoll')); 
     93                        $poll_id = intval(get_option('poll_currentpoll')); 
    9494                  } 
    9595            // Get Hardcoded Poll ID 
     
    121121            $check_voted = check_voted($poll_id); 
    122122            if($poll_active == 0) { 
    123                   $poll_close = intval(get_settings('poll_close')); 
     123                  $poll_close = intval(get_option('poll_close')); 
    124124            } 
    125125            if($check_voted > 0 || ($poll_active == 0 && $poll_close == 1) || !check_allowtovote()) { 
     
    148148      wp_register_script('wp-polls', '/wp-content/plugins/polls/polls-js.php', false, '2.14'); 
    149149      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"; 
    151151      echo '<style type="text/css">'."\n"; 
    152       $pollbar = get_settings('poll_bar'); 
     152      $pollbar = get_option('poll_bar'); 
    153153      if($pollbar['style'] == 'use_css') { 
    154154            echo '.wp-polls .pollbar {'."\n"; 
     
    166166            echo "\t".'line-height: '.$pollbar['height'].'px;'."\n"; 
    167167            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"; 
    169169            echo "\t".'border: 1px solid #'.$pollbar['border'].';'."\n"; 
    170170            echo '}'."\n"; 
     
    178178add_action('admin_head', 'poll_header_admin'); 
    179179function 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"; 
    181181} 
    182182 
     
    186186      global $user_ID; 
    187187      $user_ID = intval($user_ID); 
    188       $allow_to_vote = intval(get_settings('poll_allowtovote')); 
     188      $allow_to_vote = intval(get_option('poll_allowtovote')); 
    189189      switch($allow_to_vote) { 
    190190            // Guests Only 
     
    212212### Funcrion: Check Voted By Cookie Or IP 
    213213function check_voted($poll_id) { 
    214       $poll_logging_method = intval(get_settings('poll_logging_method')); 
     214      $poll_logging_method = intval(get_option('poll_logging_method')); 
    215215      switch($poll_logging_method) { 
    216216            // Do Not Log 
     
    286286      $poll_question_id = intval($poll_question->pollq_id); 
    287287      $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)); 
    289289      $poll_expiry = trim($poll_question->pollq_expiry); 
    290290      if(empty($poll_expiry)) { 
    291291            $poll_end_date  = __('No Expiry', 'wp-polls'); 
    292292      } 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')); 
    296296      $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question); 
    297297      $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question); 
     
    300300      $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 
    301301      // 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')); 
    303303      // If There Is Poll Question With Answers 
    304304      if($poll_question && $poll_answers) { 
     
    316316                  $poll_answer_text = stripslashes($poll_answer->polla_answers); 
    317317                  $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')); 
    319319                  $template_answer = str_replace("%POLL_ID%", $poll_question_id, $template_answer); 
    320320                  $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer); 
     
    335335            } 
    336336            // Voting Form Footer Variables 
    337             $template_footer = stripslashes(get_settings('poll_template_votefooter')); 
     337            $template_footer = stripslashes(get_option('poll_template_votefooter')); 
    338338            $template_footer = str_replace("%POLL_ID%", $poll_question_id, $template_footer); 
    339339            $template_footer = str_replace("%POLL_RESULT_URL%", $poll_result_url, $template_footer); 
     
    345345                  $temp_pollvote .= "\t</form>\n"; 
    346346                  $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\" />&nbsp;".__('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\" />&nbsp;".__('Loading', 'wp-polls')." ...</div>\n"; 
    348348            }            
    349349      } else { 
    350             $temp_pollvote .= stripslashes(get_settings('poll_template_disable')); 
     350            $temp_pollvote .= stripslashes(get_option('poll_template_disable')); 
    351351      } 
    352352      // Return Poll Vote Template 
     
    374374      $poll_question_totalvotes = intval($poll_question->pollq_totalvotes); 
    375375      $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)); 
    377377      $poll_expiry = trim($poll_question->pollq_expiry); 
    378378      if(empty($poll_expiry)) { 
    379379            $poll_end_date  = __('No Expiry', 'wp-polls'); 
    380380      } 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')); 
    384384      $template_question = str_replace("%POLL_QUESTION%", $poll_question_text, $template_question); 
    385385      $template_question = str_replace("%POLL_ID%", $poll_question_id, $template_question); 
     
    388388      $template_question = str_replace("%POLL_END_DATE%", $poll_end_date, $template_question); 
    389389      // 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')); 
    391391      // If There Is Poll Question With Answers 
    392392      if($poll_question && $poll_answers) { 
     
    427427                  if($user_voted == $poll_answer_id) { 
    428428                        // Results Body Variables 
    429                         $template_answer = stripslashes(get_settings('poll_template_resultbody2')); 
     429                        $template_answer = stripslashes(get_option('poll_template_resultbody2')); 
    430430                        $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer); 
    431431                        $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer); 
     
    438438                  } else { 
    439439                        // Results Body Variables 
    440                         $template_answer = stripslashes(get_settings('poll_template_resultbody')); 
     440                        $template_answer = stripslashes(get_option('poll_template_resultbody')); 
    441441                        $template_answer = str_replace("%POLL_ANSWER_ID%", $poll_answer_id, $template_answer); 
    442442                        $template_answer = str_replace("%POLL_ANSWER%", $poll_answer_text, $template_answer); 
     
    466466            // Results Footer Variables 
    467467            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')); 
    471471            } 
    472472            $template_footer = str_replace("%POLL_START_DATE%", $poll_start_date, $template_footer); 
     
    484484            if(!$without_poll_title) { 
    485485                  $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\" />&nbsp;".__('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\" />&nbsp;".__('Loading', 'wp-polls')." ...</div>\n"; 
    487487            }            
    488488      } else { 
    489             $temp_pollresult .= stripslashes(get_settings('poll_template_disable')); 
     489            $temp_pollresult .= stripslashes(get_option('poll_template_disable')); 
    490490      }      
    491491      // Return Poll Result 
     
    612612### Function: Displays Polls Archive Link 
    613613function display_polls_archive_link($display = true) { 
    614       if(intval(get_settings('poll_archive_show')) == 1) { 
     614      if(intval(get_option('poll_archive_show')) == 1) { 
    615615            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"; 
    617617            } 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"; 
    619619            } 
    620620      } 
     
    631631      $polls_answers = array(); 
    632632      $polls_ip = array(); 
    633       $polls_perpage = intval(get_settings('poll_archive_perpage')); 
     633      $polls_perpage = intval(get_option('poll_archive_perpage')); 
    634634      $poll_questions_ids = '0'; 
    635635      $poll_voted = false; 
     
    669669 
    670670      // 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) { 
    672672            // Hardcoded Poll ID Is Not Specified 
    673673            if(intval($temp_poll_id) == 0) { 
    674674                  // Random Poll 
    675                   if(intval(get_settings('poll_currentpoll')) == -2) { 
     675                  if(intval(get_option('poll_currentpoll')) == -2) { 
    676676                        $random_poll_id = $wpdb->get_var("SELECT pollq_id FROM $wpdb->pollsq WHERE pollq_active = 1 ORDER BY RAND() LIMIT 1"); 
    677677                        $poll_id = intval($random_poll_id); 
    678678                  // Current Poll ID Is Not Specified 
    679                   } else if(intval(get_settings('poll_currentpoll')) == 0) { 
     679                  } else if(intval(get_option('poll_currentpoll')) == 0) { 
    680680                        // Get Lastest Poll ID 
    681                         $poll_id = intval(get_settings('poll_latestpoll')); 
     681                        $poll_id = intval(get_option('poll_latestpoll')); 
    682682                  } else { 
    683683                        // Get Current Poll ID 
    684                         $poll_id = intval(get_settings('poll_currentpoll')); 
     684                        $poll_id = intval(get_option('poll_currentpoll')); 
    685685                  } 
    686686            // Get Hardcoded Poll ID 
     
    701701 
    702702      // 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')); 
    704704      if($answers) { 
    705705            foreach($answers as $answer) { 
     
    720720            $pollsarchive_output_current_title = '<h2>'.__('Current Poll', 'wp-polls').'</h2>'."\n"; 
    721721            // 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'); 
    724724            } else { 
    725725                  // User Click on View Results Link 
     
    755755                  $poll_totalvotes_zero = false; 
    756756            } 
    757                   $poll_start_date = mysql2date(get_settings('date_format').' @ '.get_settings('time_format'), gmdate('Y-m-d H:i:s', $polls_question['start'])); 
     757