bbPress

Simple, Fast, Elegant

bbPress plugin browser »

Avatar Upload (0.8.3)

Download

Version: 0.8.3

Other Versions

Last Updated: 2007-9-9

Requires bbPress Version: 0.8.2 or higher

Compatible up to: 0.8.2.1

Author Homepage »

Plugin Homepage »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(11)

Your Rating

Author: Louise Dade


  1. It would still be cool if you add class="avatar" or similar to the image HTML. :)

    What would also be cool is if you hooked it up a little. Have a filter to check at the start if it's permissible (something like

    if (!empty($_FILES['p_browse']) && apply_filters('au_upload_allowed', true ) )
    { ...

    and another filter to test for identicons, too) and a hook at the end. That way other plugins will be able to interface with this very nicely. :)

    You can also provide a function name rather than a filename to the function that adds profile tabs. You could have a function that loads the appropriate file, just so that the file can stay in my-plugins and doesn't have to go in root.

    Posted: 1 year ago #
  2. Things were not workin' in that users would not get a new avatar if they didn't have one before, they'd just get an avatar with src=http://example.com/bbpress/avatars/. Note that in your implementation if bb_get_user() doesn't return the usermeta then it doesn't exist and the database query is a waste.
    This is what I changed it to to get it to work for me:
    function avatarupload_get_avatar($id, $fulluri=1, $force_db=0)
    {
    global $bbdb, $user;

    $cached = bb_get_user($id);

    if( $user->avatar_file ) {
    $a = explode("|", $user->avatar_file);
    $a[] = $user->user_login;
    } elseif( $cached->avatar_file ) {
    $a = explode("|", $cached->avatar_file);
    $a[] = $cached->user_login;
    } else {
    return false;
    }

    // do we want the full uri?
    if ($fulluri == 1)
    {
    $config = new avatarupload_config();
    $a[0] = bb_get_option('uri') . $config->avatar_dir . $a[0];
    }

    return $a;
    }

    Posted: 1 year ago #
  3. Doh! Thanks - I can't believe I overlooked that.

    Will add a class name to the image tag too.

    Posted: 1 year ago #
  4. Version 0.8.2 is out (it was out yesterday, actually, so this might be old news to some).

    * Fixes the 'no image' bug with a new bit of logic.
    * Added class="avatar" to <img> tag.
    * Added a note in the readme file about how to get the missing files from the trunk.

    I haven't managed to get the upload script working from within the plugin folder using the add profile tab functions yet, so I just released the bug-fix update.

    Posted: 1 year ago #
  5. stefanos

    Inactive

    Hello,
    in which directory i have to upload the folder which i have downloaded? For example in wordpress there is a folder which called plugins. In bbpress there is not.
    Thanks a lot.

    Posted: 1 year ago #
  6. You have to create a folder called my-plugins in the folder you installed bbPress (the root folder) and upload plugins to it.

    Posted: 1 year ago #
  7. stefanos

    Inactive

    I have do all the instructions. While upload a user an avatar seems that everything it's ok. The avatar it seems in the page that upload the icon, but the problem is when I go to see the post of this user(in any page of forum) the avatar it is not appear. why?
    Thanks again

    Posted: 1 year ago #
  8. Hi stefanos,

    Did you add the avatar code to the forum posts template page?
    <?php avatarupload_display(get_post_author_id()); ?>

    If you did, then try viewing the page source in your browser (View -> Page Source) to see if the image is being added to the page correctly.

    If it is, then you might need to play around with the CSS -- the template may have cut-off the image depending where you placed it in the code.

    Posted: 1 year ago #
  9. geezmo

    Inactive

    I had the same problem posted by antonskey in Page 2 of this thread regarding the length of the thread body not in sync with the length of the thread author section. I followed the solution posted by louisedade but experiences the following problems:

    1 - When adding the code:

    <div class="threadauthor">
    <?php post_author_link(); ?>
    <?php avatarupload_display(get_post_author_id()); ?>
    <small><?php post_author_title(); ?></small>
    </div>

    .

    in post.php template, all posts now get the period (dot - . ) at the beginning. How to solve this?

    2 - Also, after i added the following code to my style.css template:

    #thread li {
    min-height: 200px;
    padding: 1.5em 1.0em;
    line-height: 1.5em;
    }

    .

    the header image of the template (in my case, the grayish header with the "bb" logo of the Kakumei template) disappears, leaving just a white background and the text "Welcome, xxx! View your profile..." and my forum URL. Once I remove the min-height line in style.css the header returns.

    Help!

    Posted: 11 months ago #
  10. Now that Automattic just “acquired” Gravatar and it's future (and reliability) is guaranteed maybe we can work on some code to show any available gravatar to the member and allow them to select it as a locally cached avatar?

    If no-one else is willing, I'll eventually work on code for this as I'd like to see it integrated. I'm just very low on spare time this month.

    Posted: 10 months ago #
  11. Anyone connect the avators up with Wordpress yet? I'd like to get them to show in the comments of the site.

    Posted: 9 months ago #
  12. First, thanks for your job ;) . Second, sorry for my poor english :(

    I've uploaded all files and activated the plugin (0.8.3). It seems all ok and the first time at avatar-profile, the default image appears... but never more. Since I uploaded a new avatar image, instead of showing the image appears username, and the same at the post template.

    The source code shows <img src="http://www.minoritysport.info/foro/avatars/minoritysport.png?1195932825" width="100" height="100" alt="minoritySport" class="avatar" />
    It's ok?

    If you want, test here

    Thank you

    Posted: 9 months ago #
  13. viveksivaram

    Inactive

    I have some questions and also a small suggestion. The readme is not very clear. This is what I understood from it (and interpreted to implement)

    1) First I copied unsharpmask.php, bb-avatar-upload.php, identicon.php to the

    /forums/my-plugins/ folder. I didnt create a folder called "avatar-upload.0.8.3".

    2) I created a folder called "avatars" with CHMOD 775 in the /forums folder

    3) I downloaded default.png and put it into the /forums/avatars folder

    4) I copied the avatar.php to forums/bb-templates/kakumei/ folder

    5) and last but not the least, i copied the avatar-upload.php to the /forums folder

    Boy, this alone took me a while to figure out things.

    after activating the plug in , i do not see any images in my forum.

    Also, the upload / identicon is not working saying that it has no write access to the avatars folder.

    please help me understand if i have executed all steps as documented and if i am missing something out here.

    thanks

    Vivek

    Forum url : http://aavaas.com/forums

    Posted: 9 months ago #
  14. Thank you for the plug-in :)
    I'm using it here: http://desbar.eu/

    PS: something's wrong with the size of the thumbs but I'll read the comments here later to find the reason ..

    Posted: 9 months ago #
  15. ElButch

    Member

    Hi
    I tried to install this plugin but when I click on the avatar tab in the profile section there comes a site that's loking like this:
    Search:
    Login
    Settings
    Help/Guide
    About Trac
    Wiki
    Timeline
    Roadmap
    Browse Source
    View Tickets
    Search
    Last Change
    Revision Log
    root/avatar-upload/trunk/additional-files/my-templates/avatar.php
    And I'm not able to load up any avatars.
    Is there anybody that can help me fix that problem?
    Regards Butch

    Posted: 8 months ago #
  16. Great plugin.

    How can I pull the avatar into Wordpress' comments? I'd like to show it outside of bbPress also. Is that possible?

    Thanks

    Posted: 8 months ago #
  17. The download seems to be missing several files.

    Posted: 8 months ago #
  18. Hi, for those who are having problems with missing files i've just seen this in the latest read me file:

    IMPORTANT: If the avatars/ and my-templates/ folders (in additional-files/) are empty in the ZIP archive, please download the files directly from the SVN trunk:

    * http://plugins-dev.bbpress.org/browser/avatar-upload/trunk/additional-files/avatars/default.png

    * http://plugins-dev.bbpress.org/browser/avatar-upload/trunk/additional-files/my-templates/avatar.php

    For each file above, scroll to the bottom of the page, where it says "Download in other formats" and click on the "Original format" link.

    Great plugin by the way. One problem i'm having is that my avatars only seem to work if I set the avatar folder to 777 file permission. Is this safe?

    Posted: 8 months ago #
  19. Blogger Design asked:

    How can I pull the avatar into Wordpress' comments? I'd like to show it outside of bbPress also. Is that possible?

    I've done it for WP comments with a simple and dirty hack, but it does not work for identicons. The following code is bad, there is a hardcoded path to the bbPress installation and to the avatars/ subdirectory, you may need to adapt it.

    Add the following function to your theme's comment.php and modify it to match your installation:

    <?php
    function bbpress_avatar_hack ()
    {
    global $comment;
    $avatar = get_user_option ('avatar_file', $comment->user_id);
    if ($comment->user_id && $avatar)
    {
    $items = explode ('|', $avatar);
    $filename = $items[0];
    $width = $items[1];
    $height = $items[2];
    if ($items[3] == 'avatar-upload')
    {
    // Change here!
    // forum is the bbPress installation subdirectory
    // avatars is the directory of uploaded avatars
    $apath = get_bloginfo ('url') . "/forum/avatars/$filename";
    echo "<img src=\"$apath\" width=\"$width\" height=\"$height\" style=\"float:right;\" />\n";
    }
    }
    }
    ?>

    In the next step, you have to modify the main loop of the comments display in comments.php and call the function bbpress_avatar_hack inside the comment's output.

    A description in german language is available at the German WordPress Support Portal.

    Posted: 7 months ago #
  20. Thanks, but I didn't see your response until today. I coded it in my comments using the file_exists PHP function. :)

    Posted: 7 months ago #

RSS feed for this topic

Add a Comment »

You must log in to post.

Code is Poetry.