<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Add picture on facebook wall using php</title>
	<atom:link href="http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/</link>
	<description>TheUnical Technologies Official Blog</description>
	<lastBuildDate>Tue, 24 Jan 2012 22:20:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: pls</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10443</link>
		<dc:creator>pls</dc:creator>
		<pubDate>Thu, 07 Apr 2011 12:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10443</guid>
		<description>Someone can give me an an example ?  I would to integrate this script  in mien but i don&#039;t know how ?

Below it is just a script to ask permissions to the visitors to acess to its information


 FB_APP_ID,
       &#039;secret&#039; =&gt; FB_SECRET_ID,
       &#039;cookie&#039; =&gt; true,
	));

// On récupère la session Facebook de l&#039;utilisateur
$session = $fb-&gt;getSession();

$me = null;

// On teste si la session existe
if ($session) {
	
	try {
			
			// On teste si l&#039;utilisateur est en session
			if (isset($_SESSION[&#039;user&#039;]) &amp;&amp; isset($_SESSION[&#039;uid&#039;])) {
				// On récupère les données en session: Gain en perf: économie d&#039;appel à l&#039;API
				$me = $_SESSION[&#039;user&#039;];
				$uid = $_SESSION[&#039;uid&#039;];
				$user_id = $_SESSION[&#039;user_id&#039;]; // ID du membre en BDD
			}
			else {
				// On récupère l&#039;UID de l&#039;utilisateur Facebook courant
				$uid = $fb-&gt;getUser();
				// On récupère les infos de base de l&#039;utilisateur
				$me = $fb-&gt;api(&#039;/me&#039;);	
				
				// On stock les infos de l&#039;utilisateur en session: Pseudo cache
				$_SESSION[&#039;uid&#039;] = $uid;
				$_SESSION[&#039;user&#039;] = $me;
				
				// Session n&#039;existe pas, on INSERT/MAJ les infos de l&#039;user
				$query = &quot;INSERT INTO user SET uid = &#039;&quot;.$uid.&quot;&#039;, lastname=&#039;&quot;.mysql_real_escape_string($me[&#039;last_name&#039;]).&quot;&#039;, firstname=&#039;&quot;.mysql_real_escape_string($me[&#039;first_name&#039;]).&quot;&#039;, created_at = NOW(), last_login=NOW() ON DUPLICATE KEY UPDATE last_login = NOW()&quot;;
				$res = mysql_query($query);
				
				$user_id = mysql_insert_id();
				$_SESSION[&#039;user_id&#039;] = $user_id;
			} 
			}catch (FacebookApiException $e) {
		
		// S&#039;il y&#039;a un problème lors de la récup, perte de session entre temps, suppression des autorisations...
		
		// On récupère l&#039;URL sur laquelle on devra rediriger l&#039;utilisateur pour le réidentifier sur l&#039;application
		$loginUrl = $fb-&gt;getLoginUrl(
			array(
	            &#039;canvas&#039;    =&gt; 1,
	            &#039;fbconnect&#039; =&gt; 0
			)
		);
		// On le redirige en JS (header PHP pas possible)
		echo &quot;top.location.href = &#039;&quot;.$loginUrl.&quot;&#039;;&quot;;
 		exit();
	}
	
}
else {
	// Si l&#039;utilisateur n&#039;a pas de session
		
	// On récupère l&#039;URL sur laquelle on devra rediriger l&#039;utilisateur pour le réidentifier sur l&#039;application
	$loginUrl = $fb-&gt;getLoginUrl(
	array(
           &#039;canvas&#039;    =&gt; 1,
           &#039;fbconnect&#039; =&gt; 0,
           &#039;req_perms&#039; =&gt; &#039;publish_stream&#039;
	)
);
	// On le redirige en JS (header PHP pas possible)
	echo &quot;top.location.href = &#039;&quot;.$loginUrl.&quot;&#039;;&quot;;
		exit();
}
	
 // On affiche le Header
?&gt;</description>
		<content:encoded><![CDATA[<p>Someone can give me an an example ?  I would to integrate this script  in mien but i don&#8217;t know how ?</p>
<p>Below it is just a script to ask permissions to the visitors to acess to its information</p>
<p> FB_APP_ID,<br />
       &#8216;secret&#8217; =&gt; FB_SECRET_ID,<br />
       &#8216;cookie&#8217; =&gt; true,<br />
	));</p>
<p>// On récupère la session Facebook de l&#8217;utilisateur<br />
$session = $fb-&gt;getSession();</p>
<p>$me = null;</p>
<p>// On teste si la session existe<br />
if ($session) {</p>
<p>	try {</p>
<p>			// On teste si l&#8217;utilisateur est en session<br />
			if (isset($_SESSION['user']) &amp;&amp; isset($_SESSION['uid'])) {<br />
				// On récupère les données en session: Gain en perf: économie d&#8217;appel à l&#8217;API<br />
				$me = $_SESSION['user'];<br />
				$uid = $_SESSION['uid'];<br />
				$user_id = $_SESSION['user_id']; // ID du membre en BDD<br />
			}<br />
			else {<br />
				// On récupère l&#8217;UID de l&#8217;utilisateur Facebook courant<br />
				$uid = $fb-&gt;getUser();<br />
				// On récupère les infos de base de l&#8217;utilisateur<br />
				$me = $fb-&gt;api(&#8216;/me&#8217;);	</p>
<p>				// On stock les infos de l&#8217;utilisateur en session: Pseudo cache<br />
				$_SESSION['uid'] = $uid;<br />
				$_SESSION['user'] = $me;</p>
<p>				// Session n&#8217;existe pas, on INSERT/MAJ les infos de l&#8217;user<br />
				$query = &#8220;INSERT INTO user SET uid = &#8216;&#8221;.$uid.&#8221;&#8216;, lastname=&#8217;&#8221;.mysql_real_escape_string($me['last_name']).&#8221;&#8216;, firstname=&#8217;&#8221;.mysql_real_escape_string($me['first_name']).&#8221;&#8216;, created_at = NOW(), last_login=NOW() ON DUPLICATE KEY UPDATE last_login = NOW()&#8221;;<br />
				$res = mysql_query($query);</p>
<p>				$user_id = mysql_insert_id();<br />
				$_SESSION['user_id'] = $user_id;<br />
			}<br />
			}catch (FacebookApiException $e) {</p>
<p>		// S&#8217;il y&#8217;a un problème lors de la récup, perte de session entre temps, suppression des autorisations&#8230;</p>
<p>		// On récupère l&#8217;URL sur laquelle on devra rediriger l&#8217;utilisateur pour le réidentifier sur l&#8217;application<br />
		$loginUrl = $fb-&gt;getLoginUrl(<br />
			array(<br />
	            &#8216;canvas&#8217;    =&gt; 1,<br />
	            &#8216;fbconnect&#8217; =&gt; 0<br />
			)<br />
		);<br />
		// On le redirige en JS (header PHP pas possible)<br />
		echo &#8220;top.location.href = &#8216;&#8221;.$loginUrl.&#8221;&#8216;;&#8221;;<br />
 		exit();<br />
	}</p>
<p>}<br />
else {<br />
	// Si l&#8217;utilisateur n&#8217;a pas de session</p>
<p>	// On récupère l&#8217;URL sur laquelle on devra rediriger l&#8217;utilisateur pour le réidentifier sur l&#8217;application<br />
	$loginUrl = $fb-&gt;getLoginUrl(<br />
	array(<br />
           &#8216;canvas&#8217;    =&gt; 1,<br />
           &#8216;fbconnect&#8217; =&gt; 0,<br />
           &#8216;req_perms&#8217; =&gt; &#8216;publish_stream&#8217;<br />
	)<br />
);<br />
	// On le redirige en JS (header PHP pas possible)<br />
	echo &#8220;top.location.href = &#8216;&#8221;.$loginUrl.&#8221;&#8216;;&#8221;;<br />
		exit();<br />
}</p>
<p> // On affiche le Header<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vishal</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10322</link>
		<dc:creator>vishal</dc:creator>
		<pubDate>Tue, 01 Mar 2011 12:35:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10322</guid>
		<description>!!!!!!!</description>
		<content:encoded><![CDATA[<p>!!!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Robert</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10320</link>
		<dc:creator>Steven Robert</dc:creator>
		<pubDate>Tue, 01 Mar 2011 03:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10320</guid>
		<description>@vishal Facebook will strip all the html content before publishing to wall</description>
		<content:encoded><![CDATA[<p>@vishal Facebook will strip all the html content before publishing to wall</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vishal</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10319</link>
		<dc:creator>vishal</dc:creator>
		<pubDate>Mon, 28 Feb 2011 16:46:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10319</guid>
		<description>Hi.

My facebook application has an HTML table as the output. Some of its cells have images and others have text elements. Basically, the table is dynamically created using the user profile information. Now I want to publish the same output on the user&#039;s wall. How do I achieve this?
Thanks.</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>My facebook application has an HTML table as the output. Some of its cells have images and others have text elements. Basically, the table is dynamically created using the user profile information. Now I want to publish the same output on the user&#8217;s wall. How do I achieve this?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lizzy</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10288</link>
		<dc:creator>lizzy</dc:creator>
		<pubDate>Tue, 15 Feb 2011 09:12:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10288</guid>
		<description>hi steve, thank you for the reply. got it.
but today I have an error.. 

I think I will reply on to the previous topic, under your &quot;5 Steps to publish...&quot;  topic :)

cheers</description>
		<content:encoded><![CDATA[<p>hi steve, thank you for the reply. got it.<br />
but today I have an error.. </p>
<p>I think I will reply on to the previous topic, under your &#8220;5 Steps to publish&#8230;&#8221;  topic <img src='http://blog.theunical.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Robert</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10281</link>
		<dc:creator>Steven Robert</dc:creator>
		<pubDate>Mon, 14 Feb 2011 04:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10281</guid>
		<description>@Lizzy in line no 9  &quot;image&#039;, &#039;src&#039; =&gt;&quot; here is where u add your image. remember this link should be public and not your local address.</description>
		<content:encoded><![CDATA[<p>@Lizzy in line no 9  &#8220;image&#8217;, &#8216;src&#8217; =&gt;&#8221; here is where u add your image. remember this link should be public and not your local address.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lizzy</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10277</link>
		<dc:creator>lizzy</dc:creator>
		<pubDate>Sun, 13 Feb 2011 09:36:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10277</guid>
		<description>Hi Steven, thank you for your codes.
I have successfully follow the 5 Steps from your previous post, and now am trying to add a picture to it.

in your post from this page
&quot;..then in last program include the below code to publish a photo and also meta data on a facebook wall&quot;

where do I actually have to add the codes above on adding the picture?

Hear from you soon, thanks

liz</description>
		<content:encoded><![CDATA[<p>Hi Steven, thank you for your codes.<br />
I have successfully follow the 5 Steps from your previous post, and now am trying to add a picture to it.</p>
<p>in your post from this page<br />
&#8220;..then in last program include the below code to publish a photo and also meta data on a facebook wall&#8221;</p>
<p>where do I actually have to add the codes above on adding the picture?</p>
<p>Hear from you soon, thanks</p>
<p>liz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Plamen</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10145</link>
		<dc:creator>Plamen</dc:creator>
		<pubDate>Thu, 06 Jan 2011 14:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10145</guid>
		<description>Can you please help me I can&#039;t get your code working.
Except that code from the post what exacly do I need in my .php file to get it working?</description>
		<content:encoded><![CDATA[<p>Can you please help me I can&#8217;t get your code working.<br />
Except that code from the post what exacly do I need in my .php file to get it working?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas Teicher</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-10110</link>
		<dc:creator>Tomas Teicher</dc:creator>
		<pubDate>Mon, 27 Dec 2010 06:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-10110</guid>
		<description>I got same error as Yahya. Is there any facebook documentation where I can find out what every item in array of attachment means? I did not find any documentation of Facebook class on facebook web.</description>
		<content:encoded><![CDATA[<p>I got same error as Yahya. Is there any facebook documentation where I can find out what every item in array of attachment means? I did not find any documentation of Facebook class on facebook web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yahya</title>
		<link>http://blog.theunical.com/facebook-integration/add-picture-on-facebook-wall-using-php/comment-page-1/#comment-7487</link>
		<dc:creator>Yahya</dc:creator>
		<pubDate>Sun, 01 Aug 2010 08:59:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.theunical.com/?p=133650#comment-7487</guid>
		<description>Hi,
I tried sample code on this link http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/ and it works very well. 

But when I tried this example, I keep getting this error &#039;exception &#039;FacebookRestClientException&#039; with message &#039;The post&#039;s links must direct to the application&#039;s connect or canvas&#039;</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I tried sample code on this link <a href="http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/" rel="nofollow">http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/</a> and it works very well. </p>
<p>But when I tried this example, I keep getting this error &#8216;exception &#8216;FacebookRestClientException&#8217; with message &#8216;The post&#8217;s links must direct to the application&#8217;s connect or canvas&#8217;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

