Name

<fb:profile-pic/>

Synopsis

<fb:profile-pic uid="..."/>

Renders the user’s profile picture, which is selected in the user’s settings.

FBML-Specific Attributes

Required

uid=[string] default: none

The ID of the user to return a profile picture for.

Optional

size=[thumb|small|normal|square|t|s|n|q] default: thumb

The size of the profile picture to render. Options are: thumb (t) (50 pixels wide); small (s) (100 pixels wide); normal (n) (200 pixels wide); or square (q) (50×50 pixels). The shortcut versions can also be used.

linked=[true|false] default: true

Produces a link for the profile picture back to the user’s profile.

Example FBML

The following is example FBML code for a square profile picture using <fb:profile-pic/>. Note that any of the possible sizes can be replaced with square. This profile picture will also link back to the user’s profile:

<fb:profile-pic uid="4" size="square"/>

Rendered HTML for Single Instance of Tag

The underlying HTML for the profile picture looks like this (Figure 3-16 shows the result):

<a href="http://www.facebook.com/s.php?k=100000080&id=4" 
    onclick="(new Image()).src = '/ajax/ct.php?app_id=4556145827&action_
    type=3&post_form_id=47574ff04e8cb37298e9ddcc2e84e84c&position=2&' 
    + Math.random();return true;">
<img uid="4" size="square" src="http://profile.ak.facebook.com/profile5/
    1240/77/q4_65.jpg" alt="Mark Zuckerberg" title="Mark Zuckerberg" />
</a>
The result of our <fb:profile-pic/> example
Figure 3-16. The result of our <fb:profile-pic/> example

Additional Information

  • The <fb:profile-pic/> is treated like a normal <img/> tag.

  • All attributes supported by a normal HTML <img/> tag should work with the <fb:profile-pic/> tag as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.187.108