More user

git-svn-id: http://svn.automattic.com/wordpress/trunk@2633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-06-12 23:22:06 +00:00
parent de9cc8b12c
commit 10586c54bc
4 changed files with 6 additions and 40 deletions

View File

@ -17,4 +17,5 @@ gzip_compression();
require_once(ABSPATH . WPINC . '/template-loader.php');
endif;
?>
?>

View File

@ -267,31 +267,7 @@ function get_cat_ID($cat_name='General') {
function get_author_name( $auth_id ) {
$authordata = get_userdata( $auth_id );
switch( $authordata['user_idmode'] ) {
case 'nickname':
$authorname = $authordata['user_nickname'];
break;
case 'login':
$authorname = $authordata['user_login'];
break;
case 'firstname':
$authorname = $authordata['user_firstname'];
break;
case 'lastname':
$authorname = $authordata['user_lastname'];
break;
case 'namefl':
$authorname = $authordata['user_firstname'].' '.$authordata['user_lastname'];
break;
case 'namelf':
$authorname = $authordata['user_lastname'].' '.$authordata['user_firstname'];
break;
default:
$authorname = $authordata['user_nickname'];
break;
}
return $authorname;
return $authordata->display_name;
}
// get extended entry info (<!--more-->)

View File

@ -48,7 +48,6 @@ function get_userdata( $user_id ) {
foreach ( $metavalues as $meta )
$user->{$meta->meta_key} = $meta->meta_value;
die(var_dump($user));
$cache_userdata[$cache_userdata[$userid]->user_login] =& $cache_userdata[$user_id];
return $cache_userdata[$user_id];

View File

@ -1,20 +1,10 @@
<?php
function get_the_author($idmode = '') {
global $authordata;
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;
if ($idmode == 'lastname') $id = $authordata->user_lastname;
if ($idmode == 'namefl') $id = $authordata->user_firstname.' '.$authordata->user_lastname;
if ($idmode == 'namelf') $id = $authordata->user_lastname.' '.$authordata->user_firstname;
if (!$idmode) $id = $authordata->user_nickname;
return $id;
return $author_data->display_name;
}
function the_author($idmode = '', $echo = true) {
if ($echo) echo get_the_author($idmode);
return get_the_author($idmode);