Skip to:
Content
Pages
Categories
Search
Top
Bottom

Avatar Upload in WordPress


  • KICKERMAN360
    Member

    @kickerman360

    Hi,

    I was wondering how I could display the bbPress plugin, Avatar Upload, in WordPress. Software: bbPress 1.0.1, WordPress 2.8.1

    I am using bbPress as the profile’s home so to speak since I’d rather not use WordPress’ Dashboard and want to display the avatar of the user on the home page.

    I have done deep integration both ways by using this snippet of code in [wp/bb]-config.php

    if ( !defined( ‘ABSPATH’ ) ) {

    include_once( ‘/home/path/to/forums/[bb/wp]-load.php’ );

    }

    Then pasted this bit of code where I want the avatar.

    <?php avatarupload_get_avatar(ID); ?>

    However, as I expected it doesn’t work with the error

    Fatal error: Call to undefined function avatarupload_display() in blah3 on line x

    I tried adding <?php bb-head ?> and <?php if ( bb_is_profile() ) profile_menu(); ?> to the header but both result in an error

    I am no programmer but I don’t think bbPress is being load correctly. Can anyone offer a solution or some advice?

Viewing 2 replies - 1 through 2 (of 2 total)

  • _ck_
    Participant

    @_ck_

    I believe the plugin page for Avatar Upload has a few suggestions as to how to use it in WordPress.

    You can also find other help via this tag

    http://bbpress.org/forums/tags/avatar-upload


    KICKERMAN360
    Member

    @kickerman360

    Hey thanks _ck_

    I found this snippet of code

    <?php global $user_identity;

    get_currentuserinfo();

    if ($user_identity == ”) {

    echo(‘Welcome Guest’);

    } else {

    echo(‘<img src=”/forum/avatars/’ . strtolower($user_identity) . ‘” alt=”avatar” />’);

    }

    ?>

    Which doesn’t cause an error but doesn’t display an image. I don’t think a file type is being declared which results in a 404 and then the alt text is displayed.

    I did however come up with this, which is a modded version (to be used on a homepage)

    <?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.jpg” />’); ?>

    <?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.png” />’); ?>

    <?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.gif” />’); ?>

    <?php echo(‘<img src=”/forums/avatars/’ . $current_user->user_login . ‘.jpeg” />’); ?>

    I’m not sure how to find out the file extension via php so I just created 3 extra lines of code for the 4 types of files the form should accept.

    If anyone wants to clean up my code I’d greatly appreciate it, I’m only just learning php (noob :D ) after playing with CSS and (x)HTML for a while. I know, the code will not be valid.

    Thanks again, _ck_ ( I didn’t realize there was 2 help forums for that plugin)

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.