<?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>style PHP - bring life to your web application, php programmer of bangladesh</title>
	<atom:link href="http://www.stylephp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stylephp.com</link>
	<description>php programmer of bangladesh, php, programmer, bangladesh, bring life to your web application with PHP,asp.net,bangladesh,ajax,javascript,jquery,extjs,codeigniter,zend framework</description>
	<lastBuildDate>Mon, 29 Jun 2009 17:36:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Let&#8217;s Develop a Facebook Application &#8211; Part one</title>
		<link>http://www.stylephp.com/2009/06/28/lets-develop-a-facebook-application-part-one/</link>
		<comments>http://www.stylephp.com/2009/06/28/lets-develop-a-facebook-application-part-one/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 18:44:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[facebook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[facebook application development]]></category>
		<category><![CDATA[fbjs]]></category>
		<category><![CDATA[feed form dialog]]></category>
		<category><![CDATA[notification]]></category>

		<guid isPermaLink="false">http://www.stylephp.com/2009/06/28/lets-develop-a-facebook-application-part-one/</guid>
		<description><![CDATA[Hi Guys you know Facebook is popular platform where thousands of developer working to develop application for facebook users.It is very easy to develop facebook application.Here I will show you how to develop a facebook application.I have divided it into five parts.At the end of every part you will get a demo of application which [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Guys you know <a href="http://www.facebook.com/">Facebook</a> is popular platform where thousands of developer working to develop application for facebook users.It is very easy to develop facebook application.Here I will show you how to develop a facebook application.I have divided it into five parts.At the end of every part you will get a demo of application which you can test to keep it to your server.</p>
<p>Before we begin, there are a few things you need to know. In order to create a Facebook application, you should know or need the following:</p>
<ul>
<li>You should be well versed in PHP or some other scripting language — such as ASP.NET , Ruby on Rails, JavaScript, or Python — especially one that has a client library for Facebook API.</li>
<li>You need to have a basic understanding of the Internet, SSH, MySQL, and Unix</li>
<li>You need to be familiar with <a href="http://webhostingrating.com">Web hosting</a> fundamentals and have a place to host your application.</li>
</ul>
<p>Now you're ready to get started! You can read in depth instructions on the <a href="http://wiki.developers.facebook.com/index.php/Creating_Your_First_Application">Facebook Developers Wiki</a>, but this outline here should give you good enough idea to get you going.</p>
<p><strong><span style="font-size: small;">Here are the summary of <span style="color: #0000ff;">part one</span></span></strong></p>
<ul>
<li><strong>Application Overview </strong></li>
<li><strong>Setting up  an environment for our application. </strong></li>
<li><strong>Initialize our application or Setup our Application. </strong></li>
<li><strong>Display " Welcome to Our Application" </strong></li>
<li><strong>Add our applicaton to user profile page </strong></li>
<li><strong>Get User information </strong></li>
<li><strong>Get user friends list </strong></li>
<li><strong>Send Invitation to friends</strong></li>
<li><strong>Send Notification to friends </strong></li>
<li><strong>Send Notification Email to friends </strong></li>
<li><strong>publish News Feed to Friends Wall using Feed Form Dialog </strong></li>
</ul>
<p><strong><span style="color: #0000ff;">Part Two</span></strong></p>
<ul>
<li><strong><span style="color: #808080;">Facebook Connect</span></strong></li>
<li><strong><span style="color: #808080;">Multi friend Selector</span></strong></li>
<li><strong><span style="color: #808080;">Ajax with FBJS</span></strong></li>
</ul>
<p><strong><span style="font-size: large;"><span style="text-decoration: underline;">Application Overview</span></span></strong></p>
<p>First of all see a screen shot of our application and add the application. the url is</p>
<p><a title="http://apps.facebook.com/guessthecelebrity/index.php" href="http://apps.facebook.com/guessthecelebrity/index.php"><strong>http://apps.facebook.com/guessthecelebrity/index.php</strong></a></p>
<p>You can download the application until welcome page from <a href="http://stylephp.com/guessthecelebrity/download/guessthecelebrity_welcome.rar" target="_blank"><strong>here</strong></a></p>
<p>And you can download the whole application from <a href="http://stylephp.com/guessthecelebrity/download/guessthecelebrity_final.rar" target="_blank"><strong><span style="font-size: x-small;">here</span></strong></a></p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/application-demo.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="application_demo" src="http://www.stylephp.com/wp-content/uploads/2009/06/application-demo-thumb.png" border="0" alt="application_demo" width="540" height="340" /></a></p>
<p>We will develop a simple funny celebrity contest application where every user can participate and can invite their friends.</p>
<p><strong>Guess Celebrity</strong></p>
<p>This is the page where user can play with celebrity.<br />
<strong></strong></p>
<p><strong>Invite Friends</strong></p>
<p>We can invite friends to join to this application.</p>
<p><span style="font-size: large;"><strong><span style="text-decoration: underline;">Setting up an environment for our application</span></strong></span></p>
<p>Now you have to create folder where you want to keep your application like where you want to host your application.I have created a folder "guessthecelebrity" as our application name.So you can also create a folder like your application name or  any name. I have given a screenshot of our application's folder structure here. So you can understand it easily.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/application-structure.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="application_structure" src="http://www.stylephp.com/wp-content/uploads/2009/06/application-structure-thumb.png" border="0" alt="application_structure" width="591" height="172" /></a></p>
<p>You can download php 5 client library from <a href="http://wiki.developers.facebook.com/index.php/Client_Libraries">http://wiki.developers.facebook.com/index.php/Client_Libraries</a></p>
<p>And You can download database library ezsql class from <a href="http://php.justinvincent.com">http://php.justinvincent.com</a></p>
<p>So I think you have a directory structure into your server. Here I will use my FBToolbox class to make this application.Because in this class most of the basic things are already handle. Let's start our coding.</p>
<p><strong><span style="font-size: small;">Step 1</span></strong></p>
<p>open your favorite editor and create a php file.name it <strong><span style="color: #ff0000;">config.php</span></strong> where we will write all configuration settings.</p>
<div>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   1:</span> <span style="color: #008000">// Facebook-specific configuration</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   2:</span> $apiKey         = <span style="color: #006080">'################################'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   3:</span> $secretKey      = <span style="color: #006080">'################################'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   4:</span> $baseUrl        = <span style="color: #006080">'http://apps.facebook.com/guessthecelebrity/'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   5:</span> $callbackUrl    = <span style="color: #006080">'http://www.stylephp.com/guessthecelebrity/'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   6:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   7:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   8:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   9:</span> <span style="color: #008000">// Database configuration</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  10:</span> $dbconfig[<span style="color: #006080">'db'</span>]     = <span style="color: #006080">'YOUR DATABASE NAME'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  11:</span> $dbconfig[<span style="color: #006080">'host'</span>]   = <span style="color: #006080">'YOUR DATABASE HOST'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  12:</span> $dbconfig[<span style="color: #006080">'user'</span>]   = <span style="color: #006080">'DB USER'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  13:</span> $dbconfig[<span style="color: #006080">'pass'</span>]   = <span style="color: #006080">'DB PASSWORD'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  14:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  15:</span> $listPerPage         = 10;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  16:</span> $totalSearchResult    = 0;</pre>
</div>
</div>
<p>After setting up our application we will initialize our api and secret key. right now just keep it what I am writing here. And change the database settings as your database configuration and save this file at <strong>guessthecelebrity</strong> folder.</div>
<div><strong><span style="font-size: small;">Step 2</span></strong></div>
<div>Now create another one file and name it <strong><span style="color: #ff0000;">common.php</span></strong> where we will keep our database related code and some common function.</div>
<div><strong> <span style="color: #404040;">You can download the common.php file from </span></strong><a href="http://stylephp.com/guessthecelebrity/download/common.rar" target="_blank"><strong><span style="font-size: x-small;">here</span></strong></a>.</div>
<div>Here you see a function <strong>getRequestFileName()</strong> which I will use to get file name and select correct tab.</div>
<div><strong><span style="font-size: small;">Step 3</span></strong></div>
<div><strong></strong></div>
<div><strong></strong></div>
<div>Now copy my <strong><span style="color: #ff0000; font-size: x-small;">FBToolbox class</span></strong> into your folder. I have changed some code there to use it with a application.</div>
<div>So you better copy this code or download the class from here.</div>
<div><strong><span style="color: #404040; font-size: x-small;">You can download FBToolbox class from </span><a title="FBToolbox class" href="http://stylephp.com/guessthecelebrity/download/FBToolbox.class.rar" target="_blank"><span style="color: #000080; font-size: x-small;">here</span></a></strong></div>
<div><strong></strong></div>
<div><strong></strong></div>
<div><strong></strong></div>
<div><strong></strong></div>
<div><strong></strong></div>
<div><strong><span style="color: #808080; font-size: small;">Step 4</span></strong></div>
<p>Now create another one file and name it <strong><span style="color: #ff0000;">header.php</span></strong> where we will keep our header and menu portion. And also we will keep our css and JavaScript code at this file.In this file there are two tab one is <strong>Guess Celebrity</strong> and other one is <strong>invite friends</strong>.If you want you can create another  tab.There are some css code also for some style.</p>
<p><strong><span style="color: #404040;">You can download header.php file from</span></strong> <a href="http://stylephp.com/guessthecelebrity/download/header.rar" target="_blank"><strong><span style="font-size: x-small;">here</span></strong></a></p>
<p><span><strong>Step 5</strong></span></p>
<p><span style="font-size: small;"><span style="font-size: x-small;">Create another one file and name it <strong>index.php</strong> which is home page of our application</span><strong>.</strong></span><span style="font-size: x-small;">Where we include two file one is <strong>FBToolbox class</strong> and another one is <strong>common.php.</strong> And also <strong>footer.php</strong> file. In this page we will just welcome message to the user.So first we get user id using FBToolbox class function <strong>getUserID().</strong></span></p>
<div>
<div><strong><span style="color: #404040;">You can download index.php file from</span></strong> <a href="http://stylephp.com/guessthecelebrity/download/index.rar" target="_blank"><strong><span style="font-size: x-small;">here</span></strong></a></div>
</div>
<p><strong><span style="font-size: small;">step 6</span></strong></p>
<p><span style="font-size: x-small;">Create another one file and name it <strong><span style="color: #ff0000;">footer.php</span></strong> where we will keep our footer information there.</span></p>
<p><span style="font-size: x-small;"><strong><span style="color: #404040;">You can download footer.php file from</span></strong> </span><a href="http://stylephp.com/guessthecelebrity/download/footer.rar" target="_blank"><strong><span style="font-size: x-small;">here</span></strong></a><strong><span style="font-size: x-small;">.</span></strong></p>
<p><span style="color: #004000; font-size: x-small;">OK That’s good,We have completed our environment to develop facebook application!!!!!!</span></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: large;">Initialize our application or Setup our Application</span></span></strong></p>
<p><strong></strong></p>
<p><span style="font-size: small;"><strong>step 1 </strong></span></p>
<p><span style="font-size: small;"><span style="font-size: x-small;">Now click on this </span><a title="http://www.facebook.com/developers/" href="http://www.facebook.com/developers/" target="_blank"><span style="font-size: x-small;">http://www.facebook.com/developers/</span></a><span style="font-size: x-small;"> to set up an application</span><strong>.</strong></span></p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/setup-app1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="setup_app" src="http://www.stylephp.com/wp-content/uploads/2009/06/setup-app-thumb1.png" border="0" alt="setup_app" width="526" height="231" /></a></p>
<p><strong></strong></p>
<p><span style="font-size: x-small;">Here you will see a button <strong>set up new application</strong>. Please click on this button.</span></p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/application-setup11.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="application_setup1" src="http://www.stylephp.com/wp-content/uploads/2009/06/application-setup1-thumb1.png" border="0" alt="application_setup1" width="527" height="222" /></a></p>
<p>You will get this screen.where You have to type your <strong>application name</strong> and select <strong>agree</strong> and then click on <strong>save changes</strong> button.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/applicaltion-setup21.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="applicaltion_setup2" src="http://www.stylephp.com/wp-content/uploads/2009/06/applicaltion-setup2-thumb1.png" border="0" alt="applicaltion_setup2" width="526" height="253" /></a></p>
<p>You will get your API and Secret Key.If you want you can change icon and logo also to click on change your icon and change your logo link.Now click on Authentication Tab.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/step41.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="step4" src="http://www.stylephp.com/wp-content/uploads/2009/06/step4-thumb1.png" border="0" alt="step4" width="521" height="234" /></a></p>
<p>Here you can check users and Facebook Pages.So user can add your application. Then click on User Profiles Tab.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/application-setup32.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="application_setup3" src="http://www.stylephp.com/wp-content/uploads/2009/06/application-setup3-thumb2.png" border="0" alt="application_setup3" width="508" height="196" /></a></p>
<p>Here you can write tab Name and tab url.Which will show users profile tab. And you can select wide or narrow for your application.Then click on Canvas page Tab.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/application-setup41.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="application_setup4" src="http://www.stylephp.com/wp-content/uploads/2009/06/application-setup4-thumb1.png" border="0" alt="application_setup4" width="514" height="220" /></a></p>
<p>Here write a unique name for your canvas page.If your application name exists then it will show a error message.so write again.</p>
<p>ooh!! we have finished setup for our application. That’s good.</p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: large;">Display Welcome to Our Application</span></span></strong></p>
<p><strong></strong></p>
<p><strong><span style="font-size: small;">Step 1</span></strong></p>
<p><span style="font-size: x-small;">Now open the config.php file again. And change the <strong>Api key</strong>, <strong>Secret Key</strong>,<strong>baseUrl</strong> and <strong>callbackUrl</strong>. <strong>baseUrl</strong> is the canvas page url and <strong>callbackUrl</strong> is the location of file at your server. You can see this information from <a title="http://www.facebook.com/developers/" href="http://www.facebook.com/developers/">http://www.facebook.com/developers/</a> link.</span></p>
<p><span style="font-size: x-small;"><strong>Step 2</strong></span></p>
<p><strong><span style="font-size: x-small;">Now all are set. You have to run this application using base or canvas url. Like you can run my application to type <a title="http://apps.facebook.com/jokesforyou/" href="http://apps.facebook.com/guessthecelebrity/">http://apps.facebook.com/guessthecelebrity/</a></span></strong></p>
<p><span style="color: #004000; font-size: small;"><strong>Untill Now You can download the application from <a title="First part of our application" href="http://stylephp.com/guessthecelebrity/download/guessthecelebrity_welcome.rar" target="_blank">here</a></strong></span></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: large;">Add Our Application to User Profile Page</span></span></strong></p>
<p><span style="font-size: x-small;">Now open the <strong>index.php</strong> file again. And Add below these line.</span></p>
<div>
<div>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   1:</span> <span style="color: #008000">//add this application to user profile</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   2:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   3:</span> $boxFbml = <span style="color: #006080">"Guess the Celebrity Contest..&lt;a href="</span>.$baseUrl.<span style="color: #006080">"&gt; Join Now"</span>.<span style="color: #006080">"&lt;/a&gt;"</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   4:</span> $wallFbml = <span style="color: #006080">"Guess the Celebrity Contest..&lt;a href="</span>.$baseUrl.<span style="color: #006080">"&gt; Join Now"</span>.<span style="color: #006080">"&lt;/a&gt;"</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   5:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   6:</span> $fbToolboxObj-&gt;addToProfile($fbuser, $boxFbml, $wallFbml);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   7:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   8:</span> &lt;!-- you have to print <span style="color: #0000ff">this</span> line to add application to user profile</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   9:</span>      <span style="color: #0000ff">if</span> user click on addtoprofile link then above function will work --&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  10:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  11:</span> &lt;div <span style="color: #0000ff">class</span>=<span style="color: #006080">"section_button"</span>&gt;&lt;fb:add-section-button section=<span style="color: #006080">"profile"</span>/&gt;&lt;/div&gt;</pre>
</div>
</div>
</div>
</div>
<p><strong><span style="color: #404040;">Or you can download the file from</span></strong> <a href="http://stylephp.com/guessthecelebrity/download/index_profile.rar" target="_blank"><strong>here</strong></a></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: large;">Get User Information</span></span></strong></p>
<p><span style="font-size: x-small;">By getting user information from facebook we will save it to our database. So we have to create a database.I have created a database named ‘<strong>guessthecelebrity’.</strong> You can download the schema from <strong><a title="Database schema" href="http://stylephp.com/guessthecelebrity/download/schema.rar" target="_blank">here</a></strong>. And Add some function at <strong>common.php </strong>file like saveUserInfo(),getUserInfo() etc.</span></p>
<p><span style="font-size: x-small;"><strong>You can download this file from</strong> <a href="http://stylephp.com/guessthecelebrity/download/common_final.rar" target="_blank"><strong>here</strong></a>.</span></p>
<div>And then open <strong>index.php</strong> file again and add these line.</div>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   1:</span> $userInfo = getUserInfo($fbuser);<span style="color: #008000">//get user information from our db</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   2:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   3:</span> <span style="color: #0000ff">if</span>(!$userInfo)<span style="color: #008000">//if not found</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   4:</span> {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   5:</span>     $user_details = $fbToolboxObj-&gt;getUserInfo($fbuser);<span style="color: #008000">//get from facebook</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   6:</span>     saveUserInfo($fbuser,$user_details);<span style="color: #008000">//save user information</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   7:</span>     $userInfo = getUserInfo($fbuser);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   8:</span> }</pre>
</div>
</div>
<div><strong>Or you can download the file from</strong> <a href="http://stylephp.com/guessthecelebrity/download/index_user.rar" target="_blank"><strong>here</strong></a></div>
<p><strong></strong></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: large;">Get User FriendList and Send Invitation</span></span></strong></p>
<p><span style="font-size: x-small;">Here we will create a invitation page.where user can send invitation to their friends. Create a file named <strong>invite.php</strong> or you can download this file from here.In this page we take users friend list using my FBToolbox class and send invitation to those friends. For invitation you have to pass <strong>addurl</strong> and <strong>nextUrl</strong> and <strong>fbmlData</strong>.Here addUrl is when user accept your invitation where they have to go and nextUrl is when user send invitation then where he will go after submit invitation. And fbmlData is your message for your friend.</span></p>
<p><span style="font-size: x-small;"><strong>You can download this file from</strong> <a href="http://stylephp.com/guessthecelebrity/download/invite.rar" target="_blank"><strong>here</strong></a>.</span></p>
<p><strong><span style="font-size: large;"><span style="text-decoration: underline;">Publish News Feed Using Feed Form Dialog:</span></span></strong></p>
<p>We will create feed template to publish news feed at user’s News feed section.So first of all go to this link <a title="http://developers.facebook.com/tools.php?feed" href="http://developers.facebook.com/tools.php?feed">http://developers.facebook.com/tools.php?feed</a> and you will see below page.select your application and click next.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/feed11.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="feed1" src="http://www.stylephp.com/wp-content/uploads/2009/06/feed1-thumb1.png" border="0" alt="feed1" width="517" height="204" /></a></p>
<p>then you will another one window where you can write one line template.see the picture below. change the highlighted color text as you see here.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/feed21.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="feed2" src="http://www.stylephp.com/wp-content/uploads/2009/06/feed2-thumb1.png" border="0" alt="feed2" width="519" height="223" /></a></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>One line feed :</strong> {*actor*}'s guess is this is &lt;a href="{*contest-url*}"&gt;{*celebrity-name*}'s&lt;/a&gt; photo. If you want to participate or to help your friend &lt;a href="{*contest-url*}"&gt;click here&lt;/a&gt;</p>
<p><strong>Sample Data : </strong></p>
<p>{"contest-url":"<a href="http://stylephp.com&quot;">http://stylephp.com"</a>,</p>
<p>"celebrity-name":"Raju Mazumder"</p>
<p>}</p>
<p>and click next and you will see another one window.see the picture below and change the highlighted color text as you see here.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/feed31.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="feed3" src="http://www.stylephp.com/wp-content/uploads/2009/06/feed3-thumb1.png" border="0" alt="feed3" width="521" height="222" /></a></p>
<p><strong>short story template:</strong> {*actor*}'s guess is this is &lt;a href="{*contest-url*}"&gt;{*celebrity-name*}'s&lt;/a&gt; photo. If you want to participate or to help your friend &lt;a href="{*contest-url*}"&gt;click here&lt;/a&gt;</p>
<p><strong>short story template body </strong>: {*body-text*}</p>
<p><strong>sample data: </strong></p>
<p>{"contest-url":"<a href="http://stylephp.com&quot;">http://stylephp.com"</a>,</p>
<p>"celebrity-name":"Raju Mazumder",</p>
<p>"body-text":"Guess the celebrity contest",</p>
<p>"images":[{"src":"<a href="http://pad.thedigitalmovement.com/_blaise/2007-06-15-dgen-breakfast.jpg&quot;,&quot;href&quot;:&quot;http://www.facebook.com&quot;}]">http://pad.thedigitalmovement.com/_blaise/2007-06-15-dgen-breakfast.jpg","href":"http://www.facebook.com"}]</a></p>
<p>}</p>
<p>And then click next and you will the picture below.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2009/06/feed41.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="feed4" src="http://www.stylephp.com/wp-content/uploads/2009/06/feed4-thumb1.png" border="0" alt="feed4" width="534" height="224" /></a></p>
<p><strong>Action Link text:</strong> read more</p>
<p><strong>Action Link Url </strong>: {*contest-url*}</p>
<p><strong>Sample Template Data:</strong></p>
<p>{"contest-url":"<a href="http://stylephp.com&quot;">http://stylephp.com"</a>,</p>
<p>"celebrity-name":"Raju Mazumder",</p>
<p>"body-text":"Guess the celebrity contest",</p>
<p>"images":[{"src":"<a href="http://pad.thedigitalmovement.com/_blaise/2007-06-15-dgen-breakfast.jpg&quot;,&quot;href&quot;:&quot;http://www.facebook.com&quot;}]">http://pad.thedigitalmovement.com/_blaise/2007-06-15-dgen-breakfast.jpg","href":"http://www.facebook.com"}]</a></p>
<p>}</p>
<p>And then click next you will see another one window.click on Register Template Bundle to get template bundle id and save it to use with our application.</p>
<p>ooh great we have created our feed template. Now lets see how to use it into our application.</p>
<p>Open <strong>header.php </strong>file agian and write these line below.here you have to change template bundle id which I use here.Use your register template bundle id. I have used ajax here to submit user celebrity guess selection.</p>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   1:</span> &lt;script&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   2:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   3:</span> function publishNewsFeed(celebrityPhoto,facebookuid,infoDiv,contestId,action)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   4:</span> {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   5:</span>         var celebrityName = <span style="color: #006080">''</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   6:</span>         var answerObj = <span style="color: #006080">''</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   7:</span>         var answer = <span style="color: #006080">''</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   8:</span>         <span style="color: #0000ff">for</span>(var i = 0; i &lt; 4; i++)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   9:</span>         {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  10:</span>             answerObj = document.getElementById(<span style="color: #006080">"answer"</span>+i);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  11:</span>             <span style="color: #0000ff">if</span>(answerObj.getChecked())</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  12:</span>             {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  13:</span>                 celebrityName = answerObj.getTitle();</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  14:</span>                 answer = answerObj.getValue();</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  15:</span>             }</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  16:</span>         }</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  17:</span>         document.getElementById(<span style="color: #006080">'display'</span>).setValue(answerObj);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  18:</span>         <span style="color: #0000ff">if</span>(celebrityPhoto != <span style="color: #006080">''</span>)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  19:</span>         {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  20:</span>             src = <span style="color: #006080">"&lt;?php echo $callbackUrl;?&gt;images/celebrity/"</span>+celebrityPhoto;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  21:</span>         }</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  22:</span>         <span style="color: #0000ff">else</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  23:</span>         {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  24:</span>             src = <span style="color: #006080">"&lt;?php echo $callbackUrl?&gt;images/banner.jpg"</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  25:</span>         }</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  26:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  27:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  28:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  29:</span>         var template_data = {<span style="color: #006080">"celebrity-name"</span> : <span style="color: #006080">""</span>+celebrityName,</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  30:</span>         <span style="color: #006080">"contest-url"</span>: <span style="color: #006080">"&lt;?php echo $baseUrl?&gt;"</span>,</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  31:</span>         <span style="color: #006080">"body-text"</span>:<span style="color: #006080">"Guess Celebrity Contest"</span>,</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  32:</span>         <span style="color: #006080">"images"</span>:[{<span style="color: #006080">"src"</span>:src,<span style="color: #006080">"href"</span>:<span style="color: #006080">"&lt;?php echo $baseUrl?&gt;"</span>}]};</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  33:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  34:</span>         Facebook.showFeedDialog(<strong><span style="color: #ff0000;">83607323911</span></strong>, template_data, <span style="color: #006080">''</span>, [],</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  35:</span>                           function() {<span style="color: #0000ff">new</span> Dialog().showMessage(<span style="color: #006080">"Info"</span>,</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  36:</span>                 <span style="color: #006080">"Successfully shared your answer with your friends"</span>);});</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  37:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  38:</span>         var ajax            = <span style="color: #0000ff">new</span> Ajax();</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  39:</span>         ajax.responseType   = Ajax.FBML;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  40:</span>         ajax.ondone         = function(data)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  41:</span>         {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  42:</span>             document.getElementById(infoDiv).setInnerFBML(data);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  43:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  44:</span>         }</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  45:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  46:</span>         var queryParams     = {<span style="color: #006080">"answer"</span> : answer, <span style="color: #006080">"facebookuid"</span> : facebookuid,</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  47:</span>         <span style="color: #006080">"contestId"</span> : contestId};</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  48:</span>         ajax.post(<span style="color: #006080">'&lt;?php echo $callbackUrl ?&gt;ajax.php?action='</span>+action, queryParams);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  49:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  50:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  51:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  52:</span> }</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">  53:</span> &lt;/script&gt;</pre>
</div>
</div>
<p>And for this you have to change <strong>index.php</strong> file also.You can download the complete index.php file from here. And Here we have to create another file ajax.php which file will handle all ajax request from our application.</p>
<p><strong>You can download the</strong> <strong><a href="http://stylephp.com/guessthecelebrity/download/ajax.rar" target="_blank">ajax.php</a></strong> <strong>and</strong> <strong><a href="http://stylephp.com/guessthecelebrity/download/header_final.rar" target="_blank">header.php</a></strong> <strong>file from here.</strong></p>
<div><strong><span style="font-size: large;"><span style="text-decoration: underline;">Send Notification:</span></span></strong></div>
<p>Now we will send notification to user’s friend when a user added our application. Open <strong>index.php</strong> file again write these line.</p>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   1:</span> <span style="color: #008000">//send Notification and Notification Email</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   2:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   3:</span> <span style="color: #008000">// Get friend list here</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   4:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   5:</span> $friendList = $fbToolboxObj-&gt;getFriendList($fbuser,<span style="color: #0000ff">false</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   6:</span> $message =  <span style="color: #006080">'&lt;fb:name uid='</span>.$fbuser.<span style="color: #006080">' capitalize="true" /&gt; </span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   7:</span>             has added Guess the Celebrity Application. If you</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">   8:</span>             want you can join to click &lt;a href='.$baseUrl.<span style="color: #006080">'&gt;here&lt;/a&gt;'</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060">   9:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060">  10:</span> $fbToolboxObj-&gt;sendNotification($friendList,$message,<span style="color: #006080">'app_to_user'</span>);</pre>
</div>
</div>
<p><strong>Or you can download from</strong> <a href="http://stylephp.com/guessthecelebrity/download/index_final.rar" target="_blank"><strong>here</strong></a></p>
<p>Oh great we have completed our application’s  part one</p>
<p><strong><span style="color: #004000; font-size: small;">You can download the whole application to click</span></strong> <a href="http://stylephp.com/guessthecelebrity/download/guessthecelebrity_final.rar" target="_blank"><strong><span style="font-size: small;">here</span></strong></a></p>
<p>So Develop facebook application and enjoy!!!</p>
<p>Let me know if you want to know anything.</p>
<p><strong>My next post about this application’s second part where I will show you facebook connect,multi friend selector and more!! so keep your eyes here…..</strong>
<ul class="related_post">
<li>March 20, 2009 -- <a href="http://www.stylephp.com/2009/03/20/a-php-class-for-facebook-application-developer/" title="A PHP Class For Facebook Application Developer">A PHP Class For Facebook Application Developer (15)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stylephp.com/2009/06/28/lets-develop-a-facebook-application-part-one/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A PHP Class For Facebook Application Developer</title>
		<link>http://www.stylephp.com/2009/03/20/a-php-class-for-facebook-application-developer/</link>
		<comments>http://www.stylephp.com/2009/03/20/a-php-class-for-facebook-application-developer/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 20:41:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[facebook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[facebook application]]></category>
		<category><![CDATA[news feed]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://www.stylephp.com/?p=72</guid>
		<description><![CDATA[You know facebook is a  great social application for million of users. And to develop a application for  this site is also very popular. So I have planned to write a class where  facebook application developer can do most of the basic things for their  application using this class.Specially thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>You know <a href="http://www.facebook.com/" target="_blank">facebook</a> is a  great social application for million of users. And to develop a application for  this site is also very popular. So I have planned to write a class where  facebook application developer can do most of the basic things for their  application using this class.Specially thanks to <a href="http://www.phpfour.com/" target="_blank">emran bhai</a> and <a href="http://www.ajaxray.com/" target="_blank">anis</a> to review my class.The  basic feature of this class</p>
<ul>
<li><strong>Get Facebook Users profile information </strong></li>
<li><strong>Get Friend list of a facebook user </strong></li>
<li><strong>Send Notification to Facebook user </strong></li>
<li><strong>Send Email Notification to Facebook user </strong></li>
<li><strong>Set Your Application at Facebook user profile page </strong></li>
<li><strong>Publish News feed to Facebook user </strong></li>
</ul>
<p>You can do above all the things to use this Class.</p>
<p><img class="alignnone" src="http://stylephp.com/demo_image/facebook.jpg" alt="" width="678" height="349" /></p>
<p><strong><span style="text-decoration: underline;">Download</span></strong></p>
<p>You can download it from <a href="http://stylephp.com/fbtoolbox/FBToolbox.class.php.zip" target="_blank">here</a>. The zip file contains this class along with an example.  You can also find full documentation here.</p>
<p>You can also download it from <a href="http://www.phpclasses.org/browse/package/5200.html" target="_blank">phpclasses.org</a></p>
<p><strong><span style="text-decoration: underline;">How to use it</span></strong></p>
<div>
<div>
<div>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   1:</span> <span style="color: #008000;">// Include our files</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   2:</span> include_once (<span style="color: #006080;">'FBToolbox.class.php'</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   3:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   4:</span> <span style="color: #008000;">// Prepare the object</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   5:</span> $fbToolboxObj = <span style="color: #0000ff;">new</span> FBToolbox(<span style="color: #006080;">'YOUR_API_KEY'</span>, <span style="color: #006080;">'YOUR_SECRET_KEY'</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   6:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   7:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   8:</span> <span style="color: #008000;">// Get user information</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   9:</span> $userInfo = $fbToolboxObj-&gt;getUserInfo(<span style="color: #006080;">'FB USER ID'</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  10:</span> <span style="color: #008000;">//print_r($userInfo);</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  11:</span> echo $userInfo[0][<span style="color: #006080;">'current_location'</span>][<span style="color: #006080;">'city'</span>];</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  12:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  13:</span> <span style="color: #008000;">// Get friend list here</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  14:</span> $friendList = $fbToolboxObj-&gt;getFriendList(<span style="color: #006080;">'FB USER ID'</span>,<span style="color: #0000ff;">false</span>,0,20);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  15:</span> <span style="color: #008000;">//print_r($friendList);</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  16:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  17:</span> <span style="color: #008000;">// Send notification</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  18:</span> $fbToolboxObj-&gt;sendNotification(array(<span style="color: #006080;">'FB USER ID'</span>),<span style="color: #006080;">'test api class'</span>,<span style="color: #006080;">'app_to_user'</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  19:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  20:</span> <span style="color: #008000;">// Send email notification (CAUTION: your application must have permission from user)</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  21:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  22:</span> $fbToolboxObj-&gt;sendEmail(<span style="color: #006080;">'FB USER ID'</span>,<span style="color: #006080;">'test api class'</span>,<span style="color: #006080;">'test api class'</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  23:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  24:</span> <span style="color: #008000;">// Publish news feed</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  25:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  26:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  27:</span> $one_line_story_templates[] = <span style="color: #006080;">'{*actor*} has developed a php wrapper </span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  28:</span> class for facebook application developer.';</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  29:</span> <span style="color: #008000;">//You have to run this function only one times to get template bundle id</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  30:</span> $templateBundleId = $fbToolboxObj-&gt;getTemplateBundleId($one_line_story_templates);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  31:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  32:</span> $fbToolboxObj-&gt;publishNewsFeed(<span style="color: #006080;">'FB USER ID'</span>,$templateBundleId);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  33:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  34:</span> <span style="color: #008000;">// Add your application to your profile</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  35:</span> $fbToolboxObj-&gt;addToProfile(<span style="color: #006080;">'FB USER ID'</span>,<span style="color: #006080;">"Wider FbMl"</span>,<span style="color: #006080;">"narrow fbml"</span>);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  36:</span> ?&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  37:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  38:</span> &lt;!-- you have to print <span style="color: #0000ff;">this</span> line to add application to user profile</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  39:</span> <span style="color: #0000ff;">if</span> user click on addtoprofile link then above function will work --&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  40:</span> &lt;div <span style="color: #0000ff;">class</span>=<span style="color: #006080;">"section_button"</span>&gt;&lt;fb:add-section-button section=<span style="color: #006080;">"profile"</span>/&gt;&lt;/div&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  41:</span></pre>
</div>
</div>
</div>
</div>
</div>
<p>So devs this is all about my php class. In my next post I will show you how  to develop a facebook application with new platform in details using this class.  Enjoy!!!!
<ul class="related_post">
<li>June 28, 2009 -- <a href="http://www.stylephp.com/2009/06/28/lets-develop-a-facebook-application-part-one/" title="Let&#8217;s Develop a Facebook Application &#8211; Part one">Let&#8217;s Develop a Facebook Application &#8211; Part one (16)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stylephp.com/2009/03/20/a-php-class-for-facebook-application-developer/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Customizing jQuery innerfade plug-in &#8211; Adding controls, navigation and caption</title>
		<link>http://www.stylephp.com/2009/01/17/customizing-jquery-innerfade-plug-in-adding-controls-navigation-and-caption/</link>
		<comments>http://www.stylephp.com/2009/01/17/customizing-jquery-innerfade-plug-in-adding-controls-navigation-and-caption/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 19:07:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[fading]]></category>
		<category><![CDATA[innerfade]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[slider]]></category>

		<guid isPermaLink="false">http://www.stylephp.com/2009/01/17/customizing-jquery-innerfade-plug-in-adding-controls-navigation-and-caption/</guid>
		<description><![CDATA[First of all thanks goes to Medienfreunde Hofmann &#38; Baldes GbR for their nice jQuery innerfade plug-in. It’s very popular and easy to use plug-in for adding slider in a web application.I’ve been a fan of this nice plug-in. Recently, for an application I had to add some more feature with this plugin. Here, I [...]]]></description>
			<content:encoded><![CDATA[<p>First of all thanks goes to <a href="http://medienfreunde.com">Medienfreunde Hofmann &amp; Baldes GbR</a> for their nice <a href="http://medienfreunde.com/lab/innerfade/">jQuery innerfade plug-in</a>. It’s very popular and easy to use plug-in for adding slider in a web application.I’ve been a fan of this nice plug-in. Recently, for an application I had to add some more feature with this plugin. Here, I just want to share my modifications with you.</p>
<h4><span style="text-decoration: underline;">New features I have added</span></h4>
<ul>
<li>
<ul>
<li>Add Slider controler where you can do play/stop,next/prev,first/last.</li>
<li>Add a navigation from where you can navigate to any slide.</li>
<li>Add a Slide caption where you can set caption for a slide.</li>
</ul>
</li>
</ul>
<p><a href="http://stylephp.com/demo_image/screenshot.jpg"><img class="alignnone" title="screen shot" src="http://stylephp.com/tmp/screenshot.jpg" alt="" /></a></p>
<p>Here is a <strong><a href="http://stylephp.com/jquery-plugin/Demo/">live demo</a></strong><strong></strong> here.</p>
<p><img class="alignnone" src="http://stylephp.com/demo_image/screenshot.jpg" alt="" width="721" height="269" /></p>
<h4><span style="text-decoration: underline;">Download</span></h4>
<p><a href="http://www.stylephp.com/jquery-plugin/Demo.zip">Download</a> it from here (). The zip file contains modified innerfade plugin along with an example.</p>
<h4><span style="text-decoration: underline;">How to use</span></h4>
<p>Nothing new. Use this plugin just as the original innerfade plugin. For additional features, set your options from "config.js". You can modify the "slide.css" as your application UI needs. Thats all.</p>
<h4>Plug-in Options</h4>
<ul>
<li><strong>slide_timer_on</strong> :  "yes" or "no". If "yes", then  slide will automatically play.</li>
<li><strong>slide_ui_parent </strong>: The ID of &lt;<em>ul&gt;</em> which contains the slide &lt;<em>li&gt;</em>s of slide. ( "portfolio" in attached example slider).</li>
<li><strong>slide_ui_text</strong> : The id of descrition/caption element. “portfolio-desc” in example. In case, you don’t want to use a caption, leave it "null"</li>
<li><strong>pause_button_id </strong>: The id of pause_button. “pause_button” in example. In case, you don’t want to use a controler, leave it "null"</li>
<li><strong>slide_nav_id</strong>: The id of slide navigation. “slide_nav” in example. In case, you don’t want to use a navigation, leave it "null"</li>
</ul>
<p>I have described here only new feature related options. All other  jquery innerfade settings will remain as is. Thats all. If you want to know anything more, just drop me a line. I will try my best to answer. enjoy!!!!
<ul class="related_post">
<li>No Related Post</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stylephp.com/2009/01/17/customizing-jquery-innerfade-plug-in-adding-controls-navigation-and-caption/feed/</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>Some Common Errors and Solutions of ASP.NET</title>
		<link>http://www.stylephp.com/2008/12/18/some-common-errors-and-solutions-of-aspnet/</link>
		<comments>http://www.stylephp.com/2008/12/18/some-common-errors-and-solutions-of-aspnet/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 06:52:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[compiler error]]></category>
		<category><![CDATA[cs0246]]></category>
		<category><![CDATA[iis7]]></category>
		<category><![CDATA[mapping handler]]></category>

		<guid isPermaLink="false">http://www.stylephp.com/?p=40</guid>
		<description><![CDATA[Basically I am working with PHP.But I have also great interest about asp.net(C#). So recently I am working on a website using Microsoft visual studio 2005 professional Edition and Microsoft SQL server 2000. Here I have to face some common errors. I am goggling about these errors and I have found that maximum developers face [...]]]></description>
			<content:encoded><![CDATA[<p>Basically I am working with <a href="http://php.net/" target="_blank">PHP</a>.But I have also great interest about <a href="http://www.asp.net/" target="_blank">asp.net</a>(C#). So recently I am working on a website using Microsoft visual studio 2005 professional Edition and Microsoft SQL server 2000. Here I have to face some common errors. I am goggling about these errors and I have found that maximum developers face same problem. So I think it will very helpful for many developers if I share those errors using my blog. And also you can share your own experience which is also very helpful for us. So let’s see how it happens.</p>
<p><strong>Error Message 1#</strong></p>
<p><strong><span style="color: #ff0000;">The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)</span></strong></p>
<p><strong>Error Description:</strong></p>
<p>I’m including a c# file named Group to access the common functionality.</p>
<p>The C# file is included in App_Code directory and when I access the c# file using the code below it shows the error:</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2008/12/error11.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.stylephp.com/wp-content/uploads/2008/12/error1-thumb1.png" border="0" alt="error1" width="580" height="266" /></a></p>
<p>From a post I have found that<strong> </strong>this is just a namespace problem or a missing reference problem. So I put all the code inside a common namespace named ‘<strong>DocumentManage’</strong> and now I am using this namespace with the help of using directive. But unfortunately it’s now showing that namespace named ‘<strong>DocumentManage’</strong> not found. Also without any namespace if I run using inbuilt Asp.Net development server it is running. Only in IIS if I run using <a href="http://localhost/">http://localhost/</a> it is showing the error.</p>
<p><strong><span style="color: #0000ff;">Solution:</span> </strong>There are some solutions which I have found from some of the post. I have also given my solution here.<strong></strong></p>
<p><strong><span style="color: #0000ff;">#1</span> </strong>you must specify the namespace name if you put your c# code within a common namespace<strong>.</strong></p>
<p><strong><span style="color: #0000ff;">2#</span> </strong>Visual Studio always puts classes in namespaces; please this is just a namespace problem or a missing reference problem. Just take a look at the error description on <a href="http://msdn.microsoft.com/" target="_blank">MSDN</a>, it can be found <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscomp/html/vcerrCompilerErrorCS0246.asp">here</a>.</p>
<p><strong><span style="color: #0000ff;">3#</span></strong> if you sure that you have put all your class file within a common namespace and you use this namespace with the help of using directive and you have no problem with reference also. Then be sure that you add your asp.net web site as an application into <a href="http://www.iis.net/" target="_blank">IIS</a>. This was my problem. I was not adding my website as an application at <a href="http://www.iis.net/" target="_blank">IIS</a>.So it shown this error. When add my web site as an application then all the error solve. I have shown here how to add your asp.net web application as an application.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2008/12/addapplication.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://www.stylephp.com/wp-content/uploads/2008/12/addapplication-thumb.png" border="0" alt="addapplication" width="607" height="352" /></a></p>
<p>Go to <a href="http://www.iis.net/" target="_blank">IIS</a> Manager and convert your website as an application. That’s ok.</p>
<p><strong>Error Message 2#:</strong></p>
<p><strong>The resource you are looking for does not have a handler associated with it</strong></p>
<p><strong>Error Description:</strong></p>
<p>When I try to browse me website under local host I got this error message. As an example if I browse <a href="http://localhost:81/pdfdocument">http://localhost:81/pdfdocument</a> and I get this. But if I browse <a href="http://localhost:81/pdfdocument/default.aspx">http://localhost:81/pdfdocument/default.aspx</a> then it works!</p>
<p>Another interesting thing it does not find any JavaScript and CSS file also. It can only browse aspx extension file. I have given a screen shot here.</p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2008/12/error2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.stylephp.com/wp-content/uploads/2008/12/error2-thumb.png" border="0" alt="error2" width="613" height="301" /></a></p>
<p><strong><span style="color: #0000ff;">Solution:</span></strong></p>
<p><a href="http://www.stylephp.com/wp-content/uploads/2008/12/2008-12-18-1441.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://www.stylephp.com/wp-content/uploads/2008/12/2008-12-18-1441-thumb.png" border="0" alt="2008-12-18_1441" width="618" height="475" /></a></p>
<p>Go to the IIS Manager and find out the handler mapping for the website and check StaticFile Handler and ensure that Static File Handler module has</p>
<p>Path *.*</p>
<p>Enabled</p>
<p>StaticFileModule, DefaultDocumentModule, DirectoryListingModule - Have these modules listed.</p>
<p>At screenshot you can see where you have to change.</p>
<p>You find the solution from <a href="http://forums.iis.net/p/1152947/1884387.aspx">http://forums.iis.net/p/1152947/1884387.aspx</a></p>
<p>There are two errors I have given here. I have another some errors which I will share with another post. so if you have errors and solutions please share with us. It is really helpful for us. Thanks all.
<ul class="related_post">
<li>No Related Post</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stylephp.com/2008/12/18/some-common-errors-and-solutions-of-aspnet/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.stylephp.com/2008/10/15/hello-world/</link>
		<comments>http://www.stylephp.com/2008/10/15/hello-world/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 10:35:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[stylephp]]></category>

		<guid isPermaLink="false">http://www.stylephp.com/?p=1</guid>
		<description><![CDATA[Hello Everybody!
I am coming back into your world. I have been blogging  for five to seven months with wordpress, but I have been thinking for a domain  to share, test and explore my works and experience on an unique web identity. In  order to fulfill my desire, I have chosen this site [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Everybody!</p>
<p>I am coming back into your world. I have been blogging  for five to seven months with <a title="wordpress" href="http://wordpress.com/">wordpress</a>, but I have been thinking for a domain  to share, test and explore my works and experience on an unique web identity. In  order to fulfill my desire, I have chosen this site and this domain:  stylephp.com! I am really grateful to  <a title="phpfour.com" href="http://phpfour.com">Emran  vai</a>, <a title="ajaxray.com" href="http://ajaxray.com">Anis</a>,  and above all, almighty GOD.</p>
<p>I have chosen my domain name <a title="stylephp" href="http://stylephp.com">stylephp</a>. Why?  Because you know that both "style" and "php" are important into our web  application world. We can decorate our web application using many style sheets.  And we can give life to our application using <a title="php" href="http://php.net/">PHP</a>. Recently <a title="php" href="http://php.net/">PHP </a>has become very  powerful and popular due to its stability. And i love working with <a title="php" href="http://php.net/">PHP </a>very  much.</p>
<p>It's been two to three years since i am working with <a title="php" href="http://php.net/">PHP </a>and i am  proud to say that I am a PHP dev. I also use JavaScript, CSS, AJAX, and XML.  Some of the PHP frameworks I've worked with are: <a title="codeigniter" href="http://codeigniter.com/">CodeIgniter</a>, <a title="zend framework" href="http://framework.zend.com/">Zend Framework</a> and  javascript library: <a title="prototype" href="http://www.prototypejs.org/">prototype</a>, <a title="jquery" href="http://www.jquery.com">jquery</a>. Besides, I've been making a few social  applications in <a title="facebook" href="http://www.facebook.com">Facebook </a>and up to now, I love it !</p>
<p>So friends, here I  will share what i know and what i want to know from you. My blog is here so that  I can know from you and to share my experience with you.</p>
<p>Thats all for  now. See you soon with new post <span style="font-weight: bold; color: #005fff;"> <img src='http://www.stylephp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></p>
<p>Raju Mazumder
<ul class="related_post">
<li>No Related Post</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stylephp.com/2008/10/15/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
