<?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>Nazly [Web Log] &#187; Technology</title>
	<atom:link href="http://www.nazly.net/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nazly.net</link>
	<description>Personal Weblog of Nazly Ahmed : Web Developer. PHP Addict. Wordpress Hacker. FOSS Enthusiast. (Micro)Blogger. Cricket Fanatic. Husband. Dad.</description>
	<lastBuildDate>Mon, 24 Oct 2011 08:06:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress for Android</title>
		<link>http://www.nazly.net/wordpress-for-android/</link>
		<comments>http://www.nazly.net/wordpress-for-android/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 08:06:38 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ace]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[galaxy]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/wordpress-for-android/</guid>
		<description><![CDATA[Nothing much to say, but inspired by Himal&#8216;s blogging from phone business, I just installed the official WordPress application for Android which is really cool. Hopefully this will improve the rate of my blogging. Really hopeful.. Posted from WordPress for (&#8230;)<p><a href="http://www.nazly.net/wordpress-for-android/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img  alt="image" src="http://www.nazly.net/wp-content/uploads/2011/10/wpid-1319443436402.jpg" /></p>
<p>Nothing much to say, but inspired by <a href="http://himalkk.wordpress.com">Himal</a>&#8216;s blogging from phone business, I just installed the official <a href="http://android.wordpress.org">WordPress application for Android</a> which is really cool.</p>
<p>Hopefully this will improve the rate of my blogging. Really hopeful..</p>
<p><span class="post_sig">Posted from WordPress for Android</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/wordpress-for-android/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finally I have moved to Android</title>
		<link>http://www.nazly.net/finally-i-have-moved-to-android/</link>
		<comments>http://www.nazly.net/finally-i-have-moved-to-android/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 02:44:47 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ace]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[e71]]></category>
		<category><![CDATA[galaxy]]></category>
		<category><![CDATA[gingerbread]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[qwerty]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[steve]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1512</guid>
		<description><![CDATA[The day I decided to make a move towards an Android based device is so significant because the world was in tears for the loss of Steve Jobs. Though the events don&#8217;t co-relate, it took me a very long time (&#8230;)<p><a href="http://www.nazly.net/finally-i-have-moved-to-android/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>The day I decided to make a move towards an <a href="http://en.wikipedia.org/wiki/Android_%28operating_system%29" target="_blank">Android</a> based device is so significant because the world was in tears for the loss of Steve Jobs. Though the events don&#8217;t co-relate, it took me a very long time to give up on my long lasting love towards Nokia / Symbian. I was disheartened to hear the news that <a href="http://www.zdnet.com/blog/btl/nokia-chief-outlines-windows-phone-strategy-warns-of-android-uncertainty/57723" target="_blank">Nokia would ship with Windows</a>. Being a Nokia device fanatic, I expected that Nokia would ship with Android some day. When it was not the case, I had to make the move.</p>
<p><span id="more-1512"></span>Though I was a secret admirer of Apple products, simply because of it&#8217;s solid hardware and design that you immediately fall in love over with, it was never affordable, and I never owned one.</p>
<p>In the case of Nokia, it has been the device most of the time for me and Symbian playing a 40% role. The last Nokia phone I had was an E71, which is a by far the best phone I had. The QWERTY keyboard on that phone is something I couldn&#8217;t give up on and I had serious doubts over movings towards a phone that had a touch / soft keyboard. I knew I had to move on coz I was the only one left out.</p>
<p><img src="http://www.nazly.net/wp-content/uploads/2011/10/Samsung-Galaxy-Ace-black-225x211.jpg" alt="" title="Samsung-Galaxy-Ace-black" width="225" height="211" class="alignleft size-medium wp-image-1521" /> I chose Samsung Galaxy Ace, simply for its minimalistic design. And it probably had the best hardware in the price range I was looking for. It has a 800 MHz ARM 11 processor which is faster than the desktop PC I had 12 years before. I was under the impression that Ace ships with Android 2.2 but to my surprise, it came with Android 2.3.4 (Ginderbread) pre-loaded. When I cross checked with older versions, Gingerbread had some major improvements, specially related to Applications. It provides better insights of what is running in the background, CPU and Memory usage, and the ability to kill apps. The Ace has only 158MB of internal storage which I was told can be the real problem when it comes to managing installed apps. But Gingerbread seems to have solved the problem as most of the apps gets installed on the SD card. Shed some light as I didn&#8217;t dig much on this.</p>
<p>The only drawback I experienced so far in the Ace is the battery life. 3G / HSPA usage simply drains the battery to its knees and I hardly could use it for a day. To save on that you can cut down the Auto-Sync, but I rather use the quick shortcut in Ginderbread which allows me to Deactivate the Network Mode, which I do when I&#8217;m not using it. Using Wi-Fi seems to be the best, as it hardly kills the battery.</p>
<p>Being a GNU/Linux user for almost 6 years, this is rather a late move. I regret not doing this much earlier, but happy that I did it at least by now. It has something to do with my inability to adapt.</p>
<p>Still early stages, will keep posting my reviews as it comes along..</p>
<p><strong>* Update [17th October 2011 14:50]</strong></p>
<ul>
<li>When under direct sunlight, the content on the screen is barely visible or readable.</li>
<li>The voice clarity is quit low even when the In-Call volume is set to the max.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/finally-i-have-moved-to-android/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>What&#8217;s up with October 1st?</title>
		<link>http://www.nazly.net/whats-up-with-october-1st/</link>
		<comments>http://www.nazly.net/whats-up-with-october-1st/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 04:57:58 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[colombo]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[october]]></category>
		<category><![CDATA[seatbelt]]></category>
		<category><![CDATA[srilanka]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1503</guid>
		<description><![CDATA[If you didn&#8217;t notice or really didn&#8217;t care, October 1st 2011, tomorrow, seems to be a day that has been marked to bring quite a few changes in to effect. At least the changes that I have some interest over.. (&#8230;)<p><a href="http://www.nazly.net/whats-up-with-october-1st/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you didn&#8217;t notice or really didn&#8217;t care, October 1st 2011, tomorrow, seems to be a day that has been marked to bring quite a few changes in to effect. At least the changes that I have some interest over..</p>
<ul>
<li>Facebook announced to it&#8217;s developers that starting from October 1st, all apps must migrate to OAuth 2.0 for authentication and obtain a SSL certificate for use. Or else the apps would get disabled. Read more detailed explanation in the <a href="http://developers.facebook.com/roadmap/" target="_blank">Facebook Developer Roadmap</a>.
</li>
<li>
Now this applies to Sri Lanka only. I got this SMS from <a href="http://www.adaderana.lk/news.php?nid=15199" target="_blank">Ada Derana</a> today morning which has been the buzz for sometime. &#8220;Fastening of seat belts in front seats of all cars &#038; dual purpose vehicles with English number plates is compulsory from tomorrow&#8221;. It&#8217;s a good move to make it compulsory, but I doubt for how long this will be enforced.</li>
<li>Now into Cricket. As has always been the practice, changes to the playing conditions for Tests, One-Day Internationals (ODIs) and Twenty20 Internationals (T20Is) take effect from Saturday 1 October, the ICC has confirmed. <a href="http://cricbuzz.com/cricket-news/45044/new-rules-to-take-effect-from-oct-1" target="_blank">Read More..</a></li>
</ul>
<p>So what&#8217;s the deal with October 1st. Any other changes I might have missed?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/whats-up-with-october-1st/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make content visible only to users who Like the FB page</title>
		<link>http://www.nazly.net/how-to-make-content-visible-only-to-users-who-like-the-fb-page/</link>
		<comments>http://www.nazly.net/how-to-make-content-visible-only-to-users-who-like-the-fb-page/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 16:11:53 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fb]]></category>
		<category><![CDATA[like]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[php-sdk]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[signed]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[visible-to-connection]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1464</guid>
		<description><![CDATA[A Facebook Page is a vital part of Social Media Marketing. One of the key features in a Facebook Page is the ability to add a custom Tab. Page owners can use a custom Tab to provide valuable information. On (&#8230;)<p><a href="http://www.nazly.net/how-to-make-content-visible-only-to-users-who-like-the-fb-page/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/wp-content/uploads/2011/07/fbapplike.jpg" alt="" title="fbapplike" width="200" height="133" class="alignleft size-full wp-image-1469" /> A <a href="http://www.facebook.com/pages/" target="_blank">Facebook Page</a> is a vital part of Social Media Marketing. One of the key features in a Facebook Page is the ability to add a custom Tab. Page owners can use a custom Tab to provide valuable information. On these Tabs, most of them provide content/information only to the users who have Liked their page. If this strategy is used effectively, the fan base of the Page will grow significantly. My primary focus is how we could technically provide the content based on the fact whether the user has Liked the page or not.</p>
<p><span id="more-1464"></span>Doing this using <a href="http://developers.facebook.com/docs/reference/fbml/visible-to-connection/" target="_href">Legacy FBML</a> code is very simple. The following code will display different HTML content based on whether the user Likes the page or not. If the user doesn&#8217;t like the page, a message to Like the page will be displayed. If the user Likes the page already, the full content will be displayed.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;fb:visible-to-connection&gt;
    Show content to the user
    &lt;fb:else&gt;
        &lt;div style=&quot;position:absolute; top:0; left:0;&quot;&gt;
               Like the page inorder to view the content.
        &lt;/div&gt;
    &lt;/fb:else&gt;
&lt;/fb:visible-to-connection&gt;</pre></div></div>

<p>But the case is not that simple because Facebook has deperecated the use FBML since March 2011. This is what Facebook has to say.</p>
<div class="quote">We are in the process of deprecating FBML. If you are building a new application on Facebook.com, please implement your application using HTML, JavaScript and CSS. You can use our JavaScript SDK and Social Plugins to embedded many of the same social features available in FBML. While there is still functionality that we have not ported over yet, we are no longer adding new features to FBML.</div>
<p>While looking at alternate methods to get this feature working, I came across a very easy solution. If you are good with a server-side scripting language like PHP, this solution is for you. Of course you should build your own Facebook application and create a custom Tab in your application which could be added to a Page.</p>
<p>Goto the <a href="http://developers.facebook.com/apps" target="_blank">Facebook Developers</a> Page and create a new application. Fill in the necessary fields and Save the changes. The URL entered on the &#8216;Tab URL&#8217; field is the location where Facebook will fetch the content when the Tab is clicked. Technically this is where your script will be hosted. Now add the App you created to your Facebook Page. You will see the Tab visible on your page. Create a PHP page with a Hello World message in the URL you provided as Tab URL. When you cick on the Tab, if you see the Hello World message, then its time to write our script.</p>
<p>When Facebook requests our script, we need to extract the signed_request that comes along with the request. To do that we will need the <a href="http://github.com/facebook/php-sdk/" target="_blank">Facebook php-sdk</a>. Download, extract it and copy the src directory to the location where your script is. Here is the script that will provide content based on whether the user Likes the Page or not.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require</span> <span style="color: #0000ff;">'src/facebook.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create our Application instance (replace this with your appId and secret).</span>
<span style="color: #000088;">$facebook</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Facebook<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="color: #0000ff;">'appId'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'2324983201930103'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'secret'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'f5wjeu72hmxjf981da84jpwo02sdvge3'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$theRequest</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSignedRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$theRequest</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;page&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;liked&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;The real content&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Like our page to view&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Happy Coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/how-to-make-content-visible-only-to-users-who-like-the-fb-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hide WordPress Version from HTML Source</title>
		<link>http://www.nazly.net/hide-wordpress-version-from-html-source/</link>
		<comments>http://www.nazly.net/hide-wordpress-version-from-html-source/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 16:50:34 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1436</guid>
		<description><![CDATA[If you let your website visitors know, what version of]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/wp-content/uploads/2011/06/wordpress-logo.png" alt="" title="wordpress-logo" width="250" height="155" class="alignleft size-full wp-image-1072" /> If you let your website visitors know, what version of <a href="http://www.wordpress.org target="_blank">WordPress</a> you are running, you are potentially at risk. Hackers might use this opportunity to exploit the vulnerabilities in that particular version and will try to take down your website. Though you might keep your WordPress installation up-to-date, any lapses in failing to do so may open the doors to hackers. A good security measure would be to hide the WordPress version from the HTML source. By default if the theme uses wp_head() function which is true in most cases, the chances are that the WordPress version will be displayed in your HTML source.</p>
<p><span id="more-1436"></span></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;generator&quot; content=&quot;WordPress 2.8.4&quot;&gt;</pre></div></div>

<p>To hide/remove the above, simply include the line below in the functions.php found in your theme files.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_generator'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>It&#8217;s that simple..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/hide-wordpress-version-from-html-source/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3.2 is here..!!</title>
		<link>http://www.nazly.net/wordpress-3-2-is-here/</link>
		<comments>http://www.nazly.net/wordpress-3-2-is-here/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 10:37:40 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress3.2]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1443</guid>
		<description><![CDATA[I&#8217;m just all excited.. That&#8217;s what this post is all about. It would be wrong if I don&#8217;t share it here. It&#8217;s time to upgrade to WordPress 3.2 From the WordPress.org Blog Here in the U.S. we are observing Independence (&#8230;)<p><a href="http://www.nazly.net/wordpress-3-2-is-here/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just all excited.. That&#8217;s what this post is all about. It would be wrong if I don&#8217;t share it here. It&#8217;s time to <a href="http://wordpress.org/download/" target="_blank">upgrade</a> to WordPress 3.2</p>
<p><embed type="application/x-shockwave-flash" src="http://s0.videopress.com/player.swf?v=1.02" width="600" height="336" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=ac07H291"></embed></p>
<p><span id="more-1443"></span><strong>From the WordPress.org Blog</strong><br />
<em>Here in the U.S. we are observing Independence Day, and I can’t think of a more fitting way to mark a day that celebrates freedom than by releasing more free software to help democratize publishing around the globe. I’m excited to announce that WordPress 3.2 is now available to the world, both as an update in your dashboard and a download on WordPress.org. Version 3.2 is our fifteenth major release of WordPress and comes just four months after 3.1 (which coincidentally just passed the 15 million download mark this morning), reflecting the growing speed of development in the WordPress community and our dedication to getting improvements in your hands as soon as possible. We’re dedicating this release to noted composer and pianist George Gershwin.</em></p>
<p><a href="http://wordpress.org/news/2011/07/gershwin/" target="_blank">Click Here</a> for more info on this post..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/wordpress-3-2-is-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto resizing the FB App canvas page</title>
		<link>http://www.nazly.net/auto-resizing-the-fb-app-canvas-page/</link>
		<comments>http://www.nazly.net/auto-resizing-the-fb-app-canvas-page/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 16:00:23 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fb]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[resize]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1428</guid>
		<description><![CDATA[This post is more of a note to self. A canvas page in an FB app has a height of 800px. There won&#8217;t be any issues if the content of the page is within that limit. If the content is (&#8230;)<p><a href="http://www.nazly.net/auto-resizing-the-fb-app-canvas-page/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/wp-content/uploads/2011/06/fbapp.jpg" alt="" title="fbapp" width="200" height="133" class="alignleft size-full wp-image-1424" /> This post is more of a note to self. A canvas page in an FB app has a height of 800px. There won&#8217;t be any issues if the content of the page is within that limit. If the content is dynamic in nature and can grow above 800 pixels, only a part of your content will be visible. The canvas page won&#8217;t know that your content has grown since it uses iframes. To overcome this issue, we can use the <a href="http://developers.facebook.com/docs/reference/javascript/FB.Canvas.setAutoResize/" target="_blank">setAutoResize()</a> function in the Facebook JavaScript SDK. Unfortunately getting it to work can be pain. But I finally found a working code which would increase the height of the canvas page when the content grows.</p>
<p><span id="more-1428"></span>Replace the appID with yours.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;div id=&quot;fb-root&quot;&gt;&lt;/div&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> 
  window.<span style="color: #660066;">fbAsyncInit</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        FB.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>appId<span style="color: #339933;">:</span> <span style="color: #3366CC;">'123456789123'</span><span style="color: #339933;">,</span> <span style="color: #000066;">status</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> cookie<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> xfbml<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            FB.<span style="color: #660066;">Canvas</span>.<span style="color: #660066;">setAutoResize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> e.<span style="color: #660066;">async</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        e.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">protocol</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'//connect.facebook.net/en_US/all.js'</span><span style="color: #339933;">;</span>
        document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'fb-root'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/auto-resizing-the-fb-app-canvas-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FB iframe apps &amp; sessions on IE8</title>
		<link>http://www.nazly.net/fb-iframe-apps-sessions-on-ie8/</link>
		<comments>http://www.nazly.net/fb-iframe-apps-sessions-on-ie8/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 15:36:31 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fb]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[p3p]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1419</guid>
		<description><![CDATA[Recently I was developing a Facebook iframe application using PHP and all was good until I got few complaints that the application wasn&#8217;t functioning as it&#8217;s supposed to on IE8. I was using the Facebook php-sdk and I have tested (&#8230;)<p><a href="http://www.nazly.net/fb-iframe-apps-sessions-on-ie8/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/wp-content/uploads/2011/06/fbapp.jpg" alt="" title="fbapp" width="200" height="133" class="alignleft size-full wp-image-1424" /> Recently I was developing a Facebook iframe application using PHP and all was good until I got few complaints that the application wasn&#8217;t functioning as it&#8217;s supposed to on IE8. I was using the <a href="https://github.com/facebook/php-sdk/" target="_blank">Facebook php-sdk</a> and I have tested this app successfully on Firefox 4 and Google Chrome 11. Since I was on a Ubuntu box, I tested the app on IE6 under wine and I didn&#8217;t have any issues as such. I had to get a help from a friend using Windows and IE8 to dig deep into the problem. The issue seemed that session data didn&#8217;t persist across the application specifically on IE8.</p>
<p><span id="more-1419"></span>After more research, I realized that this problem isn&#8217;t specific to Facebook, but iframes. Since the iframe was loading a web page from a different domain, IE8&#8242;s default settings prevented loading of 3rd party cookies. To get this working, I had to setup a P3P Cookie Privacy Policy according to <a href="http://www.w3.org/TR/P3P/" target="_blank">P3P Specifications</a>. In PHP, this can be done by sending this header on top of the script.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'P3P: CP=&quot;CAO PSA OUR&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>That&#8217;s it. All problems automagically solved..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/fb-iframe-apps-sessions-on-ie8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple custom field handling in WordPress</title>
		<link>http://www.nazly.net/multiple-custom-field-handling-in-wordpress/</link>
		<comments>http://www.nazly.net/multiple-custom-field-handling-in-wordpress/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 13:42:12 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[value]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1342</guid>
		<description><![CDATA[Since WordPress 3.0 introduced Custom Post Types, I have been using it extensively in my projects. Each Custom Post Type had multiple Custom Fields, but I had major concerns on building an algorithm to search across multiple Custom Fields using (&#8230;)<p><a href="http://www.nazly.net/multiple-custom-field-handling-in-wordpress/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/wp-content/uploads/2011/06/wordpress-logo.png" alt="" title="wordpress-logo" width="250" height="155" class="alignleft size-full wp-image-1072" /> Since <a href="http://wordpress.org" target="_blank">WordPress</a> 3.0 introduced Custom Post Types, I have been using it extensively in my projects. Each Custom Post Type had multiple Custom Fields, but I had major concerns on building an algorithm to search across multiple Custom Fields using <a href="http://codex.wordpress.org/Function_Reference/query_posts" target="_blank">query_posts()</a> since it allowed only a single key value pair (meta_key and meta_value). I had to extend the functionality of query_posts() to get over this problem. Looking at the documention it appears that with the release of WordPress 3.1, query_posts() will have a new parameter called meta_query which could handle multiple Custom Fields.</p>
<p><span id="more-1342"></span>Prior to WordPress 3.1, query_posts() can only be used to search a single key or value using meta_key and meta_value parameters. meta_compare parameter can be used to specify the comparison between them.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
query_posts<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                            <span style="color: #0000ff;">'meta_key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'price'</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'meta_value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'22'</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'meta_compare'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;='</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'product'</span>
                          <span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>With the release of WordPress 3.1, the introduction of meta_query parameter to query_posts() allows developers to extend the search across multiple Custom Fields.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'product'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'meta_query'</span> <span style="color: #339933;">=&gt;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'color'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'blue'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'compare'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'NOT LIKE'</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'price'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">100</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'numeric'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'compare'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'BETWEEN'</span>
		<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span>
query_posts<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$args</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Happy Coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/multiple-custom-field-handling-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Optimizing the MySQL tables of a WordPress Website</title>
		<link>http://www.nazly.net/optimizing-the-mysql-tables-of-a-wordpress-website/</link>
		<comments>http://www.nazly.net/optimizing-the-mysql-tables-of-a-wordpress-website/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 09:14:31 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=1329</guid>
		<description><![CDATA[If you are running a WordPress Website or a Blog where the content is updated and/or deleted frequently, you will need to optimize the MySQL tables more often than not so that you don&#8217;t run into database issues and down (&#8230;)<p><a href="http://www.nazly.net/optimizing-the-mysql-tables-of-a-wordpress-website/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.nazly.net/wp-content/uploads/2011/02/php-mysql-wordpress.jpg" alt="" title="php-mysql-wordpress" width="250" height="150" class="alignleft size-full wp-image-1336" /> If you are running a <a href="http://wordpress.org" target="_blank">WordPress</a> Website or a Blog where the content is updated and/or deleted frequently, you will need to optimize the <a href="http://mysql.com" target="_blank">MySQL</a> tables more often than not so that you don&#8217;t run into database issues and down times. This also helps to maintain the average response time of MySQL queries.</p>
<p><span id="more-1329"></span>When executed, the following <a href="http://php.net" target="_blank">PHP</a> script will optimize the tables which requires optimization in your WordPress database. Place this file in your WordPress&#8217;s root directory.</p>
<p>You can run this manually or the ideal scenario would be to setup a cron job to execute it in a given time interval based on your requirement..</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>            
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-config.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span>DB_HOST<span style="color: #339933;">,</span> DB_USER<span style="color: #339933;">,</span> DB_PASSWORD<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span>DB_NAME<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$selQuery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SHOW TABLE STATUS FROM `&quot;</span><span style="color: #339933;">.</span>DB_NAME<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;`&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$resSel</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$selQuery</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resSel</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Data_free&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>    
        <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - Optimized : &quot;</span>
                <span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; ( &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Data_free&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; )<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$optQuery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;OPTIMIZE TABLE `&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;`&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$optQuery</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;---------------<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/optimizing-the-mysql-tables-of-a-wordpress-website/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

