Talk:Profile.setFBML
From Facebook Developers Wiki
Contents |
[edit] Feature Requests
[edit] Refresh multiple refs
While you're changing the setProfileFBML, please give us the ability to refresh more than one ref at once. For example, if a gift is being sent to 20 people, or an action, or any other kind of "multicast" -- which is a very common thing -- it would be nice to just update the profiles in one call, by having them all point to some common refs.
- I concur. Don the Dev 19:34, 30 December 2007 (PST)
[edit] Remove profile box from profile
It would be nice if the profile box gets removed if sent empty markup. Currently, the profile box gets a message that says "No content to display." If there's no content to display then the box shouldn't even be there.
- I don't know why this is so poorly documented, but now if you pass a string " " as the profileFBML, it will show a box that says, "No content to display. This box will not be visible to people who view your profile until this application adds content to it." --Courtland 02:43, 9 June 2008 (PDT)
[edit] profile_action parameters
Why are you not using associative arrays for these params? This way, you never have to deprecate parameter lists:
$data = array("mobile" => "....", "profile" => "...."); $facebook->api_client->profile_setFBML($data);
Just my 2 cents.
[edit] Please Please Please
Do not make this change until sometime in January. Many people including myself will be unable to change our code.
- The change has been postponed to January 2008, according to the updated blog post. 506843584 22:01, 17 December 2007 (PST)
[edit] Also see FBML fb:ref
Astonishing this page doesn't contain a pointer to fb:ref and the API setRefHandle(). Be sure to look at that material.
[edit] Questions and Issues
[edit] Is there a limit as to how many characters the markup can contain?
I am finding it is getting cut off if it is too long.
- Currently it's 64k (with a couple of header bytes off) after gzip level 6 compression. So, it's hard to tell exactly how many bytes you can have prior to compression. If you can control it within 64k (minus a couple of bytes), you will be guaranteed not to have any truncations, although when size is around 64k, we normally see compression rate about 8-10x. Per this discussion thread: http://www.facebook.com/topic.php?uid=2205007948&topic=11761 - Haiping Zhao, hzhao at facebook d o t com
[edit] Syntax
<?php
//i.e. $user can come from $user = $facebook->require_login();
$html = "<fb:profile-action url='http://apps.facebook.com/myapp/somepage.php'> Hello World </fb:profile-action>";
$html .= "<fb:wide> Be careful with this. It seems to cache and stuff. Does not append, but replaces. PITA </fb:wide>";
$html .= "<fb:narrow> This only shows if panel is on the left. Dear user. Pleas emove this to the wide panel instead. Blah. </fb:narrow>";
$facebook->api_client->profile_setFBML($html, $user);
?>
[edit] profile_action parameter not working yet?
Does setting the profile action FBML work for anyone yet using the profile_action parameter? I've not had any luck w/ this yet...
- Having the same issue here. -216900466 02:25, 17 December 2007 (PST)
Can we have a clear set of examples on the use of this function, i.e. new and old syntax. I and many others may be unsure of exactly what changes we need to make. Also, the main article for this function only gives an xml return example, the list or required parameters is useless without the syntax on how to use them... for a beginner.
[edit] Error response Code 1?
If this call returns 1 it's not an error - it's successful?
[edit] Example request profile_setFBML() is invalid PHP code
You can't have an empty first parameter:
$facebook->api_client->profile_setFBML('profile fbml here', 12800193, 'profile FBML here', 'profile action fbml here', 'mobile fbml here');
Instead I pass null or the same data as the profile parameter but the past couple of days my apps have been plagued by intermittent timeouts.
Looking at the PHP library I see profile_setFBML($markup, $uid = null, $profile=, $profile_action=, $mobile_profile=) i.e. the markup is first, followed by an optional uid...
[edit] PHP 5 Example
Not sure where this would go but here it goes.
If you want to run $facebook->api_client->profile_setFBML(, 12800193, 'profile FBML here', 'profile action fbml here', 'mobile fbml here'); successfully in PHP5
encase it in a try catch.
try{
$facebook->api_client->profile_setFBML(, 12800193, 'profile FBML here', 'profile action fbml here', 'mobile fbml here');
}catch(FacebookRestClientException $e){
echo $e->getMessage();
}
otherwise it will kill your script. might be a no brainer but thought I would point it out.
[edit] New API (late May 2008)
[edit] New method signature
According to the new design integration API, specifically the MySmiley example, profile.setFBML wants these parameters:
* @param string $markup The FBML that describes the profile presence of this app for the user * @param int $uid The user * @param string $profile Profile FBML * @param string $profile_action Profile action FBML (deprecated) * @param string $mobile_profile Mobile profile FBML * @param string $profile_main Main Tab profile FBML
