<?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>Facebook Answers</title>
	<atom:link href="http://facebookanswers.co.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://facebookanswers.co.uk</link>
	<description>Answers to Facebook App Questions</description>
	<lastBuildDate>Thu, 17 May 2012 21:57:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>100% height content with headers and footers.</title>
		<link>http://facebookanswers.co.uk/?p=312</link>
		<comments>http://facebookanswers.co.uk/?p=312#comments</comments>
		<pubDate>Thu, 17 May 2012 21:54:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=312</guid>
		<description><![CDATA[A problem I have had for ages when working with layout, is what happens when there is not much to display on screen. Specifically, what happens to the footer? When you have pages of data, the footer goes at the end, and it all looks normal. You reach the bottom and can go no further. [...]]]></description>
			<content:encoded><![CDATA[<p>A problem I have had for ages when working with layout, is what happens when there is not much to display on screen. Specifically, what happens to the footer? </p>
<p>When you have pages of data, the footer goes at the end, and it all looks normal. You reach the bottom and can go no further.</p>
<p>But when you have less than a page full of data, the footer is not at the bottom. There is an ugly empty space below it, and it looks silly.</p>
<p>During the course of my searching, I have found numerous solutions. </p>
<p>The first one I found was here: <a href="http://www.cssplay.co.uk/layouts/layout.html" title="Semi-fluid footer">http://www.cssplay.co.uk/layouts/layout.html</a></p>
<p>This seemed to do the trick, until I tried viewing it on my tablet, when it broke. Also, if you look at the CSS its full of hacks and is virtually unreadable to me.</p>
<p>The second place I looked was here: <a href="http://peterned.home.xs4all.nl/examples/csslayout1.html" title="100% height with header and footer">http://peterned.home.xs4all.nl/examples/csslayout1.html</a></p>
<p>This worked fine at first, with the caveat that you need to let the background of the central content be controlled by the wrapper div. If you set a different background for the central content you will see that it is not actually stretching to the bottom of the screen at all.</p>
<p>(This is the real problem. Why can&#8217;t you just assign a height of 100% to that central div and let the browser work out the rest?)</p>
<p>However, as soon as you add a second column to this layout, you have a problem. Unless the second column has the same colour background, you run the risk of having it stop short of the bottom of the page.</p>
<p>No, what I want is a layout that allows for multipe columns, with different backgrounds in each column.</p>
<p>And I&#8217;ve finally worked out how to do it!</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 1." src="http://facebookanswers.co.uk/img/blog/layout/layoutheight.jpg" alt="Multiple columns with 100% height" /></p>
<p>The image above shows the same web page through two different browsers. The IE window is bigger, and the footer is at the base of the page. The Chrome window is smaller, and the footer has scrolled off screen.</p>
<p>You can view the page yourself here:<br />
<a href="http://www.facebookanswers.co.uk/code/fullheight/demo.htm" title="100% height with multiple columns.">The first (bugged) demo.</a></p>
<p>Now, the simple way to do this would have been to adapt the old faux-column technique, and give the wrapper div a background image that showed two columns. However, that introduces an image file which has to be edited every time the column width changes in your design. Plus, the technique seems to be frowned upn these days.</p>
<p>Instead, the solution relies on a little lateral thinking.</p>
<p>The second column is wrapped in an absolutely positioned div, with margins to avoid the header and footer.</p>
<p>But hang on a second, you would think that that would cause havoc once the page got bigger than the window. Well, no it doesn&#8217;t, because thats when the wrapped DIV takes over.</p>
<p>Its a very neat trick.</p>
<p>Unfortunately, in its current form, there is a snag. If the menu column has more content than the main column, then the header moves up the page. So this solution isn&#8217;t ideal. There was also a sizing issue in Firefox.</p>
<p>However, I didn&#8217;t give up there. Instead I ploughed on, and came up with this technique:</p>
<p><a href="http://www.facebookanswers.co.uk/code/fullheight/demo2.htm" title="100% height with multiple columns.">The second working demo.</a></p>
<p>If you have ever used the WordPress admin panel, this layout will look familiar. I basically reverse-engineered it and stripped it to the bone, when I realised that it used the exact technique I was looking for. </p>
<p>Here&#8217;s is the complete code for the demo. Note that it is all done using CSS. No javascript whatsoever is used.</p>
<pre class="qoate-code">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head&gt;

&lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;
&lt;style&gt;
html,body {
height:100%;
margin:0;
padding:0;
}

body {
font-family:sans-serif;
font-size:12px;
line-height:1.4em;
min-width:600px;
color:#333;
}

#wrapper {
height:auto;
min-height:100%;
width:100%;
position:relative;
}

#maincontentwrap {
height:100%;
color:#333;
}

#maincontentwrap,#footer {
margin-left:165px;
}

#maincontent {
padding-bottom:65px;
float:left;
width:100%;
}

#menuback,#menuwrap,#menu {
width:145px;
}

#menuback {
position:absolute;
top:0;
bottom:0;
z-index:-1;
}

ul#menu {
clear:left;
margin:0;
padding:0;
list-style:none;
}

.clear {
clear:both;
}

#menuback,#menuwrap {
border-width:0 1px 0 0;
border-style:solid;
background-color:#ececec;
border-color:#ccc;}

#menuwrap {
position:relative;
float:left;
}

