<?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>TMHs Web Tips</title>
	<atom:link href="http://www.xwebgate.com/tmh/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xwebgate.com/tmh/wp</link>
	<description>Copy and paste is not good for human brain. Almost posts of this blog was copied and pasted. :D. If you want to share any post in this blog, feel free to COPY and PASTE. But please remember place an URL point to my original post at top of your COPIED and PASTED post as I did in every posts on this blog. :D. Thank you.</description>
	<lastBuildDate>Tue, 16 Nov 2010 08:01:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>PHP SDK &amp; Graph API base Facebook Connect Tutorial</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/11/16/php-sdk-graph-api-base-facebook-connect-tutorial/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/11/16/php-sdk-graph-api-base-facebook-connect-tutorial/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 08:01:22 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Facebook Connect]]></category>
		<category><![CDATA[Graph API]]></category>
		<category><![CDATA[PHP SDK]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=274</guid>
		<description><![CDATA[http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/ In this article I’m focusing facebook latest php sdk to integrate facebook features in your site. Some days ago facebook released their new graph api system and updated their core structure. They also officially released php sdk so that &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/11/16/php-sdk-graph-api-base-facebook-connect-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><P><A href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/">http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/</A></P><br />
<P>In this article I’m focusing facebook latest <A href="http://github.com/facebook/php-sdk/" target=_blank mce_href="http://github.com/facebook/php-sdk/">php sdk</A> to integrate facebook features in your site. Some days ago facebook released their new graph api system and updated their core structure. They also officially released<A href="http://github.com/facebook/php-sdk/" target=_blank mce_href="http://github.com/facebook/php-sdk/"> php sdk </A>so that you can easily call facebook latest graph api and old legacy api from server side by php.</P><br />
<P>Before proceeding first have a look <A href="http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/" target=_blank mce_href="http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/">my previous article </A>specially <STRONG>Facebook connect authentication part. </STRONG></P><br />
<P>In this post I’ll show</P><br />
<OL><br />
<LI>How to check valid session of user, if user successfully logged in</LI><br />
<LI>How to call <A href="http://developers.facebook.com/docs/api" target=_blank mce_href="http://developers.facebook.com/docs/api">graph api </A></LI><br />
<LI>How to call<A href="http://developers.facebook.com/docs/reference/rest/" target=_blank mce_href="http://developers.facebook.com/docs/reference/rest/"> legacy api</A></LI><br />
<LI>How to update status dynamically using graph api</LI><br />
<LI>How to use <A href="http://developers.facebook.com/docs/reference/fql/" target=_blank mce_href="http://developers.facebook.com/docs/reference/fql/">FQL Query</A></LI></OL><br />
<P>So take a look <A href="http://thinkdiff.net/demo/newfbconnect1/php/index.php" target=_blank mce_href="http://thinkdiff.net/demo/newfbconnect1/php/index.php">my demo of this tutorial</A>. Please login by FBConnect and approve all the permission if you’re first time accessing the page.</P><br />
<P>&nbsp;</P><br />
<P><STRONG>STEP 1:</STRONG></P><br />
<P>First download the <A href="http://github.com/facebook/php-sdk/" target=_blank mce_href="http://github.com/facebook/php-sdk/">php sdk libary from here</A> . Now copy the facebook.php from /src/ to your project dir.</P><br />
<P><STRONG>STEP 2:</STRONG></P><br />
<P>Create a file named <STRONG>fbmain.php</STRONG>. And copy below code to this file.</P><br />
<DIV id=highlighter_831681><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_831681_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_831681" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>01</CODE></TD><br />
<TD><CODE>&lt;?php</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>02</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fbconfig</CODE><CODE>[</CODE><CODE>'appid'</CODE> <CODE>]&nbsp; = </CODE><CODE>&#8220;your application id&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>03</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fbconfig</CODE><CODE>[</CODE><CODE>'api'</CODE>&nbsp;&nbsp; <CODE>]&nbsp; = </CODE><CODE>&#8220;your application api key&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>04</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fbconfig</CODE><CODE>[</CODE><CODE>'secret'</CODE><CODE>]&nbsp; = </CODE><CODE>&#8220;your application secret key&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>05</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>06</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>try{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>07</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>include_once</CODE> <CODE>&#8220;facebook.php&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>08</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>09</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>catch(Exception </CODE><CODE>$o</CODE><CODE>){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>10</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>echo</CODE> <CODE>&#8216;&lt;pre&gt;&#8217;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>11</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>print_r(</CODE><CODE>$o</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>12</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>echo</CODE> <CODE>&#8216;&lt;/pre&gt;&#8217;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>13</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>14</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// Create our Application instance.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>15</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$facebook</CODE> <CODE>= </CODE><CODE>new</CODE> <CODE>Facebook(</CODE><CODE>array</CODE><CODE>(</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>16</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;appId&#8217;</CODE>&nbsp; <CODE>=&gt; </CODE><CODE>$fbconfig</CODE><CODE>[</CODE><CODE>'appid'</CODE><CODE>],</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>17</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;secret&#8217;</CODE> <CODE>=&gt; </CODE><CODE>$fbconfig</CODE><CODE>[</CODE><CODE>'secret'</CODE><CODE>],</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>18</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;cookie&#8217;</CODE> <CODE>=&gt; true,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>19</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>));</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>20</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>21</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// We may or may not have this data based on a $_GET or $_COOKIE based session.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>22</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// If we get a session here, it means we found a correctly signed session using</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>23</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// the Application Secret only Facebook and the Application know. We dont know</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>24</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// if it is still valid until we make an API call using the session. A session</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>25</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// can become invalid if it has already expired (should not be getting the</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>26</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// session back in this case) or if the user logged out of Facebook.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>27</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$session</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;getSession();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>28</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>29</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fbme</CODE> <CODE>= null;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>30</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// Session based graph API call.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>31</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>if</CODE> <CODE>(</CODE><CODE>$session</CODE><CODE>) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>32</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>try {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>33</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$uid</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;getUser();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>34</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fbme</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>&#8216;/me&#8217;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>35</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>} catch (FacebookApiException </CODE><CODE>$e</CODE><CODE>) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>36</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>d(</CODE><CODE>$e</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>37</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>38</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>39</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>40</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>function</CODE> <CODE>d(</CODE><CODE>$d</CODE><CODE>){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>41</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>echo</CODE> <CODE>&#8216;&lt;pre&gt;&#8217;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>42</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>print_r(</CODE><CODE>$d</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>43</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>echo</CODE> <CODE>&#8216;&lt;/pre&gt;&#8217;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>44</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>45</CODE></TD><br />
<TD><CODE>?&gt;</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>First update $fbconfig array by your application’s id, api key and secret key. In the code you’ll see I included facebook.php by include_once. If your server has no curl extension and json extension, you’ll see error message. Until you don’t install curl and json extension this sdk will not work.</P><PRE> $session = $facebook-&gt;getSession();</PRE><br />
<P>This method returns session information of user. It may be empty if user yet not logged in your site or user’s session is invalid. To check user’s session validity you’ve to first call an api, if user’s session is valid then the api will return result.</P><br />
<P>So<STRONG> if $fbme is not null that means user successfully logged in via facebook</STRONG> and <STRONG>user’s session is valid</STRONG>. So before calling any api use conditional logic like if ($fbme) { then call api}.</P><br />
<P>I also defined a method named <STRONG>d()</STRONG> to dump data quickly.</P><br />
<P><STRONG>STEP 3:</STRONG></P><br />
<P>Now create another file named index.php and copy below code and checkout my description at the end.</P><br />
<DIV><br />
<DIV id=highlighter_311812><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_311812_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_311812" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>001</CODE></TD><br />
<TD><CODE>&lt;?php</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>002</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>include_once</CODE> <CODE>&#8220;fbmain.php&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>003</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$config</CODE><CODE>[</CODE><CODE>'baseurl'</CODE><CODE>]&nbsp; =&nbsp;&nbsp; </CODE><CODE>&#8220;<A href="http://thinkdiff.net/demo/newfbconnect1/php/index.php" mce_href="http://thinkdiff.net/demo/newfbconnect1/php/index.php">http://thinkdiff.net/demo/newfbconnect1/php/index.php</A>&#8220;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>004</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>005</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//if user is logged in and session is valid.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>006</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>if</CODE> <CODE>(</CODE><CODE>$fbme</CODE><CODE>){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>007</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//Retriving movies those are user like using graph api</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>008</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>try{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>009</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$movies</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>&#8216;/me/movies&#8217;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>010</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>011</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>catch(Exception </CODE><CODE>$o</CODE><CODE>){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>012</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>d(</CODE><CODE>$o</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>013</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>014</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>015</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//Calling users.getinfo legacy api call example</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>016</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>try{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>017</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$param</CODE>&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>array</CODE><CODE>(</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>018</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;method&#8217;</CODE>&nbsp; <CODE>=&gt; </CODE><CODE>&#8216;users.getinfo&#8217;</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>019</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;uids&#8217;</CODE>&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>$fbme</CODE><CODE>[</CODE><CODE>'id'</CODE><CODE>],</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>020</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;fields&#8217;</CODE>&nbsp; <CODE>=&gt; </CODE><CODE>&#8216;name,current_location,profile_url&#8217;</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>021</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;callback&#8217;</CODE><CODE>=&gt; </CODE><CODE>&#8221;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>022</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>023</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$userInfo</CODE>&nbsp;&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>$param</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>024</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>025</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>catch(Exception </CODE><CODE>$o</CODE><CODE>){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>026</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>d(</CODE><CODE>$o</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>027</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>028</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>029</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//update user&#8217;s status using graph api</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>030</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>if</CODE> <CODE>(isset(</CODE><CODE>$_POST</CODE><CODE>[</CODE><CODE>'tt'</CODE><CODE>])){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>031</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>try {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>032</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$statusUpdate</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>&#8216;/me/feed&#8217;</CODE><CODE>, </CODE><CODE>&#8216;post&#8217;</CODE><CODE>, </CODE><CODE>array</CODE><CODE>(</CODE><CODE>&#8216;message&#8217;</CODE><CODE>=&gt; </CODE><CODE>$_POST</CODE><CODE>[</CODE><CODE>'tt'</CODE><CODE>], </CODE><CODE>&#8216;cb&#8217;</CODE> <CODE>=&gt; </CODE><CODE>&#8221;</CODE><CODE>));</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>033</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>} catch (FacebookApiException </CODE><CODE>$e</CODE><CODE>) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>034</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>d(</CODE><CODE>$e</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>035</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>036</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>037</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>038</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//fql query example using legacy method call and passing parameter</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>039</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>try{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>040</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//get user id</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>041</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$uid</CODE>&nbsp;&nbsp;&nbsp; <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;getUser();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>042</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>//or you can use $uid = $fbme['id'];</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>043</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>044</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fql</CODE>&nbsp;&nbsp;&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>&#8220;select name, hometown_location, sex, pic_square from user where uid=&#8221;</CODE> <CODE>. </CODE><CODE>$uid</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>045</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$param</CODE>&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>array</CODE><CODE>(</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>046</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;method&#8217;</CODE>&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>&#8216;fql.query&#8217;</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>047</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;query&#8217;</CODE>&nbsp;&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>$fql</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>048</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;callback&#8217;</CODE>&nbsp; <CODE>=&gt; </CODE><CODE>&#8221;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>049</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>050</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$fqlResult</CODE>&nbsp;&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>$param</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>051</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>052</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>catch(Exception </CODE><CODE>$o</CODE><CODE>){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>053</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>d(</CODE><CODE>$o</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>054</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>055</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>056</CODE></TD><br />
<TD><CODE>?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>057</CODE></TD><br />
<TD><CODE>&lt;!DOCTYPE html&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>058</CODE></TD><br />
<TD><CODE>&lt;html xmlns=</CODE><CODE>&#8220;<A href="http://www.w3.org/1999/xhtml" mce_href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>&#8220;</CODE> <CODE>xmlns:fb=</CODE><CODE>&#8220;<A href="http://www.facebook.com/2008/fbml" mce_href="http://www.facebook.com/2008/fbml">http://www.facebook.com/2008/fbml</A>&#8220;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>059</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;head&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>060</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;meta http-equiv=</CODE><CODE>&#8220;Content-Type&#8221;</CODE> <CODE>content=</CODE><CODE>&#8220;text/html; charset=UTF-8&#8243;</CODE><CODE>/&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>061</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;title&gt;PHP SDK &amp; Graph API base FBConnect Tutorial | Thinkdiff.net&lt;/title&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>062</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/head&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>063</CODE></TD><br />
<TD><CODE>&lt;body&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>064</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;div id=</CODE><CODE>&#8220;fb-root&#8221;</CODE><CODE>&gt;&lt;/div&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>065</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;script type=</CODE><CODE>&#8220;text/javascript&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>066</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>window.fbAsyncInit = </CODE><CODE>function</CODE><CODE>() {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>067</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>FB.init({appId: </CODE><CODE>&#8216;&lt;?=$fbconfig['</CODE><CODE>appid</CODE><CODE>' ]?&gt;&#8217;</CODE><CODE>, status: true, cookie: true, xfbml: true});</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>068</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>069</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>/* All the events registered */</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>070</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>FB.Event.subscribe(</CODE><CODE>&#8216;auth.login&#8217;</CODE><CODE>, </CODE><CODE>function</CODE><CODE>(response) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>071</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// do something with response</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>072</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>login();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>073</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>});</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>074</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>FB.Event.subscribe(</CODE><CODE>&#8216;auth.logout&#8217;</CODE><CODE>, </CODE><CODE>function</CODE><CODE>(response) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>075</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>// do something with response</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>076</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>logout();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>077</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>});</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>078</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>};</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>079</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>(</CODE><CODE>function</CODE><CODE>() {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>080</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>var</CODE> <CODE>e = document.createElement(</CODE><CODE>&#8216;script&#8217;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>081</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>e.type = </CODE><CODE>&#8216;text/javascript&#8217;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>082</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>e.src = document.location.protocol +</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>083</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;//connect.facebook.net/en_US/all.js&#8217;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>084</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>e.async = true;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>085</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>document.getElementById(</CODE><CODE>&#8216;fb-root&#8217;</CODE><CODE>).appendChild(e);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>086</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}());</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>087</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>088</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>function</CODE> <CODE>login(){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>089</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>document.location.href = </CODE><CODE>&#8220;&lt;?=$config['baseurl']?&gt;&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>090</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>091</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>function</CODE> <CODE>logout(){</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>092</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>document.location.href = </CODE><CODE>&#8220;&lt;?=$config['baseurl']?&gt;&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>093</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>094</CODE></TD><br />
<TD><CODE>&lt;/script&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>095</CODE></TD><br />
<TD><CODE>&lt;style type=</CODE><CODE>&#8220;text/css&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>096</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>.box{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>097</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>margin: 5px;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>098</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>border: 1px solid #60729b;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>099</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>padding: 5px;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>100</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>width: 500px;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>101</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>height: 200px;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>102</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>overflow:auto;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>103</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>background-color: #e6ebf8;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>104</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>105</CODE></TD><br />
<TD><CODE>&lt;/style&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>106</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>107</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;h3&gt;PHP SDK &amp; Graph API base FBConnect Tutorial | Thinkdiff.net&lt;/h3&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>108</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php </CODE><CODE>if</CODE> <CODE>(!</CODE><CODE>$fbme</CODE><CODE>) { ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>109</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>You&#8217;ve to login using FB Login Button to see api calling result.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>110</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php } ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>111</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;p&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>112</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;fb:login-button autologoutlink=</CODE><CODE>&#8220;true&#8221;</CODE> <CODE>perms=</CODE><CODE>&#8220;email,user_birthday,status_update,publish_stream&#8221;</CODE><CODE>&gt;&lt;/fb:login-button&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>113</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/p&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>114</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>115</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;!&#8211; all time check </CODE><CODE>if</CODE> <CODE>user session is valid </CODE><CODE>or</CODE> <CODE>not &#8211;&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>116</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php </CODE><CODE>if</CODE> <CODE>(</CODE><CODE>$fbme</CODE><CODE>){ ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>117</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;table border=</CODE><CODE>&#8220;0&#8243;</CODE> <CODE>cellspacing=</CODE><CODE>&#8220;3&#8243;</CODE> <CODE>cellpadding=</CODE><CODE>&#8220;3&#8243;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>118</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;tr&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>119</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>120</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;!&#8211; Data retrived from user profile are shown here &#8211;&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>121</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;div </CODE><CODE>class</CODE><CODE>=</CODE><CODE>&#8220;box&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>122</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;b&gt;User Information using Graph API&lt;/b&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>123</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php d(</CODE><CODE>$fbme</CODE><CODE>); ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>124</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/div&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>125</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>126</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>127</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;div </CODE><CODE>class</CODE><CODE>=</CODE><CODE>&#8220;box&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>128</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;b&gt;User likes these movies | using graph api&lt;/b&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>129</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php d(</CODE><CODE>$movies</CODE><CODE>); ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>130</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/div&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>131</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>132</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/tr&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>133</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;tr&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>134</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>135</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;div </CODE><CODE>class</CODE><CODE>=</CODE><CODE>&#8220;box&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>136</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;b&gt;User Information by Calling Legacy API method </CODE><CODE>&#8220;users.getinfo&#8221;</CODE><CODE>&lt;/b&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>137</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php d(</CODE><CODE>$userInfo</CODE><CODE>); ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>138</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/div&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>139</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>140</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>141</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;div </CODE><CODE>class</CODE><CODE>=</CODE><CODE>&#8220;box&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>142</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;b&gt;FQL Query Example by calling Legacy API method </CODE><CODE>&#8220;fql.query&#8221;</CODE><CODE>&lt;/b&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>143</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php d(</CODE><CODE>$fqlResult</CODE><CODE>); ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>144</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/div&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>145</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/td&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>146</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/tr&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>147</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/table&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>148</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;div </CODE><CODE>class</CODE><CODE>=</CODE><CODE>&#8220;box&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>149</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;form name=</CODE><CODE>&#8220;&#8221;</CODE> <CODE>action=</CODE><CODE>&#8220;&lt;?=$config['baseurl']?&gt;&#8221;</CODE> <CODE>method=</CODE><CODE>&#8220;post&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>150</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;label </CODE><CODE>for</CODE><CODE>=</CODE><CODE>&#8220;tt&#8221;</CODE><CODE>&gt;Status update using Graph API&lt;/label&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>151</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;br /&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>152</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;textarea id=</CODE><CODE>&#8220;tt&#8221;</CODE> <CODE>name=</CODE><CODE>&#8220;tt&#8221;</CODE> <CODE>cols=</CODE><CODE>&#8220;50&#8243;</CODE> <CODE>rows=</CODE><CODE>&#8220;5&#8243;</CODE><CODE>&gt;Write your status here </CODE><CODE>and</CODE> <CODE>click </CODE><CODE>&#8216;submit&#8217;</CODE><CODE>&lt;/textarea&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>153</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;br /&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>154</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;input type=</CODE><CODE>&#8220;submit&#8221;</CODE> <CODE>value=</CODE><CODE>&#8220;Update My Status&#8221;</CODE> <CODE>/&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>155</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/form&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>156</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php </CODE><CODE>if</CODE> <CODE>(isset(</CODE><CODE>$statusUpdate</CODE><CODE>)) { ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>157</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;br /&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>158</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;b style=</CODE><CODE>&#8220;color: red&#8221;</CODE><CODE>&gt;Status Updated Successfully! Status id is &lt;?=</CODE><CODE>$statusUpdate</CODE><CODE>[</CODE><CODE>'id'</CODE><CODE>]?&gt;&lt;/b&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>159</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php } ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>160</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/div&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>161</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php } ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>162</CODE></TD><br />
<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>163</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/body&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>164</CODE></TD><br />
<TD><CODE>&lt;/html&gt;</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV></DIV><br />
<P>The code is very easy to understand. First part contains php logic, api call and collection of data. Next part is html/javascript to view data (javascript for fbconnect authentication).</P><br />
<P>Please change</P><PRE>$config['baseurl']  =   &#8220;http://thinkdiff.net/demo/newfbconnect1/php/index.php&#8221;;</PRE><br />
<P>And set baseurl to your project url. And never forget to set your facebook application Connect URL. It would be your project url.</P><br />
<P>In index.php I used javascript based fbconnect authentication and fbml tag&nbsp; to show login button and logout button. If you don’t want to use javascript for this purpose, you can generate login/logout links using php code.</P><br />
<P>Generate login/logout button using this php code</P><br />
<DIV id=highlighter_999566><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_999566_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_999566" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>// login or logout url will be needed depending on current user state.</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>if</CODE> <CODE>(</CODE><CODE>$fbme</CODE><CODE>) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;</CODE><CODE>$logoutUrl</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;getLogoutUrl();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>} </CODE><CODE>else</CODE> <CODE>{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;</CODE><CODE>$loginUrl</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;getLoginUrl();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>6</CODE></TD><br />
<TD><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>And show the generated links by below code</P><br />
<DIV id=highlighter_920956><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_920956_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_920956" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>&lt;?php </CODE><CODE>if</CODE> <CODE>(</CODE><CODE>$fbme</CODE><CODE>) { ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;a href=</CODE><CODE>&#8220;&lt;?=$logoutUrl?&gt;&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;img src=</CODE><CODE>&#8220;<A href="http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif" mce_href="http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif">http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif</A>&#8220;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/a&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php </CODE><CODE>else</CODE><CODE>: ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>6</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;a href=</CODE><CODE>&#8220;&lt;?=$loginUrl?&gt;&#8221;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>7</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;img src=</CODE><CODE>&#8220;<A href="http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif" mce_href="http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif">http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif</A>&#8220;</CODE><CODE>&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>8</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;/a&gt;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>9</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&lt;?php } ?&gt;</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So user will see php generated login and logout button.</P><br />
<P>In the facebook.php sdk the getLoginUrl() function is defined as</P><br />
<DIV id=highlighter_83826><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_83826_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_83826" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>/ * The parameters:</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>* &#8211; next: the url to go to after a successful login</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>* &#8211; cancel_url: the url to go to after the user cancels</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>* &#8211; req_perms: comma separated list of requested extended perms</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>* &#8211; display: can be </CODE><CODE>&#8220;page&#8221;</CODE> <CODE>(</CODE><CODE>default</CODE><CODE>, full page) </CODE><CODE>or</CODE> <CODE>&#8220;popup&#8221;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>6</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>*</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>7</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>* @param Array </CODE><CODE>$params</CODE> <CODE>provide custom parameters */</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>8</CODE></TD><br />
<TD><CODE>public</CODE> <CODE>function</CODE> <CODE>getLoginUrl(</CODE><CODE>$params</CODE><CODE>=</CODE><CODE>array</CODE><CODE>()){&#8230;.}</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So if you want that your user approve additional permissions at the first time then generate the url by providing some parameters</P><br />
<DIV id=highlighter_29337><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_29337_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_29337" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>$loginUrl</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;getLoginUrl(</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>array</CODE><CODE>(</CODE><CODE>&#8216;req_perms&#8217;</CODE> <CODE>=&gt; </CODE><CODE>&#8216;email,read_stream&#8217;</CODE><CODE>)</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>Now lets discuss more about api calling…</P><br />
<P><STRONG>1. How to check valid session of user, if user successfully logged in</STRONG></P><br />
<P>I already discussed it in the STEP 1. So I think you already have learned how to check valid session of user. Just remember to use if ($fbme) {call api}</P><br />
<P><STRONG>2. How to call graph api </STRONG></P><br />
<P>Its very simple. For http://graph.facebook.com/me&nbsp; you’ve to use</P><br />
<DIV id=highlighter_630526><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_630526_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_630526" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>$fbme</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>&#8216;/me&#8217;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P><STRONG><BR>3. How to call legacy api</STRONG></P><br />
<P>This is almost same as of graph api calling.</P><br />
<DIV id=highlighter_484876><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_484876_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_484876" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>$param</CODE>&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>array</CODE><CODE>(</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;method&#8217;</CODE>&nbsp; <CODE>=&gt; </CODE><CODE>&#8216;users.getinfo&#8217;</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;uids&#8217;</CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>$fbme</CODE><CODE>[</CODE><CODE>'id'</CODE><CODE>],</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;fields&#8217;</CODE>&nbsp;&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>&#8216;name,current_location,profile_url&#8217;</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;callback&#8217;</CODE>&nbsp; <CODE>=&gt; </CODE><CODE>&#8221;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>6</CODE></TD><br />
<TD><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>7</CODE></TD><br />
<TD><CODE>$userInfo</CODE>&nbsp;&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>$param</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So $facebook-&gt;api() is used to call both graph api and old legacy api. If you check the api() method in facebook.php sdk you’ll see</P><br />
<DIV id=highlighter_504956><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_504956_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_504956" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>public</CODE> <CODE>function</CODE> <CODE>api() {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>$args</CODE> <CODE>= func_get_args();</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>if</CODE> <CODE>(</CODE><CODE>is_array</CODE><CODE>(</CODE><CODE>$args</CODE><CODE>[0])) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>return</CODE> <CODE>$this</CODE><CODE>-&gt;_restserver(</CODE><CODE>$args</CODE><CODE>[0]);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>} </CODE><CODE>else</CODE> <CODE>{</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>6</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>return</CODE> <CODE>call_user_func_array(</CODE><CODE>array</CODE><CODE>(</CODE><CODE>$this</CODE><CODE>, </CODE><CODE>&#8216;_graph&#8217;</CODE><CODE>), </CODE><CODE>$args</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>7</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>8</CODE></TD><br />
<TD><CODE>&nbsp;</CODE><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>That means if 1st argument is array then the api will call the old restserver.php&nbsp; otherwise it will call the new graph server.</P><br />
<P><STRONG>4. How to update status dynamically using graph api</STRONG></P><br />
<DIV id=highlighter_775572><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_775572_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_775572" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>try {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>$statusUpdate</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>&#8216;/me/feed&#8217;</CODE><CODE>, </CODE><CODE>&#8216;post&#8217;</CODE><CODE>, </CODE><CODE>array</CODE><CODE>(</CODE><CODE>&#8216;message&#8217;</CODE><CODE>=&gt; </CODE><CODE>&#8216;sample status message&#8217;</CODE><CODE>, </CODE><CODE>&#8216;cb&#8217;</CODE> <CODE>=&gt; </CODE><CODE>&#8221;</CODE><CODE>));</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>} catch (FacebookApiException </CODE><CODE>$e</CODE><CODE>) {</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>d(</CODE><CODE>$e</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>}</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>in facebook.php you’ll see</P><br />
<DIV id=highlighter_523647><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_523647_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_523647" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>function</CODE> <CODE>_graph(</CODE><CODE>$path</CODE><CODE>, </CODE><CODE>$method</CODE><CODE>=</CODE><CODE>&#8216;GET&#8217;</CODE><CODE>, </CODE><CODE>$params</CODE><CODE>=</CODE><CODE>array</CODE><CODE>()) {&#8230;}</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So the first parameter is for graph path in here https://graph.facebook.com<STRONG>/me/feed,</STRONG> 2nd parameter defines <STRONG>HTTP post</STRONG> or <STRONG>get </STRONG>parameter and <STRONG>3rd parameter defines array that contains necessary values</STRONG>. So ‘message’ is the message we want as status and ‘cb’ is the callback function which I set to null. Here <A href="http://developers.facebook.com/docs/api" mce_href="http://developers.facebook.com/docs/api">http://developers.facebook.com/docs/api</A> you’ll see all the information about graph api and their parameters, like</P><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TH>Method</TH><br />
<TH>Description</TH><br />
<TH>Arguments</TH></TR><br />
<TR><br />
<TD><CODE>/PROFILE_ID/feed</CODE></TD><br />
<TD>write to the given profile’s feed/wall</TD><br />
<TD><CODE>message</CODE>,&nbsp;<CODE>picture</CODE>,&nbsp;<CODE>link</CODE>,&nbsp;<CODE>name</CODE>,<CODE>description</CODE></TD></TR></TBODY></TABLE><br />
<P>So to call any graph api just check the manual if you need to pass additional parameters or not.</P><br />
<P>Another example to retrieve user favorite movie names (https://graph.facebook.com/me/movies) use</P><br />
<DIV id=highlighter_597487><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_597487_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_597487" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>$movies</CODE> <CODE>= </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>&#8216;/me/movies&#8217;</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P><STRONG>5. How to use FQL Query</STRONG></P><br />
<P>Currently I don’t find any way to call fql query using graph api. So use the technique of legacy api calling to run fql query</P><br />
<DIV id=highlighter_367380><br />
<DIV><br />
<DIV><A title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV><EMBED id=highlighter_367380_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_367380" menu="false" mce_src="http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf"></EMBED></DIV><A title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about" mce_href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>1</CODE></TD><br />
<TD><CODE>$fql</CODE>&nbsp;&nbsp;&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>&#8220;select name, hometown_location, sex, pic_square from user where uid=xxxxxxxxxxxxxxx&#8221;</CODE><CODE>;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>2</CODE></TD><br />
<TD><CODE>$param</CODE>&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>array</CODE><CODE>(</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>3</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;method&#8217;</CODE>&nbsp;&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>&#8216;fql.query&#8217;</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>4</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;query&#8217;</CODE>&nbsp;&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>$fql</CODE><CODE>,</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>5</CODE></TD><br />
<TD><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE>&#8216;callback&#8217;</CODE>&nbsp;&nbsp;&nbsp; <CODE>=&gt; </CODE><CODE>&#8221;</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>6</CODE></TD><br />
<TD><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD><CODE>7</CODE></TD><br />
<TD><CODE>$fqlResult</CODE>&nbsp;&nbsp; <CODE>=&nbsp;&nbsp; </CODE><CODE>$facebook</CODE><CODE>-&gt;api(</CODE><CODE>$param</CODE><CODE>);</CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>I hope this article will help you to understand the usage of php-sdk easily. <A href="http://thinkdiff.net/demo/newfbconnect1/php/index.php" target=_blank mce_href="http://thinkdiff.net/demo/newfbconnect1/php/index.php">Demo URL</A></P><br />
<P>&nbsp;</P><mce:script type="text/javascript"><!--<br />
jQuery(document).ready(function($) { window.setTimeout('loadTwitter_1655()',1000);window.setTimeout('loadFBShare_1655()',1000); });<br />
// --></mce:script><mce:script type="text/javascript"><!--<br />
 function loadTwitter_1655(){ jQuery(document).ready(function($) { $('.dd-twitter-1655').remove();$.getScript('http://platform.twitter.com/widgets.js'); }); } function loadFBShare_1655(){ jQuery(document).ready(function($) { $('.dd-fbshare-1655').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); }<br />
// --></mce:script><!-- Social Buttons Voted Counts Generated by Digg Digg plugin v4.5.0.2,       Author : Yong Mook Kim      Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ --><br />
<P>&nbsp;</P><br />
<H3>Related Posts</H3><br />
<UL><br />
<LI><A title="Graph api &amp; javascript base Facebook Connect tutorial" href="http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/" mce_href="http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/">Graph api &amp; javascript base Facebook Connect tutorial</A></LI><br />
<LI><A title="How to develop facebook application for iphone" href="http://thinkdiff.net/facebook/how-to-develop-facebook-application-for-iphone/" mce_href="http://thinkdiff.net/facebook/how-to-develop-facebook-application-for-iphone/">How to develop facebook application for iphone</A></LI><br />
<LI><A title="How to retrieve facebook user’s friendlist " href="http://thinkdiff.net/facebook/how-to-retrieve-facebook-users-friendlist/" mce_href="http://thinkdiff.net/facebook/how-to-retrieve-facebook-users-friendlist/">How to retrieve facebook user’s friendlist </A></LI></UL><!--
<p>Tags: <a href="http://thinkdiff.net/tag/facebook-graph-api/" mce_href="http://thinkdiff.net/tag/facebook-graph-api/" rel="tag">facebook graph api</a>, <a href="http://thinkdiff.net/tag/facebook-php/" mce_href="http://thinkdiff.net/tag/facebook-php/" rel="tag">facebook php</a>, <a href="http://thinkdiff.net/tag/graph-api/" mce_href="http://thinkdiff.net/tag/graph-api/" rel="tag">graph api</a>, <a href="http://thinkdiff.net/tag/php-sdk-facebook/" mce_href="http://thinkdiff.net/tag/php-sdk-facebook/" rel="tag">php sdk facebook</a></p>
<p> &#8211;><br />
<P>If you think this article kicked ass, <STRONG><A href="http://feeds.feedburner.com/Thinkdiffnet" mce_href="http://feeds.feedburner.com/Thinkdiffnet">subscribe to the RSS feed</A></STRONG> or <STRONG><A href="http://twitter.com/mahmudahsan" mce_href="http://twitter.com/mahmudahsan">follow me on Twitter!</A></STRONG> Share with your friends, or leave a comment below (or better still, do both!)<SPAN id=_marker>&nbsp;</SPAN></P><br />
<P>In this article I’m focusing facebook latest <A href="http://github.com/facebook/php-sdk/" target=_blank>php sdk</A> to integrate facebook features in your site. Some days ago facebook released their new graph api system and updated their core structure. They also officially released<A href="http://github.com/facebook/php-sdk/" target=_blank> php sdk </A>so that you can easily call facebook latest graph api and old legacy api from server side by php.</P><br />
<P>Before proceeding first have a look <A href="http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/" target=_blank>my previous article </A>specially <STRONG>Facebook connect authentication part. </STRONG></P><br />
<P>In this post I’ll show</P><br />
<OL><br />
<LI>How to check valid session of user, if user successfully logged in</LI><br />
<LI>How to call <A href="http://developers.facebook.com/docs/api" target=_blank>graph api </A></LI><br />
<LI>How to call<A href="http://developers.facebook.com/docs/reference/rest/" target=_blank> legacy api</A></LI><br />
<LI>How to update status dynamically using graph api</LI><br />
<LI>How to use <A href="http://developers.facebook.com/docs/reference/fql/" target=_blank>FQL Query</A></LI></OL><br />
<P>So take a look <A href="http://thinkdiff.net/demo/newfbconnect1/php/index.php" target=_blank>my demo of this tutorial</A>. Please login by FBConnect and approve all the permission if you’re first time accessing the page.</P><br />
<P><SPAN id=more-1655></SPAN></P><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG>STEP 1:</STRONG></SPAN></P><br />
<P>First download the <A href="http://github.com/facebook/php-sdk/" target=_blank>php sdk libary from here</A> . Now copy the facebook.php from /src/ to your project dir.</P><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG>STEP 2:</STRONG></SPAN></P><br />
<P>Create a file named <STRONG>fbmain.php</STRONG>. And copy below code to this file.</P><br />
<DIV id=highlighter_831681 class="syntaxhighlighter  php"><br />
<DIV class="bar                           "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_831681_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_831681" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">01</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;?php</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">02</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fbconfig</CODE><CODE class="php plain">[</CODE><CODE class="php string">'appid'</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">]&nbsp; = </CODE><CODE class="php string">&#8220;your application id&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">03</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fbconfig</CODE><CODE class="php plain">[</CODE><CODE class="php string">'api'</CODE></FONT></FONT>&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">]&nbsp; = </CODE><CODE class="php string">&#8220;your application api key&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">04</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fbconfig</CODE><CODE class="php plain">[</CODE><CODE class="php string">'secret'</CODE><CODE class="php plain">]&nbsp; = </CODE><CODE class="php string">&#8220;your application secret key&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">05</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">06</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">try{</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">07</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">include_once</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php string">&#8220;facebook.php&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">08</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">09</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">catch(Exception </CODE><CODE class="php variable">$o</CODE><CODE class="php plain">){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">10</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php functions">echo</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php string">&#8216;&lt;pre&gt;&#8217;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">11</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">print_r(</CODE><CODE class="php variable">$o</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">12</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php functions">echo</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php string">&#8216;&lt;/pre&gt;&#8217;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">13</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">14</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// Create our Application instance.</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">15</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$facebook</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php keyword">new</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">Facebook(</CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">16</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;appId&#8217;</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$fbconfig</CODE><CODE class="php plain">[</CODE><CODE class="php string">'appid'</CODE><CODE class="php plain">],</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">17</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;secret&#8217;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$fbconfig</CODE><CODE class="php plain">[</CODE><CODE class="php string">'secret'</CODE><CODE class="php plain">],</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">18</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;cookie&#8217;</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">=&gt; true,</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">19</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">));</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">20</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">21</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// We may or may not have this data based on a $_GET or $_COOKIE based session.</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">22</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// If we get a session here, it means we found a correctly signed session using</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">23</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// the Application Secret only Facebook and the Application know. We dont know</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">24</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// if it is still valid until we make an API call using the session. A session</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">25</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// can become invalid if it has already expired (should not be getting the</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">26</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// session back in this case) or if the user logged out of Facebook.</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">27</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$session</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;getSession();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">28</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">29</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fbme</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">= null;</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">30</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// Session based graph API call.</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">31</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php variable">$session</CODE><CODE class="php plain">) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">32</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">try {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">33</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$uid</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;getUser();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">34</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fbme</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php string">&#8216;/me&#8217;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">35</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">} catch (FacebookApiException </CODE><CODE class="php variable">$e</CODE><CODE class="php plain">) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">36</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">d(</CODE><CODE class="php variable">$e</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">37</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">38</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">39</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">40</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">function</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">d(</CODE><CODE class="php variable">$d</CODE><CODE class="php plain">){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">41</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php functions">echo</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php string">&#8216;&lt;pre&gt;&#8217;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">42</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">print_r(</CODE><CODE class="php variable">$d</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">43</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php functions">echo</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php string">&#8216;&lt;/pre&gt;&#8217;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">44</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">45</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">?&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>First update $fbconfig array by your application’s id, api key and secret key. In the code you’ll see I included facebook.php by include_once. If your server has no curl extension and json extension, you’ll see error message. Until you don’t install curl and json extension this sdk will not work.</P><PRE> $session = $facebook-&gt;getSession();</PRE><br />
<P>This method returns session information of user. It may be empty if user yet not logged in your site or user’s session is invalid. To check user’s session validity you’ve to first call an api, if user’s session is valid then the api will return result.</P><br />
<P>So<STRONG> if <SPAN style="COLOR: rgb(128,0,0)">$fbme is not null</SPAN> that means user successfully logged in via facebook</STRONG> and <STRONG>user’s session is valid</STRONG>. So before calling any api use conditional logic like if ($fbme) { then call api}.</P><br />
<P>I also defined a method named <STRONG>d()</STRONG> to dump data quickly.</P><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG>STEP 3:</STRONG></SPAN></P><br />
<P>Now create another file named index.php and copy below code and checkout my description at the end.</P><br />
<DIV style="HEIGHT: 500px; OVERFLOW: auto"><br />
<DIV id=highlighter_311812 class="syntaxhighlighter  php"><br />
<DIV class="bar                                                                                                                                                     "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_311812_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_311812" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">001</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;?php</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">002</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">include_once</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php string">&#8220;fbmain.php&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">003</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT face="Courier New"><FONT color=#000000><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$config</CODE><CODE class="php plain">[</CODE><CODE class="php string">'baseurl'</CODE><CODE class="php plain">]&nbsp; =&nbsp;&nbsp; </CODE></FONT><CODE class="php string"><FONT color=#000000>&#8220;</FONT><A href="http://thinkdiff.net/demo/newfbconnect1/php/index.php">http://thinkdiff.net/demo/newfbconnect1/php/index.php</A><FONT color=#000000>&#8220;</FONT></CODE><CODE class="php plain"><FONT color=#000000>;</FONT></CODE></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">004</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">005</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//if user is logged in and session is valid.</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">006</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">007</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//Retriving movies those are user like using graph api</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">008</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">try{</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">009</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$movies</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php string">&#8216;/me/movies&#8217;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">010</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">011</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">catch(Exception </CODE><CODE class="php variable">$o</CODE><CODE class="php plain">){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">012</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">d(</CODE><CODE class="php variable">$o</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">013</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">014</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">015</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//Calling users.getinfo legacy api call example</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">016</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">try{</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">017</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$param</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">018</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;method&#8217;</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;users.getinfo&#8217;</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">019</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;uids&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">[</CODE><CODE class="php string">'id'</CODE><CODE class="php plain">],</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">020</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;fields&#8217;</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;name,current_location,profile_url&#8217;</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">021</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;callback&#8217;</CODE><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8221;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">022</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">023</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$userInfo</CODE></FONT></FONT>&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php variable">$param</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">024</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">025</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">catch(Exception </CODE><CODE class="php variable">$o</CODE><CODE class="php plain">){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">026</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">d(</CODE><CODE class="php variable">$o</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">027</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">028</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">029</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//update user&#8217;s status using graph api</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">030</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(isset(</CODE><CODE class="php variable">$_POST</CODE><CODE class="php plain">[</CODE><CODE class="php string">'tt'</CODE><CODE class="php plain">])){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">031</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">try {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">032</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$statusUpdate</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php string">&#8216;/me/feed&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php string">&#8216;post&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE><CODE class="php string">&#8216;message&#8217;</CODE><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$_POST</CODE><CODE class="php plain">[</CODE><CODE class="php string">'tt'</CODE><CODE class="php plain">], </CODE><CODE class="php string">&#8216;cb&#8217;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8221;</CODE><CODE class="php plain">));</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">033</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">} catch (FacebookApiException </CODE><CODE class="php variable">$e</CODE><CODE class="php plain">) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">034</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">d(</CODE><CODE class="php variable">$e</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">035</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">036</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">037</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">038</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//fql query example using legacy method call and passing parameter</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">039</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">try{</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">040</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//get user id</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">041</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$uid</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;getUser();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">042</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">//or you can use $uid = $fbme['id'];</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">043</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">044</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fql</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php string">&#8220;select name, hometown_location, sex, pic_square from user where uid=&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">. </CODE><CODE class="php variable">$uid</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">045</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$param</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">046</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;method&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;fql.query&#8217;</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">047</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;query&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$fql</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">048</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;callback&#8217;</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8221;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">049</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">050</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$fqlResult</CODE></FONT></FONT>&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php variable">$param</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">051</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">052</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">catch(Exception </CODE><CODE class="php variable">$o</CODE><CODE class="php plain">){</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">053</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">d(</CODE><CODE class="php variable">$o</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">054</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">055</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">056</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">?&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">057</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;!DOCTYPE html&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">058</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT face="Courier New"><CODE class="php plain"><FONT color=#000000>&lt;html xmlns=</FONT></CODE><CODE class="php string"><FONT color=#000000>&#8220;</FONT><A href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A><FONT color=#000000>&#8220;</FONT></CODE></FONT> <FONT face="Courier New"><CODE class="php plain"><FONT color=#000000>xmlns:fb=</FONT></CODE><CODE class="php string"><FONT color=#000000>&#8220;</FONT><A href="http://www.facebook.com/2008/fbml">http://www.facebook.com/2008/fbml</A><FONT color=#000000>&#8220;</FONT></CODE><CODE class="php plain"><FONT color=#000000>&gt;</FONT></CODE></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">059</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;head&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">060</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;meta http-equiv=</CODE><CODE class="php string">&#8220;Content-Type&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">content=</CODE><CODE class="php string">&#8220;text/html; charset=UTF-8&#8243;</CODE><CODE class="php plain">/&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">061</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;title&gt;PHP SDK &amp; Graph API base FBConnect Tutorial | Thinkdiff.net&lt;/title&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">062</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/head&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">063</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;body&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">064</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;div id=</CODE><CODE class="php string">&#8220;fb-root&#8221;</CODE><CODE class="php plain">&gt;&lt;/div&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">065</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;script type=</CODE><CODE class="php string">&#8220;text/javascript&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">066</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">window.fbAsyncInit = </CODE><CODE class="php keyword">function</CODE><CODE class="php plain">() {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">067</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">FB.init({appId: </CODE><CODE class="php string">&#8216;&lt;?=$fbconfig['</CODE><CODE class="php plain">appid</CODE><CODE class="php string">' ]?&gt;&#8217;</CODE><CODE class="php plain">, status: true, cookie: true, xfbml: true});</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">068</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">069</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">/* All the events registered */</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">070</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">FB.Event.subscribe(</CODE><CODE class="php string">&#8216;auth.login&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php keyword">function</CODE><CODE class="php plain">(response) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">071</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// do something with response</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">072</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">login();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">073</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">});</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">074</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">FB.Event.subscribe(</CODE><CODE class="php string">&#8216;auth.logout&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php keyword">function</CODE><CODE class="php plain">(response) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">075</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php comments">// do something with response</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">076</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">logout();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">077</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">});</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">078</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">};</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">079</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">(</CODE><CODE class="php keyword">function</CODE><CODE class="php plain">() {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">080</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">var</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">e = document.createElement(</CODE><CODE class="php string">&#8216;script&#8217;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">081</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">e.type = </CODE><CODE class="php string">&#8216;text/javascript&#8217;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">082</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">e.src = document.location.protocol +</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">083</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;//connect.facebook.net/en_US/all.js&#8217;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">084</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">e.async = true;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">085</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">document.getElementById(</CODE><CODE class="php string">&#8216;fb-root&#8217;</CODE><CODE class="php plain">).appendChild(e);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">086</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}());</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">087</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">088</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">function</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">login(){</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">089</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">document.location.href = </CODE><CODE class="php string">&#8220;&lt;?=$config['baseurl']?&gt;&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">090</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">091</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">function</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">logout(){</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">092</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">document.location.href = </CODE><CODE class="php string">&#8220;&lt;?=$config['baseurl']?&gt;&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">093</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">094</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;/script&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">095</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class="php plain">&lt;style type=</CODE><CODE class="php string">&#8220;text/css&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">096</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">.box{</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">097</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">margin: 5px;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">098</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">border: 1px solid #60729b;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">099</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">padding: 5px;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">100</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">width: 500px;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">101</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">height: 200px;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">102</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">overflow:auto;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">103</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">background-color: #e6ebf8;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">104</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">105</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;/style&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">106</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">107</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;h3&gt;PHP SDK &amp; Graph API base FBConnect Tutorial | Thinkdiff.net&lt;/h3&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">108</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php </CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(!</CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">) { ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">109</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">You&#8217;ve to login using FB Login Button to see api calling result.</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">110</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php } ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">111</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;p&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">112</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;fb:login-button autologoutlink=</CODE><CODE class="php string">&#8220;true&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">perms=</CODE><CODE class="php string">&#8220;email,user_birthday,status_update,publish_stream&#8221;</CODE><CODE class="php plain">&gt;&lt;/fb:login-button&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">113</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/p&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">114</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">115</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;!&#8211; all time check </CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">user session is valid </CODE><CODE class="php keyword">or</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">not &#8211;&gt;</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">116</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php </CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">){ ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">117</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;table border=</CODE><CODE class="php string">&#8220;0&#8243;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">cellspacing=</CODE><CODE class="php string">&#8220;3&#8243;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">cellpadding=</CODE><CODE class="php string">&#8220;3&#8243;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">118</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;tr&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">119</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">120</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;!&#8211; Data retrived from user profile are shown here &#8211;&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">121</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;div </CODE><CODE class="php keyword">class</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8220;box&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">122</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;b&gt;User Information using Graph API&lt;/b&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">123</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php d(</CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">); ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">124</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/div&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">125</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">126</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">127</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;div </CODE><CODE class="php keyword">class</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8220;box&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">128</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;b&gt;User likes these movies | using graph api&lt;/b&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">129</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php d(</CODE><CODE class="php variable">$movies</CODE><CODE class="php plain">); ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">130</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/div&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">131</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">132</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/tr&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">133</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;tr&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">134</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">135</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;div </CODE><CODE class="php keyword">class</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8220;box&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">136</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;b&gt;User Information by Calling Legacy API method </CODE><CODE class="php string">&#8220;users.getinfo&#8221;</CODE><CODE class="php plain">&lt;/b&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">137</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php d(</CODE><CODE class="php variable">$userInfo</CODE><CODE class="php plain">); ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">138</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/div&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">139</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">140</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">141</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;div </CODE><CODE class="php keyword">class</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8220;box&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">142</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;b&gt;FQL Query Example by calling Legacy API method </CODE><CODE class="php string">&#8220;fql.query&#8221;</CODE><CODE class="php plain">&lt;/b&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">143</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php d(</CODE><CODE class="php variable">$fqlResult</CODE><CODE class="php plain">); ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">144</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/div&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">145</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/td&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">146</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/tr&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">147</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/table&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">148</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;div </CODE><CODE class="php keyword">class</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8220;box&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">149</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;form name=</CODE><CODE class="php string">&#8220;&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">action=</CODE><CODE class="php string">&#8220;&lt;?=$config['baseurl']?&gt;&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">method=</CODE><CODE class="php string">&#8220;post&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">150</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;label </CODE><CODE class="php keyword">for</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8220;tt&#8221;</CODE><CODE class="php plain">&gt;Status update using Graph API&lt;/label&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">151</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;br /&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">152</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;textarea id=</CODE><CODE class="php string">&#8220;tt&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">name=</CODE><CODE class="php string">&#8220;tt&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">cols=</CODE><CODE class="php string">&#8220;50&#8243;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">rows=</CODE><CODE class="php string">&#8220;5&#8243;</CODE><CODE class="php plain">&gt;Write your status here </CODE><CODE class="php keyword">and</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">click </CODE><CODE class="php string">&#8216;submit&#8217;</CODE><CODE class="php plain">&lt;/textarea&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">153</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;br /&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">154</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;input type=</CODE><CODE class="php string">&#8220;submit&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">value=</CODE><CODE class="php string">&#8220;Update My Status&#8221;</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">/&gt;</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">155</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/form&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">156</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php </CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(isset(</CODE><CODE class="php variable">$statusUpdate</CODE><CODE class="php plain">)) { ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">157</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;br /&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">158</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;b style=</CODE><CODE class="php string">&#8220;color: red&#8221;</CODE><CODE class="php plain">&gt;Status Updated Successfully! Status id is &lt;?=</CODE><CODE class="php variable">$statusUpdate</CODE><CODE class="php plain">[</CODE><CODE class="php string">'id'</CODE><CODE class="php plain">]?&gt;&lt;/b&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">159</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php } ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">160</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/div&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">161</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php } ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">162</FONT></CODE></TD><br />
<TD class=content>&nbsp;</TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">163</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/body&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">164</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">&lt;/html&gt;</FONT></CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV></DIV><br />
<P>The code is very easy to understand. First part contains php logic, api call and collection of data. Next part is html/javascript to view data (javascript for fbconnect authentication).</P><br />
<P>Please change</P><PRE>$config['baseurl']  =   &#8220;http://thinkdiff.net/demo/newfbconnect1/php/index.php&#8221;;</PRE><br />
<P>And set baseurl to your project url. And <SPAN style="COLOR: rgb(128,0,0)">never forget</SPAN> to set your <SPAN style="COLOR: rgb(0,0,128)">facebook application Connect URL</SPAN>. It would be your project url.</P><br />
<P>In index.php I used javascript based fbconnect authentication and fbml tag&nbsp; to show login button and logout button. If you don’t want to use javascript for this purpose, you can generate login/logout links using php code.</P><br />
<P>Generate login/logout button using this php code</P><br />
<DIV id=highlighter_999566 class="syntaxhighlighter  php"><br />
<DIV class="bar "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_999566_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_999566" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><CODE class="php comments"><FONT color=#000000 size=3 face="Courier New">// login or logout url will be needed depending on current user state.</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php keyword"><FONT color=#000000 face="Courier New">if</FONT></CODE> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;</CODE><CODE class="php variable">$logoutUrl</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;getLogoutUrl();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class="php plain">} </CODE><CODE class="php keyword">else</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">{</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;</CODE><CODE class="php variable">$loginUrl</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;getLoginUrl();</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">6</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">}</FONT></CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>And show the generated links by below code</P><br />
<DIV id=highlighter_920956 class="syntaxhighlighter  php"><br />
<DIV class="bar        "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_920956_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_920956" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class="php plain">&lt;?php </CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">) { ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;a href=</CODE><CODE class="php string">&#8220;&lt;?=$logoutUrl?&gt;&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT face="Courier New"><FONT color=#000000><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;img src=</CODE></FONT><CODE class="php string"><FONT color=#000000>&#8220;</FONT><A href="http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif">http://static.ak.fbcdn.net/rsrc.php/z2Y31/hash/cxrz4k7j.gif</A><FONT color=#000000>&#8220;</FONT></CODE><CODE class="php plain"><FONT color=#000000>&gt;</FONT></CODE></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/a&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php </CODE><CODE class="php keyword">else</CODE><CODE class="php plain">: ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">6</FONT></CODE></TD><br />
<TD class=content><FONT color=#000000><FONT size=3><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;a href=</CODE><CODE class="php string">&#8220;&lt;?=$loginUrl?&gt;&#8221;</CODE><CODE class="php plain">&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">7</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT face="Courier New"><FONT color=#000000><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;img src=</CODE></FONT><CODE class="php string"><FONT color=#000000>&#8220;</FONT><A href="http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif">http://static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif</A><FONT color=#000000>&#8220;</FONT></CODE><CODE class="php plain"><FONT color=#000000>&gt;</FONT></CODE></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">8</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;/a&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">9</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">&lt;?php } ?&gt;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So user will see php generated login and logout button.</P><br />
<P>In the facebook.php sdk the getLoginUrl() function is defined as</P><br />
<DIV id=highlighter_83826 class="syntaxhighlighter  php"><br />
<DIV class=bar><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_83826_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_83826" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">/ * The parameters:</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">* &#8211; next: the url to go to after a successful login</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">* &#8211; cancel_url: the url to go to after the user cancels</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">* &#8211; req_perms: comma separated list of requested extended perms</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">* &#8211; display: can be </CODE><CODE class="php string">&#8220;page&#8221;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php keyword">default</CODE><CODE class="php plain">, full page) </CODE><CODE class="php keyword">or</CODE></FONT></FONT> <CODE class="php string"><FONT color=#000000 face="Courier New">&#8220;popup&#8221;</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">6</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">*</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">7</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">* @param Array </CODE><CODE class="php variable">$params</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">provide custom parameters */</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">8</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php keyword"><FONT color=#000000 face="Courier New">public</FONT></CODE> <CODE class="php keyword"><FONT color=#000000 face="Courier New">function</FONT></CODE> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">getLoginUrl(</CODE><CODE class="php variable">$params</CODE><CODE class="php plain">=</CODE><CODE class="php keyword">array</CODE><CODE class="php plain">()){&#8230;.}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So if you want that your user approve additional permissions at the first time then generate the url by providing some parameters</P><br />
<DIV id=highlighter_29337 class="syntaxhighlighter  php"><br />
<DIV class=bar><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_29337_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_29337" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$loginUrl</FONT></CODE> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;getLoginUrl(</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE><CODE class="php string">&#8216;req_perms&#8217;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;email,read_stream&#8217;</CODE><CODE class="php plain">)</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">);</FONT></CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>Now lets discuss more about api calling…</P><br />
<P><STRONG><SPAN style="TEXT-DECORATION: underline">1. How to check valid session of user, if user successfully logged in</SPAN></STRONG></P><br />
<P>I already discussed it in the STEP 1. So I think you already have learned how to check valid session of user. Just remember to use if ($fbme) {call api}</P><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG>2. How to call graph api </STRONG></SPAN></P><br />
<P>Its very simple. For http://graph.facebook.com/me&nbsp; you’ve to use</P><br />
<DIV id=highlighter_630526 class="syntaxhighlighter  php"><br />
<DIV class="bar  "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_630526_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_630526" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$fbme</FONT></CODE> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php string">&#8216;/me&#8217;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG><BR>3. How to call legacy api</STRONG></SPAN></P><br />
<P>This is almost same as of graph api calling.</P><br />
<DIV id=highlighter_484876 class="syntaxhighlighter  php"><br />
<DIV class="bar                  "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_484876_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_484876" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$param</FONT></CODE>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;method&#8217;</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;users.getinfo&#8217;</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;uids&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$fbme</CODE><CODE class="php plain">[</CODE><CODE class="php string">'id'</CODE><CODE class="php plain">],</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;fields&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;name,current_location,profile_url&#8217;</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;callback&#8217;</CODE></FONT></FONT>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8221;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">6</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">);</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">7</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$userInfo</FONT></CODE>&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php variable">$param</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So $facebook-&gt;api() is used to call both graph api and old legacy api. If you check the api() method in facebook.php sdk you’ll see</P><br />
<DIV id=highlighter_504956 class="syntaxhighlighter  php"><br />
<DIV class="bar               "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_504956_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_504956" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php keyword"><FONT color=#000000 face="Courier New">public</FONT></CODE> <CODE class="php keyword"><FONT color=#000000 face="Courier New">function</FONT></CODE> <CODE class="php plain"><FONT color=#000000 face="Courier New">api() {</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$args</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">= func_get_args();</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">if</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">(</CODE><CODE class="php functions">is_array</CODE><CODE class="php plain">(</CODE><CODE class="php variable">$args</CODE><CODE class="php plain">[0])) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">return</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php variable">$this</CODE><CODE class="php plain">-&gt;_restserver(</CODE><CODE class="php variable">$args</CODE><CODE class="php plain">[0]);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">} </CODE><CODE class="php keyword">else</CODE></FONT></FONT> <CODE class="php plain"><FONT color=#000000 face="Courier New">{</FONT></CODE></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">6</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php keyword">return</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">call_user_func_array(</CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE><CODE class="php variable">$this</CODE><CODE class="php plain">, </CODE><CODE class="php string">&#8216;_graph&#8217;</CODE><CODE class="php plain">), </CODE><CODE class="php variable">$args</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">7</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">8</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;</CODE><CODE class="php plain">}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>That means if 1st argument is array then the api will call the old restserver.php&nbsp; otherwise it will call the new graph server.</P><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG>4. How to update status dynamically using graph api</STRONG></SPAN></P><br />
<DIV id=highlighter_775572 class="syntaxhighlighter  php"><br />
<DIV class="bar  "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_775572_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_775572" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">try {</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php variable">$statusUpdate</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php string">&#8216;/me/feed&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php string">&#8216;post&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE><CODE class="php string">&#8216;message&#8217;</CODE><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;sample status message&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php string">&#8216;cb&#8217;</CODE></FONT></FONT> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8221;</CODE><CODE class="php plain">));</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class="php plain">} catch (FacebookApiException </CODE><CODE class="php variable">$e</CODE><CODE class="php plain">) {</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php plain">d(</CODE><CODE class="php variable">$e</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">}</FONT></CODE></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>in facebook.php you’ll see</P><br />
<DIV id=highlighter_523647 class="syntaxhighlighter  php"><br />
<DIV class="bar "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_523647_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_523647" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php keyword"><FONT color=#000000 face="Courier New">function</FONT></CODE> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">_graph(</CODE><CODE class="php variable">$path</CODE><CODE class="php plain">, </CODE><CODE class="php variable">$method</CODE><CODE class="php plain">=</CODE><CODE class="php string">&#8216;GET&#8217;</CODE><CODE class="php plain">, </CODE><CODE class="php variable">$params</CODE><CODE class="php plain">=</CODE><CODE class="php keyword">array</CODE><CODE class="php plain">()) {&#8230;}</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>So the first parameter is for graph path in here https://graph.facebook.com<STRONG>/me/feed,</STRONG> 2nd parameter defines <STRONG>HTTP post</STRONG> or <STRONG>get </STRONG>parameter and <STRONG>3rd parameter defines array that contains necessary values</STRONG>. So ‘message’ is the message we want as status and ‘cb’ is the callback function which I set to null. Here <A href="http://developers.facebook.com/docs/api">http://developers.facebook.com/docs/api</A> you’ll see all the information about graph api and their parameters, like</P><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TH>Method</TH><br />
<TH>Description</TH><br />
<TH>Arguments</TH></TR><br />
<TR><br />
<TD><CODE><FONT color=#000000 size=3 face="Courier New">/PROFILE_ID/feed</FONT></CODE></TD><br />
<TD>write to the given profile’s feed/wall</TD><br />
<TD><FONT size=3><CODE><FONT color=#000000 face="Courier New">message</FONT></CODE>,&nbsp;<CODE><FONT color=#000000 face="Courier New">picture</FONT></CODE>,&nbsp;<CODE><FONT color=#000000 face="Courier New">link</FONT></CODE>,&nbsp;<CODE><FONT color=#000000 face="Courier New">name</FONT></CODE>,<CODE><FONT color=#000000 face="Courier New">description</FONT></CODE></FONT></TD></TR></TBODY></TABLE><br />
<P>So to call any graph api just check the manual if you need to pass additional parameters or not.</P><br />
<P>Another example to retrieve user favorite movie names (https://graph.facebook.com/me/movies) use</P><br />
<DIV id=highlighter_597487 class="syntaxhighlighter  php"><br />
<DIV class="bar "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_597487_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_597487" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$movies</FONT></CODE> <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">= </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php string">&#8216;/me/movies&#8217;</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P><SPAN style="TEXT-DECORATION: underline"><STRONG>5. How to use FQL Query</STRONG></SPAN></P><br />
<P>Currently I don’t find any way to call fql query using graph api. So use the technique of legacy api calling to run fql query</P><br />
<DIV id=highlighter_367380 class="syntaxhighlighter  php"><br />
<DIV class="bar "><br />
<DIV class=toolbar><A style="WIDTH: 16px; HEIGHT: 16px" class="item viewSource" title="view source" href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#viewSource">view source</A><br />
<DIV class="item copyToClipboard"><EMBED id=highlighter_367380_clipboard title="copy to clipboard" height=16 type=application/x-shockwave-flash width=16 src=http://thinkdiff.net/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf menu="false" flashvars="highlighterId=highlighter_367380" wmode="transparent" allowscriptaccess="always"></DIV><A style="WIDTH: 16px; HEIGHT: 16px" class="item printSource" title=print href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#printSource">print</A><A style="WIDTH: 16px; HEIGHT: 16px" class="item about" title=? href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/#about">?</A></DIV></DIV><br />
<DIV class=lines><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">1</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$fql</FONT></CODE>&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php string">&#8220;select name, hometown_location, sex, pic_square from user where uid=xxxxxxxxxxxxxxx&#8221;</CODE><CODE class="php plain">;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">2</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$param</FONT></CODE>&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php keyword">array</CODE><CODE class="php plain">(</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">3</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;method&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8216;fql.query&#8217;</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">4</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;query&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php variable">$fql</CODE><CODE class="php plain">,</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">5</FONT></CODE></TD><br />
<TD class=content><FONT size=3><FONT color=#000000><FONT face="Courier New"><CODE class=spaces>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</CODE><CODE class="php string">&#8216;callback&#8217;</CODE></FONT></FONT>&nbsp;&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&gt; </CODE><CODE class="php string">&#8221;</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt2"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">6</FONT></CODE></TD><br />
<TD class=content><CODE class="php plain"><FONT color=#000000 size=3 face="Courier New">);</FONT></CODE></TD></TR></TBODY></TABLE></DIV><br />
<DIV class="line alt1"><br />
<TABLE><br />
<TBODY><br />
<TR><br />
<TD class=number><CODE><FONT color=#000000 size=3 face="Courier New">7</FONT></CODE></TD><br />
<TD class=content><FONT size=3><CODE class="php variable"><FONT color=#000000 face="Courier New">$fqlResult</FONT></CODE>&nbsp;&nbsp; <FONT color=#000000><FONT face="Courier New"><CODE class="php plain">=&nbsp;&nbsp; </CODE><CODE class="php variable">$facebook</CODE><CODE class="php plain">-&gt;api(</CODE><CODE class="php variable">$param</CODE><CODE class="php plain">);</CODE></FONT></FONT></FONT></TD></TR></TBODY></TABLE></DIV></DIV></DIV><br />
<P>I hope this article will help you to understand the usage of php-sdk easily. <A href="http://thinkdiff.net/demo/newfbconnect1/php/index.php" target=_blank>Demo URL</A></P><br />
<P style="TEXT-ALIGN: center"><IMG class=wp-smiley alt=:) src="http://thinkdiff.net/wp-includes/images/smilies/icon_smile.gif"> </P><br />
<SCRIPT type=text/javascript>jQuery(document).ready(function($) { window.setTimeout(&#8216;loadTwitter_1655()&#8217;,1000);window.setTimeout(&#8216;loadFBShare_1655()&#8217;,1000); });</SCRIPT></p>
<p><SCRIPT type=text/javascript> function loadTwitter_1655(){ jQuery(document).ready(function($) { $(&#8216;.dd-twitter-1655&#8242;).remove();$.getScript(&#8216;http://platform.twitter.com/widgets.js&#8217;); }); } function loadFBShare_1655(){ jQuery(document).ready(function($) { $(&#8216;.dd-fbshare-1655&#8242;).remove(); $.getScript(&#8216;http://static.ak.fbcdn.net/connect.php/js/FB.Share&#8217;); }); }</SCRIPT><br />
<!-- Social Buttons Voted Counts Generated by Digg Digg plugin v4.5.0.2, </p>
<p>    Author : Yong Mook Kim</p>
<p>    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ --><br />
<P><SPAN class=st_facebook_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_twitter_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_linkedin_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_stumbleupon_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_delicious_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_ybuzz_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_mixx_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_technorati_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN><SPAN class=st_sharethis_large displaytext="share" st_url="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/" st_title="PHP SDK &amp; Graph API base Facebook Connect Tutorial"></SPAN></P><br />
<H3 class=related_post_title>Related Posts</H3><br />
<UL class=related_post><br />
<LI><A title="Graph api &amp; javascript base Facebook Connect tutorial" href="http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/">Graph api &amp; javascript base Facebook Connect tutorial</A></LI><br />
<LI><A title="How to develop facebook application for iphone" href="http://thinkdiff.net/facebook/how-to-develop-facebook-application-for-iphone/">How to develop facebook application for iphone</A></LI><br />
<LI><A title="How to retrieve facebook user’s friendlist " href="http://thinkdiff.net/facebook/how-to-retrieve-facebook-users-friendlist/">How to retrieve facebook user’s friendlist </A></LI></UL><!--
<p class="tags">Tags: <a href="http://thinkdiff.net/tag/facebook-graph-api/" rel="tag">facebook graph api</a>, <a href="http://thinkdiff.net/tag/facebook-php/" rel="tag">facebook php</a>, <a href="http://thinkdiff.net/tag/graph-api/" rel="tag">graph api</a>, <a href="http://thinkdiff.net/tag/php-sdk-facebook/" rel="tag">php sdk facebook</a></p>
<p> &#8211;><br />
<P>If you think this article kicked ass, <B><A href="http://feeds.feedburner.com/Thinkdiffnet">subscribe to the RSS feed</A></B> or <B><A href="http://twitter.com/mahmudahsan">follow me on Twitter!</A></B> Share with your friends, or leave a comment below (or better still, do both!) </P></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/11/16/php-sdk-graph-api-base-facebook-connect-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tour de Flex</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/11/06/tour-de-flex/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/11/06/tour-de-flex/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 17:54:12 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex / Flash Builder]]></category>
		<category><![CDATA[Library / Plugin]]></category>
		<category><![CDATA[Useful Website]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=270</guid>
		<description><![CDATA[http://www.adobe.com/devnet/flex/tourdeflex.html Tour de Flex is a desktop application for exploring Flex capabilities and resources, including the core Flex components, Adobe AIR, data integration, and a variety of third-party components, effects, skins, and more. Tour de Flex has three primary goals: &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/11/06/tour-de-flex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.adobe.com/devnet/flex/tourdeflex.html">http://www.adobe.com/devnet/flex/tourdeflex.html</a></p>
<p>Tour de Flex is a desktop application for exploring Flex capabilities and resources, including the core Flex components, Adobe AIR, data integration, and a variety of third-party components, effects, skins, and more.</p>
<p>Tour de Flex has three primary goals:</p>
<ul>
<li>Provide non-Flex developers with an overview of what is possible in Flex in a &#8220;look and see&#8221; environment</li>
<li>Provide Flex developers with an illustrated reference tool</li>
<li>Provide commercial and non-commercial Flex developers with a place to showcase their work</li>
</ul>
<p>System requirements:</p>
<ul>
<li>Microsoft Windows, Mac OS X, or Linux</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/11/06/tour-de-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Collada</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/10/15/open-collada/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/10/15/open-collada/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 17:15:52 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[3D Graphics]]></category>
		<category><![CDATA[3DSMax]]></category>
		<category><![CDATA[Library / Plugin]]></category>
		<category><![CDATA[Useful Website]]></category>
		<category><![CDATA[Open Collada]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=266</guid>
		<description><![CDATA[http://code.google.com/p/opencollada/downloads/list]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/opencollada/downloads/list">http://code.google.com/p/opencollada/downloads/list</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/10/15/open-collada/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MenuBar control</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/10/07/menubar-control/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/10/07/menubar-control/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 02:26:03 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[Flex / Flash Builder]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[menuBar]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=254</guid>
		<description><![CDATA[Home / Using Flex 4 / Using data-driven UI components / Menu-based controls MenuBar control Add your comment and rating Comments (1) Ratings:0   About the MenuBar control   Creating a MenuBar control   MenuBar control user interaction A MenuBar &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/10/07/menubar-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<table id="page_content_table">
<tbody>
<tr>
<td id="col2"><!-- BEGIN CONTENT WRAPPER --><!-- BEGIN BREADCRUMBS --></p>
<div id="breadcrumb">
<div id="hierarchy"><a href="http://help.adobe.com/en_US/flex/using/WSa7fd4845e77b4e67406b2ad31276e10ce3d-8000.html"><strong>Home</strong></a> / <a href="http://help.adobe.com/en_US/flex/using/WSa7fd4845e77b4e67406b2ad31276e10ce3d-8000.html"><strong>Using Flex 4</strong></a> / <a href="http://help.adobe.com/en_US/flex/using/WSc3ff6d0ea77859465cd856bc1208828aef9-8000.html"><strong>Using data-driven UI components</strong></a> / <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d7b.html"><strong>Menu-based controls</strong></a></div>
</div>
<p><!-- END BREADCRUMBS --></p>
<div id="content_wrapper"><!-- BEGIN PAGE TITLE --></div>
<h1>MenuBar control</h1>
<p><!-- END PAGE TITLE --><!-- BEGIN IONCOMMENTCOUNT --></p>
<div id="ionCTATop"><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#ionCTAAnchor">Add your comment and rating</a></div>
<div id="ionCount">
<ul>
<li><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#ionComHeading">Comments (1)</a></li>
<li>
<div id="ionRatingAnchor"><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#ionComHeading">Ratings:</a>0</div>
</li>
</ul>
</div>
<p><!-- END IONCOMMENTCOUNT --></p>
<div id="minitoc">
<div>
<div>
<div>
<ul id="minitoc-links">
<li><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#WS2db454920e96a9e51e63e3d11c0bf66f5a-7ff2"></a> <br />
<h1>About the MenuBar control</h1>
</li>
<li><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#WS2db454920e96a9e51e63e3d11c0bf66f5a-7ff1"></a> <br />
<h1>Creating a MenuBar control</h1>
</li>
<li><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#WS2db454920e96a9e51e63e3d11c0bf66f5a-7fef"></a> <br />
<h1>MenuBar control user interaction</h1>
</li>
</ul>
</div>
</div>
</div>
</div>
<div>
<p>A <a href="http://help.adobe.com/en_US/AS3LCR/Flex_4.0/mx/controls/MenuBar.html" target="_top">MenuBar</a> control displays the top level of a menu as a horizontal bar of menu items, where each item on the bar can pop up a submenu. The MenuBar control interprets the data provider in the same way as the Menu control, and supports the same events as the Menu control. Unlike the Menu control, a MenuBar control is static; that is, it does not function as a pop-up menu, but is always visible in your application. Because the MenuBar is static, you can define it directly in MXML.</p>
<p>For complete reference information, see the <em><a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/" target="_self">ActionScript 3.0 Reference for the Adobe Flash Platform</a></em>. For more information on the Menu control, see <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8f.html">Menu control events</a>.</p>
</div>
<div id="WS2db454920e96a9e51e63e3d11c0bf66f5a-7ff2"><span id="more-254"></span></div>
<h2>About the MenuBar control</h2>
<div>
<p>The following example shows a MenuBar control:</p>
<div><img id="mc_menubar" src="http://help.adobe.com/en_US/flex/using/images/mc_menubar.png" alt="MenuBar control" /></div>
<p>The control shows the labels of the top level of the data provider menu. When a user selects a top-level menu item, the MenuBar control opens a submenu. The submenu stays open until the user selects another top-level menu item, selects a submenu item, or clicks outside the MenuBar area.</p>
</div>
<h2>Creating a MenuBar control</h2>
<div>
<p>You define a MenuBar control in MXML by using the <samp>&lt;mx:MenuBar&gt;</samp> tag. Specify an <samp>id</samp> value if you intend to refer to a component elsewhere in your MXML application, either in another tag or in an ActionScript block.</p>
<p>You specify the data for the MenuBar control by using the <samp>dataProvider</samp> property. The MenuBar control uses the same types of data providers as does the Menu control. For more information on data providers for Menu and MenuBar controls, see <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b1e.html">Defining menu structure and data</a>. For more information on hierarchical data providers, see <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b69.html">Hierarchical data objects</a>.</p>
<p>In a simple case for creating a MenuBar control, you might use an <samp>&lt;fx:XML&gt;</samp> or <samp>&lt;fx:XMLList&gt;</samp> tag and standard XML node syntax to define the menu data provider. When you used an XML-based data provider, you must keep the following rules in mind:</p>
<ul>
<li>With the <samp>&lt;fx:XML&gt;</samp> tag you must have a single root node, and you set the <samp>showRoot</samp> property of the MenuBar control to <samp>false</samp>. (otherwise, your MenuBar would have only the root as a button). With the <samp>&lt;fx:XMLList&gt;</samp> tag you define a list of XML nodes, and the top level nodes define the bar buttons.</li>
<li>If your data provider has a label attribute (even if it is called “label”), you must set the MenuBar control’s <samp>labelField</samp> property and use the E4X @ notation for the label; for example:
<pre>labelField="@label"</pre>
</li>
</ul>
<p>The <samp>dataProvider</samp> property is the default property of the <samp>MenuBar</samp> control, so you can define the XML or XMLList object as a direct child of the <samp>&lt;mx:MenuBar&gt; tag</samp>, as the following example shows:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!-- menus/MenuBarControl.mxml --&gt;
&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" &gt;

    &lt;!-- Define the menu; dataProvider is the default MenuBar property.
      Because this uses an XML data provider, specify the labelField and
      showRoot properties. --&gt;
    &lt;mx:MenuBar id="myMenuBar" labelField="@label"&gt;
        &lt;fx:XMLList&gt;
            &lt;menuitem label="MenuItem A"&gt;
                &lt;menuitem label="SubMenuItem A-1" enabled="false"/&gt;
                &lt;menuitem label="SubMenuItem A-2"/&gt;
            &lt;/menuitem&gt;
            &lt;menuitem label="MenuItem B"/&gt;
            &lt;menuitem label="MenuItem C"/&gt;
            &lt;menuitem label="MenuItem D"&gt;
                &lt;menuitem label="SubMenuItem D-1"
                    type="radio" groupName="one"/&gt;
                &lt;menuitem label="SubMenuItem D-2"
                    type="radio" groupName="one"
                    selected="true"/&gt;
                &lt;menuitem label="SubMenuItem D-3"
                    type="radio" groupName="one"/&gt;
            &lt;/menuitem&gt;
        &lt;/fx:XMLList&gt;
    &lt;/mx:MenuBar&gt;
&lt;/s:Application&gt;
The executing SWF file for the previous example is shown below:</pre>
<div id="MenuBarControl"><script type="text/javascript">// <![CDATA[
                                var popup_width = 500;
                                var popup_height = 375;
                                var popup_movie_name = "movies/MenuBarControl.swf";
                                var popup_value = "movies/MenuBarControl.swf";
// ]]&gt;</script><script src="insertFlashPopup.js" type="text/javascript">// <![CDATA[
..
// ]]&gt;</script><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="375" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="Movie" value="movies/MenuBarControl.swf" /><param name="Src" value="movies/MenuBarControl.swf" /><param name="WMode" value="Transparent" /><param name="Play" value="0" /><param name="Loop" value="-1" /><param name="Quality" value="High" /><param name="SAlign" value="LT" /><param name="Menu" value="-1" /><param name="Scale" value="NoScale" /><param name="DeviceFont" value="0" /><param name="EmbedMovie" value="0" /><param name="SeamlessTabbing" value="1" /><param name="Profile" value="0" /><param name="ProfilePort" value="0" /><param name="AllowNetworking" value="all" /><param name="AllowFullScreen" value="false" /><param name="wmode" value="Transparent" /><param name="allowfullscreen" value="false" /><param name="quality" value="High" /><embed type="application/x-shockwave-flash" width="500" height="375" allowfullscreen="false" allownetworking="all" profileport="0" profile="0" seamlesstabbing="1" embedmovie="0" devicefont="0" scale="NoScale" menu="-1" salign="LT" quality="High" loop="-1" play="0" wmode="Transparent" movie="movies/MenuBarControl.swf"></embed></object></div>
<input id="MenuBarControlBtn" onclick="showSWF('MenuBarControl')" type="button" value="View Running Example" />The top-level nodes in the MenuBar control correspond to the buttons on the bar. Therefore, in this example, the MenuBar control displays the four labels shown in the preceding image.</div>
<p>You can assign any name to node tags in the XML data. In the previous example, each node is named with the generic <samp>&lt;menuitem&gt;</samp> tag, but you can use <samp>&lt;node&gt;</samp>, <samp>&lt;subNode&gt;</samp>, <samp>&lt;person&gt;</samp>, <samp>&lt;address&gt;</samp>, and so on. Several attributes or fields, such as the <samp>type</samp> attribute, have meaning to the MenuBar control. For information on how Flex interprets and uses the data provider data, see <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b23.html">Specifying and using menu entry information</a>.</p>
<div id="WS2db454920e96a9e51e63e3d11c0bf66f5a-7fef"><a name="WS2db454920e96a9e51e63e3d11c0bf66f5a-7fef"><!-- --></a></div>
<h2>MenuBar control user interaction</h2>
<div>
<p>The user interaction of the MenuBar is the same as for the Menu control, with the following difference: when the MenuBar control has the focus, the left arrow opens the previous menu. If the current menu bar item has a closed pop-up menu, the right arrow opens the current menu; if the pop-up menu is open, the right arrow opens the next menu. (The behavior wraps around the ends of the MenuBar control.)</p>
<p>For more information, see <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7dac.html">Menu control user interaction</a>.</p>
</div>
<p><!-- BEGIN USER PREFERENCES --><!-- END USER PREFERENCES --></p>
<div id="related">
<div><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#top"><img src="http://help.adobe.com/en_US/flex/using/images/BTT.jpg" alt="" /></a> </div>
</div>
<div id="footer"><!-- BEGIN IONCOMMENTS --></div>
<div id="ionCTABottom"><a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html#ionCTAAnchor">Add your comment and rating</a></div>
<div id="ionComHere">
<div id="ionCom">
<div id="ionComHeader">
<div id="ionSummary-comments-left"><strong id="ionComHeading">Comments (1)</strong></div>
<div id="ionSummary-ratings-left">
<div><strong>Ratings:</strong>0</div>
</div>
<div id="ionSummary-feed-right"><a title="Subscribe to the comments feed on this article" href="http://community.adobe.com/help/rss/comments.html?resource_id=http%3A%2F%2Fhelp.adobe.com%2Fen_US%2Fflex%2Fusing%2FWS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html&amp;hl=en_US">Comments</a></div>
</div>
<ul id="ionComList">
<li>
<div><a href="http://community.adobe.com/help/profile/index.html?id=09A3645745BB9848992015A8" target="_blank">David Ang</a>January 10, 2010</div>
<p>Now with flex 4 &#8211; is there a way to remove the hover feedback that you get when you put your mouse over the menubar?</li>
</ul>
<div id="ionMessageContainer">
<div>Please <a title="Sign in to Adobe.com" href="https://www.adobe.com/cfusion/membership/index.cfm?loc=en_US&amp;returnurl=http%3A%2F%2Fhelp.adobe.com%2Fen_US%2Fflex%2Fusing%2FWS2db454920e96a9e51e63e3d11c0bf69084-7d8e.html">sign in</a> to improve or rate the content.</div>
</div>
</div>
</div>
<p><!-- END IONCOMMENTS --><!--oss:off--><!--googleoff: all--></p>
<div><a name="ionCTAAnchor"><script src="http://community.adobe.com/help/badge/ionBadge.js" type="text/javascript"></script><script type="text/javascript">// <![CDATA[
// <![CDATA[</div>
<div  mce_tmp="1">var helpcfgPath;
var request;
var info;</div>
<div  mce_tmp="1">var ionCTAText;
var ionCTATextArray=[
"en_US", "Add your comment and rating",
"ar_AE", "أضف تعليقك وتصنيفك",
"bg_BG", "Добавяне на ваш коментар и оценка",
"cs_CZ", "Přidat komentář a hodnocení",
"da_DK", "Tilføj din kommentar og vurdering",
"de_DE", "Kommentar und Bewertung hinzufügen",
"el_GR", "Προσθέστε το σχόλιο και τη βαθμολογία σας",
"en_GB", "Add your comment and rating",
"en_UK", "Add your comment and rating",
"es_ES", "Añadir comentario y clasificación",
"et_EE", "Lisa oma kommentaar ja hinnang",
"fi_FI", "Lisää kommentti ja arvosana",
"fr_FR", "Ajouter un commentaire et une note",
"he_IL", "הוסף הערה ודירוג",
"hr_HR", "Dodajte svoj komentar i ocjenu",
"hu_HU", "Megjegyzés és értékelés hozzáadása",
"it_IT", "Aggiungete un commento e una valutazione",
"ja_JP", "コメントと評価を追加",
"ko_KR", "주석 및 평가 추가",
"lt_LT", "Pateikite savo komentarą ir įvertinimą",
"lv_LV", "Pievienojiet komentāru un vērtējumu",
"nb_NO", "Legg til kommentar og vurdering",
"nl_NL", "Voeg uw opmerking en beoordeling toe",
"pl_PL", "Dodaj komentarz i ocenę",
"pt_BR", "Adicionar comentário e classificação",
"ro_RO", "Adăugare comentariu sau evaluare",
"ru_RU", "Добавить комментарий и оценку",
"sk_SK", "Pridajte komentár a hodnotenie",
"sl_SI", "Dodajte komentarje in oceno",
"sv_SE", "Lägg till din kommentar och rankning",
"tr_TR", "Yorumunuzu ekleyin ve puan verin",
"uk_UA", "Додайте коментар та свою оцінку",
"zh_CN", "添加注释并评级",
"zh_TB", "增加註解和分級"
];</div>
<div  mce_tmp="1">if (typeof(terms_HELPCFG) != 'undefined' &#038;&#038; terms_HELPCFG.length > 0){
    var loc = getLangName();     //alert(loc);
    helpcfgPath = "http://" + window.location.host + "/HelpCfg/" + loc + "/" + terms_HELPCFG;
    readCTAText(loc);
    createXMLHttpRequest();
}</div>
<div  mce_tmp="1">if (use_robohelp_behavior) {
    document.write('</div>
<style>#ionCTATop{display:none}</style>
<div  mce_tmp="1">');
    document.write('</div>
<style>#ionCTABottom{display:none}</style>
<div  mce_tmp="1">');
}</div>
<div  mce_tmp="1">function readCTAText(loc)
{
    for (var i = 0; i < ionCTATextArray.length; i+=2) {
        if ("en-us" == ionCTATextArray[i]) {
            ionCTAText = ionCTATextArray[i+1];
        }
        if (loc == ionCTATextArray[i]) {
            ionCTAText = ionCTATextArray[i+1];
            break;
        }
    }
}</div>
<div  mce_tmp="1">function creatIonCTA()
{
    var e = document.getElementById("ionCount");
    var a = document.createElement("div");
    a.id = "ionCTATop";
    a.innerHTML = "<a href='#ionCTAAnchor'>"+ionCTAText+"</a>";
    e.parentNode.insertBefore(a,e);
    var b = document.createElement("div");
    b.id = "ionCTABottom";
    b.innerHTML = "<a href='#ionCTAAnchor'>"+ionCTAText+"</a>";
    e = document.getElementById("ionComHere");
    e.parentNode.insertBefore(b,e);</div>
<div  mce_tmp="1">}</div>
<div  mce_tmp="1">// -----------------------------------------
// ----------- START AJAX CODE  ------------
//
function createXMLHttpRequest(){
    if (window.XMLHttpRequest){       // code for Firefox, Opera, IE7, etc.
        request=new XMLHttpRequest();        
    }else if (window.ActiveXObject){  // code for IE6, IE5
        request=new ActiveXObject("Microsoft.XMLHTTP");
    }    
    if (request != null){
        request.onreadystatechange = handleStateChange;
        request.open("GET", helpcfgPath, true);
        request.send(null);
    }else{
        alert("Your browser does NOT support XMLHTTP.");
    }
}</div>
<div  mce_tmp="1">function handleStateChange(){    
    if(request.readyState == 4){    // "loaded" 
        if (request.status == 200){ // "OK"
            var requestMsg = getXMLDoc(request.responseText);
            try
            {
                info  = requestMsg.getElementsByTagName('product');
                label = getIonLabel();               
                site  = getIonSite();    
                if (use_robohelp_behavior || !(label) || !(loc) || !(label.length > 0) || !(loc.length > 0)) {
                    document.getElementById("ionCount").style.display = "none";
                    document.getElementById("ionComHere").style.display = "none";
                }
                else {
                    document.getElementById("ionCount").style.display = "block";
                    document.getElementById("ionComHere").style.display = "block";
                }</div>
<div  mce_tmp="1">                if ( (info[0].getAttribute('ionCommentingAllowed') == 'yes') &#038;&#038; (label) &#038;&#038; (label.length > 0) &#038;&#038; (loc)  &#038;&#038; (loc.length > 0)) {
					YAHOO.util.Event.onDOMReady(function(){
                        var badge = new ionBadge();
                        badge.url = window.location.toString();
                        badge.locale = loc;
                        badge.anchor = document.getElementById("ionCount");
                        badge.container = document.getElementById("ionComHere");
                        badge.productLabel = label;
                        if ( info[0].getAttribute('ionRatingAllowed') == 'yes' ){
                            badge.ratingType = info[0].getAttribute('ionRatingType');
                            badge.siteArea = site;
                        }
			if (typeof disableComments  != "undefined" &#038;&#038; disableComments == "yes" ) {
                            badge.disableFeedback = true; 
			}
                        badge.load();
			creatIonCTA();
                    });
                }
            }catch(exception){}
        }
    }
}</div>
<div  mce_tmp="1">function getXMLDoc(xmlText){
    if(window.ActiveXObject){
        xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async=false;
        xmlDoc.loadXML(xmlText);
    }else if(document.implementation &#038;&#038; document.implementation.createDocument){
        xmlDoc=document.implementation.createDocument('','',null);
        var oParser=new DOMParser();
        xmlDoc=oParser.parseFromString(xmlText,"text/xml");
    }else{
        return null;
    }
    return xmlDoc;
}</div>
<div  mce_tmp="1">// 
// -----------  END AJAX CODE   ------------
// -----------------------------------------</div>
<div  mce_tmp="1">function getLangName() {
    var lang = "en-us";
    var metaElements = document.all ?
    document.all.tags('meta') :
    document.getElementsByTagName ?
    document.getElementsByTagName ('meta') : new Array();
    for (var m = 0; m < metaElements.length; m++) {
        if (metaElements[m].name == "lang") {
            lang = metaElements[m].content;
            break;
        }
    }
    var ptn = /(..)-(..)/;
    if (ptn.test(lang)) {
        var countryCode = lang.replace(ptn, "$1");
        var languageCode = lang.replace(ptn, "$2");
        lang = countryCode + "_" + languageCode.toUpperCase();
    }
    return lang;
}</div>
<div  mce_tmp="1">function isHomepage() {
    var metaElements = document.all ?
    document.all.tags('meta') :
    document.getElementsByTagName ?
    document.getElementsByTagName ('meta') : new Array();
    for (var m = 0; m < metaElements.length; m++) {
        if ((metaElements[m].name == "topictype") &#038;&#038; (metaElements[m].content == "homepage")) {
            return true;
        }
    }
    return false;
}</div>
<div  mce_tmp="1">function getIonLabel() {
    var href = "" + document.location.href;
    var label = "";
    // No commenting for the home page
    if (isHomepage()) {
        return label;
    }
    // 3D Reviewer doesn't get commenting, but the rest of Acrobat does.
    if (href.indexOf("Acrobat/9.0/Reviewer") != -1) {
        return label;
    }</div>
<div  mce_tmp="1">    label = info[0].getAttribute('ionId');
    return label;
}</div>
<div  mce_tmp="1">function getIonSite(){
    if ( info[0].getAttribute('ionSiteArea') != "" ){
        return info[0].getAttribute('ionSiteArea');
    }else{
        return "help";
    }
}
// ]]&gt;</script><!--googleon: all--><!--oss:on--></a></div>
<div><a name="ionCTAAnchor"></a></div>
<div><a name="ionCTAAnchor"></a></div>
<div><a name="ionCTAAnchor"></a></div>
<p><a name="ionCTAAnchor"></p>
<p id="creativecommons"> </p>
<p><a id="creativecommons_text" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img id="creativecommons_img" src="http://help.adobe.com/en_US/flex/using/images/CC.png" alt="This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License" /></a></p>
<p></a><!-- BEGIN BREADCRUMBS --></p>
<div id="breadcrumb">
<ul>
<li><a title="Menu control" accesskey="p" href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf66f5a-7fea.html"><img src="http://help.adobe.com/en_US/flex/using/images/blank.gif" alt="Previous" width="17" height="17" /></a></li>
<li><a title="PopUpMenuButton control" accesskey="n" href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b20.html"><img src="http://help.adobe.com/en_US/flex/using/images/blank.gif" alt="Next" width="17" height="17" /></a></li>
</ul>
<div id="hierarchy"><a href="http://help.adobe.com/en_US/flex/using/WSa7fd4845e77b4e67406b2ad31276e10ce3d-8000.html"><strong>Home</strong></a> / <a href="http://help.adobe.com/en_US/flex/using/WSa7fd4845e77b4e67406b2ad31276e10ce3d-8000.html"><strong>Using Flex 4</strong></a> / <a href="http://help.adobe.com/en_US/flex/using/WSc3ff6d0ea77859465cd856bc1208828aef9-8000.html"><strong>Using data-driven UI components</strong></a> / <a href="http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d7b.html"><strong>Menu-based controls</strong></a></div>
</div>
<p><!-- END BREADCRUMBS --><!-- END CONTENT WRAPPER --></td>
<td id="col3"> </td>
</tr>
</tbody>
</table>
<p><!-- END PAGE CONTENT WRAPPER --><script type="text/javascript">// <![CDATA[
scrollToNameAnchor();
//
// ]]&gt;</script><!--     Description:     This file generates the link to product support in the top right corner --><!-- #menutop{     position:absolute;     top:4px;     right:24px;     width:auto;         font-size:11px;     color:#fff;     text-align:right; } #menutop a{     color:#fff; } #menutop a:hover{         text-decoration:underline; } --></p>
<div id="productmenu"><!--googleoff: index--></div>
<div id="menutop"><script type="text/javascript">// <![CDATA[
    // darken menu text for products with light backgrounds
    var path = document.location.href.toLowerCase();
    if (path.indexOf("/acrobat/")           > 0 ||
        path.indexOf("/acrobat.com/")       > 0 ||
        path.indexOf("/acrobatConnectPro/") > 0 ||
        path.indexOf("/connect/")           > 0 ||
        path.indexOf("/presenter/")         > 0 ||
        path.indexOf("/scene7/")            > 0 ||
        path.indexOf("/flashMediaserver/")  > 0 ||
        path.indexOf("/wave/")              > 0 )
    {
        document.write('</div>
<style>#menutop a{color:#505050}</style>
<div  mce_tmp="1">');
    }
    if (typeof('terms_AHV_PRODUCT_SUPPORT') != "undefined" &#038;&#038; ! use_robohelp_behavior ){      
        var supportlink = '<a href="http://adobe.com/support">'+terms_AHV_PRODUCT_SUPPORT+'</a>';
        document.write( supportlink );
     }
// ]]&gt;</script><a href="http://adobe.com/support">Product support</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/10/07/menubar-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kung Fu Panda Animation</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-animation/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-animation/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 16:19:33 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[3DSMax]]></category>
		<category><![CDATA[3DsMax]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[KungFu Panda]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=251</guid>
		<description><![CDATA[http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html by Didik Wijaya This tutorial needs you to understand basic use of 3dsmax. This tutorial is the last of Kung Fu Panda tutorial series. After all hard work from modeling, texturing, rigging, and skinning, now ready for final lesson. &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-animation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Animation" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_animation_00.jpg" border="0" alt="Kung Fu Panda Animation" hspace="6" width="107" height="80" />This tutorial is the last of Kung Fu Panda tutorial series. After all hard work from <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">modeling</a>, <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">texturing</a>, <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">rigging, and skinning</a>, now ready for final lesson. You will create animation for our Kung Fu Panda model. This time you will use motion capture data to create animation. Motion capture (mocap) data is animation data stored from capturing real actor movement. We can re-use this animation data to any object, like our Kung Fu Panda model. Using mocap, you can create animation in a minute</p>
<p>1. Continue your <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">previous lesson</a> or <a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_part3_finish.zip">download required 3dsmax file here</a>. Select one of biped and go to Motion tab. In Biped rollout, click Load File button.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_animation_01.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. A window will open. In this window, you can select any motion capture data file you have. This motion capture data should have BIP extension. You can use BIP file available in your 3dsmax CD/DVD. Usually they are located in Samples/Motion folder or you can look for free motion capture data available in the net, for example here&#8217;s a <a href="http://freemotionfiles.blogspot.com/" target="_blank">blog providing free mocap data</a></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_animation_02.gif" border="0" alt="Image" hspace="6" width="426" height="388" /></p>
<p>3. After you load BIP file, your model will use the animation movement stored in that file. Image below shows Kung Fu Panda doing some backflip kick.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_animation_03.jpg" border="0" alt="Image" hspace="6" width="510" height="140" /></p>
<p>Here&#8217;s another example of Kung Fu Panda Animation</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/MBfGhRE6GDc" /></object></p>
<p><strong>Other tutorial : </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Skinning And Rigging </a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email:<script type="text/javascript"></script> <a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a><script type="text/javascript"></script> This e-mail address is being protected from spam bots, you need JavaScript enabled to view it<script type="text/javascript"></script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kung Fu Panda Skinning And Rigging</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-skinning-and-rigging/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-skinning-and-rigging/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 16:16:48 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[3DSMax]]></category>
		<category><![CDATA[3DsMax]]></category>
		<category><![CDATA[KungFu Panda]]></category>
		<category><![CDATA[Rigging]]></category>
		<category><![CDATA[Skinning]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=248</guid>
		<description><![CDATA[http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html by Didik Wijaya This tutorial needs you to understand basic use of 3dsmax. After you model and texture Po, character from Kung Fu Panda The Movie. Now, you can rig that panda model. Rigging is the process of placing &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-skinning-and-rigging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Skinning And Rigging" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_00.jpg" border="0" alt="Kung Fu Panda Skinning And Rigging" hspace="6" width="107" height="80" />After you <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">model</a> and <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">texture</a> Po, character from Kung Fu Panda The Movie. Now, you can rig that panda model. Rigging is the process of placing skeleton system inside a mesh. There are 2 types of &#8220;skeleton&#8221; you can use in 3dsmax: Bones and Biped. Bones is usually used if you want to create bones manually. Otherwise, Biped is like a pre-built skeleton system. It&#8217;s quick and fast to use. This tutorial will show you how to apply Biped to our Kung Fu Panda Model!</p>
<p>1. First, open textured kung fu panda model you created earlier. Or you can <a href="http://www.escalight.com/free-stuff/view-details/3d-models/character/52-kung-fu-panda-textured.html">download required 3D model here</a>. Select model, go to Display tab and Freeze this model. You need to freeze this model, so you can&#8217;t accidentally select this model.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_01.gif" border="0" alt="Image" hspace="6" width="510" height="234" /></p>
<p>2. Next step is creating Biped. Go to Create&gt;Systems. Click Biped button. Then, click and drag in Front viewport to create Biped. Biped systems consist of several linked &#8220;bones&#8221;. Each &#8220;bones&#8221; is called &#8220;biped&#8221;. After you created Biped, in Structure rollout, modify Biped structure to fit model requirement. Look at image below for reference.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_02.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. Next, you need to position Biped inside the model. Make sure Bip01 in Biped is selected and go to Motion tab. Then in Biped rollout, click Figure mode. This mode allows you to modify Biped structure and shape. Position Bip01 in the middle of model (look at image below for reference). Because Bip01 is the parent of all biped, all other biped are also moved.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_03.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. Next, you need to modify each biped shape and position. Using Select and Non Uniform Tool strecth biped shape to fit the model. Also you need to rotate several biped arm.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_04.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>5. Modify each biped shape. It&#8217;s so simple, just use Select and Non-Uniform Scale in Front and Left viewport. You don&#8217;t need to modify all biped. Just modify one side of model (left or right side).</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_05.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>6. Special note: When you modify biped for fingers, extend biped farther than finger mesh. This is the trick so that you don&#8217;t need tweaking in skinning process later.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_06.gif" border="0" alt="Image" hspace="6" width="510" height="293" /></p>
<p>7. Next, we are going to copy-paste biped shape position to other side. Double click one of shoulder biped. The rest of arm and finger biped will be selected. Open Copy/Paste rollout. Click New Collection button to name the selection, then click Copy Posture button. Finally, click Paste Posture Opposite to paste to the other side.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_07.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>8. Using the same process like above, copy-paste leg posture. When finished, de-activate Figure mode and unfreeze the model..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_08.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_part1_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Skinning And Rigging Part 1 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-3.html">Part 3</a></p>
<p><strong>Other tutorial : </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy25503 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy25503 = addy25503 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text25503 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy25503 + '\'>' );
 document.write( addy_text25503 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Skinning And Rigging" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_00.jpg" border="0" alt="Kung Fu Panda Skinning And Rigging" hspace="6" width="107" height="80" />After we add Biped to model in <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Part 1</a> tutorial, next we are going to go into skinning process. <strong>Skinning</strong> is required to make skeleton system works by deforming the mesh. In 3dsmax, you can use Skin or Physique modifier to skin a model. In this tutorial, you will use Physique modifier to skin Kung Fu Panda Model. Physique is faster to use, if you use Biped for skeleton system.</p>
<p>1. This process is not necessary, but can help you to see biped inside model in Perspective viewport (Smooth and Highlight display). Select model, right click and choose Properties. Activate See-Through and click OK.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_09.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. While model is still selected, apply <strong>Physique</strong> modifier to object. In Modifier Stack, position Physique modifier below Turbosmooth modifier. In Physique rollout, click Attach to Node button. Then click Bip01 in viewport. If you have difficulties in selecting Bip01. You can press H in keyboard. Highlight Bip01, and click Pick button. A new window will open. Click Initialize button. Now, your model is skinned.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_10.gif" border="0" alt="Image" hspace="6" width="510" height="350" /></p>
<p>3. Try to select one of biped. Rotate, watch the mesh also deformed. Click Undo (Ctrl+Z) to reset biped position.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_11.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_part2_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Skinning And Rigging <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Part 1</a> | Part 2 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-3.html">Part 3</a></p>
<p><strong>Other tutorial : </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy37048 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy37048 = addy37048 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text37048 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy37048 + '\'>' );
 document.write( addy_text37048 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p><!-- START of joscomment --></p>
<div id="comment">
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Skinning And Rigging" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_00.jpg" border="0" alt="Kung Fu Panda Skinning And Rigging" hspace="6" width="107" height="80" />Skinning process is not finished yet. We need to check whether model is deformed in the way we want. If not, we need to modify several Physique attributes. Most of the time, this adjusting process is quite complicated. This tutorial will show you only the basic. But, I believe it&#8217;s quite enough to create nice animation.</p>
<p>1. First, try to select one of upper arm biped. Rotate. Notice that some part of arm is not deformed along arm movement. Click Undo (Ctrl+Z) to reset biped position..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_12.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. Before you begin adjusting, you may want to hide biped in viewport. Sometimes it&#8217;s hard to see clearly in viewport when biped is visible. Go to Modify tab. Highlight Physique modifier in Modifier Stack. In Physique Level of Detail rollout, check Hide Attached Nodes. Biped will be invisible. If you want to display Biped again, just uncheck this option. Whithout Biped visible in the screen, you can see only <strong>biped links</strong> (orange lines)</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_13.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3.In Modifier Stack, click plus (+) sign at left of Physique modifier. Then, select Envelope. Biped link will turn yellow. Select biped link at the upper arm. You will see red and grey circle. Those circles are called <strong>Envelope</strong>, which define area influenced by certain biped. Envelope has 2 areas, <strong>inner</strong> and <strong>outer</strong>. Biped influence in inner area is higher than outer area. Notice that, enveloped in upper arm is not covering all desired area. You can fix this by enlarging envelope. In Blending Envelopes rollout, focus on Envelope Parameters. Make sure <strong>Both</strong> is selected. Increase Radial Scale to 2.23. Both inner and outer envelope will be enlarged. After that, in Edit Commands click Copy button</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_14.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. You need to apply Envelope changes to the other side of arm. You can modify it manually. But, remember that you clicked Copy button before. Now, select other upper arm link and click Paste button. Both arm is now fix. You can de-activate Envvelope selection. Un-hide Attached Nodes to display all biped objects. Ttry to rotate upper arm biped to check.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_15.gif" border="0" alt="Image" hspace="6" width="510" height="194" /></p>
<p>5. Now try to rotate upper leg biped. Notice that, mesh in other legs is also deform. To fix this, just go to Envelope selection again</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_16.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>6. Select biped link in lower leg. First, make sure Both option is active. Decrease Radial Scale to 0.68. And then activate Outer option, then decrease Radial Scale to 1. Copy-paste envelope to the other side of lower leg</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_17.gif" border="0" alt="Image" hspace="6" width="510" height="298" /></p>
<p>7. If you rotate upper leg biped, you will notice that belt area is also deform. To fix this, go to Envelope selection.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_18.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>8. Select biped link in pelvis area. With Both option active, decrease Radial Scale to 0.5. Copy-paste to the other side of pelvis.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_19.gif" border="0" alt="Image" hspace="6" width="510" height="253" /></p>
<p>9. The last one. Select biped link in head. In Active Blending, uncheck Deformable and check Rigid. Head should not deformed a lot in animation. When finished, de-activate Envelope selection. Skinning process is done. Actually we need more adjustment in skinning process, but that should be enough for now. I will try to write more tutorial about this subject in the future.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_20.gif" border="0" alt="Image" hspace="6" width="510" height="308" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_rigging_part3_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Skinning And Rigging <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-2.html">Part 2</a> | Part 3</p>
<p><strong>Other tutorial : </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email:<script type="text/javascript"></script> <a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a><script type="text/javascript"></script> This e-mail address is being protected from spam bots, you need JavaScript enabled to view it<script type="text/javascript"></script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p><a name="JOSC_TOP"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-skinning-and-rigging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kung Fu Panda Texturing</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-texturing/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-texturing/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 16:10:51 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[3DSMax]]></category>
		<category><![CDATA[3DsMax]]></category>
		<category><![CDATA[KungFu Panda]]></category>
		<category><![CDATA[Texturing]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=246</guid>
		<description><![CDATA[http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html by Didik Wijaya This tutorial needs you to understand basic use of 3dsmax. It&#8217;s time to texture our little panda, after we created him in Kung Panda Modeling tutorial. We are going to use Unwrap UVW. If you are &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-texturing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Texturing" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_00.jpg" border="0" alt="Kung Fu Panda Texturing" hspace="6" width="107" height="80" />It&#8217;s time to texture our little panda, after we created him in <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Panda Modeling tutorial</a>. We are going to use Unwrap UVW. If you are unfamiliar with Unwrap UVW, consider to look at our previous tutorial: <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/understanding-unwrap-uvw.html">Understanding Unwrap UVW</a> and <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/unwrap-uvw-texturing-part-1.html">Unwrap UVW Texturing</a>. It is quite hard to unwrap a complex model like human character or this panda. But, if you follow this detailed and step by step tutorial, you will be able to use techniques describe in this tutorial at any model. Let&#8217;s unwrap!</p>
<p>1. First, open kung fu panda model you created earlier. Or you can <a href="http://www.escalight.com/free-stuff/view-details/3d-models/character/36-kung-fu-panda.html">download required 3D model here</a>. Then, go to Modify tab. Remove Turbosmooth modifier. Then, apply Unwrap UVW modifier to model.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_01.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. Next step is selecting model parts and name each of them. You need to do this in order to recall each object part later easily. In Modifier stack, click plus (+) sign left of Unwrap UVW modifer. Then highlight Face. Now, you are able to select faces. Select panda&#8217;s head using Select Object tool. Don&#8217;t select panda&#8217;s ears.You can uncheck Ignore Backfacing for easy selection. If this option inactive, you can select front and back faces altogether. Use Ctrl+click to select more faces. And Alt+click to reduce selection. After all faces in the head are selected, name these faces in Named Selection Set (located in top of the screen). For example type &#8220;head&#8221; and press Enter in keyboard</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_02.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. Next you need select anoother parts of model and name everyone of them. Use images below as references. In total, you should have 16 named selection sets.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_03.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_04.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_05.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_06.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_07.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. If you are happen to have wrong selection or name, click Edit Named Selection Sets button. In opened dialog box, you can highlight and delete the selection.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_08.gif" border="0" alt="Image" hspace="6" width="304" height="330" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_part1_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Texturing Part 1 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-3.html">Part 3</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-4.html">Part 4</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling </a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy11324 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy11324 = addy11324 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text11324 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy11324 + '\'>' );
 document.write( addy_text11324 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Texturing" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_00.jpg" border="0" alt="Kung Fu Panda Texturing" hspace="6" width="107" height="80" />You have selected and named each part of panda model in <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Part 1</a> tutorial. Next step is to assign each object to its proper mapping type. For example head is suitable with spherical mapping type. Arm is suitable with cylindrical mapping type and so on.</p>
<p>1. Continue your previous lesson. Make sure Face selection is active in Unwrap UVW. In Named Selection Sets, choose &#8220;head&#8221;. All faces in the head will be selected. In Map Parameters rollout, click Spherical. Next, clcik Align Z for mapping orientation. Don&#8217;t forget to uncheck Normalize map. If this option is active, you will get deformed unwrap faces (3dsmax will force unwrapped faces to fit rectangle)</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_09.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. Repeat procedure above with other part of model. Refer to table below. Note: some mapping need to be adjusted, like in &#8220;tail&#8221;, &#8220;ear left&#8221; and &#8220;ear right&#8221;. Just rotate Gizmo to fit selected faces. Watch image below for reference.</p>
<table border="0" width="500" align="center">
<tbody>
<tr>
<td bgcolor="#999999"><strong>Named faces </strong></td>
<td bgcolor="#999999"><strong>Mapping Type </strong></td>
<td bgcolor="#999999"><strong>Orientation</strong></td>
</tr>
<tr>
<td>body</td>
<td>Spherical</td>
<td>Align Z</td>
</tr>
<tr>
<td bgcolor="#cccccc">head</td>
<td bgcolor="#cccccc">Spherical</td>
<td bgcolor="#cccccc">Align Z</td>
</tr>
<tr>
<td>arm left / arm right</td>
<td>Cylindrical</td>
<td>Align X</td>
</tr>
<tr>
<td bgcolor="#cccccc">leg left / leg right</td>
<td bgcolor="#cccccc">Cylindrical</td>
<td bgcolor="#cccccc">Best Align</td>
</tr>
<tr>
<td>tail</td>
<td>Cylindrival</td>
<td>Best Align + Rotate Gizmo</td>
</tr>
<tr>
<td bgcolor="#cccccc">sole left / sole right</td>
<td bgcolor="#cccccc">Planar</td>
<td bgcolor="#cccccc">Align Z</td>
</tr>
<tr>
<td>palm left / palm right</td>
<td>Planar</td>
<td>Align Z</td>
</tr>
<tr>
<td bgcolor="#cccccc">briefs</td>
<td bgcolor="#cccccc">Spherical</td>
<td bgcolor="#cccccc">Align X</td>
</tr>
<tr>
<td>foot left / foot right</td>
<td>Planar</td>
<td>Best Align</td>
</tr>
<tr>
<td bgcolor="#cccccc">ear left / ear right</td>
<td bgcolor="#cccccc">Cylindrical</td>
<td bgcolor="#cccccc">Best Align + Rotate Gizmo</td>
</tr>
</tbody>
</table>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_10.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. In Parameters rollout, click Edit button. Edit UVWs window will open. Click Zoom Extents button in the right corner. Now, you can see all faces.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_11.gif" border="0" alt="Image" hspace="6" width="512" height="272" /></p>
<p>4. Select all faces. Scale down to make them smaller. Then, move them near blue rectangle. You need to scale all faces several times before they are small enough to fit the rectangle. To make you able to see blue rectangle clearly, click Options&gt;Advanced Options. In opened window, uncheck Show grid and Tile Bitmap. You can also de-activate Show Map button.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_12.gif" border="0" alt="Image" hspace="6" width="512" height="416" /></p>
<p>5. Use Named Selection Sets again to select each model part. Move and arrange each them inside the rectangle. Just arrange so that you can see all object part clearly. Later, you&#8217;ll have to to arrange again.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_13.gif" border="0" alt="Image" hspace="6" width="512" height="316" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_part2_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Texturing <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Part 1</a> | Part 2 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-3.html">Part 3</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-4.html">Part 4</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling </a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy65683 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy65683 = addy65683 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text65683 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy65683 + '\'>' );
 document.write( addy_text65683 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Texturing" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_00.jpg" border="0" alt="Kung Fu Panda Texturing" hspace="6" width="107" height="80" />In previous tutorial (<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Part 1</a> and <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-2.html">Part 2</a>), you have unwrapped faces. But you can&#8217;t directly use this unwrapped faces for texturing. We need to fix some face position for easier texture drawing. There are several places we need to fix, like in head, body, briefs and leg.</p>
<p>1. In Edit UVWs window. Focus on head faces. Select several faces at left side (look at image below). In main menu, choose Tool&gt;Break (Shortcut Ctrl+B). Then, move detached faces to the right side. Change selection to Edge. Select several edges like image below. Use Ctrl+click to select more than one edge. You need to zoom in to select all edges. Then, choose Tools&gt;Stitch Selected.Just click OK in opened dialog box. You&#8217;ll have <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/modeling-using-blueprint.html"></a>perfect symmetry head.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_14.gif" border="0" alt="Image" hspace="6" width="536" height="436" /></p>
<p>2. Next, we are going to fix body, briefs, and leg faces. Most people use Pelt Mapping when unwrapping legs. But in this tutorial I will only use standard unwrap uvw. Pelt Mapping will be discussed in another tutorial.</p>
<p>Select right side briefs faces. Use Break (Ctrl+B), and move each of them near the body. Look at image below fore reference. Use Rotate and Mirror Horizontal to each side of briefs.</p>
<p>Then, change selection to Edge. Select 2 edges in body. Choose Tools&gt;Stich selected. In opened dialog box, uncheck Scale Clusters and then OK. Repeat the same proces with other side of briefs.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_15.gif" border="0" alt="Image" hspace="6" width="512" height="399" /></p>
<p>3. Change selection to Face. Select faces at left side of body. Break, move to the right and Stich them.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_16.gif" border="0" alt="Image" hspace="6" width="512" height="222" /></p>
<p>4. Now, leve body faces for a while. Let&#8217;s modify legs faces first. Select both legs. Click Mirror Vertical, then Mirror Horizontal. Mirror Vertical is available when you click and hold Mirror Horizontal button.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_17.gif" border="0" alt="Image" hspace="6" width="512" height="328" /></p>
<p>5. Select several faces at right side of legs (look at image below). Break, move them to the left and Stitch</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_18.gif" border="0" alt="Image" hspace="6" width="512" height="170" /></p>
<p>6. Now, select both legs faces. Use Scale Horizontal to reduce legs width. You can get Scale Horizontal button, if you click and hold Scale button. Then move each leg to its proper position near body (look at image below). Place legs as near as possible to body.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_19.gif" border="0" alt="Image" hspace="6" width="512" height="328" /></p>
<p>7. Change selection to Edge. Select several edges like image below. Then choose Tools&gt;Stich Selected. This time uncheck Align clusters and Scale clusters. Click OK. Do stitching on one leg at a time. After stitching, you&#8217;ll notice that in circled area there are unweld vertices. Change selection to Vertex. Go to Tools&gt;Target Weld. Select one vertex in circled area, and move them to another vertex. We have finished fixing the faces position.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_20.gif" border="0" alt="Image" hspace="6" width="512" height="328" /></p>
<p>8. Now, you can arrange model parts to fit rectangle area. Use scale if necessary. Make sure they are all inside the rectangle. Note: I use mirror to change arm orientation.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_21.gif" border="0" alt="Image" hspace="6" width="512" height="355" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_part3_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Texturing <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-2.html">Part 2</a> | Part 3 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-4.html">Part 4</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling </a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy64315 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy64315 = addy64315 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text64315 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy64315 + '\'>' );
 document.write( addy_text64315 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Texturing" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_00.jpg" border="0" alt="Kung Fu Panda Texturing" hspace="6" width="107" height="80" />After we have created and fixed unwrapped faces in previous tutorials, we are ready to make texture template.</p>
<p>1. In Edit UVWs window, choose Tools&gt;Render UVW Template. Enter texture size. For example I use 512&#215;512 pixel. Then, click Render UV Template button. You can save texture template as bitmap image.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_22.gif" border="0" alt="Image" hspace="6" width="512" height="387" /></p>
<p>2. Open saved image in your image editing software, like Photoshop. Draw texture based on that image. Image below shows rough texture I created based on template.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_color_draft.jpg" border="0" alt="Image" hspace="6" width="512" height="512" /></p>
<p>3. Back to 3dsmax. Open Material Editor. There&#8217;s one material applied to panda model. Remember, you applied this material while in modeling process. Select this material. Click Show Map button, to make applied material appear in viewport. In Blinn Basic Parameters, click small button right next to Diffuse. In Material/Map Browser choose bitmap, and then select texture image you have created before. When finished, close Material Editor</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_23.gif" border="0" alt="Image" hspace="6" width="367" height="237" /></p>
<p>4. Apply Turbosmooth and render your scene. Image below shows example of rendered result. Next step, I will show you how I create more realistic material.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_24.jpg" border="0" alt="Image" hspace="6" width="512" height="384" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_part4_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Texturing <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-3.html">Part 3</a> | Part 4 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling </a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy17299 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy17299 = addy17299 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text17299 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy17299 + '\'>' );
 document.write( addy_text17299 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>by <strong>Didik Wijaya</strong><br />
This tutorial needs you to understand basic use of Photoshop.</p>
<p><img title="Kung Fu Panda Texturing" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_00.jpg" border="0" alt="Kung Fu Panda Texturing" hspace="6" width="107" height="80" />This tutorial section will show you how to create more realistic texture for your Kung Fu Panda model. Original Kung Fu Panda Movie uses hair and fur, which did not explained here. Here, I just show you how to apply bitmap texture. Note: This tutorial is not a detailed step by step tutorial. I assume you are familiar with Photoshop. I just give a brief explanation how I create my texture.</p>
<p>First, prepare images for references. One from Kung Fu Panda Movie image, and the other is real life panda image.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_themovie.jpg" border="0" alt="Image" hspace="6" width="365" height="365" /></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/realpanda.jpg" border="0" alt="Image" hspace="6" width="512" height="352" /></p>
<p>1. Let&#8217;s begin with panda&#8217;s head. I crop half of real panda image and drag to the tempate. Scale that cropped image to fit the template. Then use Clone Stamp tool to create surrounding fur and <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/modeling-using-blueprint.html"></a>face</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_25.jpg" border="0" alt="Image" hspace="6" width="512" height="164" /></p>
<p>2. I crop the eye from Kung Fu Panda Movie image, and drag into texture template. Then also crop some part in hand area of real panda image to add black fur. For left side of face, I just duplicate layer and use Flip Horizontal (Edit&gt;Transform&gt;Flip Horizontal). Next, use Clone Stamp tool to cover middle seam.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_26.jpg" border="0" alt="Image" hspace="6" width="512" height="176" /></p>
<p>3. Next, draw dark color in ear area, to make smoother color transistion between head and ears. Then, fix eyes shape. Just use Clone Stamp tool with small brush size. Clone from dark fur area and white fur area.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_27.jpg" border="0" alt="Image" hspace="6" width="512" height="175" /></p>
<p>4. For body, I crop several part of fur in real panda image. Resize and copy them several times to cover body. Then I use Clone stamp tool to make all fur copies blend well.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_28.jpg" border="0" alt="Image" hspace="6" width="512" height="314" /></p>
<p>5. The same technique applied with black fur. Cropping, copying and clone stamping. Note, add a little white fur with Clone stamp tool in armpit area, to make color transition between body and arm.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_29.jpg" border="0" alt="Image" hspace="6" width="238" height="274" /></p>
<p>6. For belt, I just crop some belt image from Kung Fu Panda Movie image. Unfortunately I have curvy cropped belt image. To modify it, I use Edit&gt;Transform&gt;Warp. After that, resize and postion it in belt area. Sometimes I need to distort image (Edit&gt;Transform&gt;Distort). I repeat this process several times until I get full belt image.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_30.jpg" border="0" alt="Image" hspace="6" width="512" height="307" /></p>
<p>7. For legs, same techniques applied here. I cropped from Kung Fu Pada Move image. Distort and copy paste to create desired looks</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_31.jpg" border="0" alt="Image" hspace="6" width="512" height="232" /></p>
<p>8. After that, I duplicate layer and flipped to create other side of body. Next is pants. I draw several pieces of solid color in one layer. Then under this layer, I create texture layer. I just randomize several texture with different texture size and rotation. Then, change top layer mode into Multiply. Sometime you can use Color mode too, depends on what color and texture you are using</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_32.jpg" border="0" alt="Image" hspace="6" width="512" height="512" /></p>
<p>9. For stitch effect. I just use Line Tool a lot of times.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_33.jpg" border="0" alt="Image" hspace="6" width="512" height="150" /></p>
<p>10. For another part of texture image, like in palm and foot, same technique applied here. I just use crop, copy from other image and sometimes drawing. Image below shows example of finished texture. Then, save texture and use as Diffuse map. You can add your own bump or specular map if you want.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_color.jpg" border="0" alt="Image" hspace="6" width="512" height="512" /></p>
<p>11. Congrats you have finished Kung Fu Panda Texturing tutorial. Image below shows rendered result, applied with texture above. Next is Kung Fu Panda Skinning and Rigging tutorial.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_34.jpg" border="0" alt="Image" hspace="6" width="512" height="384" /></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_texturing_35.jpg" border="0" alt="Image" hspace="6" width="512" height="384" /></p>
<p><a href="http://www.escalight.com/free-stuff/view-details/3d-models/character/52-kung-fu-panda-textured.html">Download Finished Kung Fu Panda Model (Textured)</a></p>
<p>Kung Fu Panda Texturing <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-3.html">Part 3</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-4.html">Part 4</a> | Part 5</p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Kung Fu Panda Modeling </a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy64408 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy64408 = addy64408 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text64408 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy64408 + '\'>' );
 document.write( addy_text64408 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
 document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-texturing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kung Fu Panda Modeling</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-modeling/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-modeling/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 16:01:14 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[3DSMax]]></category>
		<category><![CDATA[3DsMax]]></category>
		<category><![CDATA[KungFu Panda]]></category>
		<category><![CDATA[Modeling]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=242</guid>
		<description><![CDATA[http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html This tutorial needs you to understand basic use of 3dsmax. Have you seen Kung Fu Panda The Movie (2008)? It&#8217;s the story about a lazy, irreverent slacker panda, named Po, who is the biggest fan of Kung Fu around. &#8230; <a href="http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-modeling/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html</a></p>
<p>This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Modeling" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_00.jpg" border="0" alt="Kung Fu Panda Modeling" hspace="6" width="107" height="80" />Have you seen <a href="http://www.kungfupanda.com/" target="_blank">Kung Fu Panda The Movie (2008)</a>? It&#8217;s the story about a lazy, irreverent slacker panda, named Po, who is the biggest fan of Kung Fu around. But unwittingly Po becomes the chosen one when enemies threaten the village he lived in. In this tutorial you will learn to create Po model, low poly model version. Don&#8217;t compare the model you will create with the real one you saw in movie. I simplified many things. But at least you&#8217;ll understand how to create one. I planned to create Po character from modeling, texturing, rigging and skinning, also animate him. So let&#8217;s prepare for the first one: modeling.</p>
<p><img title="Kung Fu Panda The Movie" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_themovie.jpg" border="0" alt="Kung Fu Panda The Movie" hspace="6" width="365" height="365" /><br />
Kung Fu Panda The Movie. I really love this movie.</p>
<p>1. First, we need a reference image. Too bad, I can&#8217;t find any reference image I want in the net. So, I decide to draw myself. Look at image below, I prepared a blueprint for you, complete with Po drawing (left and side image). How to create blueprint like this, read previous tutorial <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/modeling-using-blueprint.html">Modeling Using Blueprint.</a></p>
<p>You can <a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_start.zip">download 3dsmax file with blueprint here (3dsmax ver <img src='http://www.xwebgate.com/tmh/wp/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </a>. Also you need to <a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_blueprint_image.zip">download bitmap images for blueprint</a></p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_01.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. Start by creating a sphere in Top viewport. Use Radius=78 and Segments=12. Position this sphere at Po head (look at image below). Apply material to this sphere. Use Opacity=50% so you can see blueprint behind. You can use any color you want. Later, you can change Opacity value at ay time to help you in modeling.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_02.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. In Left or Front viewport, move sphere down while holding Shift. You will get sphere clone. Use Copy for cloning method. In Command Panel, go to Modify tab, increate cloned sphere radius to 117. Place this cloned sphere in Po&#8217;s belly. Select one sphere—any sphere you want—then right click and choose Convert to&gt;Convert to Editable Poly. Next, go to Modify tab, in Edit Geometry rollout, click Attach button and click another sphere. Two sphere will be combined into one object.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_03.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. Activate Polygon selection. Select several polygons like image below, and delete them.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_04.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>5. Change to Vertex selection. In Front and Left viewport, move vertices position. Tips: In Front viewport, you can select a loop of vertices and scale them along horizontal axis using Select and Non-Uniform Scale tool. Use image below for reference.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_05.gif" border="0" alt="Image" hspace="6" width="510" height="404" /></p>
<p>6. Now, choose Border selection. Select two borders like image below. To select more than one border, hold Ctrl while selecting. In Edit Borders rollout, click Bridge to fill gap with new polygons.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_06.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>7. This conclude first part of Po modeling process. Next, you will modify head area.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_07.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_part1_finish.zip">Donwload 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Modeling Part 1 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-3.html">Part 3</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-4.html">Part 4</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy11389 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy11389 = addy11389 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text11389 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy11389 + '\'>' );
 document.write( addy_text11389 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
   document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );  document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Modeling" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_00.jpg" border="0" alt="Kung Fu Panda Modeling" hspace="6" width="107" height="80" />In <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Part 1</a> tutorial, you have created Po&#8217;s basic body shape. Next, you will modify Po&#8217;s head to create eyes, ears, and nose. You will use several tools like Bevel, Extrude, Connect, and many more. Let&#8217;s begin this tutorial section.</p>
<p>1. Continue previous tutorial. Activate Edge selection. In Left viewport, select all vertical edges in head area (look at image below). Then, in Edit Edges rollout, click Connect. Those edges will be divided.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_08.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. Change selection to Vertex. Now, move vertices using image below for reference..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_09.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. Let&#8217;s move on. We are going to create a nose. Select two polygons in nose area. Hold Ctrl while selecting to select more than one polygons. In Edit Polygons rollout, click Bevel. Click and drag in viewport, to add slight Bevel to these polygons. Then, scale polygons using Select And Non-Uniform Scale along horizontal axis, to narrow the polygons. Then add another bevel..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_10.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. Next, select several vertices in nose area (look at image below, make sure vertices in the back are not selected), and move them up and down to create better nose shape.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_11.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>5. Activate Polygon selection. In Front viewport, select half of object (right side). Then, delete those polygons. De-activate all sub-object selection. Next, apply Symmetry modifier. Make sure Mirror Axis=X and Flip is active.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_12.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>6. Let&#8217;s continue by creating eyes. In Modifier Stack, click plus (+) sign left of Editable Poly row, then highlight Vertex selection. In Front viewport, select one vertex in eye area. Then in Edit Vertices rollout, click Chamfer button. Click and drag in viewport to chamfer vertex..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_13.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>7. Change to Edge selection. Select four edges from chamfering result. Then, in Edit Edges rollout, click Settings button right next to Extrude. A small dialog box will open. Enter Extrusion Height = -5 and Extrusion Base Width = 2. Click OK.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_14.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>8. Next, we are going to create an ear. Change to Polygon selection. In Left viewport, select one polygon like image below. Add bevel to this polygon. Then, using Select and Non-Uniform Scale decrease polygon width. Next step, extrude this polygon twice. Modify vertices position to make ear shape.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_15.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>9. Po&#8217;s head is now finished.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_16.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_part2_finish.zip">Download 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Modeling <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Part 1</a> | Part 2 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-3.html">Part 3</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-4.html">Part 4</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy69517 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy69517 = addy69517 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text69517 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy69517 + '\'>' );
 document.write( addy_text69517 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
   document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );  document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Modeling" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_00.jpg" border="0" alt="Kung Fu Panda Modeling" hspace="6" width="107" height="80" />Phew, in <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Part 1</a> tutorial, you have create basic body shape, and in <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a> tutorial you sucessfully modify Po&#8217;s head. Now, it&#8217;s time to create Po&#8217;s leg. You know, Po&#8217;s leg is relatively smaller than original panda&#8217;s. Moreover, if you compared to his belly.</p>
<p>1. Begin by selecting several polygons in Front viewport (look at image below). Delete them.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_17.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. In Perspective viewport, rotate view until you can see bottom part of Po&#8217;s model. Make sure you are still in Polygon selection. Activate 3D Snap Toggle. Then, in Edit Geometry rollout, click Create button. Click four times in order (1-4) in viewport to create new polygon. 3D Snap Toggle is activated to make you select vertex position precisely.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_18.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. Change to Edge selection. Select two edges in newly created polygon (look at image below). Then use Connect to create new edge. Change selection to Vertex. Select vertices in newly created edge. In Front viewport, move them down. Then select one vertex only, and move it closer to another vertex (right image below)</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_19.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. Activate Border selection. Select border in leg area (look at left image below). Move border while holding Shift button in keyboard. Position vertices using blueprint as reference (look at middle image below). Select border again and Shift+drag to create more polygons for leg. This time, in Edit Geometry rollout, click Make Planar: Z button. The result is like right image below.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_20.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>5. Shift+drag border three more times again. Then modify vertices position, both in Front and Left viewport.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_21.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>6. Let&#8217;s continue to create foot. In Left viewport, select several polygons (left image below). Extrude them. Change to Vertex selection. Modify vertices position to create foot shape (right image below).</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_22.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>7. Next, change to Border selection. Select one border in the bottom of foot. Then, in Edit Borders rollout, click Cap button, to fill the hole with polygon..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_23.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>8. To finish modeling the foot, we need one more step. Activate Edge selection. Select all vertical edges in the bottom area of foot. In Edit Geometry rollout, click Slice Plane button. Slice plane will appear in viewport (yellow rectangle). Move slice plane down at the most bottom part of foot. Then click Slice button. When finished, turn off Slice Plane button.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_24.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>9. Next, you are going to create arm and hand.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_25.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_part3_finish.zip">Donwload 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Modeling <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a> | Part 3 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-4.html">Part 4</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy49318 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy49318 = addy49318 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text49318 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy49318 + '\'>' );
 document.write( addy_text49318 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
   document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );  document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Modeling" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_00.jpg" border="0" alt="Kung Fu Panda Modeling" hspace="6" width="107" height="80" />We have created basic body shape (<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Part 1</a>), modeling a head (<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a>), and adding legs (<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-3.html">Part 3</a>). Now, we are going to create arm and hand.</p>
<p>1. Continue your previous lesson. In Left viewport, modify several vertices position (left image below). We need to do that before creating arm. When finished, activate Polygon selection. Select several polygons in area where you will create an arm.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_26.gif" border="0" alt="Image" hspace="6" width="510" height="226" /></p>
<p>2. Apply Extrude to this polygons. In Edit Geometry rollout, click Make Planar: X. Adjust size of polygons using Select and Uniform Scale. In Front viewport, move polygons if necessary to fit blueprint behind. Next, apply Extrude three more times again. You also need to position and scale polygons. When finished, don&#8217;t deselect polygons but delete them. Finally de-activate all sub-object selection.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_27.gif" border="0" alt="Image" hspace="6" width="510" height="224" /></p>
<p>3. To create a hand, we are going to create from a box. Later, we will attach this hand object to Po model. Start by creating Box in Top viewport. Use parameters like image below. Move this box close to Po&#8217;s arm.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_28.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. Convert box into Editable Poly. Adjust several vertices position. Start from Top viewport. Use left image below fro reference. Next, in Front viewport move several vertices up.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_29.gif" border="0" alt="Image" hspace="6" width="510" height="181" /></p>
<p>5. Activate Polygon selection. Select three polygons in hand object. Extrude twice to create fingers. Then, select one polygon, and extrude to create thumb.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_30.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>6. Select, 4 polygons in the wrist area of hand object. Delete them. De-activate all sub-object selection. Now, select Po model object. Go to Modify tab. Highlight Editable Poly row in Modifier Stack. In Edit Geometry rollout, click Attach button, then click hand object in viewport. After this, activate Border selection. Select two borders between hand and arm. In Edit Borders rollout, click Bridge to connect hand and arm.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_31.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>7. In Front viewport, compare model and blueprint. Fit arm and hand based on blueprint behind. You can scale or move vertices..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_32.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>8. Your Kung Fu Panda model is almost finished. Next, we are going to create Po&#8217;s pants.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_33.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_part4_finish.zip">Donwload 3dsmax lesson file up to this point</a></p>
<p>Kung Fu Panda Modeling <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-3.html">Part 3</a> | Part 4 | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-5.html">Part 5</a></p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy92589 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy92589 = addy92589 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text92589 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy92589 + '\'>' );
 document.write( addy_text92589 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
   document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );  document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
<p>This tutorial needs you to understand basic use of 3dsmax.</p>
<p><img title="Kung Fu Panda Modeling" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_00.jpg" border="0" alt="Kung Fu Panda Modeling" hspace="6" width="107" height="80" />After a quite long tutorial step, <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-1.html">Part 1</a>, <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a>, <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-3.html">Part 3</a> and <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-4.html">Part 4</a>, we had a full model of Kung Fu Panda. Well, your Kung Fu Panda model is almost finish. We are only need to add pants for Kung Fu Panda model.</p>
<p>1. Continue your previous lesson. In Left viewport, modify several vertices position (left image below). Use blueprint behind for reference.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_34.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>2. Change selection to Edge. Select vertical edges like image below. Use Connect to create horizontal edges. Activate Vertex selection and modify several vertices position to match blueprint..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_35.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>3. Again activate Edge selection. Select vertical edges like image below. Click Settings button right next to Connect. In opened dialog box, enter Slide = -14. Click OK.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_36.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>4. Select horizontal edges like image below. Tips: you can select one or two edges and then in Selection rollout click Loop. Click Settings button right next to Chamfer. In opened dialog box, makes sure Chamfer Amount=1. Then click OK. You have added small amount of chamfer.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_37.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>5. Activate Polygon selection. Select all polygons constructing pant. Make sure you select only polygons between chamfered edges. Then using Select and Uniform Tool, give slight enlargement..</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_38.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>6. Activate Edge selection. Select edges like image below. Apply Chamfer with Amount=1. Change selection to Polygon. Select polygons like middle image below (you need to select 6 polygons here). Then enlarge them a little bit. You will get a belt.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_39.gif" border="0" alt="Image" hspace="6" width="510" height="422" /></p>
<p>7. Next, select edges like image below (these edges separate pant and body). Give a slight amount of Chamfer, to make boundary between pants and body looks sharp, when we apply model with Turbosmooth.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_40.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>8. Do we forgetting something? Yup, a tail. De-activate all sub-object selection. Right click model and choose Convert to Editable Poly. Then, in Perspective viewport, rotate view until you can see back of Po model. Activate Vertex selection. Select one vertex in the middle of Po&#8217;s buttocks. Use Chamfer. Change selection to Polygon. Select newly created polygon. Then use Bevel three times to create a tail. De-activate all sub-object selection.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_41.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>9. To finish this model. Apply Turbosmooth modifer. Increase Iterations value if you want to get more smooth model.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_42.gif" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p>10. Congrats, you have created Kung Fu Panda model. In the next tutorial, we are going to add texture.</p>
<p><img title="Image" src="http://www.escalight.com/images/stories/tutorials/3dsmax/kungfupanda/kungfupanda_modeling_43.jpg" border="0" alt="Image" hspace="6" width="510" height="344" /></p>
<p><a href="http://www.escalight.com/free-stuff/view-details/3d-models/36-kung-fu-panda.html">Donwload Finished Kung Fu Panda Model </a></p>
<p>Kung Fu Panda Modeling <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 1</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-2.html">Part 2</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-3.html">Part 3</a> | <a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-modeling-part-4.html">Part 4</a> | Part 5</p>
<p><strong>Other tutorials: </strong><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-texturing-part-1.html">Kung Fu Panda Texturing</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-skinning-and-rigging-part-1.html">Kung Fu Panda Rigging and Skinning</a><br />
<a href="http://www.escalight.com/tutorials/3dsmax-tutorials/kung-fu-panda-animation.html">Kung Fu Panda Animation</a></p>
<p>Any question or comments regarding this tutorial should be sent to:<br />
Didik Wijaya, email: <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy54866 = '&#101;sc&#97;l&#105;ght' + '&#64;';
 addy54866 = addy54866 + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 var addy_text54866 = '&#101;sc&#97;l&#105;ght' + '&#64;' + 'y&#97;h&#111;&#111;' + '&#46;' + 'c&#111;m';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy54866 + '\'>' );
 document.write( addy_text54866 );
 document.write( '<\/a>' );
 //\n // --&gt;
// ]]&gt;</script><a href="mailto:escalight@yahoo.com">escalight@yahoo.com</a> <script type="text/javascript">// <![CDATA[
   document.write( '' );
// ]]&gt;</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it <script type="text/javascript">// <![CDATA[
 document.write( '</' );  document.write( 'span>' );
// ]]&gt;</script></p>
<p><a href="http://www.escalight.com/forum">Discuss this tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/09/24/kung-fu-panda-modeling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript 3 Design Patterns</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/09/23/actionscript-3-design-patterns/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/09/23/actionscript-3-design-patterns/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 17:00:03 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Useful Website]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=239</guid>
		<description><![CDATA[http://www.as3dp.com/]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.as3dp.com/">http://www.as3dp.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/09/23/actionscript-3-design-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>http://papervision2.com/</title>
		<link>http://www.xwebgate.com/tmh/wp/2010/09/21/httppapervision2-com/</link>
		<comments>http://www.xwebgate.com/tmh/wp/2010/09/21/httppapervision2-com/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 04:24:48 +0000</pubDate>
		<dc:creator>tmh</dc:creator>
				<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[Useful Website]]></category>
		<category><![CDATA[Papervision2]]></category>

		<guid isPermaLink="false">http://www.xwebgate.com/tmh/wp/?p=237</guid>
		<description><![CDATA[http://papervision2.com/]]></description>
			<content:encoded><![CDATA[<p><a href="http://papervision2.com/">http://papervision2.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xwebgate.com/tmh/wp/2010/09/21/httppapervision2-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

