<?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>Stofko Web Design &#187; Facebook</title>
	<atom:link href="http://stofko.ca/tag/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://stofko.ca</link>
	<description></description>
	<lastBuildDate>Wed, 26 May 2010 12:02:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook Javascript (FBJS) &#8211; Mouseover Events with Animation</title>
		<link>http://stofko.ca/facebook-javascript-fbjs-mouseover-events-with-animation/</link>
		<comments>http://stofko.ca/facebook-javascript-fbjs-mouseover-events-with-animation/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 19:14:45 +0000</pubDate>
		<dc:creator>Bev</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Navigation]]></category>

		<guid isPermaLink="false">http://stofko.ca/?p=83</guid>
		<description><![CDATA[This tutorial will show you how to create a navigation menu that makes use of the Facebook Animation library and mouseover events to fade up and down hidden divs.]]></description>
			<content:encoded><![CDATA[<p>Facebook has provided a nice Animation library that can be used on applications both on and off Facebook. Detailed documentation for the library can be found <a title="FBJS/Animation" href="http://wiki.developers.facebook.com/index.php/FBJS/Animation" target="_blank">here</a>. This tutorial will show you how to create a navigation menu that makes use of the Animation library and mouseover events to fade up and down hidden divs.</p>
<p><span id="more-83"></span></p>
<p>In this example  we will create 3 buttons. Two of the buttons will open a hidden div from which other navigation options are presented, the third button will be a direct link to a new page. You can view a demo <a title="Animated Menu Demo" href="http://apps.facebook.com/example_code/animatedmenu.php" target="_blank">here</a>.</p>
<p>To begin, create the navigation menu. The first button has a hidden div with id &#8216;button1&#8242; containing 3 sub-menu items and a link to close the box. The second button also has a hidden div but this one has a lot of entires requiring a scroll bar. The third button has no sub-menu and hence no hidden div. </p>
<p><code>&lt;ul class="maintabs clearfix"&gt;<br />
  &lt;li&gt;&lt;a id='button1' href='#'&gt;First Button&lt;/a&gt;<br />
      &lt;div id='button1div' class='popup clearfix' style='position:absolute; top:100px; left:65px; height: 180px; display:none; overflow: auto'&gt;<br />
        &lt;ul&gt;<br />
           &lt;li&gt;&lt;a href="# onclick="Animation(document.getElementById('button1div')).to('height', '0px').to('opacity', 0).hide().go(); return false;"&gt;Close this window&lt;/a&gt;<br />
           &lt;li&gt;&lt;a href='page1a.php'&gt;Option A&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1b.php'&gt;Option B&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1c.php'&gt;Option C&lt;/a&gt;&lt;/li&gt;<br />
        &lt;/ul&gt;<br />
      &lt;/div&gt;<br />
  &lt;/li&gt;<br />
  &lt;li&gt;&lt;a id='button2' href='#'&gt;Second Button&lt;/a&gt;<br />
      &lt;div id='button2div' class='popup clearfix' style='position:absolute; top:100px; left:150px; height: 180px; display:none; overflow: auto'&gt;<br />
        &lt;ul&gt;<br />
           &lt;li&gt;&lt;a href="#" onclick="Animation(document.getElementById('button1div')).to('height', '0px').to('opacity', 0).hide().go(); return false;"&gt;Close this window&lt;/a&gt;<br />
           &lt;li&gt;&lt;a href='page1a.php'&gt;Option A&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1b.php'&gt;Option B&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1c.php'&gt;Option C&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1d.php'&gt;Option D&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1e.php'&gt;Option E&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1f.php'&gt;Option F&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1g.php'&gt;Option G&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1h.php'&gt;Option H&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1i.php'&gt;Option I&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1j.php'&gt;Option J&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1k.php'&gt;Option K&lt;/a&gt;&lt;/li&gt;<br />
           &lt;li&gt;&lt;a href='page1l.php'&gt;Option L&lt;/a&gt;&lt;/li&gt;<br />
        &lt;/ul&gt;<br />
     &lt;/div&gt;<br />
  &lt;/li&gt;<br />
  &lt;li&gt;&lt;a id='button3' href='anotherpage.php'&gt;Third Button&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</code></p>
<p>Next we need some FBJS to detect when the mouse moves over the navigation links. In this example I have made each hidden div the same size so they can share the code. It would be simple to change this to use a different size/shape/fade for each div if required. The script first determines which object fired the event. It then closes all other hidden divs and fades up the required new div. </p>
<p><code>&lt;script&gt;<br />
function mouseaction(evt) {<br />
eventFiredBy_ObjectId = evt.target.getId();<br />
if (eventFiredBy_ObjectId == 'button1') targetId = document.getElementById('button1div');<br />
else if (eventFiredBy_ObjectId == 'button2') targetId = document.getElementById('button2div');<br />
 <br />
//First hide all other divs<br />
if (eventFiredBy_ObjectId != 'button1') document.getElementById('button1div').setStyle({display: 'none'});<br />
if (eventFiredBy_ObjectId != 'button2') document.getElementById('button2div').setStyle({display: 'none'});<br />
 <br />
// then make the new div visible:<br />
if (eventFiredBy_ObjectId != 'button3') {<br />
Animation(targetId).to('height', 'auto').from('0px').to('width', '150px').from('0px').to('opacity', 1).from(0).show().go();<br />
}<br />
}<br />
 <br />
//add event listener to divs (mouseover &amp; mouseout)<br />
document.getElementById('button1').addEventListener('mouseover',mouseaction);<br />
document.getElementById('button2').addEventListener('mouseover',mouseaction);<br />
document.getElementById('button3').addEventListener('mouseover',mouseaction);<br />
 <br />
&lt;/script&gt;<br />
</code></p>
<p>Facebook provides a &#8220;blind&#8221; effect which would prevent the text rolling in the box as it opens. We choose not to use it here since we need the scrollbar on the second hidden div.<br />
 <br />
Below the navigation list you need a div that has enough height to exceed the largest hidden div. This will ensure the entire hidden div will be revealed on the mouseover.</p>
<p>To navigate through the menu, the user will mouse over the tabs to open the sub-menu, if any. The sub-menu will remain displayed until the user mouses over another tab or until they select a link from the sub-menu.</p>
<p>The complete example source code is available for download in a text file <a href="http://www.stofko.ca/facebook/Examples/animatedmenu.txt" target="_self">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://stofko.ca/facebook-javascript-fbjs-mouseover-events-with-animation/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Facebook Profile Boxes &#8211; Image Issues</title>
		<link>http://stofko.ca/facebook-profile-boxes-image-issues/</link>
		<comments>http://stofko.ca/facebook-profile-boxes-image-issues/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 14:11:08 +0000</pubDate>
		<dc:creator>Bev</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Profile box]]></category>

		<guid isPermaLink="false">http://stofko.ca/?p=65</guid>
		<description><![CDATA[Facebook image caching not reliable.]]></description>
			<content:encoded><![CDATA[<p>Facebook profile boxes are a great way for an application to improve the user experience and also provide publicity for the application. However, it is not so great when the profile box consists of a bunch of broken links to missing images.</p>
<p>There are currently <a title="Facebook Image Caching bugs" href="http://bugs.developers.facebook.com/buglist.cgi?product=Facebook%20Platform&amp;component=Image%20caching&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED" target="_blank">29 bugs</a> reported against the Facebook image caching mechanism. Some of these problems have been around for over a year, so there is valid reason to be concerned.</p>
<p>Fortunately there is a method you can use that forces Facebook to re-cache your image when calling setFBML.</p>
<p><span id="more-65"></span></p>
<p>By appending the current time to the image name, Facebook believes the image to be new and saves it as a new image.</p>
<p class="codebox"><code>&lt;img src="http://www.mysite.com/images/image.jpg?refresh=&lt;? echo time(); ?&gt;" /&gt;</code></p>
<p>Use this on all your profile box images to ensure you always have valid content displayed.</p>
]]></content:encoded>
			<wfw:commentRss>http://stofko.ca/facebook-profile-boxes-image-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Facebook Profile Boxes</title>
		<link>http://stofko.ca/new-facebook-profile-boxes/</link>
		<comments>http://stofko.ca/new-facebook-profile-boxes/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 14:55:22 +0000</pubDate>
		<dc:creator>Bev</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Profile box]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://stofko.ca/?p=4</guid>
		<description><![CDATA[This tutorial describes how to support the Facebook profile box on the user's Wall tab using the PHP library.]]></description>
			<content:encoded><![CDATA[<p>Facebook has fully launched its new profile, forcing application developers to revisit the coding of a profile box. Fortunately, without making any changes whatsoever, the old style profile boxes will appear successfully on the Boxes tab.</p>
<p>However, for those application developers who want to go one step further, here is a description of how to support the profile box on the user&#8217;s Wall tab using the PHP library.</p>
<p><span id="more-4"></span></p>
<h4>1. Client Library</h4>
<p>First, make sure you have the latest client library. Visit the the <a title="Facebook Client Library Wiki Page" href="http://wiki.developers.facebook.com/index.php/PHP" target="_blank">Facebook client library wiki page </a>for more information and a link to the download. Note that this library drops support for some old functions such as require_add, so if you haven&#8217;t kept your application up-to-date now is the time to do so. The PHP 5 version of the library contains the call you need. If you are using PHP 4 then you need to manually update the library call to look like this:</p>
<p class="codebox"><code>function profile_setFBML($markup, $uid = null, $profile=”, $profile_action=”, $mobile_profile=”, $profile_main=”) {<br />
return $this-&gt;call_method(’facebook.profile.setFBML’, array(’markup’ =&gt; $markup,<br />
‘uid’ =&gt; $uid,<br />
‘profile’ =&gt; $profile,<br />
‘profile_action’ =&gt; $profile_action,<br />
‘mobile_profile’ =&gt; $mobile_profile,<br />
‘profile_main’ =&gt; $profile_main));</code></p>
<h4>2. Reset FBML</h4>
<p>For the profile box to appear on the Wall tab you must load the <a href="http://wiki.developers.facebook.com/index.php/FBML">FBML </a>that will appear there. This is done using the same function that was used to load the old-style profile, only now there is a new parameter &#8220;profile_main&#8221;. In PHP, use the following code to load the profile boxes:</p>
<p class="codebox"><code>$fbml = "&lt;fb:wide&gt;This is a wide profile box on the Boxes tab.&lt;/fb:wide&gt;";<br />
$fbml .= "&lt;fb:narrow&gt;This is a narrow profile box on the Boxes tab.&lt;/fb:narrow&gt;";<br />
$fbml_main = "This is the Wall tab profile data";<br />
$result = $facebook-&gt;api_client-&gt;profile_setFBML(NULL, $user_id, $fbml, NULL, NULL, $fbml_main);<br />
echo "set FBML: result = ".var_export($result,true);<br />
</code></p>
<p>If your return code is NULL, all is well. If not, check the return codes documented on the <a href="http://wiki.developers.facebook.com/index.php/Profile.setFBML">wiki page</a>.</p>
<h4>3. Add to Profile Button</h4>
<p>If you want to make it really easy for the user, program an &#8220;Add to Profile&#8221; button to appear on a canvas page. If the user has not yet added a profile box (on the Boxes or Wall tabs) and the FBML for profile_main was successfully loaded in step 2 then the button will appear. If there is already a profile box displayed, then the button will not appear. The code for the button is simple:</p>
<p class="codebox"><code>&lt;fb:add-section-button section="profile" /&gt;<br />
</code></p>
<p>Note this cannot appear within the dashboard.</p>
<p>That&#8217;s it! You should now have the ability to display a profile box on either the Wall tab or the Boxes tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://stofko.ca/new-facebook-profile-boxes/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
