Hi,

I have the module installed and it works for the most part - but I can't figure out how to make the profile picture I show on my Drupal Profile pages bigger, it defaults to 50px wide which is too small. I have tried overriding the fb_user_picture function (see: http://drupal.org/node/886814) but that just scales the image so it looks rubbish (I want it about 200px wide).

Any ideas?

Regards,
Richard

Comments

Dave Cohen’s picture

The way to control it is to override the theme function. I'm not sure why it looks like rubbish. Try changing the markup to use size="normal" or other settings you see on http://developers.facebook.com/docs/reference/fbml/profile-pic/

miccelito’s picture

Does it mean adding a customized module (module+info file) for overriding the fb:profile-pic part in the fb_user.module?

If so, how would a customized module look like?
Something like this ... or?

<?php

// Show user name and picture.
        $form['fb_user'] = array(
          'name' => array(
            '#value' => '<fb:name uid="' . $fbu . '" useyou="false" linked="false"></fb:name>',
            '#type' => 'markup',
            '#prefix' => '<div class="fb_user_name">',
            '#suffix' => '</div>',
          ),
          'picture' => array(
            '#value' => '<fb:profile-pic uid="' size="normal" . $fbu .'" linked="false"></fb:profile-pic>',
            '#type' => 'markup',
            '#prefix' => '<div class="fb_user_picture">',
            '#suffix' => '</div>',
          ),
          '#weight' => -1,
        );

I would appreciate if you would specify a correct code.
Further more, would it even be possible to add a certain imagecache preset class within the tag?

Thanks in advance!

Dave Cohen’s picture

You could write a module and implement hook_form_alter() to do as you describe. But that will only change the form and not all the other places drupal displays the name and picture.

That's why the better way is to change theme functions, and that's what fb_connect.module attempts to do for you. It's possible imagecache or some related module is also changing the theme function. For most users, enabling fb_connect.module is enough.

miccelito’s picture

Well, I only need it for the user profile page, on other places the fb thumb size is good enough.
I will make a try tomorrow with this including imagecache (imagecache user profiles)..

miccelito’s picture

Did a test adding a customized module with the code mentioned above

<?php

// Show user name and picture.
        $form['fb_user'] = array(
          'name' => array(
            '#value' => '<fb:name uid="' . $fbu . '" useyou="false" linked="false"></fb:name>',
            '#type' => 'markup',
            '#prefix' => '<div class="fb_user_name">',
            '#suffix' => '</div>',
          ),
          'picture' => array(
            '#value' => '<fb:profile-pic uid="' size="normal" . $fbu .'" linked="false"></fb:profile-pic>',
            '#type' => 'markup',
            '#prefix' => '<div class="fb_user_picture">',
            '#suffix' => '</div>',
          ),
          '#weight' => -1,
        );

But it failed and gave en error message:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /public_html/sites/all/modules/fb_picture/fb_picture.module on line 16

Any suggestion what to change would be appreciated. Thanks in advance.