Make WordPress Core

Changeset 969


Ignore:
Timestamp:
03/11/2004 08:51:50 AM (22 years ago)
Author:
saxmatt
Message:

More options improvements.

Location:
trunk/wp-admin
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-discussion.php

    r957 r969  
    4747  <li><a href="options-general.php">General</a></li>
    4848  <li><a href="options-writing.php">Writing</a></li>
     49  <li><a href="options-reading.php">Reading</a></li>
    4950  <li><a class="current">Discussion</a></li>
    5051  <?php
     
    6869  <form name="form1" method="post" action="options.php">
    6970    <input type="hidden" name="action" value="update" />
    70     <input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','use_smilies','comments_notify','moderation_notify','comment_moderation','moderation_keys'" />
     71    <input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','moderation_keys'" />
    7172    <p>Usual settings for an article: <em>(These settings may be overidden for individual articles.)</em></p>
    7273    <ul>
     
    8384      <li>
    8485        <label for="default_comment_status">
    85         <input name="default_comment_status" type="checkbox" id="default_comment_status" value="1" <?php checked('1', get_settings('default_comment_status')); ?> />
     86        <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> />
    8687        Allow people to post comments on the article</label>
    8788      </li>
     
    105106        <label for="comment_moderation">
    106107        <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> />
    107         An administrator must approve the comment (regardless of any matches below) </label> 
     108        An administrator must approve the comment (regardless of any matches below) </label>
    108109      </li>
     110      <li>
     111        <input type="checkbox" name="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> />
     112        User must fill out name and email
     113</li>
    109114    </ul>
    110115    <p>When a comment contains any of these words in its content, name, URI, or email, hold it in the moderation queue: (Seperate multiple words with new lines.)</p>
  • trunk/wp-admin/options-general.php

    r957 r969  
    4747    <li><a class="current">General</a></li>
    4848    <li><a href="options-writing.php">Writing</a></li>
     49    <li><a href="options-reading.php">Reading</a></li>
    4950    <li><a href="options-discussion.php">Discussion</a></li>
    5051  <?php
  • trunk/wp-admin/options-permalink.php

    r965 r969  
    5656?>
    5757 <ul id="adminmenu2">
     58 <li><a href="options-general.php">General</a></li>
     59    <li><a href="options-writing.php">Writing</a></li>
     60    <li><a href="options-reading.php">Reading</a></li>
     61    <li><a href="options-discussion.php">Discussion</a></li>
    5862  <?php
    5963    //we need to iterate through the available option groups.
     
    6973    } // end for each group
    7074?>
    71   <li class="last"><a href="options-permalink.php">Permalinks</a></li>
     75  <li class="last"><a class="current">Permalinks</a></li>
    7276</ul>
    7377<br clear="all" />
  • trunk/wp-admin/options-writing.php

    r957 r969  
    11<?php
    2 $title = 'Writing Options';
     2$title = 'Reading Options';
    33
    44function add_magic_quotes($array) {
     
    4747  <li><a href="options-general.php">General</a></li>
    4848  <li><a class="current">Writing</a></li>
     49  <li><a href="options-reading.php">Reading</a></li>
    4950  <li><a href="options-discussion.php">Discussion</a></li>
    5051  <?php
     
    9596  WordPress should correct invalidly nested XHTML automatically</label></td>
    9697      </tr>
    97       <tr valign="top">
    98         <th scope="row">Character Encoding: </th>
    99         <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" />
    100           <br />
    101           The character encoding you write your blog in (UTF-8 recommended<a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html"></a>)</td>
    102       </tr>
    10398    </table>
    10499    <fieldset>
  • trunk/wp-admin/options.php

    r957 r969  
    6565    $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)");
    6666//  die(var_dump($options));
     67
     68// HACK
     69// Options that if not there have 0 value but need to be something like "closed"
     70$nonbools = array('default_ping_status', 'default_comment_status');
    6771    if ($options) {
    6872        foreach ($options as $option) {
     
    7276                $new_val = $_POST[$option->option_name];
    7377                if (!$new_val) $new_val = 0;
    74 
    75                 if ($new_val != $old_val) {
    76                     // get type and validate
    77                     $msg = validate_option($option, $this_name, $new_val);
    78                     if ($msg == '') {
    79                         //no error message
    80                         $result = $wpdb->query("UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id");
    81                         if (!$result) {
    82                             $db_errors .= " SQL error while saving $this_name. ";
    83                         } else {
    84                             ++$any_changed;
    85                         }
    86                     } else {
    87                         $validation_message .= $msg;
    88                     }
     78                if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
     79                if ($new_val !== $old_val) {
     80                    $query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id";
     81                    $result = $wpdb->query($query);
     82                    //if( in_array($option->option_name, $nonbools)) die('boo'.$query);
     83                    if (!$result) {
     84                        $db_errors .= " SQL error while saving $this_name. ";
     85                    } else {
     86                        ++$any_changed;
     87                    }
    8988                }
    9089            }
     
    143142<ul id="adminmenu2">
    144143<li><a href="options-general.php">General</a></li>
     144    <li><a href="options-writing.php">Writing</a></li>
     145    <li><a href="options-reading.php">Reading</a></li>
     146    <li><a href="options-discussion.php">Discussion</a></li>
    145147<?php
    146148    //Iterate through the available option groups.
  • trunk/wp-admin/upgrade-functions.php

    r957 r969  
    705705    }
    706706   
     707    $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 1");
     708    $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 2");
     709    $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 3");
    707710    $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 6");
    708711    $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 7");
Note: See TracChangeset for help on using the changeset viewer.