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
(10)

Your Rating

Author: Louise Dade

Allows users to upload an avatar (gif, jpeg/jpg or png) image to bbPress, and provides template functions to display the uploaded image.

Plugin URI: http://bbpress.org/plugins/topic/46

Author URI: http://www.classical-webdesigns.co.uk/

Features

  • Bozos can not upload avatars.

  • Admins can configure maximum allowed file size (bytes) and dimensions (pixels) of images from within the admin page (credit: Sam Bauers).

    • Images that exceed maximum dimensions are automatically resized (and sharpened if truecolor images).
  • Anybody with the 'moderate' capability can upload another user's avatar

    • this to ensures that inappropriate images can be removed.

    • there is no "delete avatar" function at this time, but an inappropriate image can be removed by uploading a 'safe' image (e.g. a blank 1x1 pixel image) to replace it (you could them manually set that user as a bozo to stop them re-uploading inappropriate images). Alternatively, you could set their avatar to an identicon (see below).

  • Option to display a default avatar for users who do not upload their own.

  • fel64's "Identicons" plugin gives users the option of displaying an identicon instead of uploading an image (becomes their 'default' avatar). http://bbpress.org/forums/topic/1027?replies=25#post-6759

Credit to fel64 for providing the bbPress interface for Identicons and Scott Sherrill-Mix for writing the Identicon code at http://scott.sherrillmix.com/blog/blogger/wp_identicon/


  1. There is lots of information about this plugin on the bbPress Forum thread "Plugin: Avatar Upload", including fel64's Identicons plugin, which extends Avatar Upload to generate unique default avatars for users who do not upload their own.

    If you use WordPress and wish to use your WordPress avatars in bbPress, then you need the bbpress / wordpress avatar? thread.

    Posted: 1 year ago #
  2. Hi!
    First of all, THANK YOU SO MUCH for the plugins!

    I am sorry, I am not a programmer and I am wondering if anybody can show me how to insert the "ID); ?>" into the 'profile.php' or the 'post.php' templates?

    You can check out my forum here:
    http://www.GasZappers.com/forums/

    Posted: 1 year ago #
  3. Oh I actually find this article, I will try it and let you guys know :-)...
    http://plugins-dev.bbpress.org/browser/avatar-upload/tags/0.3/readme.txt

    Posted: 1 year ago #
  4. this plugin for some reason is not working when I turn on permalinks but fine when permalinks is not on. It says userid not found. Any ideas?

    Posted: 1 year ago #
  5. I also have the Permalinks problem. If I switch it off it works. Otherwise it says "User not found"

    Posted: 1 year ago #
  6. jstone

    Inactive

    hi, I fixed the permalinks problem by adding bb_repermalink(); before line 29 in avatar-upload.php

    I don't know if this is the correct way to handle this, but I took the hint for this quick hack from the way profile.php handles permalinks.

    Hope it helps.

    Posted: 1 year ago #
  7. When I upload an avatar, it sets as chmod 600 instead of 644. I use this plugin version.
    What I have to do?

    Posted: 1 year ago #
  8. jstone, your permalink suggestion works for me :)

    another thing i noticed was that in the profile the avatar link gets displayed twice

    Posted: 1 year ago #
  9. I am having the same problem and tryed the above fix. The fix did nothing, when avatar link is clicked I get the bbPress>error page saying "User Not Found," I also tryed changing the permalink structure and only ended up with php errors after clicking avatar links.....

    Has anyone else run into this problem and found an additional fix?

    Thanks
    Jer

    Posted: 1 year ago #
  10. I was having problems with the permalinks on but I commented out these lines in the avatar-upload.php file and it worked.

    /*Grab user id
    if ( isset($_GET['id']) ) {
    $user_id = (int) $_GET['id'];
    } else {
    $user_id = intval( 0 );
    }*/

    Posted: 1 year ago #
  11. Sorry for not reply to folks - I've been away and then busy.

    I've updated the plugin to (hopefully) fix the pretty permalink problems by adding bb_repermalink() and removing the superfluous if ( isset($_GET['id']) ) {... etc .. } (see patrace's comment). I have also overhauled the upload script itself to make it more efficient and streamlined.

    If jerxs could please let me know if this update has fixed his permalink woes?

    I've added the file permissions (set to 666) info as an FAQ question -- although how you set your file permissions for your server (whether you have SHH or FTP access) is left as an exercise for the user. The script itself does not meddle with file permissions, so the permissions of the uploaded avatars will be the same as that of the avatar (parent) directory.

    The double link business, reported by drewsdesign, has me mystified - could it be a template issue rather than a plugin issue? Also, are you using more than one avatar plugin? The link could be being set twice - once by each plugin.

    Phew! I think that's everything.

    Posted: 1 year ago #
  12. Great plugin :) My suggestions:

    #1: Line 52:
    $img_ext = substr($img_name, strrpos($img_name, ".")+1);

    change to

    $img_ext = strtolower(substr($img_name, strrpos($img_name, ".")+1));

    it will not reject the extension if someone has them in uppercase (ex: JPG instead of jpg).

    2. I get a warning for wrong datatype(due to mime-type) when I upload a different file extension.
    Line 73:
    if ($img_errs == 0 && (!in_array($img_type, $config->mime_types[$img_ext]) || !in_array($img_ext, $config->file_extns)) )

    change to:

    if ($img_errs == 0 && (!@in_array($img_type, $config->mime_types[$img_ext]) || !in_array($img_ext, $config->file_extns)) )

    Posted: 1 year ago #
  13. Just released ver. 0.4.1 - a minor bug fix, including the issues noted by Swap.

    Posted: 1 year ago #
  14. How would I have an avatar display in wordpress, in the sidebar more specifically? I have been searching all over and I cannot find a solution that will do so. Everything I try gives me a fatal error.

    I'm wanting to use the same avatars in both wordpress and bbpress. The wordpress side is only going to show the avatar in the sidebar at the top.

    I'm using a theme I made at yourkahil.com. Any help would be appreciated.

    Thank you,
    Kahil

    Posted: 1 year ago #
  15. To display the same avatars in both bbPress and WordPress requires a special plugin being written fro WordPress than can extract the avatars from the bbPress database.

    There already exists plugins that can do this the other way around. For example, the User avatar from WPMU Avatar hack/plugin will display WordPress avatars (uploaded to WP using the WPMU Avatars plugin) in bbPress. But as far as I know nobody has done it the way you are asking.

    I think it would be worth doing and I will certainly look into it -- in theory the one WP plugin would work with any of the bbPress avatar plugins.

    Watch This Space!

    Posted: 1 year ago #
  16. It's practically trivial :) . The only interesting part is that the bb url needs to be configured. As for the double Avatar tab, I've got that and I think it must be because bb adds the area it's currently in to the tabs, and then the plugin adds the tab again. Haven't looked into that properly.

    Lousidedade, I would still be happy if you added in the identicon code in :) Otherwise I request that you add it as a branch.

    function bbreplyavatar() {
    	global $bbposter, $opshuns;
    	$avatar = get_usermeta( $bbposter->ID, 'avatar_file' );
    	if( $avatar ) {
    		$avatar = explode('|', $avatar );
    		$bburl = $opshuns['bburl'];
    		echo '<img alt="' . $bbposter->user_login . ' avatar" src="' . $bburl . '/avatars/' . $avatar[0] .'" class="avatar" />';
    	}
    }
    Posted: 1 year ago #
  17. Ah, you're right, it is trivial! It just needs a plugin wraped around it.

    Oh and fel, I've created a branch of the latest version (ver. 0.4.1b) of Avatar Upload and made Identicons work with it, especially with regard to the default avatar option. To use identicons as the default and not just a user-choice, the "use_default" option must be set to "0" otherwise you get the generic default image. It also creates the Identicon for users who are already registered by have not uploaded an avatar.

    The branch is not going to be a permanent stae of affairs -- I will be adding it to the main trunk, but I wanted to get it uploaded quickly. It will probably be the next version - along with resizing of images that a too big.

    Posted: 1 year ago #
  18. Ahh, thank you very much ^^

    Posted: 1 year ago #
  19. Solution to multiple Avatar tabs: bbPress does indeed add the current profile area to the tabs, hence the duplication. A fix for this will be in the next version, but if you can't wait for that, you can do it yourselves easily. Just open up the bb-avatar-upload.php file and replace the following code:

    (Edited to fit in the forum space)

    Replace this:

    function add_avatar_tab()
    {
        add_profile_tab(__('Avatar'),  'edit_profile',
                        'moderate',  'avatar-upload.php');
    }
    
    .

    With this:

    function add_avatar_tab()
    {
        global $self;
    
        if ($self != 'avatar-upload.php') {
           add_profile_tab(__('Avatar'),  'edit_profile',
                           'moderate',  'avatar-upload.php');
        }
    }
    
    .

    That will stop the duplicates.

    Posted: 1 year ago #

RSS feed for this topic

Add a Comment »

You must log in to post.

Code is Poetry.