diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index f61dd2425..a5c1e9fdd 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -102,10 +102,8 @@ window.onload = focusit;
' . __('Quicktags') . ': '; include('quicktags.php'); -} ?>
' . __('Quicktags') . ': '; include('quicktags.php'); -} ?>
- -

diff --git a/wp-admin/edit-form.php b/wp-admin/edit-form.php index f235e4b94..f10b501f5 100644 --- a/wp-admin/edit-form.php +++ b/wp-admin/edit-form.php @@ -75,7 +75,7 @@ window.onload = focusit;

' . __('Quicktags') . ': '; include('quicktags.php'); } @@ -90,15 +90,12 @@ if (get_settings('use_quicktags') && 'bookmarklet' != $mode) {
- + - diff --git a/wp-admin/install.php b/wp-admin/install.php index f0b8f56de..2ee10d71d 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -417,13 +417,9 @@ $option_data = array( // general blog setup "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)", //"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)", -"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)", -"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)", -"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)", "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)", "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)", "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)", -"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)", "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)", "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)", //rss/rdf feeds @@ -432,8 +428,6 @@ $option_data = array( "INSERT INTO $tableoptions (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 <description> tag?', 8, 20)", "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)", "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)", -"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)", -"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)", "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)", "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)", //file upload @@ -450,10 +444,7 @@ $option_data = array( "INSERT INTO $tableoptions (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)", "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)", "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)", -"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)", -"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)", "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)", -"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)", // original options from options page "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)", "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(49,'what_to_show', 5, 'posts','Posts, days, or posts paged', 4, 20)", @@ -615,7 +606,6 @@ $links_option_data = array( "INSERT INTO $tableoptions (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)", "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)", "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)", -"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)", "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)", "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)", "INSERT INTO $tableoptions (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)", @@ -713,8 +703,6 @@ $url = $_REQUEST['url']; if (isset($url)) { $query= "UPDATE $tableoptions set option_value='$url' where option_id=1"; //siteurl $q = $wpdb->query($query); - $query= "UPDATE $tableoptions set option_value='$url/wp-images/smilies' where option_id=17"; //smilies_directory - $q = $wpdb->query($query); } // $query = "DROP TABLE IF EXISTS $tableusers"; diff --git a/wp-admin/options.php b/wp-admin/options.php index 11dc5956f..4499b1259 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -38,7 +38,7 @@ for ($i=0; $i get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level " - . "FROM $tableoptions " - . "LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id " - . "WHERE group_id = $option_group_id " - . "ORDER BY seq"); - if ($options) { - foreach ($options as $option) { - echo(' \n"); - } - } +//Now display all the options for the selected group. +if ('all' == $_GET['option_group_id']) : +$options = $wpdb->get_results("SELECT * FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id ORDER BY option_name"); +else : +$options = $wpdb->get_results(" +SELECT +$tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level +FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id +WHERE group_id = $option_group_id +ORDER BY seq +"); +endif; + +foreach ($options as $option) : + if ('all' == $_GET['option_group_id']) $option->option_type = 3; + echo "\t\n"; +endforeach; ?> diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index f2229c2a2..a30db2277 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -179,9 +179,6 @@ $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUES // general blog setup "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)", //"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)", - "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)", - "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)", - "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)", "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)", "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)", "16" => "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 true to enable smiley conversion in posts (note: this makes smiley conversion in ALL posts)', 8, 20)", @@ -194,8 +191,6 @@ $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUES "23" => "INSERT INTO $tableoptions (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 <description> tag?', 8, 20)", "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)", "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)", - "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)", - "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)", "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)", "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)", //file upload @@ -212,10 +207,7 @@ $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUES "40" => "INSERT INTO $tableoptions (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)", "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)", "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)", - "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)", - "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)", "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)", - "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)", // default post stuff @@ -252,7 +244,6 @@ $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUES "73" => "INSERT INTO $tableoptions (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)", "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)", "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)", - "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)", "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)", "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)", "79" => "INSERT INTO $tableoptions (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)", @@ -806,6 +797,11 @@ function upgrade_110() { $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('comment_max_links', 3, '5', 8)"); } + // Delete unused options + $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file'); + foreach ($unusedoptions as $option) : + delete_option($option); + endforeach; } ?> \ No newline at end of file diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 64ac2a013..c8c29382d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -357,6 +357,16 @@ function add_option($name, $value='') { return; } +function delete_option($name) { + global $wpdb, $tableoptions, $tableoptiongroup_options; + // Get the ID, if no ID then return + $option_id = $wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = '$name'"); + if (!$option_id) return false; + $wpdb->query("DELETE FROM $tableoptiongroup_options WHERE option_id = '$option_id'"); + $wpdb->query("DELETE FROM $tableoptions WHERE option_name = '$name'"); + return true; +} + function get_postdata($postid) { global $post, $tableposts, $wpdb; diff --git a/wp-includes/links-update-xml.php b/wp-includes/links-update-xml.php index 414023d7c..402fe449b 100644 --- a/wp-includes/links-update-xml.php +++ b/wp-includes/links-update-xml.php @@ -51,7 +51,7 @@ function update_links() { function get_weblogs_updatedfile() { global $ignore_weblogs_cache; $update = false; - $file = ABSPATH . get_settings('weblogs_cache_file'); + $file = ABSPATH . '/wp-content/links-update-cache.xml'; if ($ignore_weblogs_cache) { $update = true; } else { @@ -76,7 +76,7 @@ function get_weblogs_updatedfile() { $contents = preg_replace("/'/",''',$contents); $contents = preg_replace('|[^[:space:][:punct:][:alpha:][:digit:]]|','',$contents); - $cachefp = fopen(ABSPATH . get_settings('weblogs_cache_file'), "w"); + $cachefp = fopen(ABSPATH . '/wp-content/links-update-cache.xml', "w"); fwrite($cachefp, $contents); fclose($cachefp); } else { @@ -147,7 +147,7 @@ if (get_weblogs_updatedfile()) { xml_set_element_handler($xml_parser, "startElement", "endElement"); // Open the XML file for reading - $fp = fopen(ABSPATH . get_settings('weblogs_cache_file'), "r") + $fp = fopen(ABSPATH . '/wp-content/links-update-cache.xml', "r") or die("Error reading XML data."); // Read the XML file 16KB at a time diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 68988bc33..579f60301 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -169,7 +169,7 @@ uksort($wpsmiliestrans, 'smiliescmp'); foreach($wpsmiliestrans as $smiley => $img) { $wp_smiliessearch[] = $smiley; $smiley_masked = str_replace(' ', '', $smiley); - $wp_smiliesreplace[] = " $smiley_masked"; + $wp_smiliesreplace[] = " $smiley_masked"; }
'. get_option_widget($option, ($user_level >= $option->option_admin_level), '')); - echo(" $option->option_description
" . get_option_widget($option, ($user_level >= $option->option_admin_level), ''); + echo "\t$option->option_description