<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Yii Developer





</description><title>sirin k</title><generator>Tumblr (3.0; @sirink)</generator><link>http://sirink.tumblr.com/</link><item><title>"ajaxgii" an AJAX CRUD generator extension for yii.</title><description>&lt;p&gt;This is a customized giiplus extension with AJAX CRUD features. &lt;br/&gt;read more here:http://www.yiiframework.com/extension/ajaxgii/&lt;/p&gt;
&lt;p&gt;some screenshots:&lt;/p&gt;
&lt;p&gt;1.Grid view&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/61ff601d101b3710ebc55ad5abeecae1/tumblr_inline_mjdpq7vu2s1qz4rgp.png"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2.Create Form&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/fa8aa6063e2d49b1796c198fe1ffb6d6/tumblr_inline_mjdpr5F6Pw1qz4rgp.png"/&gt;&lt;/p&gt;
&lt;p&gt;3.Update Form&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/af6510ef94c439c894a6e4044da803f3/tumblr_inline_mjdps1Zve01qz4rgp.png"/&gt;&lt;/p&gt;
&lt;p&gt;4.View&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/5b2e27dcfcc26c458b529ebf235e93b9/tumblr_inline_mjdpt55TO51qz4rgp.png"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i hope this extension will be useful for you.thanks&lt;/p&gt;
&lt;p&gt;Sirin k&lt;br/&gt;Nintriva Wireless&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/44920404976</link><guid>http://sirink.tumblr.com/post/44920404976</guid><pubDate>Sat, 09 Mar 2013 11:27:00 +0530</pubDate><category>giiplus</category><category>gii</category><category>ajaxgii</category><category>yiiextension</category><category>yiiframework</category><category>yii</category></item><item><title>Get notified about the status of a Facebook user in your web app using periodic Ajax calls.</title><description>&lt;p&gt;&lt;span&gt;hello, This article is helpful only if you have the following situation: A web app which uses facebook login to login its users and if a user is logged out from his/her facebook account through another browser tab, then your app dont know that he is logged out out or not from his facebook account and he/she will remain as logged in your web application.Its ok if you have no problem with this situation.But if you want to forcefully logout the user from your application if he is logged out from his facebook account means you can try this example.This example uses periodic ajax calls to facebook&amp;#8217;s graph api to check whether the user is logged in or not.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can see the source code in my yii wiki section:&lt;/span&gt;&lt;a href="http://www.yiiframework.com/wiki/376/get-notified-about-the-status-a-of-facebook-user-in-your-web-app-using-periodic-ajax-calls/" title="Get notified about the status a of Facebook user in your web app using periodic Ajax calls." target="_blank"&gt;&lt;a href="http://www.yiiframework.com/wiki/376/get-notified-about-the-status-a-of-facebook-user-in-your-web-app-using-periodic-ajax-calls/" target="_blank"&gt;http://www.yiiframework.com/wiki/376/get-notified-about-the-status-a-of-facebook-user-in-your-web-app-using-periodic-ajax-calls/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sirin k&lt;br/&gt;Nintriva Wireless &lt;/p&gt;</description><link>http://sirink.tumblr.com/post/30563217904</link><guid>http://sirink.tumblr.com/post/30563217904</guid><pubDate>Fri, 31 Aug 2012 08:14:00 +0530</pubDate></item><item><title>"giiplus" My first Yii extension.</title><description>&lt;p&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This is a customized bootstrap CRUD generator having just 3 additional features. ie.,&lt;/p&gt;
&lt;p&gt;1.pdf export.&lt;/p&gt;
&lt;p&gt;2.excel export.&lt;/p&gt;
&lt;p&gt;3.print @view.&lt;/p&gt;
&lt;p&gt;link:&lt;span class="Apple-style-span"&gt;&lt;a href="http://www.yiiframework.com/extension/giiplus/" title="http://www.yiiframework.com/extension/giiplus/" target="_blank"&gt;&lt;a href="http://www.yiiframework.com/extension/giiplus/" target="_blank"&gt;http://www.yiiframework.com/extension/giiplus/&lt;/a&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;-Sirin&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/25417701660</link><guid>http://sirink.tumblr.com/post/25417701660</guid><pubDate>Tue, 19 Jun 2012 10:48:43 +0530</pubDate></item><item><title>Displaying image in a CGridView column.</title><description>&lt;p&gt;This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.&lt;/p&gt;
&lt;div&gt;To see an exmple code see my wiki article in &lt;a href="http://www.yiiframework.com" target="_blank"&gt;www.yiiframework.com&lt;/a&gt; here:&lt;/div&gt;
&lt;div&gt;&lt;a href="http://www.yiiframework.com/wiki/331/displaying-image-in-a-cgridview-column/" title="Displaying image in a CGridView column." target="_blank"&gt;&lt;a href="http://www.yiiframework.com/wiki/331/displaying-image-in-a-cgridview-column/" target="_blank"&gt;http://www.yiiframework.com/wiki/331/displaying-image-in-a-cgridview-column/&lt;/a&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;-Sirin&lt;/div&gt;</description><link>http://sirink.tumblr.com/post/24676751542</link><guid>http://sirink.tumblr.com/post/24676751542</guid><pubDate>Fri, 08 Jun 2012 18:56:00 +0530</pubDate></item><item><title>Storing your images in your table's blob field and displaying that stored images</title><description>&lt;p&gt;Here im giving you a very simple example ie how you can store an image to your blob field in a table.Hope you already familiar with the normal image upload.&lt;/p&gt;
&lt;p&gt;First im going to tell you the necessary steps you need to carry out to &lt;strong&gt;store an image into your blob field&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Let me explain these 7 steps ,&lt;/p&gt;
&lt;div&gt;to see an example of 7 steps see my wiki article in &lt;a href="http://www.yiiframework.com" target="_blank"&gt;www.yiiframework.com&lt;/a&gt; here:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://www.yiiframework.com/wiki/332/storing-your-images-in-your-table-s-blob-field-and-displaying-that-stored-images/" title="Storing your images in your table's blob field and displaying that stored images." target="_blank"&gt;&lt;a href="http://www.yiiframework.com/wiki/332/storing-your-images-in-your-table-s-blob-field-and-displaying-that-stored-images/" target="_blank"&gt;http://www.yiiframework.com/wiki/332/storing-your-images-in-your-table-s-blob-field-and-displaying-that-stored-images/&lt;/a&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;-Sirin&lt;/div&gt;</description><link>http://sirink.tumblr.com/post/24676672777</link><guid>http://sirink.tumblr.com/post/24676672777</guid><pubDate>Fri, 08 Jun 2012 18:53:00 +0530</pubDate></item><item><title>Importing CSV file to mysql table using "LOAD DATA" command.</title><description>&lt;p&gt;hi, Here i am giving you some simple step to import huge data from a csv file to your mysql table.this is useful when you have a very huge data to import from csv format.&lt;/p&gt;
&lt;p&gt;Imagine that you have a table, tbl_user(id(int AI), name(varchar(100)), age(int), location(varchar(100))). in your db and you have a csv file like this format:&lt;a href="https://dl.dropbox.com/u/74072668/test.csv" title="Csv test format" target="_blank"&gt;Download test format&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;to see an example read my wiki article in Yiiframework site:&lt;a href="http://www.yiiframework.com/wiki/336/importing-csv-file-to-mysql-table-using-load-data-command/" title='Importing CSV file to mysql table using "LOAD DATA" command' target="_blank"&gt;&lt;a href="http://www.yiiframework.com/wiki/336/importing-csv-file-to-mysql-table-using-load-data-command/" target="_blank"&gt;http://www.yiiframework.com/wiki/336/importing-csv-file-to-mysql-table-using-load-data-command/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;-Sirin&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/24676351249</link><guid>http://sirink.tumblr.com/post/24676351249</guid><pubDate>Fri, 08 Jun 2012 18:44:00 +0530</pubDate></item><item><title>Don't buy Server space or reseller account from siliconhouse.net in india.</title><description>&lt;p&gt;hi guys,&lt;/p&gt;
&lt;p&gt;     im writing this article since i got lot of bad experience from Siliconhouse.net in india.i took a reseller account of  2000&amp;#160;GB space in linux before 3 months.Im pointing out something i have faced with this team.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;  They will delete the account you have created for one of your user without your permission.then we again need to submit a ticket make a new password again.i did this 3-4 times already.&lt;/li&gt;
&lt;li&gt;They will delete the domain we hosted without our permission.&lt;/li&gt;
&lt;li&gt;They will change our account password without our permission.&lt;/li&gt;
&lt;li&gt;They will shutdown their service after 10pm everyday.&lt;/li&gt;
&lt;li&gt;They wont allow us to run the crone  job feature.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;So guys be aware of this shit service and dont waste ur time and money with Silicon house.&lt;/p&gt;

