summaryrefslogtreecommitdiffstats
path: root/wp-inst
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-02-14 16:56:46 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-02-14 16:56:46 +0000
commit6a5b25251eb16dc8da58816eb41e806197fe8a43 (patch)
tree714721e87986d7a254175b4a70f76a3a591e0ffb /wp-inst
parent39854b3d3a80e4ac2bfee92a4b1210852baa7091 (diff)
downloadwordpress-mu-6a5b25251eb16dc8da58816eb41e806197fe8a43.tar.gz
wordpress-mu-6a5b25251eb16dc8da58816eb41e806197fe8a43.tar.xz
wordpress-mu-6a5b25251eb16dc8da58816eb41e806197fe8a43.zip
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@525 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst')
-rw-r--r--wp-inst/wp-admin/admin-db.php12
-rw-r--r--wp-inst/wp-admin/admin.php11
-rw-r--r--wp-inst/wp-admin/import/blogger.php32
-rw-r--r--wp-inst/wp-admin/import/mt.php23
-rw-r--r--wp-inst/wp-admin/link-manager.php4
-rw-r--r--wp-inst/wp-admin/user-edit.php5
-rw-r--r--wp-inst/wp-admin/users.php40
-rw-r--r--wp-inst/wp-includes/functions.php15
-rw-r--r--wp-inst/wp-includes/template-functions-category.php6
-rw-r--r--wp-inst/wp-includes/template-functions-general.php6
-rw-r--r--wp-inst/wp-includes/template-functions-post.php9
-rw-r--r--wp-inst/wp-login.php4
12 files changed, 118 insertions, 49 deletions
diff --git a/wp-inst/wp-admin/admin-db.php b/wp-inst/wp-admin/admin-db.php
index e4cf6bf..2a4a83a 100644
--- a/wp-inst/wp-admin/admin-db.php
+++ b/wp-inst/wp-admin/admin-db.php
@@ -3,7 +3,7 @@
function get_users_drafts( $user_id ) {
global $wpdb;
$user_id = (int) $user_id;
- $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC";
+ $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC";
$query = apply_filters('get_users_drafts', $query);
return $wpdb->get_results( $query );
}
@@ -14,12 +14,12 @@ function get_others_drafts( $user_id ) {
$level_key = $wpdb->prefix . 'user_level';
$editable = get_editable_user_ids( $user_id );
-
+
if( !$editable ) {
$other_drafts = '';
} else {
$editable = join(',', $editable);
- $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' ");
+ $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' ");
}
return apply_filters('get_others_drafts', $other_drafts);
@@ -42,9 +42,9 @@ function get_editable_authors( $user_id ) {
function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
global $wpdb;
-
+
$user = new WP_User( $user_id );
-
+
if ( ! $user->has_cap('edit_others_posts') ) {
if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
return array($user->id);
@@ -57,7 +57,7 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
$query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
if ( $exclude_zeros )
$query .= " AND meta_value != '0'";
-
+
return $wpdb->get_col( $query );
}
diff --git a/wp-inst/wp-admin/admin.php b/wp-inst/wp-admin/admin.php
index ab53b4c..37894ca 100644
--- a/wp-inst/wp-admin/admin.php
+++ b/wp-inst/wp-admin/admin.php
@@ -5,8 +5,8 @@ else
require_once('../wp-config.php');
if ( get_option('db_version') != $wp_db_version )
- die (sprintf(__("Your database is out-of-date. Please <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php'));
-
+ $out = @file( get_option( "siteurl" ) . "/wp-admin/upgrade.php?step=1" ); // upgrade the db!
+
require_once(ABSPATH . 'wp-admin/admin-functions.php');
require_once(ABSPATH . 'wp-admin/admin-db.php');
require_once(ABSPATH . WPINC . '/registration-functions.php');
@@ -60,13 +60,16 @@ if (isset($_GET['page'])) {
die(__('Invalid plugin page'));
}
- if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
+ if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page") && ! file_exists(ABSPATH . "wp-content/mu-plugins/$plugin_page"))
die(sprintf(__('Cannot load %s.'), $plugin_page));
if (! isset($_GET['noheader']))
require_once(ABSPATH . '/wp-admin/admin-header.php');
- include(ABSPATH . "wp-content/plugins/$plugin_page");
+ if ( file_exists(ABSPATH . "wp-content/mu-plugins/$plugin_page") )
+ include(ABSPATH . "wp-content/mu-plugins/$plugin_page");
+ else
+ include(ABSPATH . "wp-content/plugins/$plugin_page");
}
include(ABSPATH . 'wp-admin/admin-footer.php');
diff --git a/wp-inst/wp-admin/import/blogger.php b/wp-inst/wp-admin/import/blogger.php
index 4d9f3c3..7b98a7c 100644
--- a/wp-inst/wp-admin/import/blogger.php
+++ b/wp-inst/wp-admin/import/blogger.php
@@ -2,7 +2,7 @@
class Blogger_Import {
- var $lump_authors = false;
+ var $lump_authors = true;
var $import = array();
// Shows the welcome screen and the magic iframe.
@@ -22,6 +22,11 @@ class Blogger_Import {
echo "</div>\n";
}
+ function reencode($text) {
+ return $text;
+ return mb_convert_encoding($text, get_setting('blog_charset'), $this->import['blogs'][$_GET['blog']]['options']['blog-formatting']['backup']['encoding']);
+ }
+
// Deletes saved data and redirect.
function restart() {
delete_option('import-blogger');
@@ -94,7 +99,7 @@ class Blogger_Import {
$ch = curl_init();
if ($user && $pass) curl_setopt($ch, CURLOPT_USERPWD,"{$user}:{$pass}");
curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Blogger Exporter');
@@ -243,14 +248,14 @@ class Blogger_Import {
if ( ! count( $blogsary[1] < 1 ) )
die(__('No blogs found for this user.'));
$this->import['blogs'] = array();
- $template = '<MainPage><br /><br /><br /><p>'.__('Are you looking for %title%? It is temporarily out of service. Please try again in a few minutes. Meanwhile, discover <a href="http://wordpress.org/">a better blogging tool</a>.').'</p><BloggerArchives><a class="archive" href="<$BlogArchiveURL$>"><$BlogArchiveName$></a><br /></BloggerArchives></MainPage><ArchivePage><Blogger><wordpresspost><$BlogItemDateTime$>|W|P|<$BlogItemAuthorNickname$>|W|P|<$BlogItemBody$>|W|P|<$BlogItemNumber$>|W|P|<$BlogItemTitle$>|W|P|<$BlogItemAuthorEmail$><BlogItemCommentsEnabled><BlogItemComments><wordpresscomment><$BlogCommentDateTime$>|W|P|<$BlogCommentAuthor$>|W|P|<$BlogCommentBody$></BlogItemComments></BlogItemCommentsEnabled></Blogger></ArchivePage>';
+ $template = '<!--<MainPage><BloggerArchives><a class="wparchive" href="<$BlogArchiveURL$>"><$BlogArchiveName$></a><br /></BloggerArchives></MainPage><ArchivePage><Blogger><wordpresspost><$BlogItemDateTime$>|W|P|<$BlogItemAuthorNickname$>|W|P|<$BlogItemBody$>|W|P|<$BlogItemNumber$>|W|P|<$BlogItemTitle$>|W|P|<$BlogItemAuthorEmail$><BlogItemCommentsEnabled><BlogItemComments><wordpresscomment><$BlogCommentDateTime$>|W|P|<$BlogCommentAuthor$>|W|P|<$BlogCommentBody$></BlogItemComments></BlogItemCommentsEnabled></Blogger></ArchivePage>-->';
foreach ( $blogsary[1] as $key => $id ) {
// Define the required Blogger options.
$blog_opts = array(
'blog-options-basic' => false,
'blog-options-archiving' => array('archiveFrequency' => 'm'),
'blog-publishing' => array('publishMode'=>'0', 'blogID' => "$id", 'subdomain' => mt_rand().mt_rand(), 'pingWeblogs' => 'false'),
- 'blog-formatting' => array('timeStampFormat' => '0', 'encoding'=>'UTF-8', 'convertLineBreaks'=>'false', 'floatAlignment'=>'false'),
+ 'blog-formatting' => array('timeStampFormat' => '0', 'convertLineBreaks'=>'false', 'floatAlignment'=>'false'),
'blog-comments' => array('commentsTimeStampFormat' => '0'),
'template-edit' => array( 'templateText' => str_replace('%title%', trim($blogsary[2][$key]), $template) )
);
@@ -316,6 +321,9 @@ class Blogger_Import {
continue;
}
$paramary = $optary['modify'];
+ } elseif ( 'template-edit' == $blog_opt ) {
+ $optary['modify']['templateText'] = $_POST['templateText'] . $optary['modify']['templateText'];
+ $paramary = array_merge($_POST, $optary['modify']);
} else {
$paramary = array_merge($_POST, $optary['modify']);
}
@@ -363,9 +371,9 @@ class Blogger_Import {
// Step 5: Get the archive URLs from the new blog.
function get_archive_urls() {
$bloghtml = $this->get_blogger($this->import['blogs'][$_GET['blog']]['url']);
- if (! strstr($bloghtml['body'], '<a class="archive"') )
+ if (! strstr($bloghtml['body'], '<a class="wparchive"') )
die(__('Your Blogger blog did not take the new template or did not respond.'));
- preg_match_all('#<a class="archive" href="([^"]*)"#', $bloghtml['body'], $archives);
+ preg_match_all('#<a class="wparchive" href="([^"]*)"#', $bloghtml['body'], $archives);
foreach ($archives[1] as $archive) {
$this->import['blogs'][$_GET['blog']]['archives'][$archive] = false;
}
@@ -443,10 +451,10 @@ class Blogger_Import {
$post_date = "$postyear-$postmonth-$postday $posthour:$postminute:$postsecond";
- $post_content = addslashes($post_content);
+ $post_content = addslashes($this->reencode($post_content));
$post_content = str_replace(array('<br>','<BR>','<br/>','<BR/>','<br />','<BR />'), "\n", $post_content); // the XHTML touch... ;)
- $post_title = addslashes($post_title);
+ $post_title = addslashes($this->reencode($post_title));
$post_status = 'publish';
@@ -476,12 +484,12 @@ class Blogger_Import {
else if (($comment_date[2] == 'AM') && ($commenthour == '12'))
$commenthour = '00';
$comment_date = "$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond";
- $comment_author = addslashes(strip_tags($commentinfo[1]));
+ $comment_author = addslashes($this->reencode(strip_tags($commentinfo[1])));
if ( strpos($commentinfo[1], 'a href') ) {
$comment_author_parts = explode('&quot;', htmlentities($commentinfo[1]));
$comment_author_url = $comment_author_parts[1];
} else $comment_author_url = '';
- $comment_content = $commentinfo[2];
+ $comment_content = $this->reencode($commentinfo[2]);
$comment_content = str_replace(array('<br>','<BR>','<br/>','<BR/>','<br />','<BR />'), "\n", $comment_content);
$comment_approved = 1;
if ( comment_exists($comment_author, $comment_date) ) {
@@ -509,7 +517,7 @@ class Blogger_Import {
}
}
$status = sprintf(__('%s post(s) parsed, %s skipped...'), $postcount, $skippedpostcount).' '.
- sprintf(__('%s comment(s) parsed, %s skipped...'), $commentcoun, $skippedcommentcount).' '.
+ sprintf(__('%s comment(s) parsed, %s skipped...'), $commentcount, $skippedcommentcount).' '.
' <strong>'.__('Done').'</strong>';
$import = $this->import;
$import['blogs'][$_GET['blog']]['archives']["$url"] = $status;
@@ -660,6 +668,6 @@ class Blogger_Import {
$blogger_import = new Blogger_Import();
-register_importer('blogger', 'Blogger', __('Import posts and comments from a Blogger account'), array ($blogger_import, 'start'));
+register_importer('blogger', 'Blogger', __('Import posts and comments from a Blogger account.'), array ($blogger_import, 'start'));
?>
diff --git a/wp-inst/wp-admin/import/mt.php b/wp-inst/wp-admin/import/mt.php
index 3a89d7b..08bd343 100644
--- a/wp-inst/wp-admin/import/mt.php
+++ b/wp-inst/wp-admin/import/mt.php
@@ -30,9 +30,8 @@ class MT_Import {
function users_form($n) {
global $wpdb, $testing;
- $users = get_users_of_blog();
+ $users = get_users_of_blog($wpdb->blogid);
?><select name="userselect[<?php echo $n; ?>]">
- <option value="#NONE#">- Select -</option>
<?php
@@ -133,10 +132,11 @@ class MT_Import {
}
function mt_authors_form() {
+ $this->header();
?>
+<h2><?php _e('Select Authors'); ?></h2>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
-<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <i>italics</i>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?></p>
-<p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p>
+<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <i>italics</i>. For each of these names, pick an author from your blog from the menu'); ?></p>
<?php
@@ -146,7 +146,7 @@ class MT_Import {
$j = -1;
foreach ($authors as $author) {
++ $j;
- echo '<li><i>'.$author.'</i><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">';
+ echo '<li><i>'.$author.'</i><br />';
$this->users_form($j);
echo '</li>';
}
@@ -156,8 +156,13 @@ class MT_Import {
echo '</ol>';
flush();
+ $this->footer();
+?>
+<?php
}
+
+
function select_authors() {
$file = wp_import_handle_upload();
if ( isset($file['error']) ) {
@@ -173,6 +178,7 @@ class MT_Import {
function process_posts() {
global $wpdb;
+ $this->header();
$i = -1;
echo "<ol>";
foreach ($this->posts as $post) {
@@ -379,7 +385,7 @@ class MT_Import {
}
if ( $num_pings )
printf(__('(%s pings)'), $num_pings);
-
+
echo "</li>";
}
flush();
@@ -390,6 +396,7 @@ class MT_Import {
wp_import_cleanup($this->id);
echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3>';
+ $this->footer();
}
function import() {
@@ -420,11 +427,11 @@ class MT_Import {
}
function MT_Import() {
- // Nothing.
+ // Nothing.
}
}
$mt_import = new MT_Import();
-register_importer('mt', 'Movable Type', __('Import posts and comments from your Movable Type blog'), array ($mt_import, 'dispatch'));
+register_importer('mt', 'Movable Type / Typepad', __('Import posts and comments from your Movable Type or Typepad blog from their export file.'), array ($mt_import, 'dispatch'));
?>
diff --git a/wp-inst/wp-admin/link-manager.php b/wp-inst/wp-admin/link-manager.php
index 26f3ef3..9d86834 100644
--- a/wp-inst/wp-admin/link-manager.php
+++ b/wp-inst/wp-admin/link-manager.php
@@ -34,7 +34,9 @@ $links_show_order = $_COOKIE['links_show_order_' . COOKIEHASH];
if ('' != $_POST['assign']) $action = 'assign';
if ('' != $_POST['visibility']) $action = 'visibility';
if ('' != $_POST['move']) $action = 'move';
-if ('' != $_POST['linkcheck']) $linkcheck = $_POST[linkcheck];
+if ('' != $_POST['linkcheck']) $linkcheck = $_POST[ 'linkcheck' ];
+
+update_option( 'links_last_updated', time() );
switch ($action) {
case 'assign':
diff --git a/wp-inst/wp-admin/user-edit.php b/wp-inst/wp-admin/user-edit.php
index d6a3cd3..ebb6cfd 100644
--- a/wp-inst/wp-admin/user-edit.php
+++ b/wp-inst/wp-admin/user-edit.php
@@ -65,7 +65,7 @@ if (!current_user_can('edit_users')) $errors['head'] = __('You do not have permi
<p><strong><?php _e('User updated.') ?></strong></p>
</div>
<?php endif; ?>
-<?php if ( count($errors) != 0 ) : ?>
+<?php if ( count($errors) != 0 ) { ?>
<div class="error">
<ul>
<?php
@@ -73,7 +73,7 @@ if (!current_user_can('edit_users')) $errors['head'] = __('You do not have permi
?>
</ul>
</div>
-<?php endif; ?>
+<?php } else { ?>
<div class="wrap">
<h2><?php _e('Edit User'); ?></h2>
@@ -233,6 +233,7 @@ if( $invites_list != '' )
?></table></div><?php
}
}
+}
break;
}
diff --git a/wp-inst/wp-admin/users.php b/wp-inst/wp-admin/users.php
index d3fdd79..43b4d3a 100644
--- a/wp-inst/wp-admin/users.php
+++ b/wp-inst/wp-admin/users.php
@@ -151,6 +151,16 @@ case 'addexistinguser':
if ($new_user_login != '' && $new_user_login != 'admin' ) {
if ( username_exists( $new_user_login ) ) {
$user_ID = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE user_login = '$new_user_login'" );
+ $primary_blog = get_usermeta( $user_ID, "primary_blog" );
+ if( $primary_blog ) {
+ $details = get_blog_details( $primary_blog );
+ if( is_object( $details ) ) {
+ if( $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) {
+ header( "Location: users.php?update=notactive" );
+ die();
+ }
+ }
+ }
if( $wpdb->get_var( "SELECT user_id FROM {$wpdb->usermeta} WHERE user_id = '{$user_ID}' AND meta_key = '{$wpdb->prefix}capabilities'" ) == false ) {
$user = new WP_User($user_ID);
$user->set_role( $_POST[ 'new_role' ] );
@@ -225,6 +235,11 @@ default:
<div id="message" class="updated fade"><p><?php _e('Other users have been deleted.'); ?></p></div>
<?php
break;
+ case 'notactive':
+ ?>
+ <div id="message" class="updated fade"><p><?php _e('User not added. User is deleted or not active.'); ?></p></div>
+ <?php
+ break;
}
endif;
if ( isset($errors) ) : ?>
@@ -277,20 +292,27 @@ default:
$style = ('class="alternate"' == $style) ? '' : 'class="alternate"';
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$user_object->ID' and post_status = 'publish'");
if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_object->ID' title='" . __('View posts') . "'>$numposts</a>";
+ $do_not_edit = ( !is_site_admin() && $user_object->ID == $current_user->ID );
+ $disabled = $do_not_edit ? "disabled='disabled' " : '';
echo "
<tr $style>
- <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td>
+ <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' {$disabled}/> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td>
<td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td>
<td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td>
- <td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td>
- <td><select name='new_roles[{$user_object->ID}]' id='new_role'>";
- foreach($wp_roles->role_names as $roleid => $name) {
- $selected = '';
- if( $role == $roleid)
- $selected = 'selected="selected"';
- echo "<option {$selected} value=\"{$roleid}\">{$name}</option>";
+ <td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td>";
+ if ( $do_not_edit ) {
+ echo "<td><b>{$wp_roles->role_names[$role]}</b></td>";
+ } else {
+ echo "<td><select name='new_roles[{$user_object->ID}]' id='new_role'>";
+ foreach($wp_roles->role_names as $roleid => $name) {
+ $selected = '';
+ if( $role == $roleid)
+ $selected = 'selected="selected"';
+ echo "<option {$selected} value=\"{$roleid}\">{$name}</option>";
+ }
+ echo "</select></td>";
}
- echo "</select></td><td align='right'>$numposts</td><td>";
+ echo "<td align='right'>$numposts</td><td>";
if (is_site_admin())
echo "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>";
echo '</td></tr>';
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php
index 136897c..4dc07aa 100644
--- a/wp-inst/wp-includes/functions.php
+++ b/wp-inst/wp-includes/functions.php
@@ -1404,10 +1404,14 @@ function update_page_cache(&$pages) {
function clean_page_cache($id) {
- global $page_cache;
+ global $page_cache, $wpdb;
if ( isset( $page_cache[$id] ) )
unset( $page_cache[$id] );
+
+ $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type='page'");
+ wp_cache_set('all_page_ids', $page_ids, 'pages');
+
}
function update_post_category_cache($post_ids) {
@@ -2217,6 +2221,11 @@ function get_usermeta( $user_id, $meta_key = '') {
global $wpdb;
$user_id = (int) $user_id;
+ $user = get_userdata( $user_id );
+
+ if ( $meta_key && isset($user->{$meta_key}) )
+ return $user->{$meta_key};
+
if ( !empty($meta_key) ) {
$meta_key = preg_replace('|a-z0-9_|i', '', $meta_key);
$metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
@@ -2273,7 +2282,8 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
$user = get_userdata($user_id);
wp_cache_delete($user_id, 'users');
wp_cache_delete($user->user_login, 'userlogins');
-
+ wp_cache_delete( md5($user_id . $meta_key), 'usermeta' );
+
return true;
}
@@ -2295,6 +2305,7 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
$user = get_userdata($user_id);
wp_cache_delete($user_id, 'users');
wp_cache_delete($user->user_login, 'userlogins');
+ wp_cache_delete( md5($user_id . $meta_key), 'usermeta' );
return true;
}
diff --git a/wp-inst/wp-includes/template-functions-category.php b/wp-inst/wp-includes/template-functions-category.php
index d4b19ce..679972c 100644
--- a/wp-inst/wp-includes/template-functions-category.php
+++ b/wp-inst/wp-includes/template-functions-category.php
@@ -301,7 +301,11 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
WHERE cat_ID > 0 $exclusions
ORDER BY $sort_column $sort_order";
- $categories = $wpdb->get_results($query);
+ $categories = wp_cache_get( md5( $query), 'general');
+ if ( !$categories ) {
+ $categories = $wpdb->get_results($query);
+ wp_cache_set( md5($query), $categories, 'general', 360);
+ }
}
if ( $optiondates ) {
diff --git a/wp-inst/wp-includes/template-functions-general.php b/wp-inst/wp-includes/template-functions-general.php
index 3994633..d39ff9c 100644
--- a/wp-inst/wp-includes/template-functions-general.php
+++ b/wp-inst/wp-includes/template-functions-general.php
@@ -328,7 +328,11 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
$add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours));
if ( 'monthly' == $type ) {
- $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
+ $arcresults = wp_cache_get( md5('archives' . $type . $limit), 'general');
+ if ( !$arcresults ) {
+ $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
+ wp_cache_set( md5('archives' . $type . $limit), $arcresults, 'general', 360 );
+ }
if ( $arcresults ) {
$afterafter = $after;
foreach ( $arcresults as $arcresult ) {
diff --git a/wp-inst/wp-includes/template-functions-post.php b/wp-inst/wp-includes/template-functions-post.php
index 07cfd14..bd0bcce 100644
--- a/wp-inst/wp-includes/template-functions-post.php
+++ b/wp-inst/wp-includes/template-functions-post.php
@@ -312,11 +312,16 @@ function &get_pages($args = '') {
}
}
- $pages = $wpdb->get_results("SELECT * " .
+ $q = "SELECT * " .
"FROM $wpdb->posts " .
"WHERE post_type = 'page' AND post_status = 'publish' " .
"$exclusions " .
- "ORDER BY " . $r['sort_column'] . " " . $r['sort_order']);
+ "ORDER BY " . $r['sort_column'] . " " . $r['sort_order'];
+
+ if ( !$pages = wp_cache_get( md5( $q ), 'general') ) {
+ $pages = $wpdb->get_results($q);
+ wp_cache_set( md5( $q ), $pages, 'general', 180);
+ }
if ( empty($pages) )
return array();
diff --git a/wp-inst/wp-login.php b/wp-inst/wp-login.php
index 97b55f5..da4a814 100644
--- a/wp-inst/wp-login.php
+++ b/wp-inst/wp-login.php
@@ -225,8 +225,10 @@ default:
<div id="login">
<h1><a href="http://<?php echo $current_site->domain . $current_site->path ?>"><?php echo $current_site->site_name ?></a></h1>
<?php
-if ( $error )
+if ( $error ) {
echo "<div id='login_error'>$error</div>";
+ echo "<p align='center'><strong>Note:</strong> You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.com.</p>";
+}
?>
<form name="loginform" id="loginform" action="wp-login.php" method="post">