Make Avatar Uploader work with Author Pane, Imagecache Profiles and Profile2

Created on 11 October 2013, over 11 years ago
Updated 18 April 2023, about 2 years ago

First of all, I must say... FINALLY someone has thought to make this cool little module. THANK YOU!!! I tested it on my test site and I absolutely LOVE IT!

But it only works on a default user-profile page. On my site, the profile page is taken over by Profile2 and in the side-block I have Author Pane where the large version of user-picture is rendered by Imagecache Profiles. And therefore your module doesn't work in such a setup, which is more common for many Drupal sites.

So,
Feature request:
Please make sure that in the future this cool module works with Author Pane , Imagecache Profiles and Profile2.

Support request:
Can you please provide a temporary solution, like some code and instructions where to put it, for making this module work with Author Pane? I have read the readme file, but it was not very clear where to put which code. I ended up pasting this code:

<?php
/**
 * Custom uploader process, use content profile.
 */
function avatar_uploader_custom_process($file, $uid) {
  $content_type = 'profile_picture';
  
  $profile = content_profile_load($content_type, $uid);
  if (!$profile) {
    $profile = new stdClass();
    $profile->nid  = 0;
    $profile->uid  = $uid;
    $profile->type = $content_type;
    $profile->title   = $content_type;
    $profile->status  = 1;
    $profile->promote = 0;
    $profile->sticky  = 0;
    $profile->created = time();
    $profile = node_prepare($profile);
  }
  avatar_save_cck_field($profile, $file, 'field_profile_image');
  node_save($profile);
  
  return imagecache_create_url('120x120', $profile->field_profile_image[0]['filepath']);
} ?>

inside author-pane.tpl.php , but nothing happened.

💬 Support request
Status

Closed: won't fix

Component

Code

Created by

🇬🇧United Kingdom drupalina

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024