Posted by: junal on: October 13, 2008
Lots of things have changed in new Facebook and these changes brought nightmare for developers, especially for existing applications. Old news feed will be deprecated very soon, and all existing apps should use the new news feeds method. Another one is Profile box, in old method it was default but this is no more default in new facebook. Now, users will be asked by an add button to add the profile box. Once users decided to add the profile box they can preview the profile box and clicking on the add button they can add it. So, some extra work for developers no doubt. Let’s see how we can add profile box in new facebook.
I’m taking the example from my personal facebook application Fallywood…
First thing, is to add the button that will ask users whether they want to add the profile box or not. For that we have to use 2 FB tags
1. fb:if-section-not-added (decide whether user has added the box)
2. fb:add-section-button (if not then show the button)
We can add this button in each page of the app or we can add this button in any specific page, depends on us.
<fb :if-section-not-added section="profile">
<div style="height:45px; width:602px;">
<div id="movieCategories" class="box" style= "width:600px;">
<div class="class ">
<div class="class_">
Add <b>Fallywood</b> to your profile:</div>
<div class="label_2"><fb :add-section-button section="profile"/></div>
</div>
</div>
</div>
</fb>
Now, it’s time to create the profile box, remember we have to create both wide and narrow profile box. And width of narrow profile box never can be more than 184px! If we don’t set this width, narrow profile box will not be appearing. Width of wide profile box should be 380px!
It’s time to call the method…..
// this variable/array should contain all the data for small profile box $small_profile_fbml ="I'm Small Profile Box "; // this variable/array should contain all the data for big profile box $big_profile_fbml = "I'm Big Profile Box"; //set the profile box $facebook->api_client->profile_setFBML(NULL, $fb_user, $big_profile_fbml, '', '', $small_profile_fbml);
That’s it! It should work now
, please feel free to ask me any question….
still no luck, I copied your code precicely, ran it again and it’s just seems like facebook ignores subsequent calls to profile_setFBML
To all those facing an issue with the profile box showing “No content to display” (but working in the Boxes tab), please see
Facebook Profile Box Showing No Content
where the issue is resolved.
Thanks for all the help so far, problem for me I can’t work out for the life of me (and boy have I tried…) how to change “Im Small Profile Box” to display something like an external php page specially designed for the narrow window. I’m a total newb so sorry if that doesn’t make sense….
Hi,
I am having a real hard time getting any information to come up in the profile box on my facebook profile page. I am definitely a new developer and have been working on my very simple application much longer than it should be taking. Is there anyway you could tell me, in really simple terms, what is necessary to add, and where to add it, to make text show up in the profile box?
Thank you soo much for ANY assistance!!
The box just posts the “No content to display”
@Andrea : Please check your email. I have replied regarding this issue. If it shows no content found, that means the value you are passing, not getting there. There might be some problem. Please send me your code. thanks
open the facebookapi_php5_restlib.php file and find function profile_setFBML.
u change code …
function profile_setFBML($markup, $uid = null, $profile=”, $profile_action=”, $mobile_profile=”, $profile_main=”) {
return $this->call_method(’facebook.profile.setFBML’, array(’markup’ => $markup,
‘uid’ => $uid,
‘profile’ => $profile,
‘profile_action’ => $profile_action,
‘mobile_profile’ => $mobile_profile,
‘profile_main’ => $profile_main));
}
saved. after, file upload server. ![]()
fb:add-section-button code working now…
ok…
hi but when i click the button ,it asks for add and when i click add it redirects to facebook site.I need everything to happenin my application in popup. thanks in advance
Sir, im a total newbie to this development, the add to profile button doesnt appear? is there some function call in between
Add My Application to your profile:
thanks in advance, i know its supposed to be a link where in when you click it, a pop up window will show, and then it will go to your profile posting some info about your application.
I finally got it to work but somehow the boxes contain “no content to display”. Thanks a lot for the code!
I have another question, how do i place pictures inside the profile box? ” does not work?
i read and understood your code. i am using cakephp btw. thanks again.
Hi ,
my application is working fine. Thanks very much for Mustafa
Hi, i try a few time and found out your script is not working…
October 22, 2008 at 12:27 am
I tried your code but for some reason the preview popup doesn’t show the right content. It shows the content that I set a while back. Is there a way to force facebook to grab the new content set in profile_setfbml?