How on earth would I get a users avatar to show up in a Views block? All I can seem to do is get the last uploaded Avatar to show up. Please help, I can't find any information about Views integration. I'm also using Unique Avatar in hopes to associate the pic's with a user.

Comments

shrike202’s picture

Priority: Critical » Normal

ok, some of this is solved:

-This must be a node View
-You must use an argument
Provide Default Argument
User ID from Logged In User
-Fields should be a User: Picture

but NOW....
this will not show up for new users only users that this was set for when I created the view

Is there a better way to do this?

stella’s picture

Project: Avatar Selection » Views (for Drupal 7)
Version: 6.x-1.5 » 6.x-2.5

This is unrelated to the Avatar Selection module. Reassigning...

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

I'm afraid I don't understand the problem.

shrike202’s picture

Well my goal is to have a block that shows a currently logged in user's picture by using views.
This has not worked for me yet.

shrike202’s picture

Status: Postponed (maintainer needs more info) » Active
dawehner’s picture

do you mean "the current logged in user" also called me.

or do you want to display one or more logged in users?

shrike202’s picture

yes the currently logged in user is the avatar/icon/picture I'd like to show.

dawehner’s picture

this should work for you

$view = new view;
$view->name = 'test';
$view->description = 'test';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'users';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'picture' => array(
    'label' => 'Picture',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'picture',
    'table' => 'users',
    'field' => 'picture',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'uid_current' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'uid_current',
    'table' => 'users',
    'field' => 'uid_current',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
shrike202’s picture

Status: Active » Fixed

OMG THANK YOU
THANK YOU THANK YOU!!!!!!!!!!!!
That totally works, I'm going to spend the rest of the afternoon studying this!
THANK YOU

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.