3 function get_the_author($idmode = '') {
5 return apply_filters('the_author', $authordata->display_name);
8 function the_author($idmode = '', $echo = true) {
10 echo get_the_author($idmode);
11 return get_the_author($idmode);
14 function get_the_author_description() {
16 return $authordata->description;
18 function the_author_description() {
19 echo get_the_author_description();
22 function get_the_author_login() {
24 return $authordata->user_login;
27 function the_author_login() {
28 echo get_the_author_login();
31 function get_the_author_firstname() {
33 return $authordata->first_name;
35 function the_author_firstname() {
36 echo get_the_author_firstname();
39 function get_the_author_lastname() {
41 return $authordata->last_name;
44 function the_author_lastname() {
45 echo get_the_author_lastname();
48 function get_the_author_nickname() {
50 return $authordata->nickname;
53 function the_author_nickname() {
54 echo get_the_author_nickname();
57 function get_the_author_ID() {
59 return $authordata->ID;
61 function the_author_ID() {
62 echo get_the_author_id();
65 function get_the_author_email() {
67 return $authordata->user_email;
70 function the_author_email() {
71 echo apply_filters('the_author_email', get_the_author_email() );
74 function get_the_author_url() {
76 return $authordata->user_url;
79 function the_author_url() {
80 echo get_the_author_url();
83 function get_the_author_icq() {
85 return $authordata->icq;
88 function the_author_icq() {
89 echo get_the_author_icq();
92 function get_the_author_aim() {
94 return str_replace(' ', '+', $authordata->aim);
97 function the_author_aim() {
98 echo get_the_author_aim();
101 function get_the_author_yim() {
103 return $authordata->yim;
106 function the_author_yim() {
107 echo get_the_author_yim();
110 function get_the_author_msn() {
112 return $authordata->msn;
115 function the_author_msn() {
116 echo get_the_author_msn();
119 function get_the_author_posts() {
121 $posts = get_usernumposts($post->post_author);
125 function the_author_posts() {
126 echo get_the_author_posts();
129 /* the_author_posts_link() requires no get_, use get_author_link() */
130 function the_author_posts_link($idmode='') {
133 echo '<a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars(the_author($idmode, false))) . '">' . the_author($idmode, false) . '</a>';
136 function get_author_link($echo = false, $author_id, $author_nicename) {
137 global $wpdb, $wp_rewrite, $post, $cache_userdata;
138 $auth_ID = $author_id;
139 $link = $wp_rewrite->get_author_permastruct();
141 if ( empty($link) ) {
142 $file = get_settings('home') . '/';
143 $link = $file . '?author=' . $auth_ID;
145 if ( '' == $author_nicename )
146 $author_nicename = $cache_userdata[$author_id]->user_nicename;
147 $link = str_replace('%author%', $author_nicename, $link);
148 $link = get_settings('home') . trailingslashit($link);
151 $link = apply_filters('author_link', $link, $author_id, $author_nicename);
158 function wp_list_authors($args = '') {
159 parse_str($args, $r);
161 if ( !isset($r['optioncount']) )
162 $r['optioncount'] = false;
163 if ( !isset($r['exclude_admin']) )
164 $r['exclude_admin'] = true;
165 if ( !isset($r['show_fullname']) )
166 $r['show_fullname'] = false;
167 if ( !isset($r['hide_empty']) )
168 $r['hide_empty'] = true;
169 if ( !isset($r['feed']) )
171 if ( !isset($r['feed_image']) )
172 $r['feed_image'] = '';
174 list_authors($r['optioncount'], $r['exclude_admin'], $r['show_fullname'], $r['hide_empty'], $r['feed'], $r['feed_image']);
177 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
179 $query = "SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name";
180 $authors = $wpdb->get_results($query);
182 foreach ( $authors as $author ) {
183 $author = get_userdata( $author->ID );
184 $posts = get_usernumposts($author->ID);
185 $name = $author->nickname;
187 if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') )
188 $name = "$author->first_name $author->last_name";
190 if ( !($posts == 0 && $hide_empty) )
196 $link = '<a href="' . get_author_link(0, $author->ID, $author->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars($author->display_name)) . '">' . $name . '</a>';
198 if ( (! empty($feed_image)) || (! empty($feed)) ) {
200 if (empty($feed_image))
202 $link .= '<a href="' . get_author_rss_link(0, $author->ID, $author->user_nicename) . '"';
204 if ( !empty($feed) ) {
205 $title = ' title="' . $feed . '"';
206 $alt = ' alt="' . $feed . '"';
213 if ( !empty($feed_image) )
214 $link .= "<img src=\"$feed_image\" border=\"0\"$alt$title" . ' />';
220 if ( empty($feed_image) )
225 $link .= ' ('. $posts . ')';
229 if ( !($posts == 0 && $hide_empty) )