<?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>Server Side Guy &#187; Facebook</title>
	<atom:link href="http://serversideguy.com/category/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://serversideguy.com</link>
	<description>Just another Barsness Solutions weblog</description>
	<lastBuildDate>Wed, 04 Apr 2012 21:37:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting Facebook User Info With PHP and Facebook Connect</title>
		<link>http://serversideguy.com/2009/05/21/getting-facebook-user-info-with-php-and-facebook-connect/</link>
		<comments>http://serversideguy.com/2009/05/21/getting-facebook-user-info-with-php-and-facebook-connect/#comments</comments>
		<pubDate>Thu, 21 May 2009 16:21:19 +0000</pubDate>
		<dc:creator>Andy Stramer</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Connect]]></category>
		<category><![CDATA[Facebook Connect]]></category>

		<guid isPermaLink="false">http://serversideguy.com/?p=13</guid>
		<description><![CDATA[Recently for a site I&#8217;ve been working on we wanted to have the ability to track a great deal of user activity without them having to go through a &#8220;Register User&#8221; process. Facebook Connect was a logical choice since almost everyone uses it now especially the target market for our site.  Facebook Connect is very [...]]]></description>
			<content:encoded><![CDATA[<p>Recently for a site I&#8217;ve been working on we wanted to have the ability to track a great deal of user activity without them having to go through a &#8220;Register User&#8221; process. Facebook Connect was a logical choice since almost everyone uses it now especially the target market for our site.  Facebook Connect is very easy to implement however most of the tutorials and beginners guides have you use javascript. If you just want a user to comment or do other simple actions, this works great but we needed more. That&#8217;s when I was pleasured to hear they have PHP library too!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require</span> <span style="color: #0000ff;">&quot;library/facebook-platform/client/facebook.php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$facebook</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Facebook<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;your app key&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;your app secret&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$uid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_loggedin_user</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will return users id if connected and logged in to your app*</span>
<span style="color: #000088;">$userDetails</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">users_getInfo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uid</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;last_name&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;first_name&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pic</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$userDetails</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The above will set the user&#8217;s Facebook Profile Pic to $pic. Making a class of my own out all these pulled details, I soon had everything I need easily at hand and I could integrate them right into our site almost right away.</p>
<p>I would suggest taking the time to adjust to the PHP library for anyone wanting to implement Facebook Connect. I feel it is much more versatile and you won&#8217;t have to rely on the fact your user has javascript enabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://serversideguy.com/2009/05/21/getting-facebook-user-info-with-php-and-facebook-connect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

