Changeset 1599

Show
Ignore:
Timestamp:
09/05/04 00:24:28 (4 years ago)
Author:
saxmatt
Message:

Massive options cleanup and another step of cleaning up the upgrade/install.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-header.php

    r1547 r1599  
    1414$posts_per_page = get_settings('posts_per_page'); 
    1515$what_to_show = get_settings('what_to_show'); 
    16 $archive_mode = get_settings('archive_mode'); 
    1716$date_format = get_settings('date_format'); 
    1817$time_format = get_settings('time_format'); 
  • trunk/wp-admin/edit-form-advanced.php

    r1505 r1599  
    1010<?php 
    1111 
    12 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers'))); 
    13  
    1412if (0 == $post_ID) { 
    1513    $form_action = 'post'; 
     
    1917} 
    2018 
    21 if (get_settings('use_pingback')) { 
    22     $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 
    23 } else { 
    24     $form_pingback = ''; 
    25 
     19$form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 
    2620 
    2721$form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />'; 
    2822 
    29 if (get_settings('use_trackback')) { 
    3023    $form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="' . __('Help on trackbacks') . '">' . __('<strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>') . '</label> ' . __('(Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)') . '<br /> 
    3124    <input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>'; 
     
    3831        $pings .= '</ul>'; 
    3932    } 
    40 } else { 
    41     $form_trackback = ''; 
    42 
     33 
    4334$saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="' . __('Save and Continue Editing') . '" />'; 
    4435 
  • trunk/wp-admin/edit-form-comment.php

    r1503 r1599  
    11<?php 
    2  
    3 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers'))); 
    42 
    53$submitbutton_text = __('Edit Comment &raquo;'); 
  • trunk/wp-admin/edit-form.php

    r1505 r1599  
    22<div class="wrap"> 
    33<?php 
    4  
    5 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers'))); 
    6  
    74$form_action = 'post'; 
    85$form_extra = ''; 
    96 
    10 if (get_settings('use_pingback')) { 
    11     $form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 
    12 } else { 
    13     $form_pingback = ''; 
    14 
     7$form_pingback = '<input type="hidden" name="post_pingback" value="1" id="post_pingback" />'; 
    158 
    16 if (get_settings('use_trackback')) { 
    17     $form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') . 
     9$form_trackback = '<p><label for="trackback">' . sprintf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') . 
    1810    '<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>'; 
    19 } else { 
    20     $form_trackback = ''; 
    21 
     11 
    2212 
    2313$saveasdraft = ''; 
  • trunk/wp-admin/edit-page-form.php

    r1528 r1599  
    22<div class="wrap"> 
    33<?php 
    4  
    5 $allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers'))); 
    6  
    74$form_action = 'post'; 
    85$form_extra = ''; 
  • trunk/wp-admin/link-categories.php

    r1551 r1599  
    2929      include_once('admin-header.php'); 
    3030 
    31       if ($user_level < get_settings('links_minadminlevel')
     31      if ($user_level < 5
    3232          die (__("Cheatin' uh ?")); 
    3333 
     
    9292        die(sprintf(__("Can't delete the <strong>%s</strong> link category: this is the default one"), $cat_name)); 
    9393 
    94     if ($user_level < get_settings('links_minadminlevel')
     94    if ($user_level < 5
    9595      die (__("Cheatin' uh ?")); 
    9696 
     
    208208    include_once("./admin-header.php"); 
    209209 
    210     if ($user_level < get_settings('links_minadminlevel')
     210    if ($user_level < 5
    211211      die (__("Cheatin' uh ?")); 
    212212 
     
    281281    $standalone=0; 
    282282    include_once ("./admin-header.php"); 
    283     if ($user_level < get_settings('links_minadminlevel')) { 
     283    if ($user_level < 5) { 
    284284      die(__("You have do not have sufficient permissions to edit the link categories for this blog. :)")); 
    285285    } 
  • trunk/wp-admin/link-import.php

    r1551 r1599  
    1818        $standalone = 0; 
    1919        include_once('admin-header.php'); 
    20         if ($user_level < get_settings('links_minadminlevel')
     20        if ($user_level < 5
    2121            die (__("Cheatin&#8217; uh?")); 
    2222 
     
    7575                $standalone = 0; 
    7676                include_once('admin-header.php'); 
    77                 if ($user_level < get_settings('links_minadminlevel')
     77                if ($user_level < 5
    7878                    die (__("Cheatin' uh ?")); 
    7979?> 
  • trunk/wp-admin/link-manager.php

    r1551 r1599  
    9090 
    9191    // check the current user's level first. 
    92     if ($user_level < get_settings('links_minadminlevel')
     92    if ($user_level < 5
    9393      die (__("Cheatin' uh ?")); 
    9494 
     
    103103    $results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $wpdb->links LEFT JOIN $wpdb->users ON link_owner = ID WHERE link_id in ($all_links)"); 
    104104    foreach ($results as $row) { 
    105       if (!get_settings('links_use_adminlevels') || ($user_level >= $row->user_level)) { // ok to proceed 
     105      if (($user_level >= $row->user_level)) { // ok to proceed 
    106106        $ids_to_change[] = $row->link_id; 
    107107      } 
     
    123123 
    124124    // check the current user's level first. 
    125     if ($user_level < get_settings('links_minadminlevel')
     125    if ($user_level < 5
    126126      die (__("Cheatin' uh ?")); 
    127127 
     
    163163 
    164164    // check the current user's level first. 
    165     if ($user_level < get_settings('links_minadminlevel')
     165    if ($user_level < 5
    166166      die (__("Cheatin' uh ?")); 
    167167 
     
    200200    $auto_toggle = get_autotoggle($link_category); 
    201201 
    202     if ($user_level < get_settings('links_minadminlevel')
     202    if ($user_level < 5
    203203      die (__("Cheatin' uh ?")); 
    204204 
     
    251251      $auto_toggle = get_autotoggle($link_category); 
    252252 
    253       if ($user_level < get_settings('links_minadminlevel')
     253      if ($user_level < 5
    254254        die (__("Cheatin' uh ?")); 
    255255 
     
    284284    $link_id = (int) $_GET['link_id']; 
    285285 
    286     if ($user_level < get_settings('links_minadminlevel')
     286    if ($user_level < 5
    287287      die (__("Cheatin' uh ?")); 
    288288 
     
    307307    $xfn = true; 
    308308    include_once ('admin-header.php'); 
    309     if ($user_level < get_settings('links_minadminlevel')) { 
     309    if ($user_level < 5) { 
    310310      die(__('You do not have sufficient permissions to edit the links for this blog.')); 
    311311    } 
     
    572572    $standalone=0; 
    573573    include_once ("./admin-header.php"); 
    574     if ($user_level < get_settings('links_minadminlevel')) { 
     574    if ($user_level < 5) { 
    575575      die(__("You do not have sufficient permissions to edit the links for this blog.")); 
    576576    } 
     
    722722            $show_buttons = 1; // default 
    723723 
    724             if (get_settings('links_use_adminlevels') && ($link->user_level > $user_level)) { 
     724            if ($link->user_level > $user_level) { 
    725725              $show_buttons = 0; 
    726726            } 
  • trunk/wp-admin/menu.php

    r1573 r1599  
    3737$submenu['options-general.php'][15] = array(__('Reading'), 5, 'options-reading.php'); 
    3838$submenu['options-general.php'][20] = array(__('Discussion'), 5, 'options-discussion.php'); 
    39 $submenu['options-general.php'][25] = array(__('Miscellaneous'), 5, 'options-misc.php'); 
    40 $submenu['options-general.php'][30] = array(__('Permalinks'), 5, 'options-permalink.php'); 
    41 $submenu['options-general.php'][35] = array(__('Link Manager'), 5, 'options.php?option_group_id=8'); 
     39$submenu['options-general.php'][25] = array(__('Permalinks'), 5, 'options-permalink.php'); 
     40$submenu['options-general.php'][30] = array(__('Miscellaneous'), 5, 'options-misc.php'); 
    4241 
    4342$self = preg_replace('|.*/wp-admin/|i', '', $_SERVER['PHP_SELF']); 
  • trunk/wp-admin/options-discussion.php

    r1463 r1599  
    104104    <p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://wiki.wordpress.org/index.php/SpamWords">Common spam words</a>.') ?></p> 
    105105        <p>  
    106             <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php echo get_settings('moderation_keys'); ?></textarea>  
     106            <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>  
    107107        </p>  
    108108</fieldset> 
     
    111111        </p>  
    112112    </form>  
    113 </div>  
    114 <?php include("admin-footer.php") ?> 
     113</div> 
     114<?php include('./admin-footer.php'); ?> 
  • trunk/wp-admin/options-general.php

    r1551 r1599  
    5252      <tr valign="top">  
    5353        <th width="33%" scope="row"><?php _e('Weblog title:') ?></th>  
    54         <td><input name="blogname" type="text" id="blogname" value="<?php echo htmlspecialchars(get_settings('blogname')); ?>" size="40" /></td>  
     54        <td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>  
    5555      </tr>  
    5656      <tr valign="top">  
    5757        <th scope="row"><?php _e('Tagline:') ?></th>  
    58         <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php echo htmlspecialchars(get_settings('blogdescription')); ?>" size="45" /> 
     58        <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" /> 
    5959        <br /> 
    6060<?php _e('In a few words, explain what this weblog is about.') ?></td>  
     
    6262      <tr valign="top">  
    6363        <th scope="row"><?php _e('WordPress address (URI):') ?></th>  
    64         <td><input name="siteurl" type="text" id="siteurl" value="<?php echo get_settings('siteurl'); ?>" size="40" class="code" /></td>  
     64        <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code" /></td>  
    6565      </tr>  
    6666      <tr valign="top"> 
    6767        <th scope="row"><?php _e('Blog address (URI):') ?></th> 
    68         <td><input name="home" type="text" id="home" value="<?php echo get_settings('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td> 
     68        <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td> 
    6969        </tr> 
    7070      <tr valign="top">  
    7171        <th scope="row"><?php _e('E-mail address:') ?> </th>  
    72         <td><input name="admin_email" type="text" id="admin_email" value="<?php echo get_settings('admin_email'); ?>" size="40" class="code" /> 
     72        <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" /> 
    7373        <br /> 
    7474<?php _e('This address is used only for admin purposes.') ?></td>  
     
    9494      <tr> 
    9595        <th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th> 
    96         <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php echo get_settings('gmt_offset'); ?>" />  
     96        <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" />  
    9797        <?php _e('hours') ?> </td> 
    9898      </tr> 
     
    103103      <tr> 
    104104        <th scope="row"><?php _e('Default date format:') ?></th> 
    105         <td><input name="date_format" type="text" id="date_format" size="30" value="<?php echo get_settings('date_format'); ?>" /><br /> 
     105        <td><input name="date_format" type="text" id="date_format" size="30" value="<?php form_option('date_format'); ?>" /><br /> 
    106106<?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('date_format'), current_time('timestamp')); ?></strong></td> 
    107107        </tr> 
    108108      <tr> 
    109109        <th scope="row"><?php _e('Default time format:') ?></th> 
    110         <td><input name="time_format" type="text" id="time_format" size="30" value="<?php echo get_settings('time_format'); ?>" /><br /> 
     110        <td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br /> 
    111111<?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td> 
    112112        </tr>  
  • trunk/wp-admin/options-misc.php

    r1429 r1599  
    2222} 
    2323 
    24 $wpvarstoreset = array('action','standalone', 'option_group_id'); 
     24$wpvarstoreset = array('action','standalone'); 
    2525for ($i=0; $i<count($wpvarstoreset); $i += 1) { 
    2626    $wpvar = $wpvarstoreset[$i]; 
     
    4545  
    4646<div class="wrap">  
    47   <h2><?php _e('Miscellaneous Options') ?></h2>  
    48   <form name="form1" method="post" action="options.php">  
    49     <input type="hidden" name="action" value="update" />  
    50     <input type="hidden" name="action" value="update" />       <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','default_geourl_lat','default_geourl_lon','use_default_geourl'" />  
    51 <fieldset class="options"> 
    52 <legend> 
    53 <input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> /> 
    54 <label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend> 
    55     <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    56       <tr>  
    57         <th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th>  
    58         <td> 
    59            <input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php echo get_settings('fileupload_realpath'); ?>" size="50" /><br /> 
    60 <?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?> 
    61    
    62           </td>  
    63       </tr>  
    64       <tr> 
    65         <th valign="top" scope="row"><?php _e('URI of this directory:') ?> </th> 
    66         <td>           
    67            <input name="fileupload_url" type="text" id="fileupload_url" value="<?php echo get_settings('fileupload_url'); ?>" size="50" /><br /> 
    68 <?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?> 
    69         </td> 
    70       </tr> 
    71       <tr> 
    72         <th scope="row"><?php _e('Maximum size:') ?> </th> 
    73        <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_settings('fileupload_maxk'); ?>" size="4" />  
    74         <?php _e('Kilobytes (KB)') ?></td> 
    75           </tr> 
    76       <tr> 
    77         <th valign="top" scope="row"><?php _e('Allowed file extensions:') ?></th> 
    78        <td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php echo get_settings('fileupload_allowedtypes'); ?>" size="40" /> 
    79           <br /> 
    80          <?php _e('Recommended: <code>jpg jpeg png gif </code>') ?></td> 
    81           </tr> 
    82       <tr> 
    83         <th scope="row"><?php _e('Minimum level to upload:') ?></th> 
    84           <td><select name="fileupload_minlevel" id="fileupload_minlevel"> 
    85 <?php 
    86 for ($i = 1; $i < 11; $i++) { 
    87 if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'"; 
    88 else $selected = ''; 
     47<h2><?php _e('Miscellaneous Options') ?></h2>  
     48<form name="miscoptions" method="post" action="options.php">  
     49    <input type="hidden" name="action" value="update" /> 
     50    <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','use_linksupdate','weblogs_xml_url','links_updated_date_format','links_recently_updated_prepend','links_recently_updated_append','default_geourl_lat','default_geourl_lon','use_default_geourl'" />  
     51   <fieldset class="options"> 
     52   <legend> 
     53   <input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> /> 
     54   <label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend> 
     55   <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     56   <tr>  
     57   <th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th>  
     58   <td> 
     59   <input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php form_option('fileupload_realpath'); ?>" size="50" /><br /> 
     60   <?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?> 
     61     
     62  </td>  
     63   </tr>  
     64   <tr> 
     65   <th valign="top" scope="row"><?php _e('URI of this directory:') ?> </th> 
     66   <td>           
     67   <input name="fileupload_url" type="text" id="fileupload_url" value="<?php form_option('fileupload_url'); ?>" size="50" /><br /> 
     68   <?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?> 
     69   </td> 
     70   </tr> 
     71   <tr> 
     72   <th scope="row"><?php _e('Maximum size:') ?> </th> 
     73   <td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php form_option('fileupload_maxk'); ?>" size="4" />  
     74   <?php _e('Kilobytes (KB)') ?></td> 
     75  </tr> 
     76   <tr> 
     77   <th valign="top" scope="row"><?php _e('Allowed file extensions:') ?></th> 
     78   <td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php form_option('fileupload_allowedtypes'); ?>" size="40" /> 
     79  <br /> 
     80   <?php _e('Recommended: <code>jpg jpeg png gif</code>') ?></td> 
     81  </tr> 
     82   <tr> 
     83   <th scope="row"><?php _e('Minimum level to upload:') ?></th> 
     84  <td><select name="fileupload_minlevel" id="fileupload_minlevel"> 
     85   <?php 
     86   for ($i = 1; $i < 11; $i++) { 
     87   if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'"; 
     88   else $selected = ''; 
    8989    echo "\n\t<option value='$i' $selected>$i</option>"; 
    90 
    91 ?> 
    92             </select></td> 
    93         </tr> 
    94     </table>  
    95 </fieldset> 
    96 <fieldset class="options"> 
    97 <legend> 
    98 <input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> /> 
    99 <label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend> 
    100     <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    101       <tr>  
    102         <th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th>  
    103         <td> 
    104             <input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php echo get_settings('default_geourl_lat'); ?>" size="50" /> 
    105             </td>  
    106       </tr>  
    107       <tr> 
    108         <th valign="top" scope="row"><?php _e('Default longitude:') ?> </th> 
    109         <td>           
    110             <input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php echo get_settings('default_geourl_lon'); ?>" size="50" /> 
    111         </td> 
    112       </tr> 
    113       <tr> 
    114         <th scope="row">  </th> 
    115         <td><label> 
    116             <input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> />  
    117             <?php _e('Use default location values if none specified.') ?></label></td> 
    118         </tr> 
     90    } 
     91    ?> 
     92    </select></td> 
     93    </tr> 
     94    </table>  
     95    </fieldset> 
     96    <fieldset class="options"> 
     97    <legend> 
     98    <input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1" <?php checked('1', get_settings('use_linksupdate')); ?> /> 
     99    <label for="use_linksupdate"><?php _e('Track Link&#8217;s Update Times') ?></label></legend> 
     100    <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     101    <tr>  
     102    <th width="33%" valign="top" scope="row"><?php _e('Update file:') ?> </th>  
     103    <td> 
     104    <input name="weblogs_xml_url" type="text" id="weblogs_xml_url" value="<?php form_option('weblogs_xml_url'); ?>" size="50" /><br /> 
     105    <?php __('Recommended: <code>http://static.wordpress.org/changes.xml</code>') ?> 
     106     
     107    </td>  
     108    </tr>  
     109    <tr> 
     110    <th valign="top" scope="row"><?php _e('Updated link time format:') ?> </th> 
     111    <td>           
     112    <input name="links_updated_date_format" type="text" id="links_updated_date_format" value="<?php form_option('links_updated_date_format'); ?>" size="50" /> 
     113    </td> 
     114    </tr> 
     115    <tr> 
     116    <th scope="row"><?php _e('Prepend updated with:') ?> </th> 
     117    <td><input name="links_recently_updated_prepend" type="text" id="links_recently_updated_prepend" value="<?php form_option('links_recently_updated_prepend'); ?>" size="50" /></td> 
     118    </tr> 
     119    <tr> 
     120    <th valign="top" scope="row"><?php _e('Append updated with:') ?></th> 
     121    <td><input name="links_recently_updated_append" type="text" id="links_recently_updated_append" value="<?php form_option('links_recently_updated_append'); ?>" size="50" /></td> 
     122    </tr> 
     123    </table> 
     124    <p><?php printf(__('A link is "recent" if it has been updated in the past %s minutes.'), '<input name="links_recently_updated_time" type="text" id="links_recently_updated_time" size="3" value="' . get_settings('links_recently_updated_time'). '" />' ) ?></p> 
     125    </fieldset> 
     126    <fieldset class="options"> 
     127    <legend> 
     128    <input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> /> 
     129    <label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend> 
     130    <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     131    <tr>  
     132    <th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th>  
     133    <td> 
     134    <input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php form_option('default_geourl_lat'); ?>" size="50" /> 
     135    </td>  
     136    </tr>  
     137    <tr> 
     138    <th valign="top" scope="row"><?php _e('Default longitude:') ?> </th> 
     139    <td>           
     140    <input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php form_option('default_geourl_lon'); ?>" size="50" /> 
     141    </td> 
     142    </tr> 
     143    <tr> 
     144    <th scope="row">  </th> 
     145    <td><label> 
     146    <input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> />  
     147    <?php _e('Use default location values if none specified.') ?></label></td> 
     148    </tr> 
     149    </table>  
     150    </fieldset> 
     151    <p> 
     152    <label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> 
     153    </p> 
     154    <p class="submit"> 
     155        <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" /> 
     156    </p> 
     157</form>  
     158</div> 
    119159 
    120     </table>  
    121 </fieldset> 
    122         <p> 
    123             <label> 
    124             <input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> />  
    125             <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> 
    126         </p> 
    127     <p class="submit"> 
    128       <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" /> 
    129     </p> 
    130   </form>  
    131 </div>  
    132 <?php include("admin-footer.php") ?> 
     160<?php include('./admin-footer.php'); ?> 
  • trunk/wp-admin/options-permalink.php

    r1567 r1599  
    3030  $home_path = ABSPATH; 
    3131} 
    32  
    33 require_once('./optionhandler.php'); 
    3432 
    3533if (isset($_POST['submit'])) { 
  • trunk/wp-admin/options-reading.php

    r1500 r1599  
    4444 
    4545<div class="wrap">  
    46     <h2><?php _e('Reading Options') ?></h2>  
    47     <form name="form1" method="post" action="options.php">  
    48         <input type="hidden" name="action" value="update" />  
    49         <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />  
    50         <fieldset class="options">  
    51         <legend><?php _e('Front Page') ?></legend>  
    52         <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    53             <tr valign="top">  
    54                 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>  
    55                 <td><input name="posts_per_page" type="text" id="posts_per_page" value="<?php echo get_settings('posts_per_page'); ?>" size="3" />  
    56                     <select name="what_to_show" id="what_to_show" >  
    57                                                 <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option>  
    58                         <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option>  
    59                     </select> </td>  
    60             </tr>  
    61         </table>  
    62         </fieldset>  
     46<h2><?php _e('Reading Options') ?></h2>  
     47<form name="form1" method="post" action="options.php">  
     48    <input type="hidden" name="action" value="update" />  
     49    <input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />  
     50    <fieldset class="options">  
     51    <legend><?php _e('Front Page') ?></legend>  
     52    <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     53        <tr valign="top">  
     54        <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>  
     55        <td> 
     56        <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" />  
     57        <select name="what_to_show" id="what_to_show" >  
     58            <option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option>  
     59            <option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option>  
     60        </select> 
     61        </td>  
     62        </tr>  
     63    </table>  
     64    </fieldset>  
    6365 
    64         <fieldset class="options">  
    65         <legend><?php _e('Syndication Feeds') ?></legend>  
    66         <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    67             <tr valign="top">  
    68                 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>  
    69                 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php echo get_settings('posts_per_rss'); ?>" size="3" />  
    70                     <?php _e('posts') ?></td>  
    71             </tr> 
    72             <tr valign="top"> 
    73                 <th scope="row"><?php _e('For each article, show:') ?> </th> 
    74                 <td><label> 
    75                     <input name="rss_use_excerpt"  type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?>  /> 
    76                     <?php _e('full text') ?></label>                    <br /> 
    77                     <label> 
    78                     <input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /> 
    79                     <?php _e('summary') ?></label> </td> 
    80             </tr>  
    81         </table>  
    82         </fieldset>  
    83                 <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
    84             <tr valign="top">  
    85                 <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>  
    86                 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" /> 
    87                     <br /> 
    88                  <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>  
    89             </tr> 
    90         </table>  
    91         <p> 
    92             <label> 
    93             <input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />  
    94              <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label> 
    95         </p> 
    96         <p class="submit">  
    97             <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />  
    98         </p>  
    99     </form>  
     66    <fieldset class="options">  
     67    <legend><?php _e('Syndication Feeds') ?></legend>  
     68    <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     69        <tr valign="top">  
     70        <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>  
     71        <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>  
     72        </tr> 
     73        <tr valign="top"> 
     74        <th scope="row"><?php _e('For each article, show:') ?> </th> 
     75        <td> 
     76        <label><input name="rss_use_excerpt"  type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?>  /><?php _e('full text') ?></label><br /> 
     77        <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /><?php _e('summary') ?></label> 
     78        </td> 
     79        </tr>  
     80    </table>  
     81    </fieldset>  
     82    <table width="100%" cellspacing="2" cellpadding="5" class="editform">  
     83        <tr valign="top">  
     84        <th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>  
     85        <td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br /> 
     86        <?php _e('The character encoding you write your blog in (UTF-8 <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>  
     87        </tr> 
     88    </table>  
     89    <p> 
     90        <label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />  
     91         <?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label> 
     92    </p> 
     93    <p class="submit">  
     94        <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />  
     95    </p>  
     96</form>  
    10097</div>  
    101 <?php include("admin-footer.php") ?> 
     98<?php include('./admin-footer.php'); ?> 
  • trunk/wp-admin/options-writing.php

    r1429 r1599  
    6464      <tr valign="top">  
    6565        <th width="33%" scope="row"> <?php _e('Size of the writing box:') ?></th>  
    66         <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php echo get_settings('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />  
     66        <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />  
    6767         <?php _e('lines') ?></td>  
    6868      </tr>  
     
    9393          <p><?php printf(__('Enter the sites that you would like to notify when you publish a new post. For a list of some recommended sites to ping please see <a href="%s">Update Services</a> on the wiki. Separate multiple URIs by line breaks.'), 'http://wiki.wordpress.org/index.php/UpdateServices') ?></p> 
    9494     
    95     <textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php echo get_settings('ping_sites'); ?></textarea> 
     95    <textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php form_option('ping_sites'); ?></textarea> 
    9696    </fieldset> 
    9797    <fieldset class="options"> 
     
    102102            <tr valign="top"> 
    103103                <th scope="row"><?php _e('Mail server:') ?></th> 
    104                 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php echo get_settings('mailserver_url'); ?>" size="40" /> 
     104                <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" /> 
    105105                <label for="port"><?php _e('Port:') ?></label>  
    106                 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php echo get_settings('mailserver_port'); ?>" size="6" /> 
     106                <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" /> 
    107107                </td> 
    108108            </tr> 
    109109            <tr valign="top"> 
    110110                <th width="33%" scope="row"><?php _e('Login name:') ?></th> 
    111                 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php echo get_settings('mailserver_login'); ?>" size="40" /></td> 
     111                <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td> 
    112112            </tr> 
    113113            <tr valign="top"> 
    114114                <th scope="row"><?php _e('Password:') ?></th> 
    115115                <td> 
    116                     <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php echo get_settings('mailserver_pass'); ?>" size="40" /> 
     116                    <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" /> 
    117117                </td> 
    118118            </tr> 
  • trunk/wp-admin/options.php

    r1597 r1599  
    2323} 
    2424 
    25 $wpvarstoreset = array('action','standalone', 'option_group_id'); 
     25$wpvarstoreset = array('action','standalone'); 
    2626for ($i=0; $i<count($wpvarstoreset); $i += 1) { 
    2727    $wpvar = $wpvarstoreset[$i]; 
     
    3838    } 
    3939} 
    40 if (isset($_GET['option_group_id'])) $option_group_id = (int) $_GET['option_group_id']; 
    41 require_once('./optionhandler.php'); 
    42 $non_was_selected = 0; 
    43 if (!isset($_GET['option_group_id'])) { 
    44     $option_group_id = 1; 
    45     $non_was_selected = 1; 
    46 } 
    4740 
    4841switch($action) { 
     
    5346    $any_changed = 0; 
    5447     
    55     // iterate through the list of options in this group 
    56     // pull the vars from the post 
    57     // validate ranges etc. 
    58     // update the values 
    5948    if (!$_POST['page_options']) { 
    6049        foreach ($_POST as $key => $value) { 
     
    6756 
    6857    $options = $wpdb->get_results("SELECT $wpdb->options.option_id, option_name, option_type, option_value, option_admin_level FROM $wpdb->options WHERE option_name IN ($option_names)"); 
    69 //  die(var_dump($options)); 
    7058 
    7159// HACK 
     
    8573                } 
    8674                if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_val = 'closed'; 
    87                 if ($new_val !== $old_val) { 
    88                     $query = "UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"; 
    89                     $result = $wpdb->query($query); 
    90                     //if( in_array($option->option_name, $nonbools)) die('boo'.$query); 
    91                     if (!$result) { 
    92                         $dB_errors .= sprintf(__(" SQL error while saving %s. "), $this_name); 
    93                     } else { 
    94                         ++$any_changed; 
    95                     } 
     75                if ($new_val !== $old_val) 
     76                    $result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'"); 
    9677                } 
    9778            } 
    98         } // end foreach 
    9979        unset($cache_settings); // so they will be re-read 
    10080        get_settings('siteurl'); // make it happen now 
     
    10585    } 
    10686     
    107     if ( isset($dB_errors)  || isset($validation_message) ) { 
    108         if ($message != '') { 
    109             $message .= '<br />'; 
    110         } 
    111         $message .= $dB_errors . '<br />' . $validation_message; 
    112     } 
    113  
    114     $referred = str_replace(array('&updated=true', '?updated=true') , '', $_SERVER['HTTP_REFERER']); 
    115      if (strstr($referred, '?')) $goback = $referred . '&updated=true'; 
    116     else $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true'; 
     87    $referred = str_replace('?updated=true' , '', $_SERVER['HTTP_REFERER']); 
     88    $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true'; 
    11789    header('Location: ' . $goback); 
    11890    break; 
     
    12092default: 
    12193    $standalone = 0; 
    122     include_once("./admin-header.php"); 
     94    include_once('./admin-header.php'); 
    12395    if ($user_level <= 6) { 
    12496        die(__("You have do not have sufficient permissions to edit the options for this blog.")); 
     
    129101 
    130102<div class="wrap"> 
    131   <h2><?php echo $current_desc; ?></h2> 
    132   <form name="form" action="<?php echo $this_file; ?>" method="post"> 
     103  <h2>All options</h2> 
     104  <form name="form" action="options.php" method="post"> 
    133105  <input type="hidden" name="action" value="update" /> 
    134   <input type="hidden" name="option_group_id" value="<?php echo $option_group_id; ?>" /> 
    135   <table width="90%" cellpadding="2" cellspacing="2" border="0"> 
     106  <table width="98%"> 
    136107<?php 
    137 //Now display all the options for the selected group. 
    138 if ('all' == $_GET['option_group_id']) : 
    139108$options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); 
    140 endif; 
    141109 
    142110foreach ($options as $option) : 
    143     if ('all' == $_GET['option_group_id']) $option->option_type = 3; 
    144     echo "\t<tr><td width='10%' valign='top'>" . get_option_widget($option, ($user_level >= $option->option_admin_level), '</td><td width="15%" valign="top" style="border: 1px solid #ccc">'); 
    145     echo "\t</td><td  valign='top' class='helptext'>$option->option_description</td></tr>\n"; 
     111    $value = htmlspecialchars($option->option_value); 
     112    echo " 
     113<tr> 
     114    <th scope='row'><label for='$option->option_name'>$option->option_name</label></th> 
     115    <td><input type='text' name='$option->option_name' id='$option->option_name' size='30' value='$value' /></td> 
     116    <td>$option->option_description</td> 
     117</tr>"; 
    146118endforeach; 
    147119?> 
     
    151123</div> 
    152124 
    153 <div class="wrap"> 
     125 
    154126<?php 
    155 if ($current_long_desc != '') { 
    156