<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Facebook Cookbook &#187; Mahmud Ahsan</title>
	<atom:link href="http://fbcookbook.ofhas.in/author/mahmud/feed/" rel="self" type="application/rss+xml" />
	<link>http://fbcookbook.ofhas.in</link>
	<description>thousands of app development recipes</description>
	<lastBuildDate>Sun, 21 Mar 2010 10:38:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>how to send notifications and emails</title>
		<link>http://fbcookbook.ofhas.in/2009/02/13/how-to-send-notifications-and-emails/</link>
		<comments>http://fbcookbook.ofhas.in/2009/02/13/how-to-send-notifications-and-emails/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 13:26:35 +0000</pubDate>
		<dc:creator>Mahmud Ahsan</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Notification]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[facebook email]]></category>
		<category><![CDATA[facebook notification]]></category>

		<guid isPermaLink="false">http://fbcookbook.ofhas.in/?p=245</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/13/how-to-send-notifications-and-emails/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'how to send notifications and emails';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>




sending notifications and emails are very important features of a facebook app. now i&#8217;m going to show how you will send notifications and emails to users.
there are two types of notifications: user-to-user and application-to-user

a user-to-user notification is sent on behalf of one user to one or more other users
application-to-user notifications are sent on an application&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/13/how-to-send-notifications-and-emails/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'how to send notifications and emails';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3649773907774827";
/* 468x15, created 9/26/09 */
google_ad_slot = "6695465500";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
sending notifications and emails are very important features of a facebook app. now i&#8217;m going to show how you will send notifications and emails to users.</p>
<p>there are two types of notifications: user-to-user and application-to-user</p>
<ul>
<li>a user-to-user notification is sent on behalf of one user to one or more other users</li>
<li>application-to-user notifications are sent on an application&#8217;s behalf and do not require an active session.</li>
</ul>
<p><strong>case 1:</strong> suppose you have an application question/answer type. let user  &#8216;x&#8217; sent a question to user &#8216;y&#8217;. so how will you notify user &#8216;y&#8217; that he received a question. you can send a notification to user &#8216;y&#8217; from user &#8216;x&#8217; and also you could send an email to user &#8216;y&#8217; from user &#8216;x&#8217;.</p>
<p><strong>solution:</strong> for sending notification you could write this code</p>
<pre name="code" class="php">

/*------- sends a notification or request to a set of users. notifications are items sent by an application to a user&#039;s notifications page in response to some sort of user activity within an application ----------*/
// $facebook-&gt;api_client-&gt;notifications_send(ids, notificationmessage, notificationtype);

$facebook-&gt;api_client-&gt;notifications_send(&#039;654321890&#039;, &quot;you&#039;ve received a msg from &lt;fb:name uid=&#039;7464635353&#039; /&gt;&quot;, &#039;user_to_user&#039;);
</pre>
<p>this notification is sent from user to user, that&#8217;s why you&#8217;ve to mention notification type as &#8216;user_to_user&#8217;</p>
<p>another imortant thing is that, you could send same notifications to more than one users as a single api call. just specify the ids as a comman separated list like</p>
<pre name="code" class="php">

$facebook-&gt;api_client-&gt;notifications_send(&#039;654321890,656565654, 49393939&#039;, &quot;msg&quot;, &#039;user_to_user&#039;);
</pre>
<p><img class="alignnone size-full wp-image-248" title="notifications_by_ma1" src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/notifications_by_ma1.png" alt="notifications_by_ma1" width="240" height="189" /></p>
<p><strong>case 2:</strong> let you also want to send an email to user &#8216;y&#8217; from user &#8216;x&#8217; in the situation of case 1.</p>
<p><strong>solution:</strong> you could only send emails to the users, who have both authorized your application and granted it the email extended permission. so how will you ask the user for accepting extended permission for email. here is the way. write the below code in your view page or layout:</p>
<pre name="code" class="php">

&lt;fb:prompt-permission perms=&quot;email&quot;&gt;Would you like to receive email from our application?&lt;/fb:prompt-permission&gt;
</pre>
<p>this will render this link in your view page:<br />
<img class="alignnone size-full wp-image-250" title="email_extended_permiss_ma1" src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/email_extended_permiss_ma1.png" alt="email_extended_permiss_ma1" width="371" height="66" /></p>
<p>when user will click this link, a dialog box will open and show user a message  to accept receive emails permission. if user accept this permission, then this link will not shown to that user in future.</p>
<p>here is the api call that you have to use to send email:</p>
<pre name="code" class="php">

//$facebook-&gt;api_client-&gt;notifications_sendEmail(&#039;recipients&#039;, &#039;mail_subject&#039;, &quot;tex&quot;, &#039;fbml&#039;);
$facebook-&gt;api_client-&gt;notifications_sendEmail(&#039;73737373&#039;, &#039;you received a question&#039;, &quot;&quot;, &quot;hi user &lt;fb:name uid=&#039;47363633&#039; /&gt; has sent you a message&quot;);
</pre>
<p>remember the parameters:</p>
<ul>
<li><strong>recipients: </strong>a comma-separated list of recipient IDs. you can email up to 100 people at a time.</li>
<li><strong>subject:</strong> the subject of the email message. as of 10/28/2008, the subject will accept a limited set of fbml tags, including names, and tags related to internationalization.</li>
<li><strong>text:</strong> the plain text version of the email content. you must include a non-empty value for at least one of either the fbml or text parameters. the fbml input takes precedence, but if the given fbml value is invalid or cannot be rendered, then the text will be used instead. there is currently no character limit on the length of either the text or fbml body.</li>
<li><strong>fbml: </strong>the fbml version of the email. you must include a non-empty value for at least one of either the fbml or text parameters. the fbml parameter is a stripped-down set of fbml  that allows only html/fbml tags that result in text, links, linebreaks, as well as tags related to internationalization.</li>
</ul>
<p>references:</p>
<ul>
<li><a href="http://wiki.developers.facebook.com/index.php/Notifications.sendEmail">http://wiki.developers.facebook.com/index.php/Notifications.sendEmail</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Notifications.send">http://wiki.developers.facebook.com/index.php/Notifications.send</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Fb:prompt-permission">http://wiki.developers.facebook.com/index.php/Fb:prompt-permission</a></li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3649773907774827";
/* 468x15, created 9/26/09 */
google_ad_slot = "6695465500";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://fbcookbook.ofhas.in/2009/02/13/how-to-send-notifications-and-emails/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>friends selection custom component</title>
		<link>http://fbcookbook.ofhas.in/2009/02/06/friends-selection-custom-component/</link>
		<comments>http://fbcookbook.ofhas.in/2009/02/06/friends-selection-custom-component/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 10:10:41 +0000</pubDate>
		<dc:creator>Mahmud Ahsan</dc:creator>
				<category><![CDATA[FBML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[facebook widget]]></category>
		<category><![CDATA[friends selection custom component]]></category>

		<guid isPermaLink="false">http://fbcookbook.ofhas.in/?p=156</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/06/friends-selection-custom-component/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'friends selection custom component';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
for 1 of my facebook application, i was  needed a custom friends selector. the purpose was, i&#8217;ve a page from where i&#8217;ve to select multiple friends and then i&#8217;ll submit those selected friend ids using ajax call without refreshing the page.
then i searched the documentation of fbml. in facebook component, there are 2 types of [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/06/friends-selection-custom-component/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'friends selection custom component';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p>for 1 of my facebook application, i was  needed a custom friends selector. the purpose was, i&#8217;ve a page from where i&#8217;ve to select multiple friends and then i&#8217;ll submit those selected friend ids using ajax call without refreshing the page.</p>
<p>then i searched the documentation of fbml. in facebook component, there are 2 types of friends selector</p>
<ol>
<li><a href="http://wiki.developers.facebook.com/index.php/Fb:multi-friend-selector" target="_blank">http://wiki.developers.facebook.com/index.php/Fb:multi-friend-selector</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Fb:multi-friend-selector_(condensed)" target="_blank">http://wiki.developers.facebook.com/index.php/Fb:multi-friend-selector_(condensed)</a></li>
</ol>
<p><a href="http://mahmudahsan.files.wordpress.com/2008/12/face-1.png"><img class="aligncenter size-medium wp-image-298" title="face-1" src="http://mahmudahsan.files.wordpress.com/2008/12/face-1.png?w=300" alt="face-1" width="300" height="181" /></a><a href="http://mahmudahsan.files.wordpress.com/2008/12/face-2.png"><img class="aligncenter size-full wp-image-299" title="face-2" src="http://mahmudahsan.files.wordpress.com/2008/12/face-2.png" alt="face-2" width="234" height="157" /></a>but both of these are totally controlled by facebook and these components are used to send invitation or request to friends. i need a component like figure 2. the fbml code for the second component is below:</p>
<pre name="code" class="php">

&lt;fb:request-form method=”post” action=”http://yourdomain.com/submit.php” content=”Select Friends” type=”gifts” invite=”true”&gt;
&lt;div class=”clearfix” style=”padding-bottom: 10px;”&gt;
&lt;fb:multi-friend-selector condensed=”true” selected_rows=”0? style=”width: 220px;” /&gt;
&lt;/div&gt;
&lt;fb:request-form-submit /&gt;
&lt;/fb:request-form&gt;
</pre>
<p>but I was needed a component that would be fully controlled by me. so,  I developed a friends selection component and I&#8217;m sharing it. <img src='http://fbcookbook.ofhas.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-156"></span></p>
<p>here is the outlook of my component:</p>
<p><a href="http://mahmudahsan.files.wordpress.com/2008/12/custom-friends-selection-component.png"><img class="aligncenter size-full wp-image-302" title="custom-friends-selection-component" src="http://mahmudahsan.wordpress.com/files/2008/12/custom-friends-selection-component.png" alt="custom-friends-selection-component" width="281" height="248" /></a></p>
<p style="text-align:center;font-size:16px;font-family:arial;"><a href="http://ftechdb.com/mahmudahsan.wordpress.com/custom-friends-selector2.txt" target="_blank">download custom friends selector for facebook application</a></p>
<p style="text-align:left;">there are 3 parts in this code:</p>
<ol>
<li>first part is css</li>
<li>second part is javascript</li>
<li>third part is html + php</li>
</ol>
<p>so changed the file extension to .php</p>
<p>Here is the first part:</p>
<pre name="code" class="css">

&lt;style&gt;

div.scroll {
height: 160px;
width: 200px;
overflow: auto;
border: 1px solid #666;
padding: 8px;
}

#listwords{
border: 1px solid #BDBABD;
margin-top: 5px;
margin-left: 10px;
}

#listwords ul{
list-style: none;
margin-top: -3px;
cursor: pointer;
}

#listwords span{
color: olive;
text-decoration: none;
}

.itemselect{
background-color: #e2dfaf;
color: #650202;
}

.itemmouseover{
background-color: #FFEEBB;
color: BLACK;
}

.itemnormal{
color: BLACK;
font-family: arial;
font-size: 12px;
}
</pre>
<p>this is the css code for the outlook of my component. here in the top you&#8217;ll see a bold part. this is a very important code that creates scroll bar when list is overflow than it&#8217;s height.</p>
<p>now the second part and 3rd part:<br />
<code>
<pre name="code" class="javascript">

&lt;script type=”text/javascript”&gt;
//javascript part
/*————————- Friends selection —————–*/
var friendsSelectedIds =   ”; //this is string
//send this variable to php
&lt;/code&gt;&lt;/code&gt;

function toggleSelect(id){
var liBox   =   document.getElementById(’li’ + id);
var chkBox  =   document.getElementById(’chk’ + id);

liBox.toggleClassName(’itemselect’);
if (chkBox.getChecked()){
friendsSelectedIds  =   friendsSelectedIds.replace(id + ‘,’, ”);
chkBox.setChecked(false);
}
else{
chkBox.setChecked(true);
friendsSelectedIds += id + ‘,’;
}

return false;
}
/*============== END ====================*/

function sendFriendIds(){
if (friendsSelectedIds.length == 0){
new Dialog().showMessage(’Select friends’, ‘Please select friends!’);
return false;
}

//submit form using ajax call
var ajax                = new Ajax();
ajax.responseType       = Ajax.FBML;

ajax.ondone        = function(data){
//task u will do
}

ajax.onerror = function(){
new Dialog(Dialog.DIALOG_POP).showMessage(’Error’, ‘Loading error! Please try again!’, button_confirm = ‘Okay’);
}

var queryParams = {”ids” : friendsSelectedIds};
ajax.post(’http://yourdomain.com/submit.php’ , queryParams);

}
&lt;/script&gt;
</pre>
<pre name="code" class="php">

&lt;!– html Part –&gt;
&lt;form name=’ffriends’ method=”POST” action=”&quot; onsubmit=”return false”&gt;
&lt;div class=”scroll” id=”listwords”&gt;
&lt;?php $i=0; ?&gt;
&lt;ul style=’margin-left: -44px’&gt;
&lt;?php foreach($friends as $item){ ?&gt;
&lt;li id=”li&lt;?=$item[&#039;uid&#039;]?&gt;” class=’itemnormal’ onclick=”toggleSelect(&lt;?=$item[&#039;uid&#039;]?&gt;)”&gt;
&lt;input id=”chk&lt;?=$item[&#039;uid&#039;]?&gt;” type=”checkbox” /&gt; &lt;fb:name uid=”&lt;?=$item[&#039;uid&#039;]?&gt;” linked=”false” /&gt;
&lt;/li&gt;
&lt;?php } ?&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;input style=”margin-left: 10px;” class=”inputsubmit” type=”Submit” value=”Send Question” onclick=”sendFriendIds()” /&gt;
&lt;/form&gt;
</pre>
<p><span style="color:#800000;"><span style="color:#000000;">it's best that you download the code and read my description. in html part, you will see a foreach loop where friends is an array of the friends you have. i retrieve the friends using fql and assigned the result in <strong>$friends variable</strong>.  when a friend is selected, it's id is saved in </span></span><span style="color:#003366;">friendsSelectedIds variable <span style="color:#000000;">in javascript. (like </span></span><span style="color:#003366;">friendsSelectedIds=12393939,45454545, <span style="color:#000000;">)</span></span><span style="color:#800000;"> <span style="color:#000000;">a comma is added after id. </span></span></p>
<p><span style="color:#800000;"><span style="color:#000000;">when a friend is unselected its id and comma is removed from the variable. this variable is a string variable. after selecting one or more friends when user press the submit button </span></span><span style="color:#003366;"><strong>sendFriendIds() <span style="color:#000000;">method</span></strong></span><span style="color:#800000;"> <span style="color:#000000;">is called. in this method you've to redefine the ajax functionalities for your work. </span></span><span style="color:#800000;"><span style="color:#000000;">if no friend is selected a message is shown to the user.</span></span><span style="color:#800000;"><span style="color:#000000;"> remember </span></span><span style="color:#003366;"><strong>var queryParams = {"ids" : friendsSelectedIds}; <span style="color:#000000;">ids </span></strong><span style="color:#000000;">is the selected ids of friends and this will be catched from server side script. and <strong>ids </strong>containted comma separated id of friends. i think this is a very small lines of code and easily understandable for facebook application developer.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://fbcookbook.ofhas.in/2009/02/06/friends-selection-custom-component/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>fbml rendering in iframe application</title>
		<link>http://fbcookbook.ofhas.in/2009/02/03/fbml-rendering-in-iframe-application/</link>
		<comments>http://fbcookbook.ofhas.in/2009/02/03/fbml-rendering-in-iframe-application/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 16:26:23 +0000</pubDate>
		<dc:creator>Mahmud Ahsan</dc:creator>
				<category><![CDATA[FBML]]></category>
		<category><![CDATA[iFrame]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fbml in iframe]]></category>
		<category><![CDATA[xfbml]]></category>

		<guid isPermaLink="false">http://fbcookbook.ofhas.in/?p=57</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/03/fbml-rendering-in-iframe-application/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'fbml rendering in iframe application';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
before proceeding the main topic, at first i want to describe how to develop  iframe based facebook application. i assume that, the reader have minimum knowledge of how to develop canvas based facebook application. if you never develop any facebook application please visit: http://wiki.developers.facebook.com/index.php/creating_your_first_application
steps of developing iframe based facebook application:
1. when you setup a [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/03/fbml-rendering-in-iframe-application/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'fbml rendering in iframe application';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p>before proceeding the main topic, at first i want to describe how to develop  iframe based facebook application. i assume that, the reader have minimum knowledge of how to develop canvas based facebook application. if you never develop any facebook application please visit:<a href="http://wiki.developers.facebook.com/index.php/creating_your_first_application" target="_blank"> http://wiki.developers.facebook.com/index.php/creating_your_first_application</a></p>
<p>steps of developing iframe based facebook application:</p>
<p>1. when you setup a new application in facebook, choose  “use iframe” for canvas page url.<br />
2. now set the authentication code, at your bootstrap file:</p>
<pre name="code" class="php">

&lt;?php
include “facebook.php”;
$facebook = new facebook(’api_key’, ’secret_key’);
$user = $facebook-&gt;require_login();

//catch the exception that gets thrown if the cookie has an invalid session_key in it
try {
if (!$facebook-&gt;api_client-&gt;users_isappadded()) {
$facebook-&gt;redirect($facebook-&gt;get_add_url());
}
}
catch (exception $ex) { //this will clear cookies for your application and redirect them to a login prompt
$facebook-&gt;set_user(null, null);
$facebook-&gt;redirect(callback_url);
}
?&gt;
</pre>
<p>3. and don’t forget to place the necessary facebook php library. <a href="http://wiki.developers.facebook.com/index.php/php">http://wiki.developers.facebook.com/index.php/php</a></p>
<p>now i’m describing the main topic, that is how to render xfbml or fbml in your iframe based application.</p>
<p>1. first create a file called xd_receiver.htm<br />
2. place xd_receiver.htm in the root directory. suppose your application base directory is: <a href="http://myapp.com/iframeapp">http://myapp.com/iframeapp</a> . then place <strong>xd_receiver.htm</strong> in <strong>iframeapp </strong>folder.  now add the following html code to xd_receiver.htm .</p>
<pre name="code" class="html">

&lt;!doctype html public “-//w3c//dtd xhtml 1.0 strict//en” “http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd”&gt;
&lt;html xmlns=”http://www.w3.org/1999/xhtml” &gt;
&lt;head&gt;
&lt;title&gt;cross-domain receiver page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script src=”http://static.ak.facebook.com/js/api_lib/v0.4/xdcommreceiver.debug.js” type=”text/javascript”&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>now in your view file, or may be layout file, place this code. here i’m showing the layout files format for iframe application.</p>
<pre name="code" class="html">

&lt;!doctype html public “-//w3c//dtd xhtml 1.0 strict//en” “http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd”&gt;
&lt;html xmlns=”http://www.w3.org/1999/xhtml” xmlns:fb=”http://www.facebook.com/2008/fbml”&gt;

&lt;head&gt;
&lt;script src=”http://static.ak.facebook.com/js/api_lib/v0.4/featureloader.js.php” type=”text/javascript”&gt;&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;!– here is the fbml code in iframe application –&gt;

&lt;fb:serverfbml&gt;
&lt;script type=”text/fbml”&gt;
&lt;fb:fbml&gt;

&lt;fb:request-form action=”&lt;url for post invite action, see wiki page for fb:request-form for   details&gt;” method=”post” invite=”true” type=”xfbml” content=”this is a test invitation from xfbml test app &lt;fb:req-choice url=’see wiki page for fb:req-choice for details’ label=’ignore the connect test app!’ /&gt;  ” &gt;  &lt;fb:multi-friend-selector showborder=”false” actiontext=”invite your friends to use connect.”&gt;  &lt;/fb:request-form&gt;
&lt;/fb:fbml&gt;
&lt;/script&gt;
&lt;/fb:serverfbml&gt;
</pre>
<p><strong>&lt;!– here is the xfbml code –&gt;</strong></p>
<pre name="code" class="html">

this is &lt;fb:name uid=”&lt;?=$this-&gt;userid?&gt;” useyou=’false’&gt; &lt;/fb:name&gt;
my photo &lt;fb:profile-pic uid=”&lt;?=$this-&gt;userid?&gt;” &gt; &lt;/fb:profice-pic&gt;

&lt;!– remember all xfbml tags should be placed before below javascript code –&gt;

&lt;script type=”text/javascript”&gt;
fb_requirefeatures([&quot;xfbml&quot;], function(){
fb.facebook.init(”place here the api key of your application“, “xd_receiver.htm”);
});
&lt;/script&gt;

&lt;/body&gt;

&lt;/html&gt;
</pre>
<p>** <strong>remember xfbml is nothing but a subset of fbml that are supported for iframe application.</strong></p>
<p><strong>&lt;fb:serverfbml&gt;</strong> : this tag is used to renders the fbml on a facebook server inside an iframe. details of this tag is here: <a href="http://wiki.developers.facebook.com/index.php/fb:serverfbml">http://wiki.developers.facebook.com/index.php/fb:serverfbml</a></p>
<p>references:</p>
<p>1. <a href="http://wiki.developers.facebook.com/index.php/xfbml">http://wiki.developers.facebook.com/index.php/xfbml</a><br />
2. <a href="http://wiki.developers.facebook.com/index.php/cross-domain_communication_channel">http://wiki.developers.facebook.com/index.php/cross-domain_communication_channel</a><br />
3. <a href="http://wiki.developers.facebook.com/index.php/php">http://wiki.developers.facebook.com/index.php/php</a><br />
4. <a href="http://wiki.developers.facebook.com/index.php/creating_your_first_application">http://wiki.developers.facebook.com/index.php/creating_your_first_application</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fbcookbook.ofhas.in/2009/02/03/fbml-rendering-in-iframe-application/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
