Cleaned up unused options.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt
2004-04-24 21:21:19 +00:00
parent 530307015a
commit c226bd74b0
9 changed files with 40 additions and 55 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -169,7 +169,7 @@ uksort($wpsmiliestrans, 'smiliescmp');
foreach($wpsmiliestrans as $smiley => $img) {
$wp_smiliessearch[] = $smiley;
$smiley_masked = str_replace(' ', '', $smiley);
$wp_smiliesreplace[] = " <img src='" . get_settings('smilies_directory') . "/$img' alt='$smiley_masked' />";
$wp_smiliesreplace[] = " <img src='" . get_settings('siteurl') . "/wp-images/smilies/$img' alt='$smiley_masked' />";
}