Make WordPress Core

Changeset 1148


Ignore:
Timestamp:
04/24/2004 09:21:19 PM (21 years ago)
Author:
saxmatt
Message:

Cleaned up unused options.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r1139 r1148  
    103103        <div id="quicktags">
    104104<?php
    105 if ( get_settings('use_quicktags') ) {
    106105    echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="' .  __('Help with quicktags') . '">' . __('Quicktags') . '</a>: ';
    107106    include('quicktags.php');
    108 }
    109107?>
    110108</div>
     
    119117
    120118<?php
    121 if ( get_settings('use_quicktags') ) {
    122119?>
    123120<script type="text/javascript" language="JavaScript">
     
    127124</script>
    128125<?php
    129 }
    130126if ($action != 'editcomment') {
    131127    if (get_settings('use_geo_positions')) {
  • trunk/wp-admin/edit-form-comment.php

    r1140 r1148  
    4444        <div id="quicktags">
    4545<?php
    46 if (get_settings('use_quicktags')) {
    4746    echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="' . __('Help with quicktags') . '">' . __('Quicktags') . '</a>: ';
    4847    include('quicktags.php');
    49 }
    5048?>
    5149</div>
     
    5957</fieldset>
    6058
    61 <?php
    62 if (get_settings('use_quicktags')) {
    63 ?>
    6459<script type="text/javascript" language="JavaScript">
    6560<!--
     
    6762//-->
    6863</script>
    69 <?php
    70 }
    71 ?>
    7264
    7365<p class="submit"><input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" style="font-weight: bold;" tabindex="6" />
  • trunk/wp-admin/edit-form.php

    r1108 r1148  
    7676        <div id="quicktags">
    7777<?php
    78 if (get_settings('use_quicktags') && 'bookmarklet' != $mode) {
     78if ('bookmarklet' != $mode) {
    7979    echo '<a href="http://wordpress.org/docs/reference/post/#quicktags" title="' . __('Help with quicktags') . '">' . __('Quicktags') . '</a>: ';
    8080    include('quicktags.php');
     
    9191</fieldset>
    9292
    93 <?php
    94 if (get_settings('use_quicktags')) {
    95 ?>
     93
    9694<script type="text/javascript" language="JavaScript">
    9795<!--
     
    9997//-->
    10098</script>
    101 <?php } ?>
    10299
    103100<?php echo $form_pingback ?>
  • trunk/wp-admin/install.php

    r1108 r1148  
    418418"INSERT INTO $tableoptions (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)",
    419419//"INSERT INTO $tableoptions (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)",
    420 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(11,'use_bbcode', 2, '0', 'use BBCode, like [b]bold[/b]', 8, 20)",
    421 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(12,'use_gmcode', 2, '0', 'use GreyMatter-styles: **bold** \\\\italic\\\\ __underline__', 8, 20)",
    422 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(13,'use_quicktags', 2, '1', 'buttons for HTML tags (they won\'t work on IE Mac yet)', 8, 20)",
    423420"INSERT INTO $tableoptions (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)",
    424421"INSERT INTO $tableoptions (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)",
    425422"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(16,'use_smilies', 2, '1', 'set this to 1 to enable smiley conversion in posts (note: this makes smiley conversion in ALL posts)', 8, 20)",
    426 "INSERT INTO $tableoptions (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)",
    427423"INSERT INTO $tableoptions (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)",
    428424"INSERT INTO $tableoptions (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)",
     
    433429"INSERT INTO $tableoptions (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)",
    434430"INSERT INTO $tableoptions (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)",
    435 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(26,'use_weblogsping', 2, '0', 'set this to true if you want your site to be listed on http://weblogs.com when you add a new post', 8, 20)",
    436 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(27,'use_blodotgsping', 2, '0', 'set this to true if you want your site to be listed on http://blo.gs when you add a new post', 8, 20)",
    437431"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(29,'use_trackback', 2, '1', 'set this to 0 or 1, whether you want to allow your posts to be trackback\'able or not note: setting it to zero would also disable sending trackbacks', 8, 20)",
    438432"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(30,'use_pingback', 2, '1', 'set this to 0 or 1, whether you want to allow your posts to be pingback\'able or not note: setting it to zero would also disable sending pingbacks', 8, 20)",
     
    451445"INSERT INTO $tableoptions (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)",
    452446"INSERT INTO $tableoptions (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)",
    453 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(43,'subjectprefix', 3, 'blog:', 'subject prefix', 8, 20)",
    454 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(44,'bodyterminator', 3, '___', 'body terminator string (starting from this string, everything will be ignored, including this string)', 8, 20)",
    455447"INSERT INTO $tableoptions (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)",
    456 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(47,'phoneemail_separator', 3, ':::', 'when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content', 8, 20)",
    457448// original options from options page
    458449"INSERT INTO $tableoptions (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)",
     
    616607"INSERT INTO $tableoptions (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)",
    617608"INSERT INTO $tableoptions (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)",
    618 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(76,'weblogs_cache_file',   3, 'weblogs.com.changes.cache', 'path/to/cachefile needs to be writable by web server', 8, 40)",
    619609"INSERT INTO $tableoptions (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)",
    620610"INSERT INTO $tableoptions (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)",
     
    714704    $query= "UPDATE $tableoptions set option_value='$url' where option_id=1"; //siteurl
    715705    $q = $wpdb->query($query);
    716     $query= "UPDATE $tableoptions set option_value='$url/wp-images/smilies' where option_id=17"; //smilies_directory
    717     $q = $wpdb->query($query);
    718706}
    719707
  • trunk/wp-admin/options.php

    r1108 r1148  
    3939require_once('./optionhandler.php');
    4040$non_was_selected = 0;
    41 if ($option_group_id == '') {
     41if ('' == $_GET['option_group_id']) {
    4242    $option_group_id = 1;
    4343    $non_was_selected = 1;
     
    156156  <table width="90%" cellpadding="2" cellspacing="2" border="0">
    157157<?php
    158     //Now display all the options for the selected group.
    159     $options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level "
    160                                   . "FROM $tableoptions "
    161                                   . "LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id "
    162                                   . "WHERE group_id = $option_group_id "
    163                                   . "ORDER BY seq");
    164     if ($options) {
    165         foreach ($options as $option) {
    166             echo('    <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">'));
    167             echo("    </td><td  valign='top' class='helptext'>$option->option_description</td></tr>\n");
    168         }
    169     }
     158//Now display all the options for the selected group.
     159if ('all' == $_GET['option_group_id']) :
     160$options = $wpdb->get_results("SELECT * FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id ORDER BY option_name");
     161else :
     162$options = $wpdb->get_results("
     163SELECT
     164$tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level
     165FROM $tableoptions  LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id
     166WHERE group_id = $option_group_id
     167ORDER BY seq
     168");
     169endif;
     170
     171foreach ($options as $option) :
     172    if ('all' == $_GET['option_group_id']) $option->option_type = 3;
     173    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">');
     174    echo "\t</td><td  valign='top' class='helptext'>$option->option_description</td></tr>\n";
     175endforeach;
    170176?>
    171177    <tr><td colspan="3">&nbsp;</td></tr>
  • trunk/wp-admin/upgrade-functions.php

    r1074 r1148  
    180180        "9" => "INSERT INTO $tableoptions (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)",
    181181        //"INSERT INTO $tableoptions (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)",
    182         "11" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (11,'use_bbcode', 2, '0', 'use BBCode, like [b]bold[/b]', 8, 20)",
    183         "12" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (12,'use_gmcode', 2, '0', 'use GreyMatter-styles: **bold** \\\\italic\\\\ __underline__', 8, 20)",
    184         "13" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (13,'use_quicktags', 2, '1', 'buttons for HTML tags (they won\'t work on IE Mac yet)', 8, 20)",
    185182        "14" => "INSERT INTO $tableoptions (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)",
    186183        "15" => "INSERT INTO $tableoptions (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)",
     
    195192        "24" => "INSERT INTO $tableoptions (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)",
    196193        "25" => "INSERT INTO $tableoptions (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)",
    197         "26" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (26,'use_weblogsping', 2, '0', 'set this to true if you want your site to be listed on http://weblogs.com when you add a new post', 8, 20)",
    198         "27" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (27,'use_blodotgsping', 2, '0', 'set this to true if you want your site to be listed on http://blo.gs when you add a new post', 8, 20)",
    199194        "29" => "INSERT INTO $tableoptions (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)",
    200195        "30" => "INSERT INTO $tableoptions (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)",
     
    213208        "41" => "INSERT INTO $tableoptions (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)",
    214209        "42" => "INSERT INTO $tableoptions (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)",
    215         "43" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (43,'subjectprefix', 3, 'blog:', 'subject prefix', 8, 20)",
    216         "44" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (44,'bodyterminator', 3, '___', 'body terminator string (starting from this string, everything will be ignored, including this string)', 8, 20)",
    217210        "46" => "INSERT INTO $tableoptions (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)",
    218         "47" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (47,'phoneemail_separator', 3, ':::', 'when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content', 8, 20)",
    219211       
    220212        // default post stuff
     
    253245        "74" => "INSERT INTO $tableoptions (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)",
    254246        "75" => "INSERT INTO $tableoptions (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)",
    255         "76" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (76,'weblogs_cache_file',              3, 'weblogs.com.changes.cache', 'path/to/cachefile needs to be writable by web server', 8, 40)",
    256247        "77" => "INSERT INTO $tableoptions (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)",
    257248        "78" => "INSERT INTO $tableoptions (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)",
     
    807798    }
    808799
     800    // Delete unused options
     801    $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file');
     802    foreach ($unusedoptions as $option) :
     803        delete_option($option);
     804    endforeach;
    809805}
    810806
  • trunk/wp-includes/functions.php

    r1146 r1148  
    356356    }
    357357    return;
     358}
     359
     360function delete_option($name) {
     361    global $wpdb, $tableoptions, $tableoptiongroup_options;
     362    // Get the ID, if no ID then return
     363    $option_id = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = '$name'");
     364    if (!$option_id) return false;
     365    $wpdb->query("DELETE FROM $tableoptiongroup_options WHERE option_id = '$option_id'");
     366    $wpdb->query("DELETE FROM $tableoptions WHERE option_name = '$name'");
     367    return true;
    358368}
    359369
  • trunk/wp-includes/links-update-xml.php

    r737 r1148  
    5252    global $ignore_weblogs_cache;
    5353    $update = false;
    54     $file = ABSPATH . get_settings('weblogs_cache_file');
     54    $file = ABSPATH . '/wp-content/links-update-cache.xml';
    5555    if ($ignore_weblogs_cache) {
    5656        $update = true;
     
    7777            $contents = preg_replace('|[^[:space:][:punct:][:alpha:][:digit:]]|','',$contents);
    7878
    79             $cachefp = fopen(ABSPATH . get_settings('weblogs_cache_file'), "w");
     79            $cachefp = fopen(ABSPATH . '/wp-content/links-update-cache.xml', "w");
    8080            fwrite($cachefp, $contents);
    8181            fclose($cachefp);
     
    148148
    149149    // Open the XML file for reading
    150     $fp = fopen(ABSPATH . get_settings('weblogs_cache_file'), "r")
     150    $fp = fopen(ABSPATH . '/wp-content/links-update-cache.xml', "r")
    151151          or die("Error reading XML data.");
    152152
  • trunk/wp-includes/vars.php

    r1125 r1148  
    170170    $wp_smiliessearch[] = $smiley;
    171171    $smiley_masked = str_replace(' ', '', $smiley);
    172     $wp_smiliesreplace[] = " <img src='" . get_settings('smilies_directory') . "/$img' alt='$smiley_masked' />";
     172    $wp_smiliesreplace[] = " <img src='" . get_settings('siteurl') . "/wp-images/smilies/$img' alt='$smiley_masked' />";
    173173}
    174174
Note: See TracChangeset for help on using the changeset viewer.