&lt;p&gt;-Sirin &lt;br/&gt; Nintriva Wireless &lt;/p&gt;</description><link>http://sirink.tumblr.com/post/24189185532</link><guid>http://sirink.tumblr.com/post/24189185532</guid><pubDate>Fri, 01 Jun 2012 16:23:11 +0530</pubDate></item><item><title>Using Twitter bootstrap in Yii framework</title><description>&lt;p&gt;We can easily use twitter bootstrap in yii framework.Let give give you an example for twitter popover below:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;  $assetsDir = dirname(__FILE__).&amp;#8217;/../assets&amp;#8217;;&lt;/p&gt;
&lt;p&gt; $cs = Yii::app()-&amp;gt;getClientScript();&lt;br/&gt;&lt;br/&gt;  $cs-&amp;gt;registerCssFile(&lt;br/&gt;    Yii::app()-&amp;gt;assetManager-&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div id=":1a5"&gt;publish($assetsDir.&amp;#8217;/css/bootstrap.min.css&amp;#8217;)&lt;br/&gt;    );&lt;br/&gt;// Publishing and registering JavaScript file&lt;br/&gt;     &lt;br/&gt;   $cs-&amp;gt;registerScriptFile(&lt;br/&gt;     Yii::app()-&amp;gt;assetManager-&amp;gt;publish($assetsDir.&amp;#8217;/js/bootstrap-twipsy.js&amp;#8217;),&lt;br/&gt;     CClientScript::POS_HEAD&lt;br/&gt;     );&lt;br/&gt;   $cs-&amp;gt;registerScriptFile(&lt;br/&gt;     Yii::app()-&amp;gt;assetManager-&amp;gt;publish($assetsDir.&amp;#8217;/js/bootstrap-popover.js&amp;#8217;),&lt;br/&gt;      CClientScript::POS_HEAD&lt;br/&gt;     );&lt;br/&gt;&lt;br/&gt;&amp;lt;script&amp;gt;&lt;br/&gt;            $(function () {&lt;br/&gt;              $(&amp;#8220;a[rel=popover]&amp;#8221;)&lt;br/&gt;                .popover({&lt;br/&gt;                  html:true ,&lt;br/&gt;                  offset: 10&lt;br/&gt;                   &lt;br/&gt;                })&lt;br/&gt;                .click(function(e) {&lt;br/&gt;                  e.preventDefault()&lt;br/&gt;                })&lt;br/&gt;            })&lt;br/&gt;          &amp;lt;/script&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;a href=&amp;#8217;#&amp;#8217; rel=&amp;#8217;popover&amp;#8217; title=&amp;#8217;title&amp;#8217; data-content=&amp;#8217;Place content here&amp;#8217; &amp;gt;Click here&amp;lt;/a&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Regards,&lt;/div&gt;
&lt;div&gt;sirin k&lt;/div&gt;
&lt;div&gt;Nintriva Wireless&lt;/div&gt;</description><link>http://sirink.tumblr.com/post/17419959683</link><guid>http://sirink.tumblr.com/post/17419959683</guid><pubDate>Sat, 11 Feb 2012 16:35:00 +0530</pubDate></item><item><title> Starting a php project in Netbeans IDE.</title><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt; We can start developing project in Netbeans IDE.&lt;/p&gt;
&lt;p&gt;step1:Install Netbeans from the synaptic manager.&lt;/p&gt;
&lt;p&gt;step2:go to file select new project.&lt;/p&gt;
&lt;p&gt;step3:Select php.&lt;/p&gt;
&lt;p&gt;    Note:Im writing this article mainly to point out one issue in the start up when i have tried to do a php project using Netbeans IDE.&lt;br/&gt;In this step 3 you are not going to find the PHP option in project categories so that you must need to install the php plugin yourself.&lt;br/&gt;for this go to Tools&amp;gt;plugins&amp;gt;Available plugins and select the extra plugins you need  and click install.&lt;/p&gt;
&lt;p&gt;Reagards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;br/&gt;Nintriva Wireless&lt;br/&gt;India&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/17370986876</link><guid>http://sirink.tumblr.com/post/17370986876</guid><pubDate>Fri, 10 Feb 2012 19:34:37 +0530</pubDate></item><item><title>Start Using MongoDB</title><description>&lt;p&gt;You can start using MongoDb within 3 steps.&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;step1:You can easily install MongoDb from synaptic in linux.&lt;br/&gt;step2:take one terminal and type:mongod (this will start the mongoDB shell)&lt;br/&gt;&lt;strong&gt; eg: $ mongod&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;  /usr/lib/mongodb/mongod &amp;#8212;help for help and startup options&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 MongoDB starting&amp;#160;: pid=2761 port=27017 dbpath=/data/db/ 64-bit &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 db version v1.6.3, pdfile version 4.5&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 git version: nogitversion&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 sys info: Linux allspice 2.6.24-28-server #1 SMP Wed Aug 18&amp;#160;21:17:51 UTC 2010 x86_64 BOOST_LIB_VERSION=1_42&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 [initandlisten] *** warning: spider monkey build without utf8 support.  consider rebuilding with utf8 support&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 [initandlisten] waiting for connections on port 27017&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:10:43 [websvr] web admin interface listening on port 28017&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;step3:take another terminal and type:mongo&lt;br/&gt;&lt;strong&gt; eg:$ mongo&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;MongoDB shell version: 1.6.3&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;Thu Nov 24&amp;#160;11:11:54 *** warning: spider monkey build without utf8 support.  consider rebuilding with utf8 support&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;connecting to: test&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;On startup the shell connect to the test db in MongoDb server and assigns the database connection to the global variable db.This  variable will be the primary access point to the MongoDb through the shell.&lt;br/&gt;Collections can be accessed from the db variable.&lt;br/&gt;eg: db.business will return the business collection in the current database.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Basic Operations with the shell(CRUD)&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;1.Create&lt;/strong&gt;&lt;br/&gt;  We can insert a document to a collection like below example.&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt; Here we are storing a document to javascript variable ie &amp;#8220;user&amp;#8221; &lt;br/&gt;  &lt;strong&gt;&amp;gt; user = {&amp;#8220;name&amp;#8221;&amp;#160;: &amp;#8220;sirin k&amp;#8221;,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;     &amp;#8220;place&amp;#8221;&amp;#160;: &amp;#8220;palakkad&amp;#8221;,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;  &amp;#8220;date&amp;#8221;&amp;#160;: new Date()}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we can insert the javascript variable(ie user) to a collection named&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&amp;gt; db.users.insert(user)&lt;/strong&gt;&lt;br/&gt;done.&lt;/p&gt;

&lt;p&gt;Now we can see all the documents in a collection by using,&lt;br/&gt;&lt;strong&gt;2.Read&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&amp;gt;db.users.find()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{ &amp;#8220;_id&amp;#8221;&amp;#160;: ObjectId(&amp;#8220;4ecde1ddb8b201ad4fab9e0b&amp;#8221;), &amp;#8220;name&amp;#8221;&amp;#160;: &amp;#8220;sirin k&amp;#8221;, &amp;#8220;place&amp;#8221;&amp;#160;: &amp;#8220;palakkad&amp;#8221;, &amp;#8220;date&amp;#8221;&amp;#160;: &amp;#8220;Thu Nov 24&amp;#160;2011&amp;#160;11:48:57 GMT+0530 (IST)&amp;#8221; }&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We can also use fineOne() by passing a criteria through it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.Update&lt;/strong&gt;&lt;br/&gt;  Update takes 3 parameter.ie one is the criteria to decide which document to update another is the new document.&lt;br/&gt;suppos if we are  going to add another key to store the user friends as an array in one of  document we are already stored in users collection.we can do like this,&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;set a new key frients as array in js variable user.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; user.friends=[]&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;[ ]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; update the document&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;gt; db.users.update({&amp;#8220;name&amp;#8221;:&amp;#8221;sirin k&amp;#8221;},user)&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Read all the document&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;gt; db.users.find()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{ &amp;#8220;_id&amp;#8221;&amp;#160;: ObjectId(&amp;#8220;4ecde1ddb8b201ad4fab9e0b&amp;#8221;), &amp;#8220;name&amp;#8221;&amp;#160;: &amp;#8220;sirin k&amp;#8221;, &amp;#8220;place&amp;#8221;&amp;#160;: &amp;#8220;palakkad&amp;#8221;, &amp;#8220;date&amp;#8221;&amp;#160;: &amp;#8220;Thu Nov 24&amp;#160;2011&amp;#160;11:48:57 GMT+0530 (IST)&amp;#8221;, &amp;#8220;friends&amp;#8221;&amp;#160;: [ ] }&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;4.Delete&lt;/strong&gt;&lt;br/&gt;We can remove all the documents in a collection by using remove() like below.&lt;br/&gt;&lt;strong&gt;&amp;gt;db.users.remove()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;We can also pass a criteria through the remove() function.&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;gt;db.users.remove({&amp;#8220;name&amp;#8221;:&amp;#8221;sirin k&amp;#8221;})&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;          &lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;sirin k&lt;br/&gt;&lt;a href="http://www.nintriva.com" title="Nintriva Wireless" target="_blank"&gt;Nintriva Wireless&lt;/a&gt;&lt;br/&gt;INDIA&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;</description><link>http://sirink.tumblr.com/post/13242168007</link><guid>http://sirink.tumblr.com/post/13242168007</guid><pubDate>Thu, 24 Nov 2011 11:12:00 +0530</pubDate></item><item><title>MongoDb(noSQL) introduction.</title><description>&lt;p&gt;MongoDB is a scalable,     high-performance, open source, document-oriented database. Written     in C++.&lt;br/&gt;MongoDb is noSQL so here we can call &amp;#8220;collections&amp;#8221; instead of &amp;#8220;tables&amp;#8221;  and &amp;#8220;documents&amp;#8221; instead of &amp;#8220;table records&amp;#8221; in SQL.&lt;br/&gt;&lt;strong&gt;#Collection&lt;/strong&gt; is a group of documents.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#In mongoDb  we can represent documents as key value pair as below.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;{&amp;#8220;message&amp;#8221;&amp;#160;: &amp;#8220;Hello, Welcome to MongoDb&amp;#8221;}&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;#We can also have multiple key value pairs like below&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;{&amp;#8220;message&amp;#8221;&amp;#160;: &amp;#8220;Hello, Welcome to MongoDb&amp;#8221;, &amp;#8220;foo&amp;#8221;&amp;#160;: 3}&lt;br/&gt;and&lt;br/&gt;{ &amp;#8220;foo&amp;#8221;&amp;#160;: 3,&amp;#8221;message&amp;#8221;&amp;#160;: Hello, Welcome to MongoDb&amp;#8221;}&lt;/p&gt;
&lt;p&gt;Note:the above 2 documents are differ since their orders are different.&lt;br/&gt;&lt;strong&gt;#MongoDb is case sensitive and type sensitive.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;eg1:&lt;br/&gt;{&amp;#8220;message&amp;#8221;&amp;#160;: &amp;#8220;Hello, Welcome to MongoDb&amp;#8221;} and&lt;/p&gt;
&lt;p&gt;{&amp;#8220;Message&amp;#8221;&amp;#160;: &amp;#8220;Hello, Welcome to MongoDb&amp;#8221;} are different.  &lt;/p&gt;
&lt;p&gt;eg2:&lt;br/&gt;{&amp;#8220;foo&amp;#8221;&amp;#160;: 3} and&lt;br/&gt;{&amp;#8220;foo&amp;#8221; :&amp;#8221;3&amp;#8221;} are different&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#Documents in  MongoDb shouldn&amp;#8217;t contain duplicate entries.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; eg3:&lt;br/&gt;{&amp;#8220;message&amp;#8221;&amp;#160;: &amp;#8220;Hello, Welcome to MongoDb&amp;#8221;} &lt;br/&gt; {&amp;#8220;message&amp;#8221;&amp;#160;: &amp;#8220;Hello, Welcome to MongoDb&amp;#8221;} is not valid&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#Collections in MongoDb is schema free&lt;/strong&gt;&lt;br/&gt;Collections are not need to worry about any specified schema like in sql table.and it can have &lt;br/&gt;documents in any shape.&lt;/p&gt;
&lt;p&gt;eg:&lt;/p&gt;
&lt;p&gt;     {&amp;#8220;Name&amp;#8221;&amp;#160;: &amp;#8220;sirin k&amp;#8221;}&lt;br/&gt;     {&amp;#8220;age&amp;#8221; :22}&lt;/p&gt;
&lt;p&gt;A single Instance of MongoDb can host several databases which will be completely independent&lt;br/&gt;and each of which can have its own permissions.&lt;br/&gt;Note:Database names should be lower case.&lt;/p&gt;
&lt;p&gt;Some reserved db names which shouldn&amp;#8217;t use it are,&lt;br/&gt;1.admin(used to store the admin users details)&lt;br/&gt;2.local(used to store any collections that should be local to a single server)&lt;br/&gt;3.config(Used internally to store the info. about the shards)&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;br/&gt;&lt;a href="http://www.nintriva.com" title="Nintriva Wireless" target="_blank"&gt;Nintriva Wireless&lt;/a&gt;&lt;br/&gt;INDIA&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/13199714803</link><guid>http://sirink.tumblr.com/post/13199714803</guid><pubDate>Wed, 23 Nov 2011 15:35:00 +0530</pubDate></item><item><title>Gmap Multiploting and Capturing all marker updates in Yii</title><description>&lt;p&gt;This article will be useful for those who are using &lt;a href="http://www.yiiframework.com/extension/jquery-gmap/" title="jquery-gmap extension" target="_blank"&gt;jquery-gmap extension&lt;/a&gt; in Yii.&lt;/p&gt;
&lt;p&gt;Here i am going to tell you how you can plot multiple locations in a single google map using this extension and how you can capture all marker locations when a user changing them.This will be useful when you are giving an option to mark multiple locations for a user and save all the updated locations in a single map.&lt;/p&gt;
&lt;p&gt;i hope you already familiar with this extension and you are willing to store a single location through this extension.If you are not you can reffer one of my preveous article with this same extension(&lt;a href="http://sirink.tumblr.com/post/6553229506/google-maps-in-yii" title="Google maps in Yii" target="_blank"&gt;Google maps in Yii&lt;/a&gt;).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So you might have a location model which stores all the location of a business model.So you will be having ONE-TO-MANY relation from business to location  model.&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;Try the below code in your business create form.(_form.php)&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;?php&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;// create a map centered in the middle of the world &amp;#8230;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;$gmap = new EGmap3Widget();&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;$gmap-&amp;gt;width=&amp;#8217;600&amp;#8217;;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;$gmap-&amp;gt;height=&amp;#8217;450&amp;#8217;;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;$gmap-&amp;gt;setOptions(array(&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;        &amp;#8216;zoom&amp;#8217; =&amp;gt; 14,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;        &amp;#8216;center&amp;#8217; =&amp;gt; array(0,0),&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;));&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$model=Business::model()-&amp;gt;findbyPk(&amp;#8216;3&amp;#8217;);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$i=0;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;foreach($model-&amp;gt;locations as $loc)&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;//Initialize a marker&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;$m[$i] = new EGmap3Marker(array(&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    &amp;#8216;title&amp;#8217; =&amp;gt; $loc-&amp;gt;shop_name,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    &amp;#8216;draggable&amp;#8217;=&amp;gt;true,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;));&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;  //set location&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt; $m[$i]-&amp;gt;latLng=array($loc-&amp;gt;latitude,$loc-&amp;gt;longitude);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/* add dragend event with an autogenerate js function(ie captureMarkerPosition()) */&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; $m[$i]-&amp;gt;addEvent(&amp;#8216;dragend&amp;#8217;, &amp;#8216;function(result){captureMarkerPosition&amp;#8217;.$i.&amp;#8217;(result);}&amp;#8217;);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;//add marker to gmap&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt; $gmap-&amp;gt;add($m[$i]);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/* generate hidden input fields to store locations */&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;echo &amp;#8220;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;input type=&amp;#8217;hidden&amp;#8217; name=&amp;#8217;Location_id[]&amp;#8217; value=&amp;#8217;&amp;#8221;.$loc-&amp;gt;id.&amp;#8221;&amp;#8217; &amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;input type=&amp;#8217;hidden&amp;#8217; name=&amp;#8217;Location_latitude[]&amp;#8217; id=&amp;#8217;Location_latitude&amp;#8221;.$i.&amp;#8221;&amp;#8217; value=&amp;#8217;&amp;#8221;.$loc-&amp;gt;latitude.&amp;#8221;&amp;#8217;&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;input type=&amp;#8217;hidden&amp;#8217; name=&amp;#8217;Location_longitude[]&amp;#8217; id=&amp;#8217;Location_longitude&amp;#8221;.$i.&amp;#8221;&amp;#8217; value=&amp;#8217;&amp;#8221;.$loc-&amp;gt;longitude.&amp;#8221;&amp;#8217;&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;#8221;;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;/*Generate individual functions to capture the marker position  */&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;echo &amp;#8216;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;script type=&amp;#8221;text/javascript&amp;#8221;&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;function captureMarkerPosition&amp;#8217;.$i.&amp;#8217;(marker)&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt; document.getElementById(&amp;#8220;Location_latitude&amp;#8217;.$i.&amp;#8217;&amp;#8221;).value=marker.getPosition().lat();&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt; document.getElementById(&amp;#8220;Location_longitude&amp;#8217;.$i.&amp;#8217;&amp;#8221;).value=marker.getPosition().lng(); &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;/script&amp;gt;&amp;#8217;;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;$i++;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;}//end loop&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;?&amp;gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Now we want to store all these captured positions when the user press the submit button.We can write a some code in the controller action.&lt;br/&gt;&amp;lt;?php  &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;eg:actionCreatLocation.php&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;   if(isset($_POST[&amp;#8216;Location_latitude&amp;#8217;])&amp;amp;&amp;amp;isset($_POST[&amp;#8216;Location_latitude&amp;#8217;]))&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                        {&lt;/strong&gt;&lt;br/&gt;                           &lt;br/&gt;&lt;strong&gt;                                  $location[&amp;#8216;id&amp;#8217;]=$_POST[&amp;#8216;Location_id&amp;#8217;];  &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                  $location[&amp;#8216;latitude&amp;#8217;]=$_POST[&amp;#8216;Location_latitude&amp;#8217;];  &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                  $location[&amp;#8216;longitude&amp;#8217;]=$_POST[&amp;#8216;Location_longitude&amp;#8217;];&lt;/strong&gt;&lt;br/&gt;                                  &lt;br/&gt;&lt;strong&gt;                                  $i=0;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                  foreach($location[&amp;#8216;id&amp;#8217;] as $id)&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                  {&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                   $l=Location::model()-&amp;gt;findbyPk($id);&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                   $l-&amp;gt;latitude=$location[&amp;#8216;latitude&amp;#8217;][$i];&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                   $l-&amp;gt;longitude =$location[&amp;#8216;longitude&amp;#8217;][$i];&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                   $l-&amp;gt;save(false);&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                    $i++; &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                  }&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                                } &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;the above code will store the updated marker co-ordinates to Location model.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;br/&gt;&lt;a href="http://www.nintriva.com" title="Nintriva Wireless" target="_blank"&gt;Nintriva Wireless&lt;/a&gt;&lt;br/&gt;INDIA&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/13153388669</link><guid>http://sirink.tumblr.com/post/13153388669</guid><pubDate>Tue, 22 Nov 2011 15:34:00 +0530</pubDate></item><item><title>Using Jquery dialog box as form in Yii </title><description>&lt;p&gt;As you know Jquery UI framework is already bundled with the Yii framework we can use its Dialog box as a widget in Yii.We can use it as a popup form when we are clicking an ajax link.&lt;/p&gt;
&lt;p&gt;Just follow  2 steps here.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step1: &lt;/strong&gt; view1.php&lt;br/&gt;           make an ajaxlink and place an update div inside the jquery dialog box widget as its content in any of your view file.&lt;br/&gt;  note:jquery dialog&amp;#8217;s autoOpen should be false at this time.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;  &lt;strong&gt;      eg:&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    &amp;lt;?php     &lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&lt;span class="hl-reserved"&gt;echo&lt;/span&gt; &lt;span class="hl-identifier"&gt;CHtml&lt;/span&gt;&lt;span class="hl-code"&gt;::&lt;/span&gt;&lt;span class="hl-identifier"&gt;ajaxLink&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;span class="hl-identifier"&gt;Yii&lt;/span&gt;&lt;span class="hl-code"&gt;::&lt;/span&gt;&lt;span class="hl-identifier"&gt;t&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;job&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-code"&gt;,&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;ADD NEW LOCATION&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-brackets"&gt;)&lt;/span&gt;&lt;span class="hl-code"&gt;,&lt;/span&gt;&lt;span class="hl-reserved"&gt;array&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;location/create&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-brackets"&gt;)&lt;/span&gt;&lt;span class="hl-code"&gt;,&lt;/span&gt;&lt;span class="hl-reserved"&gt;array&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;span class="hl-code"&gt;
        &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;success&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-code"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;/strong&gt;&lt;span class="hl-string"&gt;&lt;strong&gt;js:function(data){
      $("#jobDialog").dialog("open");
    document.getElementById("add_location").innerHTML=data;
 
}&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span class="hl-string"&gt;$this-&amp;gt;beginWidget(&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;zii&lt;/span&gt;&lt;span class="hl-code"&gt;.&lt;/span&gt;&lt;span class="hl-identifier"&gt;widgets&lt;/span&gt;&lt;span class="hl-code"&gt;.&lt;/span&gt;&lt;span class="hl-identifier"&gt;jui&lt;/span&gt;&lt;span class="hl-code"&gt;.&lt;/span&gt;&lt;span class="hl-identifier"&gt;CJuiDialog&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;,array(
                &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;id&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;jobDialog&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;,
                &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;options&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;array(
                    &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;title&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;Yii::t(&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;job&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;,&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;Create&lt;/span&gt; &lt;span class="hl-identifier"&gt;Job&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;),
                    &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;autoOpen&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;false,
                    &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;modal&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-reserved"&gt;true&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;,
                    &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;width&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;auto&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;,
                    &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;height&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-identifier"&gt;auto&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;,
                ),
                ));
 

 echo "&amp;lt;div id='add_location'&amp;gt;&amp;lt;/div&amp;gt;";&lt;/span&gt;
&lt;/strong&gt;&lt;/pre&gt;
&lt;div class="hl-code"&gt;
&lt;div class="hl-main"&gt;
&lt;pre&gt;&lt;strong&gt;&lt;span class="hl-inlinetags"&gt;&lt;/span&gt;
 
 &lt;span class="hl-var"&gt;$this&lt;/span&gt;&lt;span class="hl-code"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="hl-identifier"&gt;endWidget&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;zii.widgets.jui.CJuiDialog&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-brackets"&gt;)&lt;/span&gt;&lt;span class="hl-code"&gt;;
&lt;/span&gt;&lt;span class="hl-inlinetags"&gt;?&amp;gt;&lt;/span&gt;&lt;/strong&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;br/&gt;&lt;span class="hl-string"&gt;Now we have an ajax link which points to the controller/action ie "location/create" and we have an update div (ie add_location)&lt;br/&gt;to load the ajax response.&lt;br/&gt;&lt;strong&gt;Step2:Now we need to update the action ie actionCreate in this example.&lt;br/&gt;&lt;br/&gt;public function actionCreate()&lt;br/&gt;	{&lt;br/&gt;&lt;br/&gt;             if( Yii::app()-&amp;gt;request-&amp;gt;isAjaxRequest )&lt;br/&gt;             {&lt;br/&gt;               // Stop jQuery from re-initialization&lt;br/&gt;                Yii::app()-&amp;gt;clientScript-&amp;gt;scriptMap['jquery.js'] = false;&lt;br/&gt;&lt;br/&gt;		$this-&amp;gt;renderPartial('create',array(&lt;br/&gt;			'model'=&amp;gt;$model,&lt;br/&gt;		));&lt;br/&gt;             }&lt;br/&gt;            else&lt;br/&gt;             {&lt;br/&gt;              $this-&amp;gt;render('create',array(&lt;br/&gt;			'model'=&amp;gt;$model,'deal'=&amp;gt;$deal,&lt;br/&gt;		));&lt;br/&gt;&lt;br/&gt;             }&lt;br/&gt;&lt;br/&gt;	}&lt;br/&gt;&lt;/strong&gt;&lt;br/&gt;You have done it.Enjoy your jquery dialog form in Yii framework.&lt;strong&gt;&lt;br/&gt;&lt;br/&gt;Regards,&lt;br/&gt;Sirin k&lt;br/&gt;&lt;a href="http://www.nintriva.com" title="Nintriva Wireless" target="_blank"&gt;Nintriva Wireless&lt;/a&gt;&lt;br/&gt;INDIA&lt;br/&gt;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://sirink.tumblr.com/post/13008325458</link><guid>http://sirink.tumblr.com/post/13008325458</guid><pubDate>Sat, 19 Nov 2011 17:43:00 +0530</pubDate></item><item><title>#SQL performance tip</title><description>&lt;p&gt;When we are doing an insert of huge no.of rows into an SQL table ,Normally we will try to write separate  insert quries this may lead us to a long duration of execution time and  we can increase the speed of executing SQL quries by adding all the rows into a single insert query.&lt;/p&gt;
&lt;p&gt; NORMAL CASE:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;eg:INSERT INTO tbl_name(field1,field2,&amp;#8230;) values(value1,value2,..);&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    INSERT INTO tbl_name(field1,field2,&amp;#8230;) values(value1,value2,..);&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    INSERT INTO tbl_name(field1,field2,&amp;#8230;) values(value1,value2,..);&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We can decrease the execution time by adding all these rows into a single INSERT query like below,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;  eg:INSERT INTO tbl_name(field1,field2,&amp;#8230;) values(value1,value2,..),values(value1,value2,..),values(value1,value2,..),&amp;#8230;.;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is useful when we are trying to insert about 10k of rows into a table at a time.&lt;br/&gt;For me normally it takes 1min 15 sec to insert 10k of rows but by using this tip it takes only 10 sec to insert 10k of rows.&lt;/p&gt;
&lt;p&gt;i have tried this when i did excel and csv import feature.&lt;br/&gt;For excel it took around 20 sec and for csv it took 10 sec of execution time for inseting 10k of rows.&lt;/p&gt;
&lt;p&gt;Reagards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;br/&gt;Nintriva Wireless&lt;br/&gt;INDIA&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/12735230595</link><guid>http://sirink.tumblr.com/post/12735230595</guid><pubDate>Sun, 13 Nov 2011 18:21:42 +0530</pubDate></item><item><title>Regular expression to support multi-lingual during  Yii validation</title><description>&lt;p&gt;Sometimes we need to validate the user input to filter special characters except certain commonly used characters lik ,.&amp;#8221;: etc.At this time we can write a regular expression in model rules.&lt;/p&gt;
&lt;p&gt; eg:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;[CODE]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;       public function rules()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    {&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;        // NOTE: you should only define rules for those attributes that&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;        // will receive user inputs.&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;        return array(&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                        array(&amp;#8216;title,description&amp;#8217;, &amp;#8216;match&amp;#8217;, &amp;#8216;pattern&amp;#8217; =&amp;gt; &amp;#8216;/^[ %  $ £ € ¥  . , &amp;#8221; ;&amp;#160;: &amp;#92;- a-zA-Z 0-9 \n\r ]+$/u&amp;#8217;,&amp;#8217;message&amp;#8217; =&amp;gt; Yii::t(&amp;#8216;default&amp;#8217;, &amp;#8216;Special characters are not allowed in {attribute}. (allowed list:% $ £ € ¥ . ,  &amp;#8221; ;&amp;#160;: -)&amp;#8217;)),&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;                       );&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;    }&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[/CODE]&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In the above example im validating my 2 fields ie title and description  with this rule,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;/^[ %  $ £ € ¥  . , &amp;#8221; ;&amp;#160;: &amp;#92;- a-zA-Z0-9 \n\r ]+$/u&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;  here im accepting some commonly used spcecial characters like %  $ £ € ¥  . , &amp;#8221; ;&amp;#160;: - and enter key or newline by using \n and \r .&lt;/p&gt;
&lt;p&gt; One main important thing we need to note in the above example is that &lt;strong&gt;it will only accept English letters ie a-zA-Z&lt;/strong&gt;.So its an exception for other languages like chinese,french,japanese etc.So that reason we are making a smaill change in the validation rule to accept all UTF-8 characters.&lt;/p&gt;
&lt;p&gt;ie&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;           &lt;strong&gt;/^[ %  $ £ € ¥  . , &amp;#8221; ;&amp;#160;: &amp;#92;- \p{L} 0-9 \n\r ]+$/u&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;  here we changed a-zA-z with \p{L}  this will accept all UTF-8 characters.Finally the rule in Yii model will be like this,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;[CODE]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;       public function rules()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;     {&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;         // NOTE: you should only define rules for those attributes that&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;         // will receive user inputs.&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;         return array(&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;                         array(&amp;#8216;title,description&amp;#8217;, &amp;#8216;match&amp;#8217;, &amp;#8216;pattern&amp;#8217;  =&amp;gt; &amp;#8216;/^[ %  $ £ € ¥  . , &amp;#8221; ;&amp;#160;: &amp;#92;- \p{L} 0-9 \n\r ]+$/u&amp;#8217;,&amp;#8217;message&amp;#8217;  =&amp;gt; Yii::t(&amp;#8216;default&amp;#8217;, &amp;#8216;Special characters are not allowed in  {attribute}. (allowed list:% $ £ € ¥ . ,  &amp;#8221; ;&amp;#160;: -)&amp;#8217;)),&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;                        );&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;    }&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[/CODE]&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt; sirin k&lt;br/&gt;&lt;a href="http://www.nintriva.com" title=" Nintriva Wireless" target="_blank"&gt; Nintriva Wireless&lt;/a&gt;&lt;br/&gt; INDIA&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/12158851871</link><guid>http://sirink.tumblr.com/post/12158851871</guid><pubDate>Mon, 31 Oct 2011 18:32:00 +0530</pubDate></item><item><title>Session lose for Facebook iframe application only in Internet Explorer .</title><description>&lt;p&gt;Facebook iframe app&amp;#8217;s session is losing in Internet Explorer when doing a second redirection inside the facebook iframe app.The main reason is ,by default IE wont allow cookies in its priavacy settings If cookies not available means session is also not available for our Facebook iframe app in IE.&lt;/p&gt;
&lt;p&gt;solution:&lt;/p&gt;
&lt;p&gt;   We just need to pass a header like header(&amp;#8216;P3P: CP=&amp;#8221;HONK&amp;#8221;&amp;#8217;); when a browser accessing our page.&lt;/p&gt;
&lt;p&gt; In Yii we can set this header at the beginning of evry action or filter.&lt;/p&gt;
&lt;p&gt; see the example in Yii,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[CODE]                   &lt;br/&gt;&lt;strong&gt;    public function actionAuthenticate()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;    {&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;          header(&amp;#8216;P3P: CP=&amp;#8221;HONK&amp;#8221;&amp;#8217;);&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;           /* Declaring facebook object for making facebook api calls */ &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;           $facebook = new Facebook(array(&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;            &amp;#8216;appId&amp;#8217;  =&amp;gt; Yii::app()-&amp;gt;controller-&amp;gt;module-&amp;gt;app_id,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;            &amp;#8216;secret&amp;#8217; =&amp;gt; Yii::app()-&amp;gt;controller-&amp;gt;module-&amp;gt;app_secret,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;            &amp;#8216;cookie&amp;#8217; =&amp;gt; false,&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;               ));&lt;/strong&gt;&lt;br/&gt;[/CODE]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;     [CODE]&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;   &lt;strong&gt;  public function filterPermission($filterChain)&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt; header(&amp;#8216;P3P: CP=&amp;#8221;HONK&amp;#8221;&amp;#8217;);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;    [/CODE]&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;        Without this header you are not able to use session when working with IE.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;br/&gt;&lt;a title="Nintriva Wireless" href="http://www.nintriva.com" target="_blank"&gt;Nintriva Wireless&lt;/a&gt;&lt;br/&gt;INDIA&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/12127176081</link><guid>http://sirink.tumblr.com/post/12127176081</guid><pubDate>Mon, 31 Oct 2011 01:02:00 +0530</pubDate></item><item><title>Print a Portion of a webpage just in 4 steps using JavaScript</title><description>&lt;blockquote&gt;
&lt;p&gt;step1:&lt;br/&gt;  Make a button to print and place a javascript function on the onclick event to print    &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;input type=&amp;#8217;button&amp;#8217; value=&amp;#8217;Print&amp;#8217; onclick=&amp;#8217;printDiv();&amp;#8217;&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;step2:&lt;br/&gt;Javascript function to perform printing operation&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;script type=&amp;#8221;text/javascript&amp;#8221;&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;function printDiv()&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;window.print();&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;/script&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;step3:&lt;/p&gt;
&lt;p&gt;Make the whole body hidden except the area need to print       &lt;br/&gt;&lt;strong&gt;  &amp;lt;style type=&amp;#8221;text/css&amp;#8221; media=&amp;#8221;print&amp;#8221;&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;body {visibility:hidden;}&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;.printableArea{visibility:visible;} &lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;/style&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;step4:&lt;br/&gt;Define the area need to print&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;div class=printableArea&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;place your Content to print&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;/div&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Regards,&lt;br/&gt;sirin k &lt;br/&gt; NINTRIVA TECHNOLOGIES  &lt;br/&gt;INDIA &lt;br/&gt; &lt;a href="http://www.nintriva.com" target="_blank"&gt;www.nintriva.com&lt;/a&gt;&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/10274881387</link><guid>http://sirink.tumblr.com/post/10274881387</guid><pubDate>Fri, 16 Sep 2011 18:11:00 +0530</pubDate></item><item><title>Yii's CArrayDataProvider is really awesome but confusing.</title><description>&lt;p&gt;Yii &amp;#8216;s CArrayDataProvider is very helpful to display model relation data&amp;#8217;s directly on it.But it is truely a confusing one because by default it will assume a table field named &amp;#8220;id&amp;#8221; as primary key for its pagination purpose and what if you dont have field named &amp;#8220;id&amp;#8221; as primary key on your table? so its truely confusing and if you tried to display without an &amp;#8220;id&amp;#8221; field on ur table you will get an error like &amp;#8220;yourmodel.id is not defined&amp;#8221;.&lt;/p&gt;
&lt;p&gt;To solve this CArrayDataProvider confusing problem you just need to use on of its attribute named &amp;#8220;keyField&amp;#8221; to specify your primary key field on your table.There is an property named &amp;#8220;id&amp;#8221; thats just an id of the dataProvider itself.&lt;/p&gt;
&lt;p&gt;i have 2 models ie deal and buyer(MANY_MANY).&lt;/p&gt;
&lt;p&gt;so $deal-&amp;gt;buyers is the relation i used to display my deal buyers.i used a field named &amp;#8220;facebook_id&amp;#8221; as primary key in model &amp;#8220;buyer&amp;#8221; .see my code.&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;&lt;strong&gt;&lt;span class="hl-var"&gt;$dp&lt;/span&gt;&lt;span class="hl-code"&gt; = &lt;/span&gt;&lt;span class="hl-reserved"&gt;new&lt;/span&gt; &lt;span class="hl-identifier"&gt;CArrayDataProvider&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;span class="hl-var"&gt;$deal-&amp;gt;buyers&lt;/span&gt;&lt;span class="hl-code"&gt;, &lt;/span&gt;&lt;span class="hl-reserved"&gt;array&lt;/span&gt;&lt;span class="hl-brackets"&gt;(&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;   &lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;keyField&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-code"&gt; =&amp;gt; &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;facebook_id&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-code"&gt;,         &lt;/span&gt;&lt;span class="hl-comment"&gt;//&lt;/span&gt;&lt;span class="hl-comment"&gt; PRIMARY KEY&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;   &lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;id&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-code"&gt; =&amp;gt; &lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;&lt;span class="hl-string"&gt;buyers_list&lt;/span&gt;&lt;span class="hl-quotes"&gt;'&lt;/span&gt;                    &lt;span class="hl-comment"&gt;//&lt;/span&gt;&lt;span class="hl-comment"&gt; ID of the data provider itself&lt;/span&gt;&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;&lt;span class="hl-brackets"&gt;)&lt;/span&gt;&lt;span class="hl-brackets"&gt;)&lt;/span&gt;&lt;/strong&gt;&lt;span class="hl-code"&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;span class="hl-code"&gt;Regards,&lt;br/&gt;sirin k&lt;br/&gt;&lt;br/&gt;&lt;a title="NINTRIVA TECHNOLOGIES" href="http://www.nintriva.com" target="_blank"&gt;NINTRIVA TECHNOLOGIES&lt;/a&gt;&lt;br/&gt;INDIA&lt;br/&gt;&lt;/span&gt;&lt;span class="hl-code"&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;</description><link>http://sirink.tumblr.com/post/9344604740</link><guid>http://sirink.tumblr.com/post/9344604740</guid><pubDate>Thu, 25 Aug 2011 01:52:18 +0530</pubDate></item><item><title>Facebook DeAuthorize callback URL and its response data. </title><description>&lt;p&gt;Facebook Deauthorize callback is used to getting notification to the app owner when a user uninstall our app from their fan page or profile.&lt;/p&gt;
&lt;p&gt;We have an option in Facebook&amp;#8217;s advanced section  of app settings named &amp;#8220;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Deauthorize Callback&lt;/span&gt;&lt;/span&gt;&amp;#8220;.Here we can specify a URL in ourserver.If we are setting a URL in this section facebook will send a signed request to the specified URL when a user uninstall our app from their fanpage or profile.Facebook providing 2 functions to decode the signed Request and get the encoded data using our app secret key.&lt;/p&gt;
&lt;p&gt;Here is what i have done in my callback URL to get the singned request details,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;?php&lt;/p&gt;
&lt;p&gt;if(isset($_REQUEST[&amp;#8216;signed_request&amp;#8217;]))&lt;br/&gt;  {    $data=$this-&amp;gt;parse_signed_request($_REQUEST[&amp;#8216;signed_request&amp;#8217;],&amp;#8217;YOUR_FB_SECRET_KEY&amp;#8217;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;?&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But whats the problem here is that we cannot identify the structure of decoded array $data.because this process is a hidden call so that we cannot print this using print_r();&lt;/p&gt;
&lt;p&gt;so what i have done is that stored it to a file by serializing after that i restored this object by unserialize from that file in my server.&lt;/p&gt;
&lt;p&gt;here is the code for that:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; $s=serialize($data);&lt;br/&gt; file_put_contents(&amp;#8216;yourfilename&amp;#8217;,$s);&lt;/p&gt;

&lt;/blockquote&gt;
&lt;p&gt;The above 2 process is happening at the time of uninstall callback.after this 2 processes i executed one more code to get this from that file and print it out.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if(file_exists(&amp;#8216;yourfilename&amp;#8217;))&lt;br/&gt;  {&lt;br/&gt;    $s=file_get_contents(&amp;#8216;yourfilename&amp;#8217;);&lt;br/&gt;    $data=unserialize($s);&lt;br/&gt;&lt;br/&gt;    echo &amp;#8220;&amp;lt;pre&amp;gt;&amp;#8221;;&lt;br/&gt;    print_r($data);&lt;br/&gt;    echo &amp;#8220;&amp;lt;/pre&amp;gt;&amp;#8221;;&lt;br/&gt;  }&lt;/p&gt;

&lt;/blockquote&gt;
&lt;p&gt;Then i got a result like below:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Array&lt;br/&gt;    {&lt;br/&gt;     [algorithm]=&amp;gt;HMAC-SHA256&lt;br/&gt;     [issued_at]=&amp;gt;134534232&amp;#160;&lt;br/&gt;     [profile_id]=&amp;gt;324556365474&lt;br/&gt;     [user]=&amp;gt;Array(&lt;br/&gt;                        [country]=&amp;gt;in&lt;br/&gt;                        [locale]=&amp;gt;en_US&lt;/p&gt;
&lt;p&gt;                        )&lt;br/&gt;    [user_id]=&amp;gt;0&lt;/p&gt;
&lt;p&gt;    }&lt;br/&gt;Here  i got the fan page id as profile_id from this array .that is the fan page id which is uninstalled my app if it is a user profile the we will get the user facebook id in &amp;#8220;user_id&amp;#8221; from this array.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;here is that 2 functions from facebook:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;function parse_signed_request($signed_request, $secret) {&lt;br/&gt;  list($encoded_sig, $payload) = explode(&amp;#8216;.&amp;#8217;, $signed_request, 2); &lt;br/&gt;&lt;br/&gt;  // decode the data&lt;br/&gt;  $sig = $this-&amp;gt;base64_url_decode($encoded_sig);&lt;br/&gt;  $data = json_decode($this-&amp;gt;base64_url_decode($payload), true);&lt;br/&gt;&lt;br/&gt;  if (strtoupper($data[&amp;#8216;algorithm&amp;#8217;])&amp;#160;!== &amp;#8216;HMAC-SHA256&amp;#8217;) {&lt;br/&gt;    error_log(&amp;#8216;Unknown algorithm. Expected HMAC-SHA256&amp;#8217;);&lt;br/&gt;    return null;&lt;br/&gt;  }&lt;br/&gt;&lt;br/&gt;  // check sig&lt;br/&gt;  $expected_sig = hash_hmac(&amp;#8216;sha256&amp;#8217;, $payload, $secret, $raw = true);&lt;br/&gt;  if ($sig&amp;#160;!== $expected_sig) {&lt;br/&gt;    error_log(&amp;#8216;Bad Signed JSON signature!&amp;#8217;);&lt;br/&gt;    return null;&lt;br/&gt;  }&lt;br/&gt;&lt;br/&gt;  return $data;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;public function base64_url_decode($input)&lt;br/&gt;{&lt;br/&gt;  return base64_decode(strtr($input, &amp;#8216;-_&amp;#8217;, &amp;#8216;+/&amp;#8217;));&lt;br/&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;By using this function you can decode that signed request and get the id of  the uninstalled fan page or profile id.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;br/&gt;&lt;a title="NINTRIVA TECHNOLOGIES" href="http://www.nintriva.com" target="_blank"&gt;NINTRIVA TECHNOLOGIES&lt;/a&gt;&lt;br/&gt;INDIA&lt;/p&gt;</description><link>http://sirink.tumblr.com/post/9245310258</link><guid>http://sirink.tumblr.com/post/9245310258</guid><pubDate>Mon, 22 Aug 2011 13:58:57 +0530</pubDate></item><item><title>Datetime comparing when validating a Yii form</title><description>&lt;p&gt;hi guys,&lt;/p&gt;
&lt;p&gt;          i have two fields in my table 1.start_time,2.end_time.im using a jquiry datetime picker for datetime input,so here i just want to make sure that the end_time should be greater than the start time.&lt;/p&gt;
&lt;p&gt;To accomplish this we just need to place a simple validation rule in Yii model class like the following example:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;   public function rules()&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;{&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;return array(   array(&amp;#8216;end_time&amp;#8217;,&amp;#8217;compare&amp;#8217;,&amp;#8217;compareAttribute&amp;#8217;=&amp;gt;&amp;#8217;start_time&amp;#8217;,&amp;#8217;operator&amp;#8217;=&amp;gt;&amp;#8217;&amp;gt;&amp;#8217;,&amp;#8217;on&amp;#8217;=&amp;gt;&amp;#8217;insert&amp;#8217;,&amp;#8217;message&amp;#8217;=&amp;gt;&amp;#8217;Ending time should be greater than starting time&amp;#8217;),&lt;/p&gt;
&lt;p&gt;      );&lt;/p&gt;
&lt;p&gt;      }&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;sirin k&lt;/p&gt;
&lt;p&gt;&lt;a title="NINTRIVA TECHNOLOGIES" href="http://www.nintriva.com" target="_blank"&gt;NINTRIVA TECHNOLOGIES&lt;/a&gt;&lt;br/&gt;INDIA &lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://sirink.tumblr.com/post/8768102053</link><guid>http://sirink.tumblr.com/post/8768102053</guid><pubDate>Thu, 11 Aug 2011 11:05:00 +0530</pubDate></item></channel></rss>
