diff --git a/wp-blog-header.php b/wp-blog-header.php index bfcaaa6322..c489b95b19 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -270,9 +270,10 @@ if ('' != $category_name) { $whichcat .= ")"; } -// author stuff -foreach ($users as $auteur) { - $cache_authors[$auteur->ID] = $auteur; +// Author/user stuff +$users = $wpdb->get_results("SELECT * FROM $tableusers WHERE 1=1"); +foreach ($users as $user) { + $cache_userdata[$user->ID] = $user; } if ((empty($author)) || ($author == 'all') || ($author == '0')) { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 6b32330687..19bf5da911 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -175,8 +175,8 @@ function get_currentuserinfo() { // a bit like get_userdata(), on steroids } function get_userdata($userid) { - global $wpdb, $cache_authors, $tableusers; - if ( empty($cache_authors[$userid]) ) { + global $wpdb, $cache_userdata, $tableusers; + if ( empty($cache_userdata[$userid]) ) { $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = '$userid'"); $user->user_nickname = stripslashes($user->user_nickname); $user->user_firstname = stripslashes($user->user_firstname); @@ -1095,6 +1095,7 @@ function start_wp() { ); } $authordata = get_userdata($post->post_author); + $day = mysql2date('d.m.y', $post->post_date); $currentmonth = mysql2date('m', $post->post_date); $numpages = 1; diff --git a/wp-includes/template-functions-author.php b/wp-includes/template-functions-author.php index 86993bbee6..169044cd23 100644 --- a/wp-includes/template-functions-author.php +++ b/wp-includes/template-functions-author.php @@ -5,6 +5,7 @@ function the_author($idmode = '', $echo = true) { if (empty($idmode)) { $idmode = $authordata->user_idmode; } + if ($idmode == 'nickname') $id = $authordata->user_nickname; if ($idmode == 'login') $id = $authordata->user_login; if ($idmode == 'firstname') $id = $authordata->user_firstname; @@ -76,7 +77,7 @@ function the_author_posts_link($idmode='') { function get_author_link($echo = false, $author_id, $author_nicename) { - global $wpdb, $tableusers, $post, $querystring_start, $querystring_equal, $cache_authors; + global $wpdb, $tableusers, $post, $querystring_start, $querystring_equal, $cache_userdata; $auth_ID = $author_id; $permalink_structure = get_settings('permalink_structure'); @@ -84,7 +85,7 @@ function get_author_link($echo = false, $author_id, $author_nicename) { $file = get_settings('siteurl') . '/' . get_settings('blogfilename'); $link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID; } else { - if ('' == $author_nicename) $author_nicename = $cache_authors[$author_id]->author_nicename; + if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename; // Get any static stuff from the front $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); $link = get_settings('siteurl') . $front . 'author/';