Make WordPress Core

Changeset 1599


Ignore:
Timestamp:
09/05/2004 12:24:28 AM (20 years ago)
Author:
saxmatt
Message:

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

Location:
trunk
Files:
1 deleted
31 edited

Legend:

Unmodified
Added
Removed
  • 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     echo $current_long_desc;
    157 }
    158 ?>
    159 </div>
    160 <?php
    161 } // end else a group was selected
    162127break;
    163128} // end switch
  • trunk/wp-admin/post.php

    r1572 r1599  
    733733        $ping_status = get_settings('default_ping_status');
    734734        $post_pingback = get_settings('default_pingback_flag');
    735         $default_post_cat = get_settings('default_post_category');
    736735
    737736        include('edit-page-form.php');
     
    783782        $ping_status = get_settings('default_ping_status');
    784783        $post_pingback = get_settings('default_pingback_flag');
    785         $default_post_cat = get_settings('default_post_category');
    786784
    787785        if (get_settings('advanced_edit')) {
     
    797795
    798796<?php
    799 $bookmarklet_height= (get_settings('use_trackback')) ? 460 : 420;
     797$bookmarklet_height= 420;
    800798
    801799if ($is_NS4 || $is_gecko) {
  • trunk/wp-admin/profile.php

    r1551 r1599  
    108108case 'IErightclick':
    109109
    110 
    111     $bookmarklet_tbpb  = (get_settings('use_trackback')) ? '&trackback=1' : '';
    112     $bookmarklet_tbpb .= (get_settings('use_pingback'))  ? '&pingback=1'  : '';
    113     $bookmarklet_height= (get_settings('use_trackback')) ? 590 : 550;
     110    $bookmarklet_height= 550;
    114111
    115112    ?>
     
    147144    $profiledata=get_userdata($user_ID);
    148145
    149     $bookmarklet_tbpb  = (get_settings('use_trackback')) ? '&trackback=1' : '';
    150     $bookmarklet_tbpb .= (get_settings('use_pingback'))  ? '&pingback=1'  : '';
    151     $bookmarklet_height= (get_settings('use_trackback')) ? 480 : 440;
     146    $bookmarklet_height= 440;
    152147
    153148if (isset($updated)) { ?>
  • trunk/wp-admin/upgrade-functions.php

    r1598 r1599  
    153153
    154154function upgrade_all() {
     155    populate_options();
    155156    upgrade_071();
    156157    upgrade_072();
     
    159160    upgrade_110();
    160161    upgrade_130();
    161 
    162     // Options that should not exist
    163     $obs_options = array('');
    164 }
    165 
    166 
    167 // .71 stuff
     162}
     163
     164function populate_options() {
     165
     166    $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
     167    add_option('siteurl', $guessurl, 'WordPress web address');
     168    add_option('blogfilename', '', 'Default file for blog');
     169    add_option('blogname', 'My Weblog', 'Blog title');
     170    add_option('blogdescription', '', 'Short tagline');
     171    add_option('new_users_can_blog', 0);
     172    add_option('users_can_register', 1);
     173    add_option('admin_email', 'you@example.com');
     174    add_option('start_of_week', 1);
     175    add_option('use_balanceTags', 1);
     176    add_option('use_smilies', 1);
     177    add_option('require_name_email', 1);
     178    add_option('comments_notify', 1);
     179    add_option('posts_per_rss', 10);
     180    add_option('rss_excerpt_length', 50);
     181    add_option('rss_use_excerpt', 0);
     182    add_option('use_fileupload', 0);
     183    add_option('fileupload_realpath', ABSPATH . 'wp-content');
     184    add_option('fileupload_url', get_option('siteurl') . '/wp-content');
     185    add_option('fileupload_allowedtypes', 'jpg jpeg gif png');
     186    add_option('fileupload_maxk', 300);
     187    add_option('fileupload_minlevel', 6);
     188    add_option('mailserver_url', 'mail.example.com');
     189    add_option('mailserver_login', 'login@example.com');
     190    add_option('mailserver_pass', 'password');
     191    add_option('mailserver_port', 110);
     192    add_option('default_category', 1);
     193    add_option('default_comment_status', 'open');
     194    add_option('default_ping_status', 'open');
     195    add_option('default_pingback_flag', 1);
     196    add_option('default_post_edit_rows', 9);
     197    add_option('posts_per_page', 10);
     198    add_option('what_to_show', 'posts');
     199    add_option('date_format', 'F j, Y');
     200    add_option('time_format', 'g:i a');
     201    add_option('use_geo_positions', 0);
     202    add_option('use_default_geourl', 0);
     203    add_option('default_geourl_lat', 0);
     204    add_option('default_geourl_lon', 0);
     205    add_option('weblogs_xml_url', 'http://static.wordpress.org/changes.xml');
     206    add_option('links_updated_date_format', 'F j, Y g:i a');
     207    add_option('links_recently_updated_prepend', '<em>');
     208    add_option('links_recently_updated_append', '</em>');
     209    add_option('links_recently_updated_time', 120);
     210    add_option('comment_moderation', 0);
     211    add_option('moderation_notify', 1);
     212    add_option('permalink_structure');
     213    add_option('gzipcompression', 0);
     214    add_option('hack_file', 0);
     215    add_option('blog_charset', 'utf-8');
     216    add_option('moderation_keys');
     217    add_option('active_plugins');
     218    add_option('home');
     219    add_option('category_base');
     220    add_option('ping_sites', 'http://rpc.pingomatic.com/');
     221    add_option('advanced_edit', 0);
     222    add_option('comment_max_links', 2);
     223
     224    // Delete unused options
     225    $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls');
     226    foreach ($unusedoptions as $option) :
     227        delete_option($option);
     228    endforeach;
     229}
    168230
    169231function upgrade_071() {
     
    205267    )
    206268    ");
    207 
    208     // Guess a site URI
    209 $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUEST_URI);
    210     $option_data = array(       //base options from b2cofig
    211         "1" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (1,'siteurl', 3, '$guessurl', 'siteurl is your blog\'s URL: for example, \'http://example.com/wordpress\'', 8, 30)",
    212         "2" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (2,'blogfilename', 3, 'index.php', 'blogfilename is the name of the default file for your blog', 8, 20)",
    213         "3" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (3,'blogname', 3, 'my weblog', 'blogname is the name of your blog', 8, 20)",
    214         "4" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (4,'blogdescription', 3, 'babblings!', 'blogdescription is the description of your blog', 8, 40)",
    215         //"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (6,'search_engine_friendly_urls', 2, '0', 'Querystring Configuration ** (don\'t change if you don\'t know what you\'re doing)', 8, 20)",
    216         "7" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (7,'new_users_can_blog', 2, '0', 'whether you want new users to be able to post entries once they have registered', 8, 20)",
    217         "8" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (8,'users_can_register', 2, '1', 'whether you want to allow users to register on your blog', 8, 20)",
    218         "54" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (54,'admin_email', 3, 'you@example.com', 'Your email (obvious eh?)', 8, 20)",
    219         // general blog setup
    220         "9" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (9 ,'start_of_week', 5, '1', 'day at the start of the week', 8, 20)",
    221         //"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (10,'use_preview', 2, '1', 'Do you want to use the \'preview\' function', 8, 20)",
    222         "14" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (14,'use_htmltrans', 2, '1', 'IMPORTANT! set this to false if you are using Chinese, Japanese, Korean, or other double-bytes languages', 8, 20)",
    223         "15" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (15,'use_balanceTags', 2, '1', 'this could help balance your HTML code. if it gives bad results, set it to false', 8, 20)",
    224         "16" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (16,'use_smilies', 2, '1', 'set this to true to enable smiley conversion in posts (note: this makes smiley conversion in ALL posts)', 8, 20)",
    225         "17" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (17,'smilies_directory', 3, 'http://example.com/wp-images/smilies', 'the directory where your smilies are (no trailing slash)', 8, 40)",
    226         "18" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (18,'require_name_email', 2, '0', 'set this to true to require e-mail and name, or false to allow comments without e-mail/name', 8, 20)",
    227         "20" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (20,'comments_notify', 2, '1', 'set this to true to let every author be notified about comments on their posts', 8, 20)",
    228         //rss/rdf feeds
    229         "21" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (21,'posts_per_rss', 1, '10', 'number of last posts to syndicate', 8, 20)",
    230         "22" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (22,'rss_language', 3, 'en', 'the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 )', 8, 20)",
    231         "23" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (23,'rss_encoded_html', 2, '0', 'for b2rss.php: allow encoded HTML in &lt;description> tag?', 8, 20)",
    232         "24" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (24,'rss_excerpt_length', 1, '50', 'length (in words) of excerpts in the RSS feed? 0=unlimited note: in b2rss.php, this will be set to 0 if you use encoded HTML', 8, 20)",
    233         "25" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (25,'rss_use_excerpt', 2, '1', 'use the excerpt field for rss feed.', 8, 20)",
    234         "29" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (29,'use_trackback', 2, '1', 'set this to false or true, whether you want to allow your posts to be trackback\'able or not note: setting it to false would also disable sending trackbacks', 8, 20)",
    235         "30" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (30,'use_pingback', 2, '1', 'set this to false or true, whether you want to allow your posts to be pingback\'able or not note: setting it to false would also disable sending pingbacks', 8, 20)",
    236         //file upload
    237         "31" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (31,'use_fileupload', 2, '0', 'set this to false to disable file upload, or true to enable it', 8, 20)",
    238         "32" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (32,'fileupload_realpath', 3, '/home/your/site/wordpress/images', 'enter the real path of the directory where you\'ll upload the pictures \nif you\'re unsure about what your real path is, please ask your host\'s support staff \nnote that the  directory must be writable by the webserver (chmod 766) \nnote for windows-servers users: use forwardslashes instead of backslashes', 8, 40)",
    239         "33" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (33,'fileupload_url', 3, 'http://example.com/images', 'enter the URL of that directory (it\'s used to generate the links to the uploded files)', 8, 40)",
    240         "34" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, separated by spaces. example: \'jpg gif png\'', 8, 20)",
    241         "35" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (35,'fileupload_maxk', 1, '96', 'by default, most servers limit the size of uploads to 2048 KB, if you want to set it to a lower value, here it is (you cannot set a higher value than your server limit)', 8, 20)",
    242         "36" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (36,'fileupload_minlevel', 1, '1', 'you may not want all users to upload pictures/files, so you can set a minimum level for this', 8, 20)",
    243         "37" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'', 8, 30)",
    244         // email settings
    245         "38" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (38,'mailserver_url', 3, 'mail.example.com', 'mailserver settings', 8, 20)",
    246         "39" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (39,'mailserver_login', 3, 'login@example.com', 'mailserver settings', 8, 20)",
    247         "40" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (40,'mailserver_pass', 3, 'password', 'mailserver settings', 8, 20)",
    248         "41" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (41,'mailserver_port', 1, '110', 'mailserver settings', 8, 20)",
    249         "42" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (42,'default_category', 1, '1', 'by default posts will have this category', 8, 20)",
    250         "46" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (46,'use_phoneemail', 2, '0', 'some mobile phone email services will send identical subject & content on the same line if you use such a service, set use_phoneemail to true, and indicate a separator string', 8, 20)",
    251        
    252         // default post stuff
    253        
    254         "55" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(55,'default_post_status',    5, 'publish', 'The default state of each new post', 8, 20)",
    255         "56" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(56,'default_comment_status', 5, 'open', 'The default state of comments for each new post', 8, 20)",
    256         "57" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(57,'default_ping_status',    5, 'open', 'The default ping state for each new post', 8, 20)",
    257         "58" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(58,'default_pingback_flag',  5, '1', 'Whether the \'PingBack the URLs in this post\' checkbox should be checked by default', 8, 20)",
    258         "59" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(59,'default_post_category',  7, '1', 'The default category for each new post', 8, 20)",
    259         "83" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(83,'default_post_edit_rows', 1, '9', 'The number of rows in the edit post form (min 3, max 100)', 8, 5)",
    260 
    261         // original options from options page
    262         "48" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (48,'posts_per_page', 1, '20','How many posts/days to show on the index page.', 4, 20)",
    263         "49" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (49,'what_to_show', 5, 'posts','Posts or days', 4, 20)",
    264         "50" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (50,'archive_mode', 5, 'monthly','Which \'unit\' to use for archives.', 4, 20)",
    265         "51" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (51,'time_difference', 6, '0', 'if you\'re not on the timezone of your server', 4, 20)",
    266         "52" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (52,'date_format', 3, 'n/j/Y', 'see note for format characters', 4, 20)",
    267         "53" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (53,'time_format', 3, 'g:i a', 'see note for format characters', 4, 20)",      "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (84,'use_geo_positions', 2, '0', 'Turns on the geo url features of WordPress', 8, 20)",
    268         "85" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (85,'use_default_geourl', 2, '1','enables placement of default GeoURL ICBM location even when no other specified', 8, 20)",
    269         "86" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (86,'default_geourl_lat ', 8, 0.0, 'The default Latitude ICBM value - <a href=\"http://www.geourl.org/resources.html\" target=\"_blank\">see here</a>', 8, 20)",
    270         "87" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (87,'default_geourl_lon', 8, 0.0, 'The default Longitude ICBM value', 8, 20)",
    271         "60" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (60,'links_minadminlevel',             1, '5', 'The minimum admin level to edit links', 8, 10)",
    272         "61" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (61,'links_use_adminlevels',           2, '1', 'set this to false to have all links visible and editable to everyone in the link manager', 8, 20)",
    273         "62" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (62,'links_rating_type',               5, 'image', 'Set this to the type of rating indication you wish to use', 8, 10)",
    274         "63" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (63,'links_rating_char',               3, '*', 'If we are set to \'char\' which char to use.', 8, 5)",
    275         "64" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (64,'links_rating_ignore_zero',        2, '1', 'What do we do with a value of zero? set this to true to output nothing, 0 to output as normal (number/image)', 8, 20)",
    276         "65" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (65,'links_rating_single_image',       2, '1', 'Use the same image for each rating point? (Uses links_rating_image[0])', 8, 20)",
    277         "66" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (66,'links_rating_image0',             3, 'wp-links/links-images/tick.png', 'Image for rating 0 (and for single image)', 8, 40)",
    278         "67" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (67,'links_rating_image1',             3, 'wp-links/links-images/rating-1.gif', 'Image for rating 1', 8, 40)",
    279         "68" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (68,'links_rating_image2',             3, 'wp-links/links-images/rating-2.gif', 'Image for rating 2', 8, 40)",
    280         "69" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (69,'links_rating_image3',             3, 'wp-links/links-images/rating-3.gif', 'Image for rating 3', 8, 40)",
    281         "70" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (70,'links_rating_image4',             3, 'wp-links/links-images/rating-4.gif', 'Image for rating 4', 8, 40)",
    282         "71" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (71,'links_rating_image5',             3, 'wp-links/links-images/rating-5.gif', 'Image for rating 5', 8, 40)",
    283         "72" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (72,'links_rating_image6',             3, 'wp-links/links-images/rating-6.gif', 'Image for rating 6', 8, 40)",
    284         "73" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (73,'links_rating_image7',             3, 'wp-links/links-images/rating-7.gif', 'Image for rating 7', 8, 40)",
    285         "74" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (74,'links_rating_image8',             3, 'wp-links/links-images/rating-8.gif', 'Image for rating 8', 8, 40)",
    286         "75" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (75,'links_rating_image9',             3, 'wp-links/links-images/rating-9.gif', 'Image for rating 9', 8, 40)",
    287         "77" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (77,'weblogs_xml_url',                 3, 'http://www.weblogs.com/changes.xml', 'Which file to grab from weblogs.com', 8, 40)",
    288         "78" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (78,'weblogs_cacheminutes',            1, '60', 'cache time in minutes (if it is older than this get a new copy)', 8, 10)",
    289         "79" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (79,'links_updated_date_format',       3, 'd/m/Y h:i', 'The date format for the updated tooltip', 8, 25)",
    290         "80" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (80,'links_recently_updated_prepend',  3, '&gt;&gt;', 'The text to prepend to a recently updated link', 8, 10)",
    291         "81" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (81,'links_recently_updated_append',   3, '&lt;&lt;', 'The text to append to a recently updated link', 8, 20)",
    292         "82" => "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (82,'links_recently_updated_time',     1, '120', 'The time in minutes to consider a link recently updated', 8, 20)"
    293         );
    294 
    295     foreach ($option_data as $option_id => $query) {
    296         if(!$wpdb->get_var("SELECT * FROM $wpdb->options WHERE option_id = '$option_id'")) {
    297             $wpdb->query($query);
    298         }
    299     }
    300 
    301         if (file_exists('../wp-links/links.config.php')) {
    302         include('../wp-links/links.config.php');
    303    
    304         // now update the database with those settings
    305         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_minadminlevel           )."' WHERE option_id=60"; $q = $wpdb->query($query);
    306         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_use_adminlevels         )."' WHERE option_id=61"; $q = $wpdb->query($query);
    307         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_type             )."' WHERE option_id=62"; $q = $wpdb->query($query);
    308         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_char             )."' WHERE option_id=63"; $q = $wpdb->query($query);
    309         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_ignore_zero      )."' WHERE option_id=64"; $q = $wpdb->query($query);
    310         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_single_image     )."' WHERE option_id=65"; $q = $wpdb->query($query);
    311         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image0           )."' WHERE option_id=66"; $q = $wpdb->query($query);
    312         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image1           )."' WHERE option_id=67"; $q = $wpdb->query($query);
    313         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image2           )."' WHERE option_id=68"; $q = $wpdb->query($query);
    314         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image3           )."' WHERE option_id=69"; $q = $wpdb->query($query);
    315         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image4           )."' WHERE option_id=70"; $q = $wpdb->query($query);
    316         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image5           )."' WHERE option_id=71"; $q = $wpdb->query($query);
    317         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image6           )."' WHERE option_id=72"; $q = $wpdb->query($query);
    318         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image7           )."' WHERE option_id=73"; $q = $wpdb->query($query);
    319         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image8           )."' WHERE option_id=74"; $q = $wpdb->query($query);
    320         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_rating_image9           )."' WHERE option_id=75"; $q = $wpdb->query($query);
    321         $query = "UPDATE $wpdb->options SET option_value='".addslashes($weblogs_cache_file            )."' WHERE option_id=76"; $q = $wpdb->query($query);
    322         $query = "UPDATE $wpdb->options SET option_value='".addslashes($weblogs_xml_url               )."' WHERE option_id=77"; $q = $wpdb->query($query);
    323         $query = "UPDATE $wpdb->options SET option_value='".addslashes($weblogs_cacheminutes          )."' WHERE option_id=78"; $q = $wpdb->query($query);
    324         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_updated_date_format     )."' WHERE option_id=79"; $q = $wpdb->query($query);
    325         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_recently_updated_prepend)."' WHERE option_id=80"; $q = $wpdb->query($query);
    326         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_recently_updated_append )."' WHERE option_id=81"; $q = $wpdb->query($query);
    327         $query = "UPDATE $wpdb->options SET option_value='".addslashes($links_recently_updated_time   )."' WHERE option_id=82"; $q = $wpdb->query($query);
    328     // end if links.config.php exists
    329     }
    330 
    331269}
    332270
     
    350288    add_clean_index($wpdb->comments, 'comment_approved');
    351289
    352 
    353     // Options stuff
    354     if (!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'comment_moderation'")) {
    355         $wpdb->query("INSERT INTO $wpdb->options
    356             (option_id, blog_id, option_name, option_can_override, option_type, option_value, option_width, option_height, option_description, option_admin_level)
    357             VALUES
    358             ('0', '0', 'comment_moderation', 'Y', '5',' none', 20, 8, 'If enabled, comments will only be shown after they have been approved.', 8)");
    359     }
    360 
    361     if (!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'moderation_notify'")) {
    362         $wpdb->query("INSERT INTO $wpdb->options
    363             (option_id, blog_id, option_name, option_can_override, option_type, option_value, option_width, option_height, option_description, option_admin_level)
    364             VALUES
    365             ('0', '0', 'moderation_notify' , 'Y', '2', '1', 20, 8, 'Set this to true if you want to be notified about new comments that wait for approval', 8)");
    366     }
    367    
    368290    // Get the title and ID of every post, post_name to check if it already has a value
    369291    $posts = $wpdb->get_results("SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''");
     
    384306        }
    385307    }
    386    
    387     if (!$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = 'permalink_structure'")) { // If it's not already there
    388         $wpdb->query("INSERT INTO `$wpdb->options`
    389             (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`)
    390             VALUES
    391             ('', '0', 'permalink_structure', 'Y', '3', '', '20', '8', 'How the permalinks for your site are constructed. See <a href=\"options-permalink.php\">permalink options page</a> for necessary mod_rewrite rules and more information.', '8');");
    392         }
    393        
    394     if (!$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = 'gzipcompression'")) { // If it's not already there
    395         $wpdb->query("INSERT INTO `$wpdb->options`
    396             (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`)
    397             VALUES
    398             ('', '0', 'gzipcompression', 'Y', '2', '0', '20', '8', 'Whether your output should be gzipped or not. Enable this if you don&#8217;t already have mod_gzip running.', '8');");
    399 }
    400     if (!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'hack_file'")) {
    401         $wpdb->query("INSERT INTO `$wpdb->options`
    402             ( `option_id` , `blog_id` , `option_name` , `option_can_override` , `option_type` , `option_value` , `option_width` , `option_height` , `option_description` , `option_admin_level` )
    403             VALUES
    404             ('', '0', 'hack_file', 'Y', '2', '0', '20', '8', 'Set this to true if you plan to use a hacks file. This is a place for you to store code hacks that won&#8217;t be overwritten when you upgrade. The file must be in your wordpress root and called <code>my-hacks.php</code>', '8')");
    405     }
    406 
    407     // fix upload users description
    408     $wpdb->query("UPDATE $wpdb->options SET option_description = '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'' WHERE option_id = 37");
    409     // and file types
    410     $wpdb->query("UPDATE $wpdb->options SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34");
    411     // add link to php date format. this could be to a wordpress.org page in the future
    412     $wpdb->query("UPDATE $wpdb->options SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 52");
    413     $wpdb->query("UPDATE $wpdb->options SET option_description = 'see <a href=\"http://php.net/date\">help</a> for format characters' WHERE option_id = 53");
     308
     309
    414310    $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')
    415311                                                      WHERE option_name LIKE 'links_rating_image%'
    416312                                                      AND option_value LIKE 'wp-links/links-images/%'");
    417     $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = 'comment_allowed_tags'");
    418     $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = 'use_preview'");
    419     $wpdb->query("DELETE FROM $wpdb->options WHERE option_name = 'search_engine_friendly_urls'");
     313
    420314    // Multiple categories
    421315    maybe_create_table($wpdb->post2cat, "
     
    496390
    497391    // Convert passwords to MD5 and update table appropiately
    498 
    499392    $user_table = $wpdb->get_row("DESCRIBE $wpdb->users user_pass");
    500393    if ($user_table->Type != 'varchar(32)') {
     
    509402    }
    510403
    511     // Add blog_charset option
    512     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'blog_charset'")) {
    513         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('blog_charset', 3, 'utf-8', 8)");
    514     }
    515404
    516405    // Get the GMT offset, we'll use that later on
     
    529418
    530419    // Add a gmt_offset option, with value $gmt_offset
    531     if (!get_settings('gmt_offset')) {
    532         if(!$wpdb->get_var("SELECT * FROM $wpdb->options WHERE option_name = 'gmt_offset'")) {
    533             $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_description, option_admin_level) VALUES ('gmt_offset', 8, $gmt_offset, 'The difference in hours between GMT and your timezone', 8)");
    534         }
    535 
    536     }
     420    add_option('gmt_offset', $gmt_offset);
    537421
    538422    // Check if we already set the GMT fields (if we did, then
     
    568452    // First we need to enlarge option_value so it can hold larger values:
    569453    $wpdb->query("ALTER TABLE `$wpdb->options` CHANGE `option_value` `option_value` TEXT NOT NULL");
    570    
    571     // Now an option for blog pinging
    572     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'ping_sites'")) {
    573         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('ping_sites', 3, 'http://rpc.pingomatic.com/', 8)");
    574     }
    575    
    576     // Option for using the advanced edit screen by default
    577     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'advanced_edit'")) {
    578         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('advanced_edit', 5, '0', 8)");
    579     }
     454
    580455    // Fix for CVS versions
    581456    $wpdb->query("UPDATE $wpdb->options SET option_type = '5' WHERE option_name = 'advanced_edit'");
    582    
    583     // Now an option for moderation words
    584     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'moderation_keys'")) {
    585         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('moderation_keys', 3, '', 8)");
    586     }
    587 
    588     // Option for plugins
    589     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'active_plugins'")) {
    590         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('active_plugins', 3, '', 8)");
    591     }
    592 
    593     // Option for max # of links per comment
    594     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'comment_max_links'")) {
    595         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('comment_max_links', 3, '5', 8)");
    596     }
    597 
    598     // Option for different blog URL
    599     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'home'")) {
    600         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('home', 3, '', 8)");
    601     }
    602 
    603     // Option for category base
    604     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'category_base'")) {
    605         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('category_base', 3, '', 8)");
    606     }
    607 
    608     // Delete unused options
    609     $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file');
    610     foreach ($unusedoptions as $option) :
    611         delete_option($option);
    612     endforeach;
    613457
    614458    // Forward-thinking
     
    623467    global $wpdb, $table_prefix;
    624468
    625     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'default_email_category'")) {
    626         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_description, option_admin_level) VALUES('default_email_category', 1, '1', 'by default posts by email will have this category', 8)");
    627     }
    628 
    629     if(!$wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'recently_edited'")) {
    630         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_type, option_value, option_admin_level) VALUES ('recently_edited', 3, '', 8)");
    631     }
     469    add_option('default_email_category', 1, 'Posts by email go to this category');
     470    add_option('recently_edited');
     471    add_option('use_linksupdate', 0);
    632472
    633473    maybe_add_column($wpdb->options, 'autoload', "ALTER TABLE `$wpdb->options` ADD `autoload` ENUM( 'yes', 'no' ) NOT NULL ;");
  • trunk/wp-atom.php

    r1575 r1599  
    1414<feed version="0.3"
    1515  xmlns="http://purl.org/atom/ns#"
    16   xmlns:dc="http://purl.org/dc/elements/1.1/"
    17   xml:lang="<?php echo get_settings('rss_language'); ?>">
     16  xmlns:dc="http://purl.org/dc/elements/1.1/">
    1817    <title><?php bloginfo_rss('name') ?></title>
    1918    <link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" />
  • trunk/wp-blog-header.php

    r1570 r1599  
    151151}
    152152
    153 $archive_mode = get_settings('archive_mode');
    154153$use_gzipcompression = get_settings('gzipcompression');
    155154
  • trunk/wp-commentsrss2.php

    r1575 r1599  
    2121    <link><?php (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) ? permalink_single_rss() : bloginfo_rss("url") ?></link>
    2222    <description><?php bloginfo_rss("description") ?></description>
    23     <language><?php echo get_settings('rss_language'); ?></language>
    2423    <pubDate><?php echo gmdate('r'); ?></pubDate>
    2524    <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
  • trunk/wp-includes/functions-post.php

    r1589 r1599  
    218218
    219219// get permalink from post ID
    220 function post_permalink($post_ID=0, $mode = 'id') {
    221     global $wpdb;
    222     global $querystring_start, $querystring_equal, $querystring_separator;
    223 
    224     $blog_URL = get_settings('home') .'/'. get_settings('blogfilename');
    225 
    226     $postdata = get_postdata($post_ID);
    227 
    228     // this will probably change to $blog_ID = $postdata['Blog_ID'] one day.
    229     $blog_ID = 1;
    230 
    231     if (!($postdata===false)) {
    232    
    233         switch(strtolower($mode)) {
    234             case 'title':
    235                 $title = preg_replace('/[^a-zA-Z0-9_\.-]/', '_', $postdata['Title']);
    236                 break;
    237             case 'id':
    238             default:
    239                 $title = "post-$post_ID";
    240                 break;
    241         }
    242 
    243         // this code is blatantly derived from permalink_link()
    244         $archive_mode = get_settings('archive_mode');
    245         switch($archive_mode) {
    246             case 'daily':
    247                 $post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).substr($postdata['Date'],5,2).substr($postdata['Date'],8,2).'#'.$title;
    248                 break;
    249             case 'monthly':
    250                 $post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).substr($postdata['Date'],5,2).'#'.$title;
    251                 break;
    252             case 'weekly':
    253                 if((!isset($cacheweekly)) || (empty($cacheweekly[$postdata['Date']]))) {
    254                     $sql = "SELECT WEEK('".$postdata['Date']."') as wk";
    255                         $row = $wpdb->get_row($sql);
    256                     $cacheweekly[$postdata['Date']] = $row->wk;
    257                 }
    258                 $post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).$querystring_separator.'w'.$querystring_equal.$cacheweekly[$postdata['Date']].'#'.$title;
    259                 break;
    260             case 'postbypost':
    261                 $post_URL = $blog_URL.$querystring_start.'p'.$querystring_equal.$post_ID;
    262                 break;
    263         }
    264     }
    265 
    266     return $post_URL;
     220function post_permalink($post_id = 0, $mode = '') { // $mode legacy
     221    return get_permalink($post_id);
    267222}
    268223
  • trunk/wp-includes/functions.php

    r1597 r1599  
    314314}
    315315
     316function get_option($option) {
     317    return get_settings($option);
     318}
     319
     320function form_option($option) {
     321    echo htmlspecialchars( get_option($option) );
     322}
     323
    316324function get_alloptions() {
    317325    global $wpdb;
     
    352360
    353361// thx Alex Stapleton, http://alex.vort-x.net/blog/
    354 function add_option($name, $value = '') {
    355     // Adds an option if it doesn't already exist
     362function add_option($name, $value = '', $description = '') {
    356363    global $wpdb;
    357364    if ( is_array($value) || is_object($value) )
     
    361368        $name = $wpdb->escape($name);
    362369        $value = $wpdb->escape($value);
    363         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value) VALUES ('$name', '$value')");
     370        $description = $wpdb->escape($description);
     371        $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description) VALUES ('$name', '$value', '$description')");
    364372
    365373        if($wpdb->insert_id) {
  • trunk/wp-includes/links-update-xml.php

    r1355 r1599  
    5959            // is it old?
    6060            $modtime = filemtime($file);
    61             if ((time() - $modtime) > (get_settings('weblogs_cacheminutes') * 60)) {
     61            if ((time() - $modtime) > (1.5 * 60)) {
    6262                $update = true;
    6363            }
  • trunk/wp-includes/template-functions-general.php

    r1508 r1599  
    223223
    224224    if ('' == $type) {
    225         $type = get_settings('archive_mode');
     225        $type = 'monthly';
    226226    }
    227227
  • trunk/wp-locations.php

    r1575 r1599  
    1818        if (get_settings('rss_use_excerpt')) {
    1919?>
    20         <note><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), get_settings('rss_encoded_html')) ?>
     20        <note><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length')) ?>
    2121        </note>
    2222<?php
    2323        } else { // use content
    2424?>
    25         <note><?php the_excerpt_rss('', 0, '', get_settings('rss_excerpt_length'), get_settings('rss_encoded_html')) ?></note>
     25        <note><?php the_excerpt_rss('', 0, '', get_settings('rss_excerpt_length')) ?></note>
    2626<?php
    2727        } // end else use content
  • trunk/wp-mail.php

    r1487 r1599  
    88$time_difference = get_settings('gmt_offset') * 3600;
    99
    10 $phone_delim = get_settings('use_phoneemail');
    11 if (empty($phone_delim)) $phone_delim = '::';
     10$phone_delim = '::';
    1211
    1312$pop3 = new POP3();
  • trunk/wp-rdf.php

    r1575 r1599  
    2626    <link><?php bloginfo_rss('url') ?></link>
    2727    <description><?php bloginfo_rss('description') ?></description>
    28     <dc:language><?php echo get_settings('rss_language'); ?></dc:language>
    2928    <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></dc:date>
    3029    <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
  • trunk/wp-rss.php

    r1575 r1599  
    3131} else { // use content
    3232?>
    33             <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), get_settings('rss_encoded_html')) ?></description>
     33            <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length')) ?></description>
    3434<?php
    3535} // end else use content
  • trunk/wp-trackback.php

    r1575 r1599  
    2828
    2929    @header('Content-Type: text/xml; charset=' . get_settings('blog_charset'));
    30 
    31     if (!get_settings('use_trackback'))
    32         trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.');
    3330
    3431    $pingstatus = $wpdb->get_var("SELECT ping_status FROM $wpdb->posts WHERE ID = $tb_id");
Note: See TracChangeset for help on using the changeset viewer.