<?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>Thomas Gericke &#187; php</title>
	<atom:link href="http://www.thomasgericke.de/v4/interactive/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thomasgericke.de/v4/interactive/blog</link>
	<description>Facts. Thoughts. Stories. A Blog.</description>
	<lastBuildDate>Thu, 26 Jan 2012 08:42:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Woopra Webanalyse im Test</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2010/08/woopra-webanalyse-im-test/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2010/08/woopra-webanalyse-im-test/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 19:03:50 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[erfahrungsbericht]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[webstats]]></category>
		<category><![CDATA[woopra]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=7182</guid>
		<description><![CDATA[Habe heute Abend Woopra getestet. Geboten wird ein Dien [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-7192" title="Screen shot 2010-08-11 at 8.48.58 PM" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/uploads/2010/08/Screen-shot-2010-08-11-at-8.48.58-PM.png" alt="" width="252" height="45" />Habe heute Abend <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.woopra.com/" target="_blank" title="(140 hits)">Woopra</a> getestet. Geboten wird ein Dienst, welcher Echtzeit-Statistiken von Webseiten generiert. Hierzu wird ein Javascript-Code-Schnipsel auf der gewünschten Website eingebunden, welche einen Connect auf die Woopra-Server macht und dabei Server- und Client-Daten übermittelt. Nette Idee, funktioniert auch. Für mich <strong>dennoch untauglich</strong>. Mehr dazu weiter unten.</p>
<p>Die Bedienung der Woopra-Website ist einfach und intuitiv. Zunächst muss ein Profil angelegt und per E-Mail-Verifizierung bestätigt werden. Dann können die Websites (anhand von Domains) angelegt werden, die getracked werden sollen.</p>
<p>Im Quellcode der fraglichen Webseiten muss nun der kleine Javascript-Schnipsel eingebunden werden. Sofort darauf werden die Live-Statistiken entweder über das Dashboard der Woopra-Website oder aber über ein entsprechendes Desktop-Programm ausgegeben. Ich hatte den Mac OS X Client getestet. Dieser schaut sehr ansprechend aus und stellt die Informationen nett dar.</p>
<p>Für mich kommt Woopra in dieser Form nicht in Frage, denn es deckt nicht mal die Hälfte meiner Anwendungsfälle ab. Konkretes Problem ist, dass ich zahlreiche Seiten betreibe, die keinerlei oder besondere Header-Informationen senden und mit der Javascript-Ausgabe im BODY nicht klar kommen. Spätestens bei einem 301-Header ist hier Schluss, das funktioniert nicht mit Javascript.</p>
<p>Das erinnert mich daran, dass ich mit (m)einem unlängst eingeschlafenen eigenen Webanalyse-Tool weitermachen sollte. Bereits vor einem Jahr hatte ich eine lauffähige Version, die in ähnlicher Weise wie Woopra arbeitet und auch viele brauchbare Daten bereitstellt. Aus Zeitgründen war dieses Projekt eingeschlafen. Vielleicht mache ich bei Gelegenheit damit mal weiter und erfinde Google Analytics neu <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2010/08/woopra-webanalyse-im-test/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 with New Face</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2010/06/wordpress-3-0-with-new-face/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2010/06/wordpress-3-0-with-new-face/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:38:16 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[daily life]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twentyten]]></category>
		<category><![CDATA[USA]]></category>
		<category><![CDATA[vacation]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=5312</guid>
		<description><![CDATA[after migrating websites and databases onto new hardwar [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>after <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.thomasgericke.de/v4/interactive/blog/2010/06/websites-going-into-maintenance-mode-soon-major-database-migration-forced/" target="_blank" title="(82 hits)">migrating websites and databases onto new hardware</a> last weekend, I took the chance and did, what was way long overdue: I made an upgrade to WordPress 3.0 yesterday. Even though several other blogs of friends and those all around the world mentioned heavy problems and various plugins malfunctioning after the upgrade, it worked very well for me.</p>
<p>And as I already was working on the blog, I also changed the theme. The newly released default theme &#8220;<a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wordpress.org/extend/themes/twentyten" target="_blank" title="(97 hits)">Twenty Ten</a>&#8221; looks great, so I&#8217;ve chosen it and I barely changed it. I just uploaded another header image, which now shows <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://en.wikipedia.org/wiki/Lake_Tahoe" target="_blank" title="(63 hits)">Lake Tahoe</a> in California, USA, I activated some widgets and added a menu. That was it.</p>
<p style="text-align: left;">By the way, some Lake Tahoe appetizers: 
<div class="ngg-galleryoverview" id="ngg-gallery-2-5312">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-12" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.thomasgericke.de/v4/interactive/blog/wp-content/gallery/wp3-0/2010-05-07_17-28-06_dscf8924.jpg" title="USA Westcoast 2010" class="shutterset_set_2" >
								<img title="USA Westcoast 2010" alt="USA Westcoast 2010" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/gallery/wp3-0/thumbs/thumbs_2010-05-07_17-28-06_dscf8924.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-22" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.thomasgericke.de/v4/interactive/blog/wp-content/gallery/wp3-0/2010-05-07_18-37-54_dscf8952.jpg" title="USA Westcoast 2010" class="shutterset_set_2" >
								<img title="USA Westcoast 2010" alt="USA Westcoast 2010" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/gallery/wp3-0/thumbs/thumbs_2010-05-07_18-37-54_dscf8952.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-32" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.thomasgericke.de/v4/interactive/blog/wp-content/gallery/wp3-0/2010-05-08_11-27-18_dscf8976.jpg" title="USA Westcoast 2010" class="shutterset_set_2" >
								<img title="USA Westcoast 2010" alt="USA Westcoast 2010" src="http://www.thomasgericke.de/v4/interactive/blog/wp-content/gallery/wp3-0/thumbs/thumbs_2010-05-08_11-27-18_dscf8976.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

</p>
<p>Well, okay. I also deactivated some senseless plugins and installed some new ones. Major changes are:<br />
<span id="more-5312"></span></p>
<ul>
<li>Main page now shows excerpts of posts, if they are longer than short</li>
<li>Facebook&#8217;s Like button was introduces, so please use it <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>Similar posts will be suggested on each posting&#8217;s page</li>
<li>NextGEN Gallery has been (re-)activated</li>
<li>You may now be informed of new comments when leaving a comment</li>
</ul>
<p>Some more words upon Facebook&#8217;s Like button: as mentioned by <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.hombertho.de/2010/04/24/das-gefaellt-mir-eine-facebookfunktion-die-es-jetzt-auch-auf-homebertho-gibt/" target="_blank" title="(342 hits)">Thomas Homberger on his blog</a>, I added the Like button as code sniplet within the themes single.php file, since all the plugins do use more space of the page than useful. How to do this is very well <a href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://www.loadblog.de/software/facebook-like-button-wordpress-plugin-empfehlen-gefaellt-mir/" target="_blank" title="(101 hits)">described on this page</a> (in German).</p>
<p>If you like the Lake Tahoe picture, be prepared to see more photos of my last three week vacation to the U.S. Westcoast soon. Stay tuned.</p>
<p>Of course, I&#8217;d love to read your comments (English or German) upon the new layout as well as suggestions. <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Bye.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2010/06/wordpress-3-0-with-new-face/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>unfake.it: performance increase and temporary twitter failure</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/12/unfakeit-performance-increase-and-temporary-twitter-failure/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/12/unfakeit-performance-increase-and-temporary-twitter-failure/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:02:25 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[unfake]]></category>
		<category><![CDATA[url shortening]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=4541</guid>
		<description><![CDATA[Hi there,

during the past few days, unfake.it's perf [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>during the past few days, <a title="unfake.it (705 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a>&#8216;s performance increased dramatically. Several scripts and jobs have been <strong>moved onto new servers</strong>, the database structure and various <code>SQL</code> statements have been enhanced and even <code>SQL SELECT</code> statements have been optimized to more and more use readonly slave servers. Most URLs are being faked in much less than <strong>a tenth of a second</strong>. The <a title="magical previews (296 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/help.php#preview" target="_blank">magical preview</a>s of faked URLs are generated <strong>almost instantly</strong>, since performance increased dramatically.</p>
<p>Unfortunately, faked URLs weren&#8217;t posted to <a title="Twitter (111 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://twitter.com/" target="_blank">Twitter</a> when using the <a title="WordPress Plugin (603 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wordpress.org/extend/plugins/url-shortener-for-twitter-tools/" target="_blank">WordPress Plugin</a> during the past 4 hours due to a <strong>tiny misconfiguration</strong>. This issue could be solved.</p>
<p><a title="unfake.it (705 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/" target="_blank">unfake.it</a> has become <strong>a more and more commonly used URL shortener</strong> during the past months. Almost <strong>1.000 URLs</strong> are faked in a 24 hour period, even though this magic edge has not yet been crossed. See the <a title="stats (392 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://unfake.it/stats.php" target="_blank">stats</a> for more information &#8217;bout that.</p>
<p>Bye, Thomas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/12/unfakeit-performance-increase-and-temporary-twitter-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: publishing content on newsfeeds using a facebook application</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/08/howto-publishing-content-on-newsfeeds-using-a-facebook-application/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/08/howto-publishing-content-on-newsfeeds-using-a-facebook-application/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 19:08:56 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[FBJS]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=4271</guid>
		<description><![CDATA[Hi there!
Quite a while ago, I started writing my firs [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p>Quite a while ago, I started writing my first and own <a title="unfake.it's facebook application (216 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://apps.facebook.com/unfake_it/" target="_blank">facebook application</a>. I got stuck while trying to publish content to my own profile page and also to my friends&#8217; newsfeeds. I stumbled upon several problems. Either there was no content displayed, it was formatted in a wrong way, it was not published on my friends&#8217; newsfeeds or it even was published on behalf of my friends&#8217; username. It was quite strange to me and I could not find an easy documentation on how to do it the right way.</p>
<p>I played around with <a title="Stream.publish (256 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Stream.publish" target="_blank">Stream.publish</a>, <a title="Feed.publishUserAction (206 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Feed.publishUserAction" target="_blank">Feed.publishUserAction</a> or <a title="Notifications.send (220 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Notifications.send" target="_blank">Notifications.send</a> &#8211; none of those functions did what I wanted them to do. This may be so, because I did not fully understand their purposes.</p>
<p><strong>So, this is my way to do it.</strong> I am using the <a title="FBJS (208 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/FBJS" target="_blank">FBJS</a> (FaceBook JavaScript) popup call <a title="Facebook.showFeedDialog (291 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/Facebook.showFeedDialog" target="_blank">Facebook.showFeedDialog</a>. This is truely (as far as I&#8217;m concerned) the best and easiest way.</p>
<p>First of all, I assume you are familiar with how to build an facebook application from scratch. If not, please read the <a title="developer's documentation (428 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://developers.facebook.com/get_started.php" target="_blank">developer&#8217;s documentation</a>.</p>
<p><strong><span style="text-decoration: underline;">Step 1: build and register your Feed Template Bundle</span></strong></p>
<ol>
<li>go to the <a title="Feed Template Console (533 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://developers.facebook.com/tools.php?feed" target="_blank">Feed Template Console</a></li>
<li>choose your application and hit &#8220;Next&#8221;</li>
<li>create a template for your &#8220;One Line Story&#8221; and hit &#8220;Next&#8221;</li>
<li>create a template for your &#8220;Short Story&#8221; and hit &#8220;Next&#8221;</li>
<li>create Action Links and hit &#8220;Next&#8221;</li>
<li>hit &#8220;Register Template Bundle&#8221;</li>
<li>copy and save the Template Bundle ID given in the popup (you will have to paste it into your application&#8217;s code later)</li>
</ol>
<p>When doing this, you may enter any text or even HyperText in the fields for the <strong>One Line</strong> or <strong>Short Story</strong>. You also may enter predefined tags such as <code>{*actor*}</code> or your own defined tags such as <code>{*foobar*}</code>. In the <strong>Sample Template Data</strong>, you may enter the tag definitions and display a preview. What you enter there and at this very moment has <em><strong>no effect on the content displayed within your application later</strong></em>! That&#8217;s just for previewing purposes. The real content will be defined later in your application&#8217;s script. Remember that! Some Examples for your Sample Template Data at this point may be:</p>
<p>
<pre class="brush: php">{&amp;quot;foobar&amp;quot;: &amp;quot;This is a foobar text&amp;quot;}</pre>
</p>
<p>Or a bit more complex:</p>
<p>
<pre class="brush: php">{&amp;quot;foolink&amp;quot;: &amp;quot;&amp;lt;a href=&amp;quot;http://www.google.com/&amp;quot;&amp;gt;Google&amp;lt;/a&amp;gt;&amp;quot;,&lt;/p&gt;
&lt;p&gt;&amp;quot;images&amp;quot;:[{&amp;quot;src&amp;quot;:&amp;quot;http://domain.com/image1.jpg&amp;quot;, &amp;quot;href&amp;quot;:&amp;quot;&amp;lt;a href=&amp;quot;http://www.facebook.com/&amp;quot;&amp;gt;http://www.facebook.com&amp;lt;/a&amp;gt;&amp;quot;},&lt;/p&gt;
&lt;p&gt;{&amp;quot;src&amp;quot;: &amp;quot;http://anotherdomain.com/image2.jpg&amp;quot;, &amp;quot;href&amp;quot;:&amp;quot;&amp;lt;a href=&amp;quot;http://www.facebook.com/&amp;quot;&amp;gt;http://www.facebook.com&amp;lt;/a&amp;gt;&amp;quot;}]}</pre>
</p>
<p>You see, e.g . the <code>{*images*}</code> tag is defined as some sort of array consisting of multiple SRC and HREF values. Attention: the special tag <code>{*images*}</code> is displayed automatically on Short Stories, you don&#8217;t need to call them!</p>
<p><strong><span style="text-decoration: underline;">2. write your application&#8217;s content</span></strong></p>
<p>
<pre class="brush: php">&lt;?PHP&lt;/p&gt;
&lt;p&gt;require_once &#039;facebook-platform/php/facebook.php&#039;;&lt;/p&gt;
&lt;p&gt;$appid = &#039;xxxxxxxxx&#039;; // your app ID&lt;/p&gt;
&lt;p&gt;$appapikey = &#039;XXXXXXXXXXXXXXXX; // your app key&lt;/p&gt;
&lt;p&gt;$appsecret = &#039;XXXXXXXXXXXXXXXX&#039;; // your app secret&lt;/p&gt;
&lt;p&gt;$template_bundle_id = &#039;xxxxxxxxxxxxxxxx&#039;; // the ID you got in Step 1&lt;/p&gt;
&lt;p&gt;$facebook = new Facebook($appapikey, $appsecret);&lt;/p&gt;
&lt;p&gt;$user_id = $facebook-&gt;require_login();&lt;/p&gt;
&lt;p&gt;echo &quot;&lt;p&gt;Hello, &lt;fb:name uid=\&quot;$user_id\&quot; useyou=\&quot;false\&quot; /&gt;!&lt;/p&gt;&quot;;&lt;/p&gt;
&lt;p&gt;?&gt;&lt;/p&gt;
&lt;p&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--&lt;/p&gt;
&lt;p&gt;    var template_bundle_id =&quot;&quot;;&lt;/p&gt;
&lt;p&gt;    var url=&quot;http://www.google.com/&quot;;&lt;/p&gt;
&lt;p&gt;    var user_message_prompt = &quot;Share this URL with your friends?&quot;;&lt;/p&gt;
&lt;p&gt;    var user_message = {value: &quot;wants to share a greate website.&quot;};&lt;/p&gt;
&lt;p&gt;    var image =&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;;&lt;/p&gt;
&lt;p&gt;    var template_data = {&quot;url&quot;: url,&lt;/p&gt;
&lt;p&gt;                                  &quot;images&quot;: [{&#039;href&#039;: url, &#039;src&#039; : image}]};&lt;/p&gt;
&lt;p&gt;    Facebook.showFeedDialog(template_bundle_id, template_data, &#039;&#039;, &#039;&#039;, &#039;&#039;, user_message_prompt, user_message);&lt;/p&gt;
&lt;p&gt;// --&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;</pre>
</p>
<p><strong>This is it.</strong></p>
<p>Every time you call your application&#8217;s page, you&#8217;ll get a facebook popup asking you to display the content on your profile and even in your friends&#8217; newsfeeds. Of course, it does not make any sense to share some data every time you call your application&#8217;s canvas page, so you may want to add some more code to your application.</p>
<p>The text to be shared is the text you entered when registering the Template Bundle in Step 1. If you get an error, please make sure the defined variables (such as &#8220;url&#8221; or &#8220;images&#8221;) are valid and do exist. In other words: <strong>whatever you call in your Template Bundle, it has to be defined in your script</strong>.</p>
<p>Of course, you may generate the content dynamically from a database or any other source.</p>
<p>I hope this HOWTO helped.</p>
<p>Bye, T.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/08/howto-publishing-content-on-newsfeeds-using-a-facebook-application/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Updating profile boxes with a facebook app</title>
		<link>http://www.thomasgericke.de/v4/interactive/blog/2009/03/updating-profile-boxes-with-a-facebook-app/</link>
		<comments>http://www.thomasgericke.de/v4/interactive/blog/2009/03/updating-profile-boxes-with-a-facebook-app/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:52:33 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thomasgericke.de/v4/interactive/blog/?p=1601</guid>
		<description><![CDATA[Hi there!

A few days ago, I started to write my firs [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there!</p>
<p>A few days ago, I started to write <strong>my first own facebook application</strong>. It all went quite okay until one certain point: I wanted my application to update the profile box of the user, which uses the app at that single moment. And that wasn&#8217;t as easy, as I thought.</p>
<p>The problem was: after the profile box has been updated, <strong>all profile boxes of all users had the same content</strong> &#8211; the content of the user who last updated his profile box.</p>
<p>I will come to the solution later. First of all, a quick explanation of what I needed to do:</p>
<ol>
<li>I <strong>read the documentation</strong> of facebook&#8217;s application guide to understand the <a title="API (202 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/API" target="_blank">API</a> and the <a title="FBML (232 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://wiki.developers.facebook.com/index.php/FBML" target="_blank">FBML language</a></li>
<li>I <strong>set up my own application</strong> using the <a title="step-by-step guide (428 hits)" href="http://www.thomasgericke.de/v4/interactive/blog/go.php?http://developers.facebook.com/get_started.php" target="_blank">step-by-step guide</a></li>
<li>I <strong>set up my new application on my own host</strong> including facebook&#8217;s PHP libraries</li>
</ol>
<p><strong>Here&#8217;s the code step-by-step </strong>(just put all sniplets together)<strong>:</strong></p>
<p><strong><code>Code sniplet #1</code></strong></p>
<pre class="brush: php">require_once &#039;facebook-platform/php/facebook.php&#039;;

$appid = &#039;xxxxxxxxxxxx&#039;;
$appapikey = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;
$appsecret = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;

$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook-&gt;require_login();</pre>
<p><strong>Above:</strong> first of all, we need to include facebook&#8217;s <strong>PHP libraries</strong>, define several <strong>variables</strong> for our application, <strong>initialize our facebook object</strong> and <strong>retrieve the UID</strong> of the user who currently uses the application.</p>
<p><strong><code>Code sniplet #2</code></strong></p>
<pre class="brush: php">$fb_box = &quot;&lt;H4 class=&#039;box_header clearfix&#039;&gt;&lt;span&gt;&quot;;
$fb_box .= &quot;Hello World!&quot;;
$fb_box .= &quot;&lt;/span&gt;&lt;/H4&gt;&quot;;
$fb_box .= &quot;&lt;div&gt;I am &quot;;
$fb_box .= &quot;&lt;fb:name uid=\&quot;$user_id\&quot; useyou=\&quot;false\&quot; /&gt;.&quot;;
$fb_box .= &quot;Nice you&#039;re on my page.&lt;/div&gt;&quot;;
$fb_box .= &quot;Some more content in HTML or FBML...&quot;;</pre>
<p><strong>Above:</strong> we then define the <strong>content</strong> which we want to be displayed <strong>within the profile box</strong>. In this examble, it will be the name of the user, greeting the visitor.</p>
<p><strong><code>Code sniplet #3</code></strong></p>
<pre class="brush: php">$fb_box_handle = &#039;pb_&#039; . $appid . &#039;_&#039; . $user_id;</pre>
<p><strong>Above:</strong> this is <strong>important</strong>! At this point, I got stuck for a while. The reason was, facebook <strong>caches</strong> profile boxes content until the application&#8217;s canvas page is requested for the next time. <strong>The handle is very important</strong> for that caching mechanism, since it has to be <strong>a unique identifier</strong> for each application and each user. For that reason, I simply use the prefix &#8216;<strong>pb_</strong>&#8216; followed by the <strong>applications ID</strong> (defined above) and the <strong>UID</strong> of the current user (also defined above)!</p>
<p><strong><code>Code sniplet #4</code></strong></p>
<pre class="brush: php">$facebook-&gt;api_client-&gt;call_method(&#039;facebook.profile.setFBML&#039;,
array(
&#039;api_key&#039; =&gt; $appapikey,
&#039;v&#039; =&gt; &#039;1.0&#039;,
&#039;uid&#039; =&gt; $user_id,
&#039;profile&#039; =&gt; &#039;&lt;fb:narrow&gt;&lt;fb:ref handle=&quot;&#039; . $fb_box_handle . &#039;&quot; /&gt;&lt;/fb:narrow&gt;&#039;,
&#039;profile_main&#039; =&gt; &#039;&lt;fb:ref handle=&quot;&#039; . $fb_box_handle . &#039;&quot; /&gt;&#039;,
)
);</pre>
<p><strong>Above:</strong> the rest is quite simple. We make an <strong>API call</strong> to facebook and send our <strong>application key</strong>, the <strong>protocol version</strong>, the <strong>UID</strong> of the facebook user whose profile box ought to be updated and, of course, the <strong>content</strong> for that box. The content will be sent as the <strong>reference handle</strong> we defined earlier.</p>
<p>If you want to update multiple profile boxes with one single API call, I guess, this could work if you send an array containing the UIDs. If not, you can still get all those UIDs, walk through the array and perform multiple API calls. I read somewhere, some users had problem updating large numbers of profiles&#8230; Just give it a try.</p>
<p>Comments (if it worked for you or even if it didn&#8217;t) are appreciated <img src='http://www.thomasgericke.de/v4/interactive/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><code>UPDATE because of comment #2:</code></p>
<p>The example above is about updating content in a users profile, <strong>not</strong> about setting up a profile box on a profile. You should read the manual carefully.</p>
<p>A user has to approve a certain application to create a profile box. Therefore, you need to <strong>render a button</strong>, which sets up the box.  You can easily do this by:</p>
<pre class="brush: php">$appapikey = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;
$appsecret = &#039;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#039;;
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook-&gt;require_login();
$facebook-&gt;api_client-&gt;profile_setFBML($appapikey, $user_id, &#039;profile&#039;, NULL, &#039;mobile_profile&#039;, &#039;profile_main&#039;);
echo &quot;&lt;fb:add-section-button section=&#039;profile&#039; /&gt;&quot;;</pre>
<p>The last line renders the button, you want to have on your canvas page.</p>
<p>Good luck!  Thomas</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thomasgericke.de/v4/interactive/blog/2009/03/updating-profile-boxes-with-a-facebook-app/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

