<?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>Ali Qureshi&#039;s Blog</title>
	<atom:link href="http://www.parorrey.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parorrey.com/blog</link>
	<description>random bits on web development</description>
	<lastBuildDate>Tue, 13 Jul 2010 05:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<atom:link rel='hub' href='http://www.parorrey.com/blog/?pushpress=hub'/>
		<item>
		<title>How to fetch, parse, cache, and display your external RSS and Atom feeds and mediaRSS on your website using SimplePie</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-fetch-parse-and-parse-cache-display-rss-atom-and-mediarss-feeds-using-simplepie/</link>
		<comments>http://www.parorrey.com/blog/php-development/how-to-fetch-parse-and-parse-cache-display-rss-atom-and-mediarss-feeds-using-simplepie/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 14:06:45 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[mediaRSS]]></category>
		<category><![CDATA[PHP Classes]]></category>
		<category><![CDATA[RSS Parser]]></category>
		<category><![CDATA[SimplePie]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=145</guid>
		<description><![CDATA[If you ever faced a scenario where you had to parse the rss feed with image thumbnails placed inside &#8220;enclosure&#8221; tags, SimplePie is the perfect solution. In fact SimplePie can parse mediaRSS. There are several other php classes such as Magpie which can do the job as well. Magpie can parse rss2.0 enclosure but not [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/php-development/setting-different-cache-age-for-different-feeds-using-magpie-rss-php-rss-parser/' rel='bookmark' title='Permanent Link: Setting different cache age for different feeds using Magpie RSS &#8211; PHP RSS Parser'>Setting different cache age for different feeds using Magpie RSS &#8211; PHP RSS Parser</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fhow-to-fetch-parse-and-parse-cache-display-rss-atom-and-mediarss-feeds-using-simplepie%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fhow-to-fetch-parse-and-parse-cache-display-rss-atom-and-mediarss-feeds-using-simplepie%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you ever faced a scenario where you had to parse the rss feed with image thumbnails placed inside &#8220;enclosure&#8221; tags, <a href="http://simplepie.org/" target="_blank"><strong>SimplePie</strong></a> is the perfect solution. In fact SimplePie can parse mediaRSS. There are several other php classes such as Magpie which can do the job as well. Magpie can parse rss2.0 enclosure but not mediaRSS and I had hard time getting enclosure parsed with Magpie. After spending hours, I tried Simple Pie and it worked like a charm.  </p>
<p>SimplePie is a fast and feature rich PHP class that is very simple to use.  </p>
<p>In few steps, you can use SimplePie to retrieve and parse any RSS or Atom feeds and display them on any PHP website. SimplePie also allows you to incorporate any type of data from any number of feeds. Here&#8217;s how you can setup SimplePie in three steps:</p>
<ul>
<li> <a href="http://simplepie.org/downloads/" target="_blank">Download SimplePie</a> and uncompress it    </li>
<li> Place the &#8220;simplepie.inc&#8221; into a your &#8220;includes&#8221; folder under root directory of your website and include it into your calling script    </li>
<li> Create a directory named &#8220;cache&#8221; (also in the web-accessible root directory) and make sure that it&#8217;s writable by the server (i.e., CHMOD to 755, 775, or 777)</li>
</ul>
<p>Here&#8217;s the sample code to fetch, parse, cache, and display your external RSS and Atom feeds and mediaRSS on your website using SimplePie: </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SIMPLEPIE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/path/to/simplepie.inc'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>SIMPLEPIE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//include the simplepie class</span>
  <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.parorrey.com/blog/feed/'</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// bake a new pie</span>
  <span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_feed_url</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// provide feed url</span>
  <span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_cache_duration</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// specify cache duration in seconds</span>
  <span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle_content_type</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// text/html utf-8 character encoding</span>
  <span style="color: #000088;">$check</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// script initialization check</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$check</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_items</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$enclosure</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_enclosure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
   <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$enclosure</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_link</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; 
       alt=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_title</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;/&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">else</span> <span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$rss_feed</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;div class=&quot;rssItem&quot;&gt;
  &lt;span class=&quot;date&quot;&gt;
 '</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'j F Y @ g:i a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/span&gt;
  &lt;h3&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_permalink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; 
       title=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_title</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;
      target=&quot;_blank&quot; rel=&quot;no-follow&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_title</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
       &lt;br/&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$thumb</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/h3&gt;		
&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_description</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/p&gt;&lt;/div&gt;
&lt;div class=&quot;spacer dash&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>      
&nbsp;
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div id=&quot;rssNews&quot;&gt;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$rss_feed</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>SimplePie also allows you to merge different rss feeds into one single stream.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_feed_url</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'http://your-domain1.com/your-feed1/'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'http://your-domain2.com/your-feed2/'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'http://your-domain3.com/your-feed3/'</span>
	<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here is where the cache directory should exist if you are using the default cache location: </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">/</span>path<span style="color: #339933;">/</span>to<span style="color: #339933;">/</span>your<span style="color: #339933;">/</span>feed_page<span style="color: #339933;">.</span>php
<span style="color: #339933;">/</span>path<span style="color: #339933;">/</span>to<span style="color: #339933;">/</span>your<span style="color: #339933;">/</span>cache<span style="color: #339933;">/</span>
<span style="color: #339933;">/</span>path<span style="color: #339933;">/</span>to<span style="color: #339933;">/</span>simplepie<span style="color: #339933;">/</span>way<span style="color: #339933;">/</span>deep<span style="color: #339933;">/</span>in<span style="color: #339933;">/</span>directory<span style="color: #339933;">/</span>simplepie<span style="color: #339933;">.</span>inc</pre></div></div>

<p>Please note that using ./cache (dot-slash-cache) means that the cache directory will be relative to the page that&#8217;s calling SimplePie, not SimplePie itself.
</p>
<p>Hope that helps.</p>
<p> Cheers! </p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/php-development/setting-different-cache-age-for-different-feeds-using-magpie-rss-php-rss-parser/' rel='bookmark' title='Permanent Link: Setting different cache age for different feeds using Magpie RSS &#8211; PHP RSS Parser'>Setting different cache age for different feeds using Magpie RSS &#8211; PHP RSS Parser</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/php-development/how-to-fetch-parse-and-parse-cache-display-rss-atom-and-mediarss-feeds-using-simplepie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook requires every developer to verify his Facebook account to create new applications</title>
		<link>http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/</link>
		<comments>http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 10:04:08 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Facebook Apps Development]]></category>
		<category><![CDATA[Facebook Apps]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=140</guid>
		<description><![CDATA[While attempting to add another developer to my Facebook Application Settings panel after I tried to save his name, I got the following error: &#8220;Validation failed. Only verified developers can be added as listed developers of this application.&#8221; A Google search brings this blog post which says here http://developers.facebook.com/blog/post/386 that &#8220;Starting this week, we are [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/' rel='bookmark' title='Permanent Link: Facebook applications will automatically upgrade to new data permissions on June 30'>Facebook applications will automatically upgrade to new data permissions on June 30</a></li>
<li><a href='http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/' rel='bookmark' title='Permanent Link: Facebook Graph API authentication OAuth 2.0 replacing Require Login'>Facebook Graph API authentication OAuth 2.0 replacing Require Login</a></li>
<li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ffacebook-apps-development%2Ffacebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ffacebook-apps-development%2Ffacebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>While attempting to add another developer to my <strong>Facebook Application</strong> Settings panel after I tried to save his name, I got the following error:</p>
<blockquote><p>&#8220;Validation failed.</p>
<p>Only verified developers can be added as listed developers of this application.&#8221;</p></blockquote>
<p>A Google search brings this blog post which says here http://developers.facebook.com/blog/post/386 that</p>
<blockquote><p>&#8220;Starting this week, we are requiring every developer to verify his or her Facebook account to create new applications. This is the same quick process that users go through when they want to do things like upload large videos.&#8221;</p>
<p>&#8220;You can verify your account by either confirming your mobile phone or adding a credit card to your account. Facebook will not charge your credit card if you add it to your account.&#8221;</p></blockquote>
<p>Verifying mobile number did not resolve it and I suggested him to first add the application where I was adding him as developer and that worked for me. After he joined that <strong>Facebook app</strong> as a user, I could add him in the developers list.</p>
<p>Cheers!</p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/' rel='bookmark' title='Permanent Link: Facebook applications will automatically upgrade to new data permissions on June 30'>Facebook applications will automatically upgrade to new data permissions on June 30</a></li>
<li><a href='http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/' rel='bookmark' title='Permanent Link: Facebook Graph API authentication OAuth 2.0 replacing Require Login'>Facebook Graph API authentication OAuth 2.0 replacing Require Login</a></li>
<li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook applications will automatically upgrade to new data permissions on June 30</title>
		<link>http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/</link>
		<comments>http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 11:26:11 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Facebook Apps Development]]></category>
		<category><![CDATA[Extended Permissions]]></category>
		<category><![CDATA[Facebook Apps]]></category>
		<category><![CDATA[Graph API]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=137</guid>
		<description><![CDATA[Starting June 30, 2010, your Facebook application will only be able to read the publically available information of a user&#8217;s profile by default, the way data read permissions are granted in the platform. While the changes are broad in scope, none of them impact backwards compatibility: all of your existing code will continue to work. [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/' rel='bookmark' title='Permanent Link: Facebook requires every developer to verify his Facebook account to create new applications'>Facebook requires every developer to verify his Facebook account to create new applications</a></li>
<li><a href='http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/' rel='bookmark' title='Permanent Link: Facebook Graph API authentication OAuth 2.0 replacing Require Login'>Facebook Graph API authentication OAuth 2.0 replacing Require Login</a></li>
<li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ffacebook-apps-development%2Ffacebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ffacebook-apps-development%2Ffacebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Starting June 30, 2010, your Facebook application will only be able to read the publically available information of a user&#8217;s profile by default, the way data read permissions are granted in the platform. While the changes are broad in scope, none of them impact backwards compatibility: all of your existing code will continue to work.
</p>
<p>The most important changes are:
</p>
<ul>
<li>Graph API</li>
<li>Data Permissions</li>
<li>OAuth 2.0</li>
<li>New SDKs</li>
<li>Facebook Connect Branding</li>
</ul>
<p>To <strong>get access to user&#8217;s profile information</strong>, your facebook application must explicitly request all of the data it needs to function. For instance, if you want to incorporate a user&#8217;s events into your application, you would request the user_events extended permission.During the <strong>authentication process</strong>, the user is presented with a UI in which the user can authorize your application to access that specific part of her profile.</p>
<p>Following is the <strong>complete list of extended permissions for Graph API</strong>:</p>
<p>publish_stream, create_event, rsvp_event, sms, offline_access, manage_pages, email, read_insights, read_stream, read_mailbox, ads_management, xmpp_login, user_about_me, user_activities, user_birthday, user_education_history, user_events, user_groups, user_hometown, user_interests, user_likes, user_location, user_notes, user_online_presence, user_photo_video_tags, user_photos, user_relationships, user_religion_politics, user_status, user_videos, user_website, user_work_history, read_friendlists, read_requests.</p>
<p>To upgrade your require_login()  authentication to Graph API authorization, please check my earlier post for <a href="http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/" target="_blank">how to authenticate using Facebook Graph API</a> and simply add any extended permission that you may need in your app. Go the function &#8220;RequestforPermission&#8221; in that post and add your permissions in the</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #0000ff;">'req_perms'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'email,publish_stream'</span></pre></div></div>

<p>Cheers. </p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/' rel='bookmark' title='Permanent Link: Facebook requires every developer to verify his Facebook account to create new applications'>Facebook requires every developer to verify his Facebook account to create new applications</a></li>
<li><a href='http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/' rel='bookmark' title='Permanent Link: Facebook Graph API authentication OAuth 2.0 replacing Require Login'>Facebook Graph API authentication OAuth 2.0 replacing Require Login</a></li>
<li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Graph API authentication OAuth 2.0 replacing Require Login</title>
		<link>http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/</link>
		<comments>http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 13:27:22 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Facebook Apps Development]]></category>
		<category><![CDATA[Facebook Apps]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[Graph API]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=120</guid>
		<description><![CDATA[Facebook has recently introduced Graph API and simplified many things. The new Graph API attempts to drastically simplify the way developers read and write data to Facebook.The Graph API uses OAuth 2.0 for authorization. OAuth 2.0 is a simpler version of OAuth that developers used earlier for authorization as $facebook->require_login(). (by the way, old token [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/' rel='bookmark' title='Permanent Link: Facebook applications will automatically upgrade to new data permissions on June 30'>Facebook applications will automatically upgrade to new data permissions on June 30</a></li>
<li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/' rel='bookmark' title='Permanent Link: Facebook requires every developer to verify his Facebook account to create new applications'>Facebook requires every developer to verify his Facebook account to create new applications</a></li>
<li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ffacebook-apps-development%2Fgraph-api-authorization-oauth-2-0-replacing-require-login%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ffacebook-apps-development%2Fgraph-api-authorization-oauth-2-0-replacing-require-login%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Facebook has recently introduced Graph API and simplified many things.  The new Graph API attempts to drastically simplify the way developers read and write data to Facebook.The Graph API uses <strong>OAuth 2.0 for authorization</strong>. OAuth 2.0 is a simpler version of OAuth that developers used earlier for authorization as <strong>$facebook->require_login().</strong> (by the way, old token still works)</p>
<p>In the previous version, RequireLogin was a one line simple way of getting authorization for user. When I upgraded to OAuth 2.0, I had a hard time getting my user authenticated which looked like very simple thing in pre Graph API days. </p>
<p>Here is how I finally manage to put together for my latest facebook app.</p>
<p>To authenticate user in <strong>Graph API</strong>, first of all, <a href="http://github.com/facebook/php-sdk" target="_blank">download the Facebook PHP SDK</a> facebook.php and put it inside includes folder. After that, get the Application Id, API key, application secret and canvas url of your facebook app and put it inside following $fbconfig array.  </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'appid'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Application id here&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'api'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;API Key here&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'secret'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;App Secret here&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'canvas_url'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://apps.facebook.com/your_app_name/&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  try<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'includes/facebook.php'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  catch<span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$o</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create our Application instance.</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: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'appid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'secret'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'secret'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'cookie'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Your Canvas Callback URL domain here&quot;</span>
  <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$session</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSession</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$session</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> RequestforPermission<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: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>	<span style="color: #666666; font-style: italic;">//got session</span>
	try <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$me</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/me'</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: #339933;">!</span>IsApplicationUser<span style="color: #009900;">&#40;</span><span style="color: #000088;">$me</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//InsertApplicationUser($me);</span>
            <span style="color: #666666; font-style: italic;">//create a function and insert the user info</span>
             <span style="color: #666666; font-style: italic;">//into App DB for later use</span>
	<span style="color: #009900;">&#125;</span>
          <span style="color: #009900;">&#125;</span>
 catch <span style="color: #009900;">&#40;</span>FacebookApiException <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
RequestforPermission<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fbconfig</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'canvas_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Please add this function &#8220;RequestforPermission&#8221; as well in this file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> RequestforPermission<span style="color: #009900;">&#40;</span><span style="color: #000088;">$next_url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$loginUrl</span><span style="color: #339933;">=</span><span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLoginUrl</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'canvas'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fbconnect'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'display'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'next'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$next_url</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'cancel_url'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'http://www.facebook.com/'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'req_perms'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'email,publish_stream'</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;fb:redirect url=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$loginUrl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// end redirect function</span></pre></div></div>

<p>Put all this code into a file named &#8220;fb-authentication.php&#8221; and simply include &#8220;fb-authentication.php&#8221; in those files in your application where you want Facebook user authentication.</p>
<p>Hope that helps.</p>
<p>Cheers. </p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-applications-will-automatically-upgrade-to-new-data-permissions-on-june-30/' rel='bookmark' title='Permanent Link: Facebook applications will automatically upgrade to new data permissions on June 30'>Facebook applications will automatically upgrade to new data permissions on June 30</a></li>
<li><a href='http://www.parorrey.com/blog/facebook-apps-development/facebook-requires-every-developer-to-verify-his-facebook-account-to-create-new-applications/' rel='bookmark' title='Permanent Link: Facebook requires every developer to verify his Facebook account to create new applications'>Facebook requires every developer to verify his Facebook account to create new applications</a></li>
<li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to show/hide divs based on radio button selection using jQuery</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/</link>
		<comments>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 09:33:46 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Front End Development]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113</guid>
		<description><![CDATA[If you want a radio button selection to show certain Div contents and hide some other Div on the web page, and on another radio button selection, you need a different Div associated with that radio button hiding the unwanted one, read on. This can be achieved very efficiently using jQuery. We can put the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fhow-to-showhide-divs-based-on-radio-button-selection-using-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fhow-to-showhide-divs-based-on-radio-button-selection-using-jquery%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you want a radio button selection to show certain Div contents and hide some other Div on the web page, and on another radio button selection, you need a different Div associated with that radio button hiding the unwanted one, read on.</p>
<p>This can be achieved very efficiently using jQuery. We can put the code inside &#8220;click&#8221; or &#8220;change&#8221; event of radio button group,</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[name$='group_name']&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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: #009900;">&#125;</span></pre></div></div>

<p>and after getting the value of selected radio button by this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> radio_value <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We can simply hide or show our required Divs using following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>radio_value<span style="color: #339933;">==</span><span style="color: #3366CC;">'Yes'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#yes_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#no_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Here’s putting every together, simply put this code in your page inside script tags and it will work.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[name$='group_name']&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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>
&nbsp;
  <span style="color: #003366; font-weight: bold;">var</span> radio_value <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>radio_value<span style="color: #339933;">==</span><span style="color: #3366CC;">'Yes'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#yes_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#no_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</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: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>radio_value<span style="color: #339933;">==</span><span style="color: #3366CC;">'No'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#no_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#yes_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#yes_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#no_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Hope that helps.</p>
<p>Cheers.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to unzip files on remote server using PHP script</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-unzip-files-on-remote-server-using-php-script/</link>
		<comments>http://www.parorrey.com/blog/php-development/how-to-unzip-files-on-remote-server-using-php-script/#comments</comments>
		<pubDate>Mon, 24 May 2010 10:32:19 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[php script]]></category>
		<category><![CDATA[uncompress]]></category>
		<category><![CDATA[unzipping]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=106</guid>
		<description><![CDATA[Uploading files to server is a daily chore every webmaster has to do and if you do it using some ftp client where each and every file and image, no matter how small it might be, is uploaded separately, it’s a real pain. Sometimes, It takes hours to get these files uploaded and even then [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/web-hosting/copying-files-from-remote-server-to-another-server-through-ssh/' rel='bookmark' title='Permanent Link: Copying files from remote server to another server through SSH'>Copying files from remote server to another server through SSH</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fhow-to-unzip-files-on-remote-server-using-php-script%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fhow-to-unzip-files-on-remote-server-using-php-script%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Uploading files to server is a daily chore every webmaster has to do and if you do it using some ftp client where each and every file and image, no matter how small it might be, is uploaded separately, it’s a real pain. Sometimes, It takes hours to get these files uploaded and even then some files are skipped somehow.</p>
<p>A very easy solution to this tedious task is to upload a compressed zip or tar file and uncompress it on server. If you have SSH access or your hosting control panel provide you extracting your compressed file, it’s very helpful. For instance, CPanel and HSphere provide both zipping and unzipping of files and folders on server. But not all hosting environments allow you to unzip files on server without SSH access.</p>
<p>An easy way to unzip file on server is to use following php script.</p>
<p>Just provide the zip file name and destination folder to extract files in the script and it will extract your files for you saving you hours of uploading headache.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$destination</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/destination'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//blank for root folder</span>
&nbsp;
  <span style="color: #000088;">$zip</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ZipArchive<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$zip_file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">open</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'www.zip'</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;">$zip_file</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extractTo</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$destination</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'files successfully extracted to
      &lt;strong&gt;'</span><span style="color: #339933;">.</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$destination</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
     &lt;/strong&gt; directory.'</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;">'No donuts for you. :('</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Hope it helps.</p>
<p>Cheers!</p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/web-hosting/copying-files-from-remote-server-to-another-server-through-ssh/' rel='bookmark' title='Permanent Link: Copying files from remote server to another server through SSH'>Copying files from remote server to another server through SSH</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/php-development/how-to-unzip-files-on-remote-server-using-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP/MySQL datetime formatting bypassing UNIX_TIMESTAMP</title>
		<link>http://www.parorrey.com/blog/php-development/phpmysql-datetime-formatting-bypassing-unix-timestamp/</link>
		<comments>http://www.parorrey.com/blog/php-development/phpmysql-datetime-formatting-bypassing-unix-timestamp/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 14:41:30 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[format date]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=100</guid>
		<description><![CDATA[PHP/MySQL datetime formatting bypassing UNIX_TIMESTAMP Formatting MySQL date to something useful has been a pain for PHP developers for a long time. Usually you would make your query return the datetime using UNIX_TTIMESTAMP and then using PHP date function, format it to your heart&#8217;s content like this: echo date&#40;&#34;F jS, Y h:i:s A&#34;, $row-&#62;date&#41;; But [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fphpmysql-datetime-formatting-bypassing-unix-timestamp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Fphpmysql-datetime-formatting-bypassing-unix-timestamp%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h2>PHP/MySQL datetime formatting bypassing UNIX_TIMESTAMP</h2>
<p>Formatting <strong>MySQL</strong> date to something useful has been a pain for PHP developers for a long time. </p>
<p>Usually you would make your query return the datetime using <strong>UNIX_TTIMESTAMP</strong> and then using PHP date function, format it to your heart&#8217;s content like this: </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F jS, Y h:i:s A&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>But this method has a downside, you can’t use the * and have to put all the fields in the query to use UNIX_TIMESTAMP for datetime field and have it returned as timestamp.  </p>
<p>A better way of doing this is, especially in the scenario when you have to use * in the query, by using <strong>PHP5 DateTime Object</strong>. This way you can avoid UNIX_TIMESTAMP.  </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$myDate</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$oDate</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F jS, Y h:i:s A &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Hope it helps.  </p>
<p>Cheers! </p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/php-development/phpmysql-datetime-formatting-bypassing-unix-timestamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple goes to war with Adobe by banishing Flash</title>
		<link>http://www.parorrey.com/blog/technology/apple-goes-to-war-with-adobe-by-banishing-flash/</link>
		<comments>http://www.parorrey.com/blog/technology/apple-goes-to-war-with-adobe-by-banishing-flash/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 14:22:55 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone OS 4.0]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=94</guid>
		<description><![CDATA[As Apple previewed the new version of its iPhone OS, it also has updated the agreement that developers must adhere to if they want to create applications for Apple devices. Since the iPhone went on sale in 2007, Apple has not allowed Flash onto the device, essentially shutting Adobe out of the creative process behind [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ftechnology%2Fapple-goes-to-war-with-adobe-by-banishing-flash%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Ftechnology%2Fapple-goes-to-war-with-adobe-by-banishing-flash%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As Apple previewed the new version of its <strong>iPhone OS</strong>, it also has updated the agreement that developers must adhere to if they want to create applications for Apple devices.</p>
<p>Since the iPhone went on sale in 2007, Apple has not allowed Flash onto the device, essentially shutting Adobe out of the creative process behind building applications for the iPhone OS.</p>
<p>When asked, during his preview of iPhone OS 4.0, Steven Jobs, if there had been any change in Apple’s position on Flash. He simple replied, “No.”</p>
<p>Although it is not official why Apple would want to cause trouble for Adobe in this way, but most probably <strong>Apple</strong> wants to make it harder for developers to create an application for one platform, like Flash,and then pop out versions for other platforms, like the <strong>iPhone</strong> or <strong>Google’s</strong> Android.</p>
<p>Some speculate that it is because most online ads use Flash and Apple wants to replace them with their own ad solution, now called <strong>iAd</strong>.</p>
<p>And explain is that Adobe turned its back on Apple when the company was deeply troubled, and that Jobs never forgave them, and waited for an opportunity to get back.</p>
<p>Whatever the reason, <strong>Apple</strong> has gone to war with an old ally <strong>Adobe</strong> after having gone sore with another ally <strong>Google</strong>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/technology/apple-goes-to-war-with-adobe-by-banishing-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ten Step Guide to Install Redmine project management application</title>
		<link>http://www.parorrey.com/blog/project-management/ten-step-guide-to-install-redmine-project-management-application/</link>
		<comments>http://www.parorrey.com/blog/project-management/ten-step-guide-to-install-redmine-project-management-application/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 06:02:14 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Redmine]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[RubyGems]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=87</guid>
		<description><![CDATA[Having tried several open source project management and bug tracking tools, such as dotProject, mantis  etc, Ruby based Redmine is a good solution. Redmine is a flexible project management web application written using Ruby on Rails framework. It should run on most Unix, Linux, Mac and Windows systems as long as Ruby &#38; Ruby on [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fproject-management%2Ften-step-guide-to-install-redmine-project-management-application%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fproject-management%2Ften-step-guide-to-install-redmine-project-management-application%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Having tried several open source project management and bug tracking tools, such as dotProject, mantis  etc, Ruby based <strong>Redmine</strong> is a good solution.</p>
<p>Redmine is a flexible project management web application written using Ruby on Rails framework. It should run on most Unix, Linux, Mac and Windows systems as long as Ruby &amp; Ruby on Rails and RubyGems are available on that platform.</p>
<h2>Step 1</h2>
<p>For setting up Redmine on your server, you need SSH access. Log into your shell using putty or any other tool, and create a folder for rails application inside your user account but outside your public root, for instance if you are using CPanel to manage your hosting account, create a folder “rails_apps” inside your “/home” folder beside “/public_html “ folder.</p>
<p>First of all, change your directory to “rails_apps” by typing:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>your-user-account<span style="color: #000000; font-weight: bold;">/</span>rails_apps<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<h2>Step 2</h2>
<p>Once inside folder “rails_apps”, download and extract the Redmine archive. First get the Redmine files by typing following command at shell:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">69449</span><span style="color: #000000; font-weight: bold;">/</span>redmine-0.9.3.tar.gz</pre></div></div>

<p>Please make sure that you get the latest version of Redmine. You can get the latest version file path from here <a href="http://rubyforge.org/frs/?group_id=1850">http://rubyforge.org/frs/?group_id=1850</a></p>
<p>Type following command to uncompress the Redmine file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf redmine-0.9.3.tar.gz</pre></div></div>

<p>It will uncompress and create the directory redmine-0.9.3.</p>
<h2>Step 3</h2>
<p>Now set up your MySQL Database/user for Redmine installation. After setting up your mysql db and db user, rename “config/database.yml.example” to “config/database.yml” and edit this file in order to configure your database settings for &#8220;production&#8221; environment. Add your DB information here.</p>
<h3>Sample DB information for MySQL</h3>
<pre>production:
  adapter: mysql
  database: redmine
  host: localhost
  port: 3307
  username: redmine
  password: my_password</pre>
<h2>Step 4</h2>
<p>Change your directory to Redmine by typing following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span>  <span style="color: #000000; font-weight: bold;">/</span>redmine-0.9.3</pre></div></div>

<h2>Step 5</h2>
<p>Redmine stores session data in cookies by default, which requires a secret to be generated. This can be done by running following command but make sure you are under the application root directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">RAILS_ENV</span>=production rake config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>session_store.rb</pre></div></div>

<h2>Step 6</h2>
<p>Create the database structure, by running the following command to create tables and an administrator account under the application root directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate</pre></div></div>

<h2>Step 7</h2>
<p>Insert default configuration data in database, by running the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">RAILS_ENV</span>=production rake  redmine:load_default_data</pre></div></div>

<p>This step is optional but highly recommended, as you can define your own configuration from scratch. It will load default roles, trackers, statuses, workflows and enumerations.</p>
<h2>Step 8</h2>
<p>Test the installation by running WEBrick web server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby script<span style="color: #000000; font-weight: bold;">/</span>server webrick <span style="color: #660033;">-e</span> production <span style="color: #660033;">-d</span></pre></div></div>

<p>Once WEBrick has started, point your browser to http://yourdomain.com:3000/. You should now see the application welcome page. Take special care to run above WEBrick command with –d to detach otherwise when you close the shell window, application will also shut down.</p>
<h2>Step 9</h2>
<p>Use default administrator account to log in:</p>
<pre>login: admin
password: admin</pre>
<h2>Step 10</h2>
<p>To get email notifications, set up SMTP server configuration.</p>
<p>Rename “config/email.yml.example” to “config/email.yml “ and edit this file to adjust your SMTP or pop email settings.</p>
<pre>#Outgoing email settings
production:
  delivery_method: :smtp
  smtp_settings:
  address: mail.yourdomain.com
  port: 25
  domain: yourdomain.com
  authentication: :login
  user_name: redmine@yourdomain.com
  password: redmine</pre>
<p>Don&#8217;t forget to restart the application after any change.</p>
<p>Cheers!</p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/php-development/how-to-fix-broken-facebook-sample-application-footprints/' rel='bookmark' title='Permanent Link: How to fix broken Facebook sample application &#8216;footprints&#8217;'>How to fix broken Facebook sample application &#8216;footprints&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/project-management/ten-step-guide-to-install-redmine-project-management-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FBJS Quick Jump Menu for a FBML Facebook Platform App</title>
		<link>http://www.parorrey.com/blog/php-development/fbjs-quick-jump-menu-for-a-fbml-facebook-platform-app/</link>
		<comments>http://www.parorrey.com/blog/php-development/fbjs-quick-jump-menu-for-a-fbml-facebook-platform-app/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 14:30:20 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Facebook Apps Development]]></category>
		<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Facebook Apps]]></category>
		<category><![CDATA[FBJS]]></category>
		<category><![CDATA[FBML]]></category>

		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=81</guid>
		<description><![CDATA[In a FBML Facebook App, your quick jump menu will require a little tweak to work in FBJS properly. Just change your standard js jump menu from: &#60;select onchange=&#34;goto(this.options[this.selectedIndex].value)&#34;&#62; &#60;option value=&#34;page.php?id=1&#34;&#62;Page1&#60;/option&#62; &#60;option value=&#34;page.php?id=2&#34;&#62;Page2&#60;/option&#62; &#60;option value=&#34;page.php?id=3&#34;&#62;Page3&#60;/option&#62; &#60;/select&#62; To this: &#60;select onchange=&#34;document.setLocation(this.getValue());&#34;&#62; &#60;option value=&#34;page.php?id=1&#34;&#62;Page1&#60;/option&#62; &#60;option value=&#34;page.php?id=2&#34;&#62;Page2&#60;/option&#62; &#60;option value=&#34;page.php?id=3&#34;&#62;Page3&#60;/option&#62; &#60;/select&#62; Cheers. Related posts:Facebook Graph API authentication OAuth 2.0 [...]


Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/' rel='bookmark' title='Permanent Link: Facebook Graph API authentication OAuth 2.0 replacing Require Login'>Facebook Graph API authentication OAuth 2.0 replacing Require Login</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Ffbjs-quick-jump-menu-for-a-fbml-facebook-platform-app%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.parorrey.com%2Fblog%2Fphp-development%2Ffbjs-quick-jump-menu-for-a-fbml-facebook-platform-app%2F&amp;source=parorrey&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In a <strong>FBML Facebook App</strong>, your quick jump menu will require a little tweak to work in <strong>FBJS</strong> properly.<br />
Just change your standard js jump menu from:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>select onchange<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;goto(this.options[this.selectedIndex].value)&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;page.php?id=1&quot;</span><span style="color: #339933;">&gt;</span>Page1<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;page.php?id=2&quot;</span><span style="color: #339933;">&gt;</span>Page2<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;page.php?id=3&quot;</span><span style="color: #339933;">&gt;</span>Page3<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>select<span style="color: #339933;">&gt;</span></pre></div></div>

<p>To this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>select onchange<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;document.setLocation(this.getValue());&quot;</span><span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;page.php?id=1&quot;</span><span style="color: #339933;">&gt;</span>Page1<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;page.php?id=2&quot;</span><span style="color: #339933;">&gt;</span>Page2<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;page.php?id=3&quot;</span><span style="color: #339933;">&gt;</span>Page3<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>select<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Cheers.</p>


<p>Related posts:<ol><li><a href='http://www.parorrey.com/blog/facebook-apps-development/graph-api-authorization-oauth-2-0-replacing-require-login/' rel='bookmark' title='Permanent Link: Facebook Graph API authentication OAuth 2.0 replacing Require Login'>Facebook Graph API authentication OAuth 2.0 replacing Require Login</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.parorrey.com/blog/php-development/fbjs-quick-jump-menu-for-a-fbml-facebook-platform-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
