<?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; PHP</title>
	<atom:link href="http://www.nazly.net/category/technology/php/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>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>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>
		<item>
		<title>Basics of maintaing a WordPress site</title>
		<link>http://www.nazly.net/basics-of-maintaing-a-wordpress-site/</link>
		<comments>http://www.nazly.net/basics-of-maintaing-a-wordpress-site/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 17:36:45 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[notificaion]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[uptime]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=903</guid>
		<description><![CDATA[WordPress is simple, yet powerful. Those are the key ingredients why it is popular among the Bloggers and Web Developers alike. WordPress will always be the first choice as a blogging platform. In the recent times it has moved far (&#8230;)<p><a href="http://www.nazly.net/basics-of-maintaing-a-wordpress-site/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1072" title="wordpress-logo" src="http://www.nazly.net/wp-content/uploads/2011/06/wordpress-logo.png" alt="" width="250" height="155" /> <a href="http://wordpress.org">WordPress</a> is <strong>simple</strong>, yet <strong>powerful</strong>. Those are the key ingredients why it is popular among the Bloggers and Web Developers alike. WordPress will always be the first choice as a blogging platform. In the recent times it has moved far from being just a blogging engine. Most Web developers choose WordPress as their primary <a href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a> of choice ahead of other popular Content Management Systems. Regardless of you being a Blogger or a Web Developer, the manner you maintain your WordPress files and database will play an important role in running a successful website.</p>
<p><span id="more-903"></span>Maintaining and monitoring your WordPress site requires performing certain tasks on a regular basis. The term regular will depend on how often your Website gets updated. Depending on the frequency you will need to plan this out. If you run a Website that gets updated daily (eg: news), then taking daily backups is a high priority. Performing these tasks manually can become a tedious process. There are plenty of tools and techniques available to automate them.</p>
<h3>Monitoring a Website</h3>
<p>You might want to use a <a href="http://www.google.lk/search?q=Website+Monitoring+Service">Website Monitoring Service</a> to check whether your website is up and running. There are plenty of services over the Internet if you Google for it. These services offer monitoring your Web Server (HTTP), FTP, Mail Server (POP &amp; SMTP), SSL, DNS and custom TCP ports on regular intervals. If any of these don&#8217;t respond, the service will alert you via Email or SMS. Most of them offer limited options for free while you need to pay based on the additional services you require. This type of monitoring is not WordPress specific and can apply to any Wesbite.</p>
<p>If you are a developer you can code your own monitoring system which will be cost efficient and can be expandable according to your monitoring requirements. Using <a href="http://php.net/manual/en/function.fsockopen.php">socket functions</a> and tools like <a href="http://www.php.net/manual/en/ref.curl.php">curl</a> can assist in doing that. </p>
<p>In any of the case above, you will need to specify the port of the service you wish to monitor. In certain cases, the port can occasionally differ from the default port that particular service would run depending on how it is configured on your Server. So you need to specify the correct one. </p>
<p>There is one instance that most of the Bloggers/Web Developers fail to address. While your Web Server/Apache might run smoothly, there is a possibility that your database might not respond. This can happen when your DB gets corrupted, privileges get messed up or your MySQL Server crashes for some reason. In this case WordPress will send you this ugly message on a plain white page. </p>
<p><img src="http://www.nazly.net/wp-content/uploads/2011/06/databaseerror.jpg" alt="" title="databaseerror" width="394" height="37" class="alignnone size-full wp-image-1097" /></p>
<p>It&#8217;s not suitable to show an error message of this nature to your visitors. Most importantly the HTTP status code for this response is 200, which means Search Engines will pick it up as your content for the site. If this message hangs on for long, you will get indexed on Google with this Error Message.</p>
<p>Here is how you can display a custom error message with your design template and get notified at the same time when your DB doesn&#8217;t respond.</p>
<p>Create a file called <strong>db-error.php</strong> and store that file under the wp-contents folder.<br />
The contents of the file should be..</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.0 500 Internal Server Error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;webmaster@mydomain.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;DB fail&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Down at : &quot;</span><span style="color: #339933;">.</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;html&gt;Your customer error message with yout HTML template&lt;/html&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It&#8217;s that simple..!</p>
<p>WordPress will execute the above script when the DB doesn&#8217;t respond. The first line will send the HTTP response code 500 (Internal Server Error) so that Search Engines won&#8217;t index it. The next line will send an email to you, notifying the time the DB went down. Third line will output the HTML of your template where you can include a custom error message. You can extend this piece of code to fit into your needs. Instead of Email, you could use SMS/Twitter to get instantly notified. </p>
<h3>Backup</h3>
<p>Taking regular backups of your WordPress installation and most importantly the database regularly will help to restore your Website within minutes if any data loss occurs. A hard disk crash, server failure or even a hacker wiping out all your data can be some of the reasons how a data loss could occur. While your hosting provider might do the backup for you, its always good to have your own. If you take regular backups, you are never a loser.</p>
<p>One of the important folders to backup is the wp-contents folder, but I would advise you to backup the whole WordPress installation directory. You will also need to backup the MySQL database. A simple MySQL dump would do. If you are the average blogger, then there are quite a lot of <a href="http://wordpress.org/extend/plugins/search.php?q=backup">WordPress plugins for backup</a> which would do the job for you. If you have shell access, I would advice you to write a shell script that would backup the files and database. Add a cron job to execute the script based on how frequent you wish to take backups. If you don&#8217;t have shell access, you can try using the options in your Web Hosting Control Panel. </p>
<h3>Security</h3>
<p>When it comes to security, applying the correct patches and upgrading to the newest version of the core and plugins of WordPress will prevent the hackers  from trying to exploit the vulnerabilities in your Website. While this can be automated, it is advisable you do this process manually to reduce complications that may arise after an upgrade. It will depend on the plugins you use and the purpose you use it for. Golden rule before upgrade is to backup your WordPress files and DB so that you can restore it if something goes wrong.</p>
<p>Before choosing the right plugin to use, make sure to check the compatibility of the plugin with the version of WordPress you are running. Also make sure to check the ratings of the plugin. All these information is available on the plugin&#8217;s page.</p>
<p>Good luck..!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/basics-of-maintaing-a-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress Security @ Refresh Colombo</title>
		<link>http://www.nazly.net/wordpress-security-refresh-colombo/</link>
		<comments>http://www.nazly.net/wordpress-security-refresh-colombo/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 05:34:07 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[colombo]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[refreshcolombo]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slide]]></category>
		<category><![CDATA[twittter]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=989</guid>
		<description><![CDATA[The Refresh Colombo event yesterday evening was one of the best meetups we had so far and I would like to thank everyone for coming and making it a great success. Special thanks goes out to Chandika and Naveen for (&#8230;)<p><a href="http://www.nazly.net/wordpress-security-refresh-colombo/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.refreshcolombo.org">Refresh Colombo</a> event yesterday evening was one of the best meetups we had so far and I would like to thank everyone for coming and making it a great success. Special thanks goes out to <a href="http://twitter.com/chandika">Chandika</a> and <a href="http://twitter.com/naveen6">Naveen</a> for their very informative talks which would have definitely made a big impact to all who were present there. I got the honour of doing a session on WordPress Security and got a lot of requests to share the presentation slides. So here it goes. <a href="http://www.nazly.net/wp-content/uploads/2010/10/wordpress-security.pdf"><strong>Click Here</strong></a> to download it.</p>
<p>You can follow <a href="http://twitter.com/induNan">InduNan</a> who live tweeted from the event. Thanks to <a href="http://twitter.com/thilinag">Thilina</a> and <a href="http://twitter.com/malinthe">Malinthe</a> for <a href="http://liveblog.lk/">live blogging</a> from the event. Photos will be uploaded to  <a href="http://facebook.com/refresh.colombo">Refresh Colombo Facebook page</a> soon. See you all at the next event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/wordpress-security-refresh-colombo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP date() function usage and examples</title>
		<link>http://www.nazly.net/php-date-function-usage-and-examples/</link>
		<comments>http://www.nazly.net/php-date-function-usage-and-examples/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 07:26:55 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=942</guid>
		<description><![CDATA[I have been coding PHP like for almost 10 years. The date() function in PHP is a widely used function in most of my apps. The application or website I&#8217;m developing will require to associate with a date at some (&#8230;)<p><a href="http://www.nazly.net/php-date-function-usage-and-examples/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I have been coding PHP like for almost 10 years. The date() function in PHP is a widely used function in most of my apps. The application or website I&#8217;m developing will require to associate with a date at some point. When displaying a date/time it requires to be displayed in a particular format. This will be different from one app to another. So remembering each format character is quite difficult even thought I have 10 years of experience on my back. So each an every time I head to the <a href="http://php.net/manual/en/function.date.php" target="_blank">PHP: date() Manual</a> to find out the format character. I have had cheat sheet wallpapers as my desktop wallpaper but I still felt the PHP Manual served me better. But finally I decided to build my own reference with commonly used character combinations with their respective output to make my life much easier (not that it was difficult before) so that other PHP developers will benefit out of this as well. </p>
<p><span id="more-942"></span></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: #666666; font-style: italic;">#The two example outputs are based on this time
</span><span style="color: #666666; font-style: italic;">#eg1: 2010-06-19 15:09:35
</span><span style="color: #666666; font-style: italic;">#eg2: 2010-06-19 08:30:59
</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&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#Output eg1: 2010-06-19
</span><span style="color: #666666; font-style: italic;">#Output eg2: 2010-06-19
</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;n/j/y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#Output eg1: 6/19/10
</span><span style="color: #666666; font-style: italic;">#Output eg2: 6/19/10
</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: #666666; font-style: italic;">#Output eg1: 2010-06-19 15:09:35
</span><span style="color: #666666; font-style: italic;">#Output eg2: 2010-06-19 08:30:59
</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;l, jS F Y h:i a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#Output eg1: Saturday, 19th June 2010 03:09 pm
</span><span style="color: #666666; font-style: italic;">#Output eg2: Saturday, 19th June 2010 08:30 am
</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jS M y g:i A&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#Output eg1: 19th Jun 10 3:09 PM
</span><span style="color: #666666; font-style: italic;">#Output eg2: 19th Jun 10 8:30 AM
</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;D, j M Y G:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#Output eg1: Sat, 19 Jun 2010 15:09:35
</span><span style="color: #666666; font-style: italic;">#Output eg2: Sat, 19 Jun 2010 8:30:59
</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/php-date-function-usage-and-examples/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 &#8220;Thelonious&#8221; released</title>
		<link>http://www.nazly.net/wordpress-3-0-thelonious-released/</link>
		<comments>http://www.nazly.net/wordpress-3-0-thelonious-released/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 05:48:07 +0000</pubDate>
		<dc:creator>Nazly</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[matt]]></category>
		<category><![CDATA[mullenweg]]></category>
		<category><![CDATA[thelonious]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress3]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp3]]></category>

		<guid isPermaLink="false">http://www.nazly.net/?p=934</guid>
		<description><![CDATA[It&#8217;s the moment that most of the WordPress enthusiasts were waiting for. The release of WordPress 3.0 bring lots of new features and updates that makes WordPress a powerful CMS to build complex and powerful websites. Arm your vuvuzelas: WordPress (&#8230;)<p><a href="http://www.nazly.net/wordpress-3-0-thelonious-released/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the moment that most of the WordPress enthusiasts were waiting for. The release of WordPress 3.0 bring lots of new features and updates that makes WordPress a powerful CMS to build complex and powerful websites.</p>
<p><span style="color: #666666;"><em>Arm your vuvuzelas: WordPress 3.0, the thirteenth major release of WordPress and the culmination of half a year of work by 218 contributors, is <a href="http://wordpress.org/download/" target="_blank">now available for download</a> (or <a href="http://codex.wordpress.org/Dashboard_Updates_SubPanel" target="_blank">upgrade within your dashboard</a>). Major new features in this release include a sexy <strong>new default theme called Twenty Ten</strong>.</em><span id="more-934"></span><em>Theme developers have new APIs that allow them to easily implement custom backgrounds, headers, shortlinks, <a href="http://codex.wordpress.org/Appearance_Menus_SubPanel" target="_blank">menus</a> (no more file editing), <a href="http://codex.wordpress.org/Custom_Post_Types" target="_blank">post types</a>, and <a href="http://codex.wordpress.org/Custom_Taxonomies" target="_blank">taxonomies</a>. (Twenty Ten theme shows all of that off.) Developers and network admins will appreciate the long-awaited <strong>merge of MU and WordPress</strong>, creating the new multi-site functionality which makes it possible to run one blog or ten million from the same installation. As a user, you will love the new <strong>lighter interface</strong>, the contextual help on every screen, the <strong>1,217 bug fixes and feature enhancements</strong>, bulk updates so you can upgrade 15 plugins at once with a single click, and blah blah blah just watch the video:) (In HD, if you can, so you can catch the Easter eggs.)</em></span></p>
<p><span style="color: #444444;"><em>Source : <a href="http://wordpress.org/development/2010/06/thelonious/" target="_blank">http://wordpress.org/development/2010/06/thelonious/</a></em></span></p>
<p><embed src="http://v.wordpress.com/wp-content/plugins/video/flvplayer.swf?ver=1.21" type="application/x-shockwave-flash" width="584" height="330" wmode="transparent" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=BQtfIEY1&amp;width=584&amp;height=330&amp;locksize=no&amp;dynamicseek=false&amp;qc_publisherId=p-18-mFEk4J448M" title="Introducing WordPress 3.0 &quot;Thelonious&quot;"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nazly.net/wordpress-3-0-thelonious-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