#maincontentwrap, ul#menu {
padding-top:28px;
}

#header * {
height:auto;
width:auto;
margin:0;
padding:0;
}

#header {
color:#ccc;
font:normal 13px/28px sans-serif;
height:28px;
position: absolute;
top:0;
left:0;
width:100%;
min-width:600px;
z-index:99999;
background-color:#464646;
}

#footer {
position:absolute;
bottom:0;
left:0;
right:0;
padding:0;
margin: 0 0 0 146px;
border-top-width:1px;
border-top-style:solid;
border-color:#dfdfdf;
background-color: #444;
color: white;
}

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id="wrapper"&gt;
&lt;div id="menuback"&gt;&lt;/div&gt;
&lt;div id="menuwrap"&gt;
&lt;ul id="menu"&gt;
&lt;li&gt;Option 1&lt;/li&gt;
&lt;li&gt;Option 2&lt;/li&gt;
&lt;li&gt;Option 3&lt;/li&gt;
&lt;li&gt;Option 4&lt;/li&gt;
&lt;li&gt;Option 5&lt;/li&gt;
&lt;li&gt;Option 6&lt;/li&gt;
&lt;li&gt;Option 7&lt;/li&gt;
&lt;li&gt;Option 8&lt;/li&gt;
&lt;li&gt;Option 9&lt;/li&gt;
&lt;li&gt;Option 10&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div id="maincontentwrap"&gt;
&lt;div id="maincontent"&gt;
&lt;p&gt;But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?
&lt;/p&gt;

&lt;div class="clear"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div class="clear"&gt;&lt;/div&gt;&lt;/div&gt;  

&lt;div id="footer"&gt;
This is the footer
&lt;div class="clear"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id="header" &gt;
This is the header
&lt;/div&gt;

&lt;div class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;!-- wrapper --&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>I would be interested to hear of any problems people have with the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=312</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Social Plugins and the Facebook Javascript SDK. Part 5 &#8211; CSS</title>
		<link>http://facebookanswers.co.uk/?p=302</link>
		<comments>http://facebookanswers.co.uk/?p=302#comments</comments>
		<pubDate>Tue, 08 May 2012 13:54:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook and Your Site]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=302</guid>
		<description><![CDATA[Its time to make our plugins look pretty. Currently, they are as ugly as sin. I mentioned earlier that I had wrapped the plugins in DIVs, so I could control them with CSS later. The actual HTML is as follows: Class pz_c_one and pz_c_twothree are layout related and specify the width of each plugin container. [...]]]></description>
			<content:encoded><![CDATA[<p>Its time to make our plugins look pretty. Currently, they are as ugly as sin.</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 1." src="http://facebookanswers.co.uk/img/blog/jssdk/css01.jpg" alt="Improving the look of your plugins - Part 1" /></p>
<p>I mentioned earlier that I had wrapped the plugins in DIVs, so I could control them with CSS later. The actual HTML is as follows:</p>
<pre class="qoate-code">
&lt;div class="pz_c_one pz_fbplugin"&gt;
&lt;fb:activity site="quniverse.co.uk" app_id="403933906306438" width="300" height="300" header="true" recommendations="true"&gt;&lt;/fb:activity&gt;
&lt;/div&gt;
&lt;div class="pz_c_twothree pz_fbplugin"&gt;
&lt;fb:comments href="http://www.quniverse.co.uk/" num_posts="5" width="610"&gt;&lt;/fb:comments&gt;
&lt;/div&gt;
</pre>
<p>Class pz_c_one and pz_c_twothree are layout related and specify the width of each plugin container. The class we are really interested in is pz_fbplugin. If you define that as follows, then you will see immediate results.</p>
<pre class="qoate-code">
.pz_fbplugin
{
    background-color: #fff;
}
</pre>
<p>This produces a much more attractive page:</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 2." src="http://facebookanswers.co.uk/img/blog/jssdk/css02.jpg" alt="Improving the look of your plugins - Part 2" /></p>
<p>In fact, for this page, I wouldn&#8217;t want to do any more styling, as the FB colour scheme matches the site design quite well. But what if you had, say, an Orange site, or a red one? In that case, the FB colours would look out of place. So how would you change, say, the background colour of the Recent Activity Heading? Lets say your client wants to &#8220;go green&#8221; on the cheap, by  changing the heading colour to green. How would you do that?</p>
<p>First, you need to work out what CSS is controlling that colour. So, using your browser tool of choice (in our case pressing F12 on Chrome) you drill down to find the correct element.</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 3." src="http://facebookanswers.co.uk/img/blog/jssdk/css03.jpg" alt="Improving the look of your plugins - Part 3" /></p>
<p>Hmm, in this case, it seems to be controlled by the class .uiBoxLightblue</p>
<p>Indeed, if we manually set that to &#8220;green&#8221;, we get our green heading:</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 4." src="http://facebookanswers.co.uk/img/blog/jssdk/css04.jpg" alt="Improving the look of your plugins - Part 4" /></p>
<p>So how do we programatically set the background to green? The plugin is stored in an iFrame, so it won&#8217;t see any CSS specified in your parent page. Try it and see. Instead, we need to inject CSS into the plugin itself.</p>
<p>On Planet Earth, you would do this:</p>
<pre class="qoate-code">
&lt;fb:activity site="quniverse.co.uk" app_id="403933906306438" width="300" height="300" css="mycss.css" header="true" recommendations="true"&gt;&lt;/fb:activity&gt;
</pre>
<p>However, on Planet Facebook, this doesn&#8217;t work. Nor does the code given on Stackoverflow:</p>
<pre class="qoate-code">
&lt;fb:tag name='link'&gt;
&lt;fb:tag-attribute name='rel'&gt;stylesheet&lt;/fb:tag-attribute&gt;
&lt;fb:tag-attribute name='href'&gt;YOUR_FACEBOOK_CANVAS_PAGE/style.css&lt;/fb:tag-attribute&gt;
&lt;fb:tag-attribute name='type'&gt;text/css&lt;/fb:tag-attribute&gt;
&lt;fb:tag-attribute name='media'&gt;all&lt;/fb:tag-attribute&gt;
&lt;/fb:tag&gt;
</pre>
<p>If you try sticking that, or any other HTML, between the fb:activity tags, it renders them <b>before</b> rendering the iframe. So any CSS calls are ignored.</p>
<p>In short, there doesn&#8217;t appear to be a way to inject CSS into an activity plugin.</p>
<p>So how did I do the following then?</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 5." src="http://facebookanswers.co.uk/img/blog/jssdk/css05.png" alt="Improving the look of your plugins - Part 5" /></p>
<p>Simple. </p>
<p>First, I disabled the header, having first noted that it was 33px in height.</p>
<pre class="qoate-code">
&lt;fb:activity site="quniverse.co.uk" app_id="403933906306438" width="300" height="300" css="mycss.css" header="false" recommendations="true"&gt;&lt;/fb:activity&gt;
</pre>
<p>Then I added a DIV wrapper with an id pz_fbactivity. I also removed the pz_fbplugin class from the existing wrapper, and that is now only used for the comments plugin. it is important to remove that class, because it sets the background to white. We want a transparent background, so that the background we apply to pz_fbactivity is visible.</p>
<pre class="qoate-code">
&lt;div class="pz_c_one"&gt;
&lt;div id="pz_fbactivity"&gt;
&lt;fb:activity site="quniverse.co.uk" app_id="403933906306438" width="300" height="300" header="false" recommendations="true"&gt;
&lt;/fb:activity&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="pz_c_twothree pz_fbplugin"&gt;
&lt;fb:comments href="http://www.quniverse.co.uk/" num_posts="5" width="610"&gt;&lt;/fb:comments&gt;
&lt;/div&gt;
</pre>
<p>Then I added a bit of CSS to go with the ID.</p>
<pre class="qoate-code">
#pz_fbactivity
{
    margin-top: 10px;
    padding-top:  33px;
    background-image: url(../images/fb/plugin/activity.png);
    background-repeat: no-repeat;
    background-position: top center;
   }
</pre>
<p>The margin-top is specific to my site. The rest is important however. First, we pad the top by 33px, so that the plugin doesn&#8217;t use it. Secondly we assign our own background image. Note that you don&#8217;t have to use a background image. You could specify a colour or a gradient. Its up to you.</p>
<p>Finally, we need to make the background image. This is what I did. Remember to allow 33px for the header, and another 300px for the body, plus 300px width. Of course, if you specify other dimensions for the plugin your background needs to be adjusted accordingly.</p>
<p><img class="size-full wp-image-9" title="Improving the look of your plugins - Part 6." src="http://facebookanswers.co.uk/img/blog/jssdk/css06.png" alt="Improving the look of your plugins - Part 6" /></p>
<p>And it works quite well! The only thing you cannot change this way, is the text colour. However, the plugin itself does allow for different fonts, a light or dark colour scheme and a different border colour, (in the initial dialog when you create the plugin), so you are not totally helpless when it comes to styling your activity box.</p>
<p>Personally, I see these plugins as a temporary measure for me, until I get fully to grips with the JSSDK and / or PHPSDK. Now I want my attention to  other ways of achieving the same thing. Ideally I want to lose the iframes altogether and have my own widgits which I can fully control&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=302</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Social Plugins and the Javascript SDK. Part 4.</title>
		<link>http://facebookanswers.co.uk/?p=298</link>
		<comments>http://facebookanswers.co.uk/?p=298#comments</comments>
		<pubDate>Mon, 07 May 2012 22:03:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook and Your Site]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=298</guid>
		<description><![CDATA[To fill in that blank area we are going to add an Activity box: https://developers.facebook.com/docs/reference/plugins/activity/ This is actually fairly simple. Just fill in your details&#8230; &#8230;then copy the code across. As I have already added the code to load the JS SDK, I am only interested in the third code chunk of the dialog, as [...]]]></description>
			<content:encoded><![CDATA[<p>To fill in that blank area we are going to add an Activity box:</p>
<p><a href="https://developers.facebook.com/docs/reference/plugins/activity/" title="Adding an Activity Plugin">https://developers.facebook.com/docs/reference/plugins/activity/</a></p>
<p>This is actually fairly simple. Just fill in your details&#8230;</p>
<p><img class="size-full wp-image-9" title="Activities on your Site - Part 1." src="http://facebookanswers.co.uk/img/blog/jssdk/act01.jpg" alt="Activities on your Site - Part 1" /></p>
<p>&#8230;then copy the code across. As I have already added the code to load the JS SDK, I am only interested in the third code chunk of the dialog, as highlighted. I wrapped mine in a DIV so that I could manipulate its position easily using CSS later.</p>
<p><img class="size-full wp-image-9" title="Activities on your Site - Part 2." src="http://facebookanswers.co.uk/img/blog/jssdk/act02.jpg" alt="Activities on your Site - Part 2" /></p>
<p>There you have it. An Activites section. It is in desperate need of CSS formatting, and I will cover that in Part 5. But for now, you can see it is an Activities box.</p>
<p><img class="size-full wp-image-9" title="Activities on your Site - Part 3." src="http://facebookanswers.co.uk/img/blog/jssdk/act03.jpg" alt="Activities on your Site - Part 3" /></p>
<p>Note that if you are using the site Admin facebook ID, you don&#8217;t get anything displayed here for some reason. So log out and try a different facebook account if thats the case.</p>
<p>Right, the next step is to make the plugins look prettier, using CSS.</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=298</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Social Plugins and the Javascript SDK. Part 3.</title>
		<link>http://facebookanswers.co.uk/?p=295</link>
		<comments>http://facebookanswers.co.uk/?p=295#comments</comments>
		<pubDate>Mon, 07 May 2012 09:43:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook and Your Site]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=295</guid>
		<description><![CDATA[Ok, to recap, so far we have done the following: Registered our site on Facebook to get an App ID. Added a LIKE button to the site. Added META tags as per the Facebook Next, lets add some comments: https://developers.facebook.com/docs/reference/plugins/comments/ This is actually fairly simple. Just fill in your details&#8230; &#8230;then copy the code across. [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, to recap, so far we have done the following:</p>
<ul>
<li>Registered our site on Facebook to get an App ID.</li>
<li>Added a LIKE button to the site.</li>
<li>Added META tags as per the Facebook</li>
</ul>
<p>Next, lets add some comments:</p>
<p>https://developers.facebook.com/docs/reference/plugins/comments/</p>
<p>This is actually fairly simple. Just fill in your details&#8230;</p>
<p><img class="size-full wp-image-9" title="Comments on your Site - Part 1." src="http://facebookanswers.co.uk/img/blog/jssdk/com01.jpg" alt="Comments on your Site - Part 1" /></p>
<p>&#8230;then copy the code across. As I have already added the code to load the JS SDK, I am only interested in the third code chunk of the dialog, as highlighted. I wrapped mine in a DIV so that I could manipulate its position easily using CSS later.</p>
<p><img class="size-full wp-image-9" title="Comments on your Site - Part 2." src="http://facebookanswers.co.uk/img/blog/jssdk/com02.jpg" alt="Comments on your Site - Part 2" /></p>
<p>There you have it. A comments section. It is in desperate need of CSS formatting, and I will cover that in Part 5. But for now, you can see it is a comments box.</p>
<p><img class="size-full wp-image-9" title="Comments on your Site - Part 3." src="http://facebookanswers.co.uk/img/blog/jssdk/com03.jpg" alt="Comments on your Site - Part 3" /></p>
<p>Whats more, if you make a comment, it appears on your timeline too, as you would expect.</p>
<p><img class="size-full wp-image-9" title="Comments on your Site - Part 4." src="http://facebookanswers.co.uk/img/blog/jssdk/com04.jpg" alt="Comments on your Site - Part 4" /></p>
<p>Right, looking at the screenshot, there is a gaping hole to the left of the comments box. I am going to put another plugin in that space, in Part 4. </p>
<p>Once that is done, we will look at using CSS to make the plugins prettier. Then we will deal with the no Javascript situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=295</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Social Plugins and the Javascript SDK. Part 2.</title>
		<link>http://facebookanswers.co.uk/?p=293</link>
		<comments>http://facebookanswers.co.uk/?p=293#comments</comments>
		<pubDate>Sun, 06 May 2012 21:50:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook and Your Site]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=293</guid>
		<description><![CDATA[Now that we have our App ID, its time to juice up our website. As you can see it is currently devoid of facebook. First, go here to add a LIKE button. https://developers.facebook.com/docs/reference/plugins/like/ Fill in your site information like that shown below. Then generate the code. You will need to insert different bits in different [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we have our App ID, its time to juice up our website. As you can see it is currently devoid of facebook.</p>
<p><img class="size-full wp-image-9" title="Like Buttons on your Site - Part 1." src="http://facebookanswers.co.uk/img/blog/jssdk/js01.jpg" alt="Like Buttons on your Site - Part 1" /></p>
<p>First, go here to add a LIKE button.</p>
<p>https://developers.facebook.com/docs/reference/plugins/like/</p>
<p>Fill in your site information like that shown below.</p>
<p><img class="size-full wp-image-9" title="Like Buttons on your Site - Part 2." src="http://facebookanswers.co.uk/img/blog/jssdk/js02.jpg" alt="Like Buttons on your Site - Part 2" /></p>
<p>Then generate the code. You will need to insert different bits in different bits of your website.</p>
<p><img class="size-full wp-image-9" title="Like Buttons on your Site - Part 3." src="http://facebookanswers.co.uk/img/blog/jssdk/js03.jpg" alt="Like Buttons on your Site - Part 3" /></p>
<p>Once you have done that, generate some META tags, using the second dialog box.</p>
<p><img class="size-full wp-image-9" title="Like Buttons on your Site - Part 4." src="http://facebookanswers.co.uk/img/blog/jssdk/js04.jpg" alt="Like Buttons on your Site - Part 4" /></p>
<p>Again, generate the code and paste it into the top of your page.</p>
<p><img class="size-full wp-image-9" title="Like Buttons on your Site - Part 5." src="http://facebookanswers.co.uk/img/blog/jssdk/js05.jpg" alt="Like Buttons on your Site - Part 5" /></p>
<p>Use a bit of CSS to position your LIKE button wherever you want.</p>
<p><img class="size-full wp-image-9" title="Like Buttons on your Site - Part 6." src="http://facebookanswers.co.uk/img/blog/jssdk/js06.jpg" alt="Like Buttons on your Site - Part 6" /></p>
<p>Next, we are going to add a comments box to the main page&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=293</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Social Plugins and the Javascript SDK. Part 1.</title>
		<link>http://facebookanswers.co.uk/?p=289</link>
		<comments>http://facebookanswers.co.uk/?p=289#comments</comments>
		<pubDate>Sun, 06 May 2012 21:33:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook and Your Site]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=289</guid>
		<description><![CDATA[Its been a while since I&#8217;ve posted here, but I&#8217;ve finally gotten around to exploring the Javascript SDK. I&#8217;ve steered clear of it in the past because I&#8217;ve traditionally tried to make my sites as inclusive as possible, IE I have wanted them to work with or without Javascript. However, I&#8217;ve decided to embrace the [...]]]></description>
			<content:encoded><![CDATA[<p>Its been a while since I&#8217;ve posted here, but I&#8217;ve finally gotten around to exploring the Javascript SDK. I&#8217;ve steered clear of it in the past because I&#8217;ve traditionally tried to make my sites as inclusive as possible, IE I have wanted them to work with or without Javascript.</p>
<p>However, I&#8217;ve decided to embrace the Javascript SDK now, for a number of reasons:</p>
<ul>
<li>Facebook itself requires Javascript to work properly, unless you use the mobile version.</li>
<li>if you are going the HTML5 route then you will want Javascript to update older browsers (modernizr) and to utilise CANVAS etc.</li>
<li>There is a load of cool stuff you can do with Javascript.</li>
</ul>
<p>Now, you may be wondering why I am even fretting about this. But check out this article: <a href="http://www.punkchip.com/2011/03/why-support-javascript-disabled/" title="Support for Javascript Disabled ">Support for Javascript Disabled</a>.</p>
<p>From that, I think its important to make sure the site still functions without Javascript enabled. However, if it is enabled, there&#8217;s no harm in using it. So my first goal is to get to grips with the SDK on the assumption that all users will be using it. Once I know how to use it properly, I can look at using PHP to support browsers without Javascript.</p>
<p>Before we jump in with some code, there is one fundamental thing you need to do first. The Facebook documentation doesn&#8217;t make much of this point, which is surprising, as it is crucial. Why they omit to mention it is beyond me, but there you go&#8230;</p>
<p><b>Before you implement the plugins you need to register your website with facebook to get an App ID.</b></p>
<p>To register your site, go here:</p>
<p>http://developers.facebook.com/setup/</p>
<p>Once there, give your site a name, but don&#8217;t worry about the Namespace. In my case, I am using my Quniverse test site to experiment.</p>
<p><img class="size-full wp-image-9" title="Registering your Site - Part 1." src="http://facebookanswers.co.uk/img/blog/jssdk/plug01.jpg" alt="Registering your Site - Part 1" /></p>
<p>Then you need to enter your details. Make sure you select to integrate your site with Facebook.</p>
<p><img class="size-full wp-image-9" title="Registering your Site - Part 2." src="http://facebookanswers.co.uk/img/blog/jssdk/plug02.jpg" alt="Registering your Site - Part 2" /></p>
<p>I&#8217;ve also assigned an icon etc. The key thing to note though, is your App ID. You will need this.</p>
<p><img class="size-full wp-image-9" title="Registering your Site - Part 3." src="http://facebookanswers.co.uk/img/blog/jssdk/plug03.jpg" alt="Registering your Site - Part 3" /></p>
<p>Right once we have got that we are going to do the following over the next couple of posts. First we will add a LIKE button using JSSDK. Then we will add a comments box.</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=289</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wow! Teenage girls are tech savvy.</title>
		<link>http://facebookanswers.co.uk/?p=281</link>
		<comments>http://facebookanswers.co.uk/?p=281#comments</comments>
		<pubDate>Wed, 14 Dec 2011 17:31:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[browser usage]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=281</guid>
		<description><![CDATA[One of the sites I have developed for a customer is designed for Prom Dresses, called Prom Palace. I was just looking through the logs, as we have been doing some facebook advertising of late (very useful, you can target much better than using google ads), and I was amazed to see the following browser [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.facebookanswers.co.uk/img/blog/purple.jpg" alt="A tech savvy teenager, yesterday." /><br />
One of the sites I have developed for a customer is designed for Prom Dresses, called <a href="http://www.prompalace.co.uk" title= "Prom Palace">Prom Palace</a>.</p>
<p>I was just looking through the logs, as we have been doing some facebook advertising of late (very useful, you can target much better than using google ads), and I was amazed to see the following browser stats:</p>
<p>Chrome: 42%<br />
 IE: 36% (9: 14%, 8: 17% 7-: 5%)<br />
 Firefox: 12%<br />
 Safari: 9%<br />
 Others: Negligible.</p>
<p>Total hits: 150,000</p>
<p>Compare that to the main bridal site I do, <a href="http://www.glamourousgowns.co.uk" title="Glamourous gowns">Glamourous Gowns</a>, and while they have many more hits (800,000+) they are less tech savvy:</p>
<p>IE: 54% (9: 15%, 8: 26%, 7-: 13%)<br />
 Chrome: 18%<br />
 Firefox: 15%<br />
 Safari: 10%<br />
 Android: 1%<br />
 Others: Negligible</p>
<p>This highlights a number of things:</p>
<p>1. Never guess what your punters are using. Always check the stats.<br />
 2. Chrome is now a heavyweight browser.<br />
 3. Some 25% of my punters won&#8217;t be able to cope with CSS3 and HTML5 etc.<br />
 4. Either, I shouldn&#8217;t spend any time developing mobile versions of the sites, OR I should do them a lot better. At the moment if you access via a smartphone you default to a very basic menu system and an ugly looking display screen. I am investigating JQuery mobile at the moment, so significant improvements may be a few lines of code away&#8230;</p>
<p>Have other people experienced similar trends in browser usage? If so, what industry are they aimed at etc? </p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=281</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boosting Facebook Fan Page Traffic with Tags</title>
		<link>http://facebookanswers.co.uk/?p=278</link>
		<comments>http://facebookanswers.co.uk/?p=278#comments</comments>
		<pubDate>Thu, 24 Nov 2011 20:26:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook Fanpages]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=278</guid>
		<description><![CDATA[Up until a few weeks ago, I thought that tagging on Facebook involved only photographs. I had read various complaints about people&#8217;s privacy being invaded blah blah blah, but hadn&#8217;t paid much attention because I don&#8217;t really use Facebook for photos. However, one day a client asked me how they could get links to appear [...]]]></description>
			<content:encoded><![CDATA[<p>Up until a few weeks ago, I thought that tagging on Facebook involved only photographs. I had read various complaints about people&#8217;s privacy being invaded blah blah blah, but hadn&#8217;t paid much attention because I don&#8217;t really use Facebook for photos.</p>
<p>However, one day a client asked me how they could get links to appear in their wall posts like such and such did. I had no idea what they were talking about until they showed me, and then I was stumped, as I had no idea how it was done. Rather than bore you with the details of what I did next, I will cut to the chase.</p>
<p>This is a tag.</p>
<div class="puz_center">
<img class="size-full wp-image-9" title="Using Facebook Fanpage Tags to boost traffic- Part 1." src="http://facebookanswers.co.uk/img/blog/tag00.jpg" alt="Facebook Fanpage Tags - Part 1" /></div>
<p>Note from the tag, that I have referred to the facebook fanpage in my wall post, and if hovered over, the link produces the bubble as shown.</p>
<p>Now, if you follow that link, you get to the Facebook fanpage. What you don&#8217;t get on that fanpage, is a copy of the post on our wall. However, if the facebook fanpage allowed posts from other people that is exactly what would happen. So using a tag, you not only get a nice engaging link on your own fanpage, but you can also get the same post appearing on the tagged fanpage. This post will be read by all the fans of that page.</p>
<p>Obviously, you have to be careful. You don&#8217;t want to make a load of spam posts which will annoy the fanpage owners you are tagging. Do that and you will get blocked. Also, they will think that you are an idiot and if you are a customer of their&#8217;s they will think twice about sending any business your way in future.</p>
<p>So, the way to use this facility is to write a genuinely engaging wall post that refers to the fanpage you are tagging.</p>
<p>This is how to do it.</p>
<p>The first thing to do is log on using an id that has admin rights to the fan page you want to post on.</p>
<p>Once you have done that, you need to find the link on the right of the screen that says something like &#8220;Use facebook as [My fan page]&#8220;.</p>
<div class="puz_center">
<img class="size-full wp-image-9" title="Using Facebook Fanpage Tags to boost traffic- Part 2." src="http://facebookanswers.co.uk/img/blog/tag01.jpg" alt="Facebook Fanpage Tags - Part 2" /></div>
<p>Click that link, and you are now posting as the fan page. In this case, I am using the fan page of a client of mine; Glamourous Gowns.</p>
<p>Oh, another thing you should do, is to like the fan page you are about to tag. This is a common courtesy, and if you don&#8217;t want to like the fan page you are trying to tag, why on Earth are you tagging them?</p>
<p>Ok, so you are now using Facebook as your fanpage. The next thing you want to do is make a wall post. I know that Glamourous Gowns recently added the new wedding dress ranges from Mori Lee and Forever Yours. So it would be nice to make a wall post mentioning this, and linking to the Glamourous Gowns website. I also know that Mori Lee and Forever Yours both have fan pages on Facebook. So the post will want to tag them.</p>
<p>So I start typing my message, and when I get to the point where I want to add a tag for Mori Lee, I type the @ character, and start typing Mori Lee.</p>
<div class="puz_center">
<img class="size-full wp-image-9" title="Using Facebook Fanpage Tags to boost traffic- Part 3." src="http://facebookanswers.co.uk/img/blog/tag02.jpg" alt="Facebook Fanpage Tags - Part 3" /></div>
<p>Facebook detects that I am trying to type a tag, and presents a dropdown of available tags, based on what I have typed already. I want the MORI LEE BRIDAL GOWN tag, so I select that and continue with the message.</p>
<div class="puz_center">
<img class="size-full wp-image-9" title="Using Facebook Fanpage Tags to boost traffic- Part 4." src="http://facebookanswers.co.uk/img/blog/tag03.jpg" alt="Facebook Fanpage Tags - Part 4" /></div>
<p>As you can see, Facebook highlights the tag and lets you carry on typing.</p>
<p>Once the message is complete, I post it, and see what has happened?</p>
<div class="puz_center">
<img class="size-full wp-image-9" title="Using Facebook Fanpage Tags to boost traffic- Part 5." src="http://facebookanswers.co.uk/img/blog/tag04.jpg" alt="Facebook Fanpage Tags - Part 5" /></div>
<p>Yes, I now have nice tags on my post, pointing to the Mori Lee and Facebook fanpages.</p>
<p>The best is yet to come though&#8230;</p>
<div class="puz_center">
<img class="size-full wp-image-9" title="Using Facebook Fanpage Tags to boost traffic- Part 6." src="http://facebookanswers.co.uk/img/blog/tag05.jpg" alt="Facebook Fanpage Tags - Part 6" /></div>
<p>As you can see here, the Mori Lee Bridal Gown fanpage is configured to show my post! My wall post is now being potentially seen by all fans of this page.</p>
<p>And thats all there is to it. A few things to remember:</p>
<p>1. Tagging on a fanpage only works if you are using facebook as the fanpage.<br />
2. Like the fanpage you tag.<br />
3. Only use tags for legitimate posts.<br />
4. Not every fanpage will show your post, however the tag will always appear on your own fanpage.</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=278</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Action Links to enhance a user&#8217;s post.</title>
		<link>http://facebookanswers.co.uk/?p=270</link>
		<comments>http://facebookanswers.co.uk/?p=270#comments</comments>
		<pubDate>Wed, 28 Sep 2011 10:15:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook PHP Apps]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=270</guid>
		<description><![CDATA[Somebody asked about action links yesterday. Up until now I had never heard of them, but they are quite cute. Basically they allow you to add a link to the bottom of a user&#8217;s post. See it in action. If you run this test app, and use it to post a comment to your wall, [...]]]></description>
			<content:encoded><![CDATA[<p>Somebody asked about action links yesterday. Up until now I had never heard of them, but they are quite cute. Basically they allow you to add a link to the bottom of a user&#8217;s post.</p>
<p><a href="http://apps.facebook.com/icyouriq" title="Test Application for Action Links">See it in action.</a></p>
<p>If you run this test app, and use it to post a comment to your wall, you will notice the &#8220;Sweet FA&#8221; link, which links you to facebookanswers.co.uk.</p>
<p>The full source code for that app is shown in this article:</p>
<p><a href="http://facebookanswers.co.uk/?p=238" title="Publishing to a user's wall">Publishing to a User&#8217;s Wall</a></p>
<p>The important bit of code is here:</p>
<pre class="qoate-code">
$attachment = array
 (
 'access_token'=&gt;$facebook-&gt;getAccessToken(),
 'message' =&gt; 'I\'ve been testing my IQ!',
 'name' =&gt; 'IC-YOUR-IQ',
 'caption' =&gt; 'This is my result:',
 'link' =&gt; 'http://apps.facebook.com/icyouriq/',
 'actions' =&gt; array('name'=&gt;'Sweet FA','link'=&gt;'http://www.facebookanswers.co.uk'),
 'description' =&gt; $cmsg,
 'picture' =&gt; 'http://www.facebookanswers.co.uk/img/misc/iq.jpg'
 );
</pre>
<p>The key bit is the &#8220;actions&#8221; section.</p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=270</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading pictures using the PHP SDK</title>
		<link>http://facebookanswers.co.uk/?p=262</link>
		<comments>http://facebookanswers.co.uk/?p=262#comments</comments>
		<pubDate>Tue, 23 Aug 2011 01:17:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Facebook PHP Apps]]></category>

		<guid isPermaLink="false">http://facebookanswers.co.uk/?p=262</guid>
		<description><![CDATA[NB: this is in response to a question posed on our Facebook Fan Page, and is a work in progress. If you have any comments or see mistakes, don&#8217;t be shy. The code here is rough and ready and liable to revision. So don&#8217;t be surprised if you find errors. The application can be run [...]]]></description>
			<content:encoded><![CDATA[<p>NB: this is in response to a question posed on our Facebook Fan Page, and is a work in progress. If you have any comments or see mistakes, don&#8217;t be shy. The code here is rough and ready and liable to revision. So don&#8217;t be surprised if you find errors.</p>
<p>The application can be run here: <a href="http://apps.facebook.com/photolove/" title="Photo Love" target="_blank">Photo Love</a></p>
<p>If you run the application, you are presented with a list of albums, and you select one. A picture is then uploaded into that album.</p>
<p>There are two programs:</p>
<p>index.php</p>
<pre class="qoate-code">
&lt;?php

// This should point to wherever you have your php facebook api.
require_once ("../src/3.11/facebook.php");
// id of any associated fan page.
$cfanpageid = "142393235804950";
// URL of the above
$cfanpage = "http://www.facebook.com/pages/Face-Answers/142393235804950";
// Application ID
$cappid = "xxxxxxxxxxxxxxx";
// Application Secret
$cappsecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$facebook = new Facebook(array(
'appId' =&gt; $cappid,
'secret' =&gt; $cappsecret,
'cookie' =&gt; true,
'domain' =&gt; 'facebookanswers.co.uk'
));

$user = $facebook-&gt;getUser();

// NOTE!!!! Make sure you use the permissions shown below.

if (!$user) {
    $url = $facebook-&gt;getLoginUrl(array('scope'=&gt; 'read_stream, publish_stream, photo_upload, user_photos, user_photo_video_tags','redirect_uri'=&gt;'http://apps.facebook.com/photolove/'));
    echo "&lt;p&gt;Redirecting to perm request...&lt;/p&gt;";
    echo "&lt;script type=\"text/javascript\"&gt;top.location.href = '$url';&lt;/script&gt;";
} else {

  try {
         $facebook-&gt;setFileUploadSupport(true);
        $likes = $facebook-&gt;api('me/likes');
        $fa_fbfriends = $facebook-&gt;api('me/friends');
        $fa_fbalbums = $facebook-&gt;api('me/albums/');
        $fa_fbme = $facebook-&gt;api('me');
        $fa_fbname = $fa_fbme['name'];
        $fa_fbid = $fa_fbme['id'];
        $fa_fanpageliked = false;
        $fa_appliked = false;
        $fa_accesstoken = $facebook-&gt;getAccessToken();
        foreach ($likes['data'] as $ilike) {
            if ($ilike['id'] == $cfanpageid) {$fa_fanpageliked = true;}
            if ($ilike['id'] == $cappid) {$fa_appliked = true; }
}
 require_once('backend.php');
}

    catch (FacebookApiException $e) {
        $url = $facebook-&gt;getLoginUrl(array('scope'=&gt; 'read_stream, publish_stream, photo_upload, user_photos, user_photo_video_tags','redirect_uri'=&gt;'http://apps.facebook.com/photolove/'));
        echo "Please wait for authorisation…";
        echo "&lt;script type=\"text/javascript\"&gt;top.location.href = '$url';&lt;/script&gt;";
    }

}
</pre>
<p>Nothing new in the above, apart from three points:</p>
<ol>
<li>We are now using SDK 3.11</li>
<li>We are using permissions specific to uploading pictures.</li>
<li>We define an array of albums:        $fa_fbalbums = $facebook->api(&#8216;me/albums/&#8217;);</li>
</ol>
<p>Next we have the actual meat of the code. </p>
<pre class="qoate-code">
&lt;?php

/**
 * @author Dominic Lloyd
 * @copyright 2011
 */

?&gt;
&lt;html&gt;
&lt;head&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;Operation: Photo Love v12.666&lt;/h1&gt;

&lt;?php

if (isset($_POST['PHOTOLOVE'])){

switch ($_POST['PHOTOLOVE']) {
    case "CREATE":
    $newalbumdata = array(
    'access_token'=&gt;$fa_accesstoken,
    'message'=&gt; 'Lovely Photos',
    'name'=&gt; 'Operation: Photo Love');
    $newalbum = $facebook-&gt;api('/me/albums', 'post', $newalbumdata);
    $newalbumid = $newalbum['id'];  

    break;
    case "SELECT":
    $newalbumid = $_POST['album'];  

    break;
    default:
    }
    echo "Boof: ".$newalbumid;

 $newphotodata = array(
     'access_token'=&gt;$fa_accesstoken,
     'message'=&gt; 'Greetings from Facebook Answers!',
     'image'=&gt; '@'.realpath('helloworld.jpg')
     ); 

 $uploadedphoto = $facebook-&gt;api('/'.$newalbumid.'/photos/', 'post', $newphotodata);

        $url = "http://www.facebook.com/media/albums/";
        echo "Going to Galleries…";
        echo "&lt;script type=\"text/javascript\"&gt;top.location.href = '$url';&lt;/script&gt;";
        exit;  

}
        echo "&lt;form method='post'&gt;";
        if (sizeof($fa_fbalbums['data'])==0)
        {
            echo "There are no albums. First you need to create an album.";
            $action = "CREATE";
        }
        else
        {
            $action = "SELECT";

        echo "&lt;label for='album'&gt;Pick an album:&lt;/label&gt;";

        echo "&lt;select name='album'&gt;";
        foreach($fa_fbalbums['data'] as $fa_fbalbum)
        {

            echo "&lt;option value='".$fa_fbalbum['id']."'&gt;".$fa_fbalbum['name']."&lt;/option&gt;";
        }

                echo "&lt;/select&gt;";
                }
        echo "&lt;input type='hidden' name='PHOTOLOVE' value='$action'&gt;";
        echo "&lt;input type='submit' value='Go!'&gt;";
        echo "&lt;/form&gt;";

?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>This routine will either produce a select box allowing you to pick an album, or create an album for you if there are none.</p>
<p>Once you have selected/created an album, a picture is uploaded, and the albums are displayed.</p>
<p>The main thing to note here, is that the picture is uploaded from the server that is running your PHP application. So if you want to enable a user to upload their own picture, you will first need to upload that picture to your server. </p>
]]></content:encoded>
			<wfw:commentRss>http://facebookanswers.co.uk/?feed=rss2&#038;p=262</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

