Skip to:
Content

bbPress.org


Ignore:
Timestamp:
03/03/2008 06:16:23 AM (18 years ago)
Author:
sambauers
Message:

Built-in Avatar/Gravatar support using pluggable function.

Clean up layout/CSS for post author display.

Properly clear infobox in topic and stop "strikethrough" effect in IE.

Show email address on profile to 'manage_users' privilege holders. Fixes #792

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-includes/template-functions.php

    r1185 r1198  
    44    global $bb, $bbdb, $bb_current_user, $page, $bb_cache,
    55        $posts, $bb_post, $post_id, $topics, $topic, $topic_id,
    6         $forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view;
     6        $forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view,
     7        $del_class, $bb_alt;
    78
    89    if ( $globals )
     
    11501151}
    11511152
     1153function post_author_avatar( $size = '48', $default = '', $post_id = 0 ) {
     1154    if ( ! bb_get_option('show_avatars') )
     1155        return false;
     1156   
     1157    $author_id = get_post_author_id( $post_id );
     1158    if ( $link = get_user_link( $author_id ) ) {
     1159        echo '<a href="' . attribute_escape( $link ) . '">' . bb_get_avatar( $author_id, $size, $default ) . '</a>';
     1160    } else {
     1161        echo bb_get_avatar( $author_id, $size, $default );
     1162    }
     1163}
     1164
    11521165function post_text( $post_id = 0 ) {
    11531166    echo apply_filters( 'post_text', get_post_text( $post_id ), get_post_id( $post_id ) );
     
    14231436    if ( is_array( $profile_info_keys ) ) {
    14241437        foreach ( $profile_info_keys as $key => $label ) {
    1425             if ( 'user_email' != $key && isset($user->$key) && '' !== $user->$key && 'http://' != $user->$key ) {
     1438            if (
     1439                ( 'user_email' != $key || ( 'user_email' == $key && bb_current_user_can( 'edit_users' ) ) )
     1440                && isset($user->$key)
     1441                && '' !== $user->$key
     1442                && 'http://' != $user->$key
     1443            ) {
    14261444                echo "\t<dt>{$label[1]}</dt>\n";
    14271445                echo "\t<dd>" . make_clickable($user->$key) . "</dd>\n";
Note: See TracChangeset for help on using the changeset viewer.