By Jesse Stay
Book Price: $29.99 USD
£18.50 GBP
PDF Price: $23.99
Cover | Table of Contents | Colophon




fb_sig_profile,
fb_sig_user, fb_sig_session_key,
fb_sig_time, and fb_sig
parameters—that give more information about the user submitting the form
to the processing script. The fb_sig parameter is
essentially just a hash (see http://en.wikipedia.org/wiki/Hash_algorithm)
of all the other fb_sig_ values preceding it.fb_sig_user
and fb_sig_session_key parameters are added only if
the user using your app has successfully authenticated and logged into
Facebook.requirelogin=[true|false] default: true
true, the user will be prompted to
log in (if they have not already done so), and then they will be asked
if they want to submit data to your app. The login redirects the user
to the posted form, with the fb_sig_user and
fb_sig_session values attached
to that form.clicktoenable=[element
id]clicktodisable=[fb_sig_profile,
fb_sig_user, fb_sig_session_key,
fb_sig_time, and fb_sig
parameters—that give more information about the user submitting the form
to the processing script. The fb_sig parameter is
essentially just a hash (see http://en.wikipedia.org/wiki/Hash_algorithm)
of all the other fb_sig_ values preceding it.fb_sig_user
and fb_sig_session_key parameters are added only if
the user using your app has successfully authenticated and logged into
Facebook.requirelogin=[true|false] default: true
true, the user will be prompted to
log in (if they have not already done so), and then they will be asked
if they want to submit data to your app. The login redirects the user
to the posted form, with the fb_sig_user and
fb_sig_session values attached
to that form.clicktoenable=[element
id]clicktodisable=[element
id]clickthrough=[true|false] default:
falsefacebook.fbml.refreshImgSrc() API tag on the Facebook
Developer Wiki for more information about how to do this (see http://developers.facebook.com/documentation.php?v=1.0&method=fbml.refreshImgSrc).style attributes and <style/>
tags for rendering the CSS inline. One must recognize, however, that
Facebook reads these external files and parses them into its own
formats.?version=2.0 or
similar parameter if you want to indicate the file was changed. URLs in a
href attribute must be absolute, just like
tags, and must link to the callback URL
specified in the application’s installation settings.<link rel="stylesheet" type="text/css" href="http://fbmlessentials.
staynalive.com/facebook.css?version=1.0" />id attributes in the DOM from
your HTML, rewrites those IDs with the string app,
appended by the ID of your application, followed by an underscore, and
then the original ID you specified. The following HTML that you send to
Facebook through your app:<div id="foo">bar</div>
<div id="app0123456789_foo">bar</div>
#) must have the app0123456789_
prefixed to the ID. Which means:#foo { ... }#app0123456789_foo { ... }<style/> element or file. Take
some time to practice these examples. Improper CSS and prefixing with
application IDs in the wrong places have been the cause of some of the
largest headaches I’ve had when using FBML.<script src="http://fbmlessentials.staynalive.com/facebook.js?version=
1.0"></script>app,
followed by the application ID of your app and an underscore. Be sure
when referencing the method later to reference the parsed method name
instead of your original method name. Global functions provided by
Facebook are not rewritten in this manner.onclick attribute is supported in FBML/HTML elements for your app. To
access other events for your FBML/HTML, you must set up an event
listener.BIGINT(20) data
type to do this. You will want to find the equivalent for your database
environment.uid
attribute in FBML, you can use the following identifiers in place
of the actual ID of the user:loggedinuserprofileowner<fb:is-logged-out/> has no FBML-specific
attributes.
uid
of profileowner, and only the user who added your app
will have access to those settings.<fb:user/>uid=[string]<fb:user id="4">
The content rendered here will only display if you have permission to
view Mark Zuckerberg's Profile.
</fb:user>The content rendered here will only display if you have permission to view Mark Zuckerberg's Profile.
profile.setFBML call via the API. It’s important to understand that FBML on a
user’s profile is not dynamic. This means that if you change the FBML, you
must either set it through the “Default FBML” box in your application
settings or make an API call via profile.setFBML again
to reset the FBML for that user’s profile. Just refreshing the user’s
profile page will not refresh it with your new FBML!
The following tags work only in the application’s profile box on a user’s
profile.<fb:wide/><fb:wide/> tag; add this to your “Default
FBML” box in your application settings (or you can set it via the
setFBML API call):<fb:wide> When a user drags the application profile box into the wide column on their profile, this code will appear. </fb:wide>
<fb:name/>uid=[string|loggedinuser|profileowner]loggedinuser displays the name of
the user viewing the profile, whereas
profileowner can be used to display the
name of the owner of the profile being viewed.firstnameonly=[true|false]
default: falsetrue, displays just the
first name of the user.linked=[true|false] default:
truetrue, links the name to
the listed user’s profile.lastnameonly=[true|false]
default: truetrue, displays just the last name
of the user.possessive=[true|false] default:
falsetrue, makes the name
possessive (adds ’s to the name, turning
Jesse into
Jesse’s).reflexive=[true|false] default:
falsetrue, and
useyou is true, turns
the pronoun “you” into “yourself.”shownetwork=[true|false] default:
falsetrue, and an actual
Facebook ID other than profileowner or
loggedinuser is used,
the name will display the user’s network in parentheses to the
right of the name (see the example for this tag).useyou=[true|false] default:
truetrue, and the profile
owner is the same as the logged-in user, displays “you” as the
user’s name.ifcantsee=[string]
default: empty
stringcapitalize=[true|false] default:
falseuseyou is
true and the specified
uid is the logged-in user, capitalizes
“YOU”.<fb:title/><fb:title/>
used in the FBML Essentials app:<fb:title>O'Reilly FBML Essentials - Examples, Tips, Tricks, and
Trivia About Facebook!</fb:title><header/> in the canvas page’s HTML
( shows the result):<title>O'Reilly FBML Essentials - Examples, Tips, Tricks, and
Trivia About Facebook!</title><fb:iframe/>src=[string]
default: nonefb_sig_profile,
fb_sig_user,
fb_sig_session_key,
fb_sig_time, and
fb_sig, in addition to an
fb_sig_in_iframe parameter to let the app
know it is being called from an iframe.<fb:notif-subject/>notifications.send() API method. This FBML works
only within that FBML call.notifications.send() API call:<fb:notif-subject>This is the subject of the E-mail</fb:notif-subject>
<fb:notif-page/>notifications.send() API method call.notifications.send() API call:<fb:notif-page>Add the <a href="http://apps.facebook.com/fbmlessentials"> FBML Essentials app! </a></fb:notif-page>
<fb:notif-email/>notifications.send() API method call. It can be used only in the
notifications.send() API call. This is a great
way to send an email to the user (not the user’s Facebook inbox, but
the user’s real email address) and parse FBML beforehand as part of
the email.notifications.send() API call:<fb:time/>hour:minutes[am|pm] format. If not
the same day, but the same year, the year is not displayed, so the
format is Month Day hour:minutes[am|pm]. If neither
the same day nor year, it is displayed in Month Day, Year
hour:minutes[am|pm] format.t=[int] default:
nonetz=[string] default:
the logged-in-user's time
zone+/– such as
Etc/GMT-7.preposition=[true|false] default:
false<fb:time/> tag and what they produce. This
FBML code:<fb:time t="1"/>
December 31, 1969 5:00pm
<fb:time t="1" tz="America/Boise" preposition="true"/>
5:00pm on December 31, 1969
<fb:fbmlversion/><fb:fbml version="1.0"> The version listed here is <fb:fbmlversion/> </fb:fbml> The version listed here is <fb:fbmlversion/>
<fb:redirect/>clicktoshowdisplay:block.clicktohidedisplay:none.clicktotoggledisplay:none and vice versa, depending on the
current state.clickthroughtrue when using radio
buttons or checkboxes with which you want to use
clicktoshow, clicktohide, or
clicktotoggle. Not setting clickthrough="true" when using
these elements will render the element inoperable.<div id="example1" style="display:none">Visible</div>
<a href="#" clicktoshow="example1">Click here to make "Visible"
appear.</a><div id="example2">Visible2</div>
<a href="#" clicktohide="example2">Click here to make "Visible2"
dissapear.</a><div id="example3">Visible3</div> <a href="#" clicktotoggle="example1,example2,example3"> Click here to toggle visibility of Visible1, Visible2, and Visible3 </a>
display:none, display:block,
etc.) that is affected by the attributes just described should be done
inline, via style attributes. Styling cannot be done
inside a stylesheet document or via
tags._” in
Facebook. This won’t affect your code too much, but it’s important to
remember, as in certain instances you may need to call the method or
variable with the application ID attached. In most cases you can just
call the method name or variable name by itself and Facebook will
handle all the magic!onClick event handler of some sort within a
link or element in order to launch anything on profile pages. On
canvas pages, the click action is not necessary